Closed amcewen closed 4 years ago
"Hmm. I'm trying to connect to that network, but it's asking me for more details, like an extra setting, but we can't provide that."
(or something)
Got the test page online, and the code written to fetch it and check its contents. Currently it's only wired into the "check for updates" flow (that's easier to test the different scenarios first as it doesn't involve dropping off the WiFi).
At the moment it reports errors just as a string - next step is to implement custom error classes (e.g. in https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87) so I can then handle them correctly. Then add it to the WiFi config flow too.
Cool!
I've extended the check-for-upgrades and the configure-wifi flows so they (try to) detect any captive portals, and also provide better feedback for WiFi problems.
We'll need three new audio clips please @CharlieMiab, and maybe updates for some of the existing ones. At present the same error clips get used for both the update and the configure-wifi flows, but they can be different if need be.
The flows now are as follows:
configure-wifi.wav
check-the-wifi.wav
which let's the user know it's checking to see if things workedwifi-works.wav
captive-portal.wav
. We won't be able to work round that, so try a different WiFi network.wifi-but-no-internet.wav
So connecting to the WiFi worked, but we can't get from that WiFi network out to the Internet for some reason. Check if there's a problem with that network's connection to the Internet, or try a different WiFi network.wifi-failed.wav
. Either try again or try a different WiFi network.checking-for-content.wav
collections-updated.wav
and the rest as usualcaptive-portal.wav
. We won't be able to work round that, so try a different WiFi network.wifi-but-no-internet.wav
So connecting to the WiFi worked, but we can't get from that WiFi network out to the Internet for some reason. Check if there's a problem with that network's connection to the Internet, or try a different WiFi network.wifi-failed.wav
. Either try again or try a different WiFi network.Related (usability issue): https://github.com/museuminabox/brain-dei-mille/issues/25
For reference, when an Android phone encounters a captive portal it pops up a notification saying "Sign in to WiFi network required", so maybe we could say something like "this WiFi network needs extra sign in steps that we can't complete"?
This is all done now. If it encounters a captive portal it now forgets that network, so it'll be less likely that someone will accidentally join a captive portal network and then get trapped there.
Adding the testing I did for the captive portal test .img for reference
In the Royal Armouries Museum:
Repeated this process three times, turning the Box off after each try and experienced the same flow as listed above.
When the configure-wifi script finishes and tests whether it can connect to the Internet, it should be able to spot the difference between couldn't connect at all and got a response but not the page we expected, and work out if that's likely to be a captive portal.
We should report the difference to the user.