diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp index e500f476..7668eaad 100644 --- a/libraries/WiFi/src/WiFiSTA.cpp +++ b/libraries/WiFi/src/WiFiSTA.cpp @@ -262,7 +262,7 @@ bool WiFiSTAClass::disconnect(bool wifioff) WiFi.getMode(); esp_wifi_start(); esp_wifi_set_config(WIFI_IF_STA, &conf); - ret = esp_wifi_set_config(WIFI_IF_STA, &conf) == ESP_OK; + ret = esp_wifi_disconnect() == ESP_OK; if(wifioff) { WiFi.enableSTA(false);