Open projectgus opened 2 hours ago
no preferred networks were found during the scan
Poking around a bit more, I realised that wcli:listNetworks()
is empty when the CTRL-EVENT-NETWORK-NOT-FOUND
event comes back as Koreader hasn't added any networks yet.
So maybe better logic could be to call listNetworks()
before scanning, and ignore CTRL-EVENT-NETWORK-NOT-FOUND
if there are no networks configured at all? I don't know if that's a behaviour that's different on later wpa_supplicant or not?
(Again, happy to put together a PR if any of these sound like reasonable ideas to you.)
That code was only changed recently btw: https://github.com/koreader/lj-wpaclient/pull/11
It's not strictly impossible that it worked fine/better with older devices; I have no idea really.
I was emboldened to try and figure out why my Kobo Aura always shows "Scanning for networks..." for a full 20 seconds each time it connects to Wi-Fi...
Uncommenting the print statements in
wpaclient.lua
(and adding two of my own log lines in koreader to confirm timing), I see:It seems like in the case of the Aura, this comment is wrong:
On the Aura, seems wpa_supplicant sends
CTRL-EVENT-NETWORK-NOT-FOUND
but doesn't start any new scan.I note that the Aura is also one of the "older devices" that doesn't send
CTRL-EVENT-SCAN-STARTED
. (yay for ancient wpa_supplicant versions?)Do you think it'd be reasonable to add a "quirk" here of "if wpa_supplicant didn't send
CTRL-EVENT-SCAN-STARTED
or "FAIL-BUSY*" as the first reply then assume it's old and cursed, so ignoreCTRL-EVENT-NETWORK-NOT-FOUND
?"I'd be very happy to try and put something together and send a PR, but I don't have any devices to test with apart from two Auras...