Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix network connection after soft-boot. #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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