From 081aec44290cdacc2a28cf8b5c01d34c3d681d93 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 18 Nov 2020 16:39:34 -0800 Subject: [PATCH] Retry connection when getting NOT_AUTHED I saw it once with a correct password. Retrying may still fail but at least it'll try first. --- ports/esp32s2/common-hal/wifi/__init__.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 2eb3719b4d..70f1d98cba 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -59,6 +59,7 @@ static void event_handler(void* arg, esp_event_base_t event_base, ESP_EARLY_LOGW(TAG, "reason %d 0x%02x", reason, reason); if (radio->retries_left > 0 && (reason == WIFI_REASON_AUTH_EXPIRE || + reason == WIFI_REASON_NOT_AUTHED || reason == WIFI_REASON_ASSOC_EXPIRE || reason == WIFI_REASON_CONNECTION_FAIL || reason == WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT)) {