-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add a reconnect method to the WiFi manager #100
Comments
Update to this - the WiFi manager get/post/put methods all initiate a connection if not connected, so when using these methods The problem comes when using the socket directly, for example when using the MQTT libraries or the ESP object directly. In this case This leads to three options that I can see:
Thoughts? |
I do not like this option,
Which examples have this issue? |
An example would be the Azure IoT library - this uses the socket and network interface which are passed to miniMQTT. If code uses the WiFi manager to connect, then gets a connection issue and needs to reconnect that involves resetting the WiFi manager and reconnecting. Or am I overthinking this, and should add a connection check and auto reconnect to the IoT library when reconnecting? |
I think this is the crux of the API design for CircuitPython networking libraries. I don't know what the right answer is. It feels like the protocol level (HTTP, MQTT) will need to know what to do on reconnect in order to get back into it's current state. Python's socket doesn't have a |
I like this. The socket which already has access to the interface, |
Yeah, by basically getting a new socket. |
Need to explicitly call connect method after reset when WiFi manager is used with MQTT. adafruit/Adafruit_CircuitPython_ESP32SPI#100
There is currently no single method way to reconnect the WiFi manager if the connection is lost. Currently it's a two step process:
It would be nice to have a single call to do this -
wifi.reconnect()
The text was updated successfully, but these errors were encountered: