[GH-ISSUE #117] Seems there is no DHCP timeout #88

Closed
opened 2026-02-28 01:23:21 +03:00 by kerem · 4 comments
Owner

Originally created by @noname000git on GitHub (Mar 5, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/117

My setup: router connecting internet, serving IP in lan and wifi repeater giving new ssid, but relying in router to serve IP. WifiManager configured and working to autoconnect with timeout to second ssid.
If I power off main router and reboot ESP, it finds second ssid, connects but as it can't get IP the system blocks forever waiting (neither failback to portal nor the failback function).
Does it mean that if DHCP server hangs all the ESP in lan will be unrecoverable in reboot?
Thanks

Originally created by @noname000git on GitHub (Mar 5, 2016). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/117 My setup: router connecting internet, serving IP in lan and wifi repeater giving new ssid, but relying in router to serve IP. WifiManager configured and working to autoconnect with timeout to second ssid. If I power off main router and reboot ESP, it finds second ssid, connects but as it can't get IP the system blocks forever waiting (neither failback to portal nor the failback function). Does it mean that if DHCP server hangs all the ESP in lan will be unrecoverable in reboot? Thanks
kerem closed this issue 2026-02-28 01:23:21 +03:00
Author
Owner

@tzapu commented on GitHub (Mar 5, 2016):

that sounds to me the same behaviour any device like a laptop would have, if there s no dhcp, the device won t get an ip, and won t work

depending on your configuration, and where it locks, you could add a check after autoConnect, and if IP is not ok, reboot.

<!-- gh-comment-id:192653838 --> @tzapu commented on GitHub (Mar 5, 2016): that sounds to me the same behaviour any device like a laptop would have, if there s no dhcp, the device won t get an ip, and won t work depending on your configuration, and where it locks, you could add a check after autoConnect, and if IP is not ok, reboot.
Author
Owner

@noname000git commented on GitHub (Mar 6, 2016):

the problem is I can't check anything after autoconnect because it never ends (autoconnect waits forever for the ip). Maybe It would be nice to timeout autoconnect after a fixed time, let execute the callback function to do offline tasking and continue to portal with timeout to loop again

<!-- gh-comment-id:192962847 --> @noname000git commented on GitHub (Mar 6, 2016): the problem is I can't check anything after autoconnect because it never ends (autoconnect waits forever for the ip). Maybe It would be nice to timeout autoconnect after a fixed time, let execute the callback function to do offline tasking and continue to portal with timeout to loop again
Author
Owner

@tzapu commented on GitHub (Mar 7, 2016):

hi,
thanks for this, it seems there are a number of edge cases, like yours, that i am now discovering, that involve autoConnect/waitForConnectionResult to stall forever. I will need to find a way to test this myself.
in the mean time, i have added a change in the latest commit that sorts at least some of these cases, probably not yours.
There s also a function to force a timeout on connection, mentioned here https://github.com/tzapu/WiFiManager#debug

try adding wifiManager.setConnectTimeout(60); BEFORE autoConnect
please let me know what happens, these kind of errors have been making my life miserable, as people report some of them but I can t replicate :D

<!-- gh-comment-id:193160793 --> @tzapu commented on GitHub (Mar 7, 2016): hi, thanks for this, it seems there are a number of edge cases, like yours, that i am now discovering, that involve autoConnect/waitForConnectionResult to stall forever. I will need to find a way to test this myself. in the mean time, i have added a change in the latest commit that sorts at least some of these cases, probably not yours. There s also a function to force a timeout on connection, mentioned here https://github.com/tzapu/WiFiManager#debug try adding `wifiManager.setConnectTimeout(60);` BEFORE autoConnect please let me know what happens, these kind of errors have been making my life miserable, as people report some of them but I can t replicate :D
Author
Owner

@tzapu commented on GitHub (Mar 8, 2016):

hi, i ve just made another commit to this, could you please try the github version of WiFiManager and see if anything changed for you?

<!-- gh-comment-id:193618710 --> @tzapu commented on GitHub (Mar 8, 2016): hi, i ve just made another commit to this, could you please try the github version of WiFiManager and see if anything changed for you?
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#88
No description provided.