From 7811668fb185c65d57c3c262114fbe51c083e345 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Wed, 21 Jun 2017 12:42:55 +0300 Subject: [PATCH] Make sure that WiFi is started before trying to erase configuration. Connected to: https://github.com/espressif/arduino-esp32/issues/400 --- libraries/WiFi/src/WiFiSTA.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp index abb506b8..e500f476 100644 --- a/libraries/WiFi/src/WiFiSTA.cpp +++ b/libraries/WiFi/src/WiFiSTA.cpp @@ -260,6 +260,7 @@ bool WiFiSTAClass::disconnect(bool wifioff) *conf.sta.password = 0; WiFi.getMode(); + esp_wifi_start(); esp_wifi_set_config(WIFI_IF_STA, &conf); ret = esp_wifi_set_config(WIFI_IF_STA, &conf) == ESP_OK;