Closed dennisss closed 7 years ago
That was a left over from my original code. It used to wait for a DHCP client to connect and I would get its address from there. It turned out the ESP SDK function to get the list of DHCP client was broken and always returned a bogus address. I then resorted to broadcasting until getting a first heartbeat.
I noticed this when using a static IP in STA mode with bad parameters: the AP fallback mode would hang as the static IP code turns off the DHCP client.
I'm not sure if this code is necessary. Currently it checks for the status of the DHCP client (wifi_station_dhcpc_status) when in AP mode. WiFi.softAP(..) already internally checks the status of the DHCP server with wifi_softap_dhcps_status.