[GH-ISSUE #1515] power outage #1293

Open
opened 2026-02-28 01:29:27 +03:00 by kerem · 6 comments
Owner

Originally created by @stef-ladefense on GitHub (Oct 28, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1515

a question,
how to handle a power outage and a long reconnection to local wifi modem.
let me explain:
when the electric current returns after a cut, the esp's will start faster than the internet modem.
therefore, they will switch to portal mode after setConnectTimeout(45)and exiting without a connection after a setConfigPortalTimeout(180).
the way i found is to test the output of wifiManager.autoConnect and do an esp.restart to restart the connection, the modem will restart and the esp will connect to it.

is there an internal solution that would automatically restart a connection after the timeout without rebooting?

Thanks a lot

Originally created by @stef-ladefense on GitHub (Oct 28, 2022). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1515 a question, how to handle a power outage and a long reconnection to local wifi modem. let me explain: when the electric current returns after a cut, the esp's will start faster than the internet modem. therefore, they will switch to portal mode after setConnectTimeout(45)and exiting without a connection after a setConfigPortalTimeout(180). the way i found is to test the output of wifiManager.autoConnect and do an esp.restart to restart the connection, the modem will restart and the esp will connect to it. is there an internal solution that would automatically restart a connection after the timeout without rebooting? Thanks a lot
Author
Owner

@mkrasselt1 commented on GitHub (Nov 29, 2022):

You could use this to give the device up to 5 min to conenct to the accesspoint on boot and up to 5 reconnects to the same station :)

//Give more time to connect to access point
  WiFiManager.setConnectTimeout(300);
  WiFiManager.setConnectRetries(5);
<!-- gh-comment-id:1330368224 --> @mkrasselt1 commented on GitHub (Nov 29, 2022): You could use this to give the device up to 5 min to conenct to the accesspoint on boot and up to 5 reconnects to the same station :) ``` //Give more time to connect to access point WiFiManager.setConnectTimeout(300); WiFiManager.setConnectRetries(5); ```
Author
Owner

@Tomerv32 commented on GitHub (Dec 26, 2022):

Hey
same question here, same issue with power outages:

  wm.setConnectTimeout(30);
  wm.setConnectRetries(10);
  wm.setConfigPortalBlocking(false);
  bool res = wm.autoConnect(ap, "password");

I have some cases where my ESP32 moves to a different place,
and needs to be re-configured to a new WiFi network, even though it already has one saved.
(I can't add a button for reset/portal open etc..)
As I don't want to wait 300*5 seconds until the Portal opens in such a case,
I need a way to try reconnecting while the portal is open.

couldn't find such a thing in the library. any ideas? :)

<!-- gh-comment-id:1365137912 --> @Tomerv32 commented on GitHub (Dec 26, 2022): Hey **same question here, same issue with power outages:** ``` wm.setConnectTimeout(30); wm.setConnectRetries(10); wm.setConfigPortalBlocking(false); bool res = wm.autoConnect(ap, "password"); ``` I have some cases where my ESP32 moves to a different place, and needs to be re-configured to a new WiFi network, even though it already has one saved. (I can't add a button for reset/portal open etc..) As I don't want to wait 300*5 seconds until the Portal opens in such a case, I need a way to try reconnecting while the portal is open. couldn't find such a thing in the library. any ideas? :)
Author
Owner

@stef-ladefense commented on GitHub (Dec 26, 2022):

You could use this to give the device up to 5 min to conenct to the accesspoint on boot and up to 5 reconnects to the same station :)

//Give more time to connect to access point
  WiFiManager.setConnectTimeout(300);
  WiFiManager.setConnectRetries(5);

ok thank
does this mean that it will wait 300s before trying to connect and this 5 times?
over a total duration of 5X300?

<!-- gh-comment-id:1365216906 --> @stef-ladefense commented on GitHub (Dec 26, 2022): > You could use this to give the device up to 5 min to conenct to the accesspoint on boot and up to 5 reconnects to the same station :) > > ``` > //Give more time to connect to access point > WiFiManager.setConnectTimeout(300); > WiFiManager.setConnectRetries(5); > ``` ok thank does this mean that it will wait 300s before trying to connect and this 5 times? over a total duration of 5X300?
Author
Owner

@mkrasselt1 commented on GitHub (Feb 16, 2023):

ok thank does this mean that it will wait 300s before trying to connect and this 5 times? over a total duration of 5X300?

yep thats correct - should give your router plenty time to get back up and running

<!-- gh-comment-id:1433204069 --> @mkrasselt1 commented on GitHub (Feb 16, 2023): > ok thank does this mean that it will wait 300s before trying to connect and this 5 times? over a total duration of 5X300? yep thats correct - should give your router plenty time to get back up and running
Author
Owner

@mkrasselt1 commented on GitHub (Feb 16, 2023):

couldn't find such a thing in the library. any ideas? :)

If there is no why to trigger such a portal opening in you case, the only option would be to keep it open all the time.

<!-- gh-comment-id:1433205264 --> @mkrasselt1 commented on GitHub (Feb 16, 2023): > couldn't find such a thing in the library. any ideas? :) If there is no why to trigger such a portal opening in you case, the only option would be to keep it open all the time.
Author
Owner

@tablatronix commented on GitHub (Feb 17, 2023):

You have to use the beta version

<!-- gh-comment-id:1433947543 --> @tablatronix commented on GitHub (Feb 17, 2023): You have to use the beta version
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#1293
No description provided.