From b80bccccffea7aab68d4af9580664f77fecc45b2 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 12 Jun 2019 18:03:18 +1000 Subject: [PATCH] esp32/modnetwork: Still try to reconnect to WLAN even with AUTH_FAIL. WIFI_REASON_AUTH_FAIL does not necessarily mean the password is wrong, and a wrong password may not lead to a WIFI_REASON_AUTH_FAIL error code. So to improve reliability connecting to a WLAN always reconnect regardless of the error. --- ports/esp32/modnetwork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32/modnetwork.c b/ports/esp32/modnetwork.c index b93715b6e6..8462576058 100644 --- a/ports/esp32/modnetwork.c +++ b/ports/esp32/modnetwork.c @@ -159,8 +159,8 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) { message = "\nno AP found"; break; case WIFI_REASON_AUTH_FAIL: + // Password may be wrong, or it just failed to connect; try to reconnect. message = "\nauthentication failed"; - wifi_sta_connect_requested = false; break; default: // Let other errors through and try to reconnect.