Merge pull request #3382 from Blake-Latchford/wifi-disconnect-reason-logging

Extend WiFi disconnect logging to specify reason
This commit is contained in:
Liam Cottle
2026-09-18 12:01:30 +12:00
committed by GitHub
+2 -1
View File
@@ -229,7 +229,8 @@ void setup() {
WiFi.onEvent([](WiFiEvent_t event, WiFiEventInfo_t info){
if (event == ARDUINO_EVENT_WIFI_STA_DISCONNECTED) {
WIFI_DEBUG_PRINTLN("WiFi disconnected. Flagging for reconnect...");
WIFI_DEBUG_PRINTLN("WiFi disconnected (reason=%s). Flagging for reconnect...",
WiFi.disconnectReasonName((wifi_err_reason_t)info.wifi_sta_disconnected.reason));
wifi_needs_reconnect = true;
} else if (event == ARDUINO_EVENT_WIFI_STA_GOT_IP) {
WIFI_DEBUG_PRINTLN("WiFi connected successfully!");