[GH-ISSUE #938] A new parameter to allow multiple attempts to connect before falling back to AP #794

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

Originally created by @rharrison on GitHub (Sep 12, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/938

I have an interesting problem where the esp Client fails to get an IP address from the AP. It then configures itself as an AP for configuration. I have added an option to try multiple times before falling back into AP configuration mode. This has fixed my problem as the IP is often given out on the second attempt.

Should I send a pull request to you for the code changes or is this not something you’re interested in ?

Originally created by @rharrison on GitHub (Sep 12, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/938 I have an interesting problem where the esp Client fails to get an IP address from the AP. It then configures itself as an AP for configuration. I have added an option to try multiple times before falling back into AP configuration mode. This has fixed my problem as the IP is often given out on the second attempt. Should I send a pull request to you for the code changes or is this not something you’re interested in ?
kerem 2026-02-28 01:27:05 +03:00
Author
Owner

@tablatronix commented on GitHub (Sep 12, 2019):

This sounds like the disconnect bug.
You can try disconnecting first then connecting.

<!-- gh-comment-id:531008482 --> @tablatronix commented on GitHub (Sep 12, 2019): This sounds like the disconnect bug. You can try disconnecting first then connecting.
Author
Owner

@rharrison commented on GitHub (Sep 13, 2019):

Thanks for your help. This might be because I don’t disconnect at the end of my program it just powers off iirc. Let me investigate and come back to you.

<!-- gh-comment-id:531076242 --> @rharrison commented on GitHub (Sep 13, 2019): Thanks for your help. This might be because I don’t disconnect at the end of my program it just powers off iirc. Let me investigate and come back to you.
Author
Owner

@rharrison commented on GitHub (Sep 13, 2019):

Excuse my ignorance here but should we be disconnecting from the WiFi network before we leave. I can not see an obvious way to do do this. I see there is a WiFi.Disconnect() routine but I'm not sure how to call that from WiFiManager. Is it ok just to send the data to the server and then power off? or should i be telling the AP i'm disconnecting before powering off.

<!-- gh-comment-id:531137904 --> @rharrison commented on GitHub (Sep 13, 2019): Excuse my ignorance here but should we be disconnecting from the WiFi network before we leave. I can not see an obvious way to do do this. I see there is a WiFi.Disconnect() routine but I'm not sure how to call that from WiFiManager. Is it ok just to send the data to the server and then power off? or should i be telling the AP i'm disconnecting before powering off.
Author
Owner

@tablatronix commented on GitHub (Sep 13, 2019):

What esp version are you using?
I mean disconnect before connecting

<!-- gh-comment-id:531213498 --> @tablatronix commented on GitHub (Sep 13, 2019): What esp version are you using? I mean disconnect before connecting
Author
Owner

@rharrison commented on GitHub (Sep 13, 2019):

ESP8266 2.5.2

This seems to have solved it :-)

 wifiManager.disconnect();
 if ( ! wifiManager.autoConnect(ssid.c_str(), "foobar")) {

Any idea why we need to do this ?

<!-- gh-comment-id:531352055 --> @rharrison commented on GitHub (Sep 13, 2019): ESP8266 2.5.2 This seems to have solved it :-) ``` wifiManager.disconnect(); if ( ! wifiManager.autoConnect(ssid.c_str(), "foobar")) { ``` Any idea why we need to do this ?
Author
Owner

@rharrison commented on GitHub (Sep 13, 2019):

I'm so pleased you managed to solve this. @tablatronix . It was a real hack I put in to try to connect 3 times :-/

<!-- gh-comment-id:531354969 --> @rharrison commented on GitHub (Sep 13, 2019): I'm so pleased you managed to solve this. @tablatronix . It was a real hack I put in to try to connect 3 times :-/
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#794
No description provided.