mthorley / wifimanager-pico

WiFi captive portal to support configuration of local WiFi networks on RaspberryPi PicoW
12 stars 2 forks source link

Static IP configuration won't clear after AP gets WiFi settings #3

Open kookon opened 4 months ago

kookon commented 4 months ago

Had an issue with IP configuration, where Pico didn't get a new IP after configuring wifi settings in the portal. After connecting to newly configured network, the IP was still the same as in AP mode (192.168.42.1). I think the same problem is described here:

https://stackoverflow.com/questions/40069654/how-to-clear-static-ip-configuration-and-start-dhcp

And a solution is to change WiFiManager.cpp line 196 to WiFi.disconnect(true);

And add after that:

delay(500);
WiFi.config(INADDR_NONE);