Closed ukicar closed 8 years ago
@ukicar Please confirm this fix and close the issue if OK
@ukicar action from you needed!
Fix confirmed by @manuIO (email)
The original fix works if the connection is lost when the board is powered. But if the STA network is not available at system boot, it fall back in AP mode.
From my point of view, the system must stays waiting for the STA network in this case. For example, after a power cut, home routers are often longer to boot than WeIO, and falling back to AP is probably not the intended behavior.
I propose to transform this part https://github.com/nodesign/weio/blob/master/scripts/run_weio.sh#L118-L127 by :
if grep -q '"auto_to_ap": "YES"' /weio/config.weio; then
while [ $WIFI_READY -ne 1 ]; do
echo "WiFi network is not ready. Switching to RESCUE mode."
# We did not connect even after whole delay expired
# Something went wrong - got to RESCUE
/weio/scripts/wifi_set_mode.sh rescue
# Re-check WiFi
check_wifi
done
fi
to prevent an auto reconfiguration if auto_to_ap
is not set and the wifi network is not available at boot start.
@ukicar, @drasko, ok with that ?
OK for me. Note - if for some reason you can not log in as a STA (for example typo in the password), you will not come back to AP mode. This will demand manual network set-up, and after that restart of WeIO app.
But this is OK for me, as I suppose that auto_to_ap : "NO"
is for advanced users.
Yeah, but there's a button to fall back in AP if needed. I'll do the change tonight.
OK, +1
PR #260 merged, and fully tested on my side. Can be closed once the fix is confirmed by someone else.
Checkbox has never been cabled behind for this functionality. This is the place where variable comes from IDE : https://github.com/nodesign/weio/blob/master/handlers/userSettingsHandler.py#L121
But in config.weio there is nothing called auto_to_ap To resolve this issue we have to