-
Notifications
You must be signed in to change notification settings - Fork 86
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
ESP32 reconnect when connection lost #92
Comments
WiFi (or ESP8266WiFi) base library is where re-connection is handled. You can use a WiFiEventHandler to determine what to do after a wifi connection is lost. Hope this helps, best regards! |
with esp8266 i have no problems, it's eso32 that loses connection and does not reconnect.. |
Old thread, but for the record, the following worked for me: I added a Wifi disconnected event in setup:
I added a void for Wifi disconnect event and the GotIP event:
Most importantly, you may notice above, I added the WiFi.setAutoReconnect(true) in the void Wifi_disconnected NOT in the void setup where I had originally assumed it would go. If I put it in setup void, the reconnect attempt doesn't happen. If I put it in the Wifi_disconnected void, it works. Also note, it should be WiFi.setAutoReconnect(true), not WiFi.autoReconnect(True) I solved this issue via my patented high-level coding skills, a.k.a. try every possible combination of random things until something works. Took me three days... |
As of Apr2022 this is how you get and process WiFi events. tl;dr: Use this:
And add the listener in setup()
|
Hello, ive some esp32cam that properly works with asyncwifimanager, so i can configure them flawlessly.
But the problem is that when the wifi connection is lost:
Should i manually insert something in the loop to check if the connection is up end end in a if(!wifiManager.autoConnect()) ?
Or what else?
i tried setting WiFi.autoReconnect(True), but with no effect
Thanks
The text was updated successfully, but these errors were encountered: