Skip to content

Commit b14d5bf

Browse files
committed
[WiFi] Perform wifi disconnect on disconnect event.
See esp8266/Arduino#5912
1 parent 118e09b commit b14d5bf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ESPEasyWiFiEvent.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ void onDisconnect(const WiFiEventStationModeDisconnected& event){
108108
}
109109
lastDisconnectReason = event.reason;
110110
wifiStatus = ESPEASY_WIFI_DISCONNECTED;
111+
if (WiFi.status() == WL_CONNECTED) {
112+
// See https://github.com/esp8266/Arduino/issues/5912
113+
WiFi.disconnect();
114+
}
111115
processedDisconnect = false;
112116
}
113117

0 commit comments

Comments
 (0)