-
Notifications
You must be signed in to change notification settings - Fork 13.3k
WiFiMulti hangs if no DHCP Server is available #3993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@hotchpotch please retest with latest git, and build with lwip2 (option in menu). |
Hello again.. ESP8266WiFiMulti.cpp Line 112
The while loop hangs here because "status" is WL_DISCONNECTED until a IP Adress is assigned... |
WiFiMulti i meant for networks with a working dhcp server. I think implementing a timeout for that while loop should be enough. |
@manholl @gavanfantom @denisn73 please test PR #4146 . It implements a timeout in the WiFi connection loop inside WiFiMulti. It addresses cases of no DHCP, wrong password, etc. |
Anyone have a code example of how to use the following handler? onStationModeDHCPTimeout? I can't seem to find any examples on this specific handler, illustrating its use. |
ESP12F
SDK Version 2.3
I use Wifi.begin(SSID, key) to connect to my WLAN - if the DHCP-Server is available- everythink works ok and the "onStationModeGotIP" Event is fired - see last line..
But if the DHCP Server is not available the Programm hangs until the Server is available again.
I tried to use the onStationModeDHCPTimeout but it never gets fired..
I have expected that after some time the "onStationModeDHCPTimeout" Event is fired, or i get a wifi.status so that i can handle that i have no IP. But now my Program hangs - this is a big problem for me, because my ESP is battery powered.. and will not enter deep sleep mode.
The text was updated successfully, but these errors were encountered: