Skip to content

Comments

Fix network connection after soft-boot.#47

Open
garthk wants to merge 1 commit intogeekscape:masterfrom
garthk:fix-soft-boot-network
Open

Fix network connection after soft-boot.#47
garthk wants to merge 1 commit intogeekscape:masterfrom
garthk:fix-soft-boot-network

Conversation

@garthk
Copy link

@garthk garthk commented Jan 14, 2022

When the LOLIN32 re-connected we got sta_if.isconnected and interpreted it as AP mode, in which we didn't set the global connected. In turn is_connected() stayed false, and aiko.mqtt.mqtt_thread would never try to connect, but ping would work.

This change ensures is_connected() returns True if we wake with network.WLAN(network.STA_IF).isconnected() returning True.

Tested with hard reset, mpfshell --reset, and soft reboot with connection.net.wifi either configured or left to its AP defaults.

When the LOLIN32 re-connected we got `sta_if.isconnected` and
interpreted it as AP mode, in which we didn't set the global
`connected`. In turn `is_connected()` stayed false,
and `aiko.mqtt.mqtt_thread` would never try to connect,
but `ping` would work.

This change ensures `is_connected()` returns True if we wake with
`network.WLAN(network.STA_IF).isconnected()` returning True.

Tested with hard reset, `mpfshell --reset`, and soft reboot with
`connection.net.wifi` either configured or left to its AP defaults.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant