[GH-ISSUE #612] Keep ESP in WIFI_STA mode #513

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

Originally created by @ofthesea-io on GitHub (May 30, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/612

Disclaimer: This is more of a question to the forum rather than a issue, so I have a feeling I'm doing this in the wrong place. I do apologise ahead of time. Not sure where else to post it.

If the wifiManager disconnects from the WiFi due to WiFi failure, it will try to reconnect within the allocated timeout period :

wifiManager.setTimeout(seconds);

From what I understand, when it goes into this phase, the ESP is set to WIFI_AP_STA mode.

github.com/tzapu/WiFiManager@b516085a3d/WiFiManager.cpp (L201)

Is there a way to keep it in WIFI_STA mode and only when the timeout has elapsed, does it move it over to WIFI_AP_STA?

I have wired code up to a reset button that clears the config and sets it back into config portal mode, should I wish to get to the config portal sooner.

Originally created by @ofthesea-io on GitHub (May 30, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/612 **Disclaimer: This is more of a question to the forum rather than a issue, so I have a feeling I'm doing this in the wrong place. I do apologise ahead of time. Not sure where else to post it.** If the wifiManager disconnects from the WiFi due to WiFi failure, it will try to reconnect within the allocated timeout period : `wifiManager.setTimeout(seconds);` From what I understand, when it goes into this phase, the ESP is set to WIFI_AP_STA mode. https://github.com/tzapu/WiFiManager/blob/b516085a3d0a7c6eb3e720cd423b7999a1e8f85d/WiFiManager.cpp#L201 Is there a way to keep it in WIFI_STA mode and only when the timeout has elapsed, does it move it over to WIFI_AP_STA? I have wired code up to a reset button that clears the config and sets it back into config portal mode, should I wish to get to the config portal sooner.
kerem closed this issue 2026-02-28 01:25:39 +03:00
Author
Owner

@DeltaVetal26 commented on GitHub (May 30, 2018):

Hi, maybe this will help you: https://github.com/tzapu/WiFiManager/tree/development#on-demand-configuration-portal Have you looked?

<!-- gh-comment-id:393082450 --> @DeltaVetal26 commented on GitHub (May 30, 2018): Hi, maybe this will help you: https://github.com/tzapu/WiFiManager/tree/development#on-demand-configuration-portal Have you looked?
Author
Owner

@ofthesea-io commented on GitHub (May 30, 2018):

The problem was in my sketch.

To verify, the timeout functionality only works with autoConnect during "setup". Once it it has connected and you power cycle the router, the ESP will sit for n amount of time, waiting to reconnect to the last know SSID. Once the router is back up it reconnects (as it should). If you power cycle, the router and the ESP, the timeout trigger then gets hit and sends the ESP to the config portal mode.

But, long story short. I believe the problem was my side.

P.S. I would be nice to have a autoconnect timeout as well. So after x hours, if it doesn't find the router it sends it to config portal mode.

<!-- gh-comment-id:393132104 --> @ofthesea-io commented on GitHub (May 30, 2018): The problem was in my sketch. To verify, the timeout functionality only works with autoConnect during "setup". Once it it has connected and you power cycle the router, the ESP will sit for n amount of time, waiting to reconnect to the last know SSID. Once the router is back up it reconnects (as it should). If you power cycle, the router and the ESP, the timeout trigger then gets hit and sends the ESP to the config portal mode. But, long story short. I believe the problem was my side. P.S. I would be nice to have a autoconnect timeout as well. So after x hours, if it doesn't find the router it sends it to config portal mode.
Author
Owner

@tablatronix commented on GitHub (May 30, 2018):

Wifimanager does not reconnect the esp does that itself.

<!-- gh-comment-id:393135135 --> @tablatronix commented on GitHub (May 30, 2018): Wifimanager does not reconnect the esp does that itself.
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#513
No description provided.