Skip to content

Commit

Permalink
WiFiSTA - allow using DHCP again after disconnecting static IP (espre…
Browse files Browse the repository at this point in the history
…ssif#8848)

reset _useStaticIp to false in WiFi.disconnect()

Co-authored-by: Rodrigo Garcia <[email protected]>
  • Loading branch information
JAndrassy and SuGlider authored Nov 10, 2023
1 parent bf81fbb commit a9a72d1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libraries/WiFi/src/WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ bool WiFiSTAClass::disconnect(bool wifioff, bool eraseap)
wifi_sta_config(&conf);

if(WiFi.getMode() & WIFI_MODE_STA){
_useStaticIp = false;
if(eraseap){
if(esp_wifi_set_config((wifi_interface_t)ESP_IF_WIFI_STA, &conf)){
log_e("clear config failed!");
Expand Down

0 comments on commit a9a72d1

Please sign in to comment.