Make sure that WiFi is started before trying to erase configuration.

Connected to: https://github.com/espressif/arduino-esp32/issues/400
This commit is contained in:
me-no-dev 2017-06-21 12:42:55 +03:00
parent 24085a3b24
commit 7811668fb1

View File

@ -260,6 +260,7 @@ bool WiFiSTAClass::disconnect(bool wifioff)
*conf.sta.password = 0; *conf.sta.password = 0;
WiFi.getMode(); WiFi.getMode();
esp_wifi_start();
esp_wifi_set_config(WIFI_IF_STA, &conf); esp_wifi_set_config(WIFI_IF_STA, &conf);
ret = esp_wifi_set_config(WIFI_IF_STA, &conf) == ESP_OK; ret = esp_wifi_set_config(WIFI_IF_STA, &conf) == ESP_OK;