From 80e9e42c3b7a8ad646cd8803c9f4f84e35c9ebb1 Mon Sep 17 00:00:00 2001 From: Nikos Mouratidis <33179613+mouridis@users.noreply.github.com> Date: Wed, 30 Sep 2020 20:34:10 +0800 Subject: [PATCH] Fix issue #3522 (WiFi does not restart after stopped) (#4114) This commit fixes issue https://github.com/espressif/arduino-esp32/issues/3522 where WiFi service fails to start after a WiFi.disconnect(true) or a WiFi.mode(WIFI_OFF). --- libraries/WiFi/src/WiFiGeneric.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/WiFi/src/WiFiGeneric.cpp b/libraries/WiFi/src/WiFiGeneric.cpp index a1bdc76f..1362a65b 100644 --- a/libraries/WiFi/src/WiFiGeneric.cpp +++ b/libraries/WiFi/src/WiFiGeneric.cpp @@ -574,7 +574,7 @@ bool WiFiGenericClass::mode(wifi_mode_t m) */ wifi_mode_t WiFiGenericClass::getMode() { - if(!lowLevelInitDone){ + if(!lowLevelInitDone || !_esp_wifi_started){ return WIFI_MODE_NULL; } wifi_mode_t mode;