[GH-ISSUE #669] Failure behavior on accessing wifi network #557

Closed
opened 2026-02-28 01:25:51 +03:00 by kerem · 2 comments
Owner

Originally created by @vaz83 on GitHub (Jul 20, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/669

Hi,
I want that my ESP8266 when it fails to connect to the local wifi network, it can restart so it can try a couple of times. My question is how I make that possible?

I have the parameter setConfigPortalBlocking set to true. on the setup i made this:

if(wm.autoConnect(ssid.c_str())) { //if you get here you have connected to the WiFi Serial.println("Connected to wifi network!"); WiFi.mode(WIFI_STA); wm.startWebPortal(); } else { Serial.println("failed to connect and hit timeout"); delay(3000); // if we still have not connected restart and try all over again ESP.restart(); delay(5000); //Serial.println("Non blocking config portal running!"); }

however, it's not working, because it doesn't enter in the else sentence.
My idea is for example, power failure, the esp will start before my wifi router, so it will keep restarting until it successfully connects. Can you help me out?

Originally created by @vaz83 on GitHub (Jul 20, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/669 Hi, I want that my ESP8266 when it fails to connect to the local wifi network, it can restart so it can try a couple of times. My question is how I make that possible? I have the parameter setConfigPortalBlocking set to true. on the setup i made this: `if(wm.autoConnect(ssid.c_str())) { //if you get here you have connected to the WiFi Serial.println("Connected to wifi network!"); WiFi.mode(WIFI_STA); wm.startWebPortal(); } else { Serial.println("failed to connect and hit timeout"); delay(3000); // if we still have not connected restart and try all over again ESP.restart(); delay(5000); //Serial.println("Non blocking config portal running!"); }` however, it's not working, because it doesn't enter in the else sentence. My idea is for example, power failure, the esp will start before my wifi router, so it will keep restarting until it successfully connects. Can you help me out?
kerem closed this issue 2026-02-28 01:25:51 +03:00
Author
Owner

@vaz83 commented on GitHub (Jul 21, 2018):

tablatronix, need your help man :)

<!-- gh-comment-id:406758535 --> @vaz83 commented on GitHub (Jul 21, 2018): tablatronix, need your help man :)
Author
Owner

@vaz83 commented on GitHub (Jul 22, 2018):

problem solved.
wm.setEnableConfigPortal(!wm.getWiFiIsSaved());

<!-- gh-comment-id:406873814 --> @vaz83 commented on GitHub (Jul 22, 2018): problem solved. wm.setEnableConfigPortal(!wm.getWiFiIsSaved());
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#557
No description provided.