mazi-project / portal

This is the portal of the MAZI toolkit
http://www.mazizone.eu/toolkit/
MIT License
18 stars 6 forks source link

undesirable behaviour in online mode when offline #150

Closed panosnethood closed 5 years ago

panosnethood commented 5 years ago

A MAZI adopter noticed that when a MAZI Zone is set to "online" mode while the Raspberry Pi is actually offline the captive portal does not behave as expected.

Is it possible to detect this situation and use the offline mode always when the Raspberry Pi is offline?

iomavridis commented 5 years ago

Thanks for your feedback.

It seems that the captive portal service does not respond properly to this case. We will change the networking section, preventing the online option when the Toolkit has no internet access, providing the appropriate message to the administrator. For example: Please connect your Toolkit to the internet to enjoy the online mode.

panosnethood commented 5 years ago

Great, thanks! For later perhaps, it would be nice if the online mode is de-activated automatically when a Raspberry Pi loses Internet connectivity, since this could happen later, after the initial configuration, and even without the user knowing about it.

panosnethood commented 5 years ago

Thanks for fixing (partially) this issue in v3.0. What is still not working is if I have configured my mazizone to "online" because it was connected to the Internet, it does not detect if Internet connection is lost for some reason.

So, in this case it stays online while offline, and the behaviour is not as expected.

I guess this would need a script running always when online to detect if there is indeed internet connectivity. If this wouldn't harm performance I think it is important.

haniavis commented 5 years ago

Since v3.0 there is a check for Internet Connectivity before you can change your mode to online or managed. In addition, there is a check for Internet Connectivity while booting the raspberry, so in case it is configured in online mode but there is no Internet connection during booting, it will change to offline.

Having a script running always when online could cause other problems, except from affecting performance. Using an unstable Internet connection where you could loose connectivity for just 3-4 seconds or even, the raspberry would be switched to offline mode and this will cause confusion (users will be suddenly redirected to the portal).

I would propose to leave the functionality as its is now. And a reboot can fix the issue turning automatically to offline.

panosnethood commented 5 years ago

OK, I added a note on this in the "Networking" section of the "Admin panel" guidelines and also the "Splash page", linking to this issue for more information.