summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-06-12 18:03:18 +1000
committerDamien George <damien.p.george@gmail.com>2019-06-22 21:50:49 +1000
commitb80bccccffea7aab68d4af9580664f77fecc45b2 (patch)
tree3d60da525da204a0309fe5cb381e3567c7d88a9d
parent34c04d2319cdfae01ed7bf7f9e341d69b86d751a (diff)
downloadmicropython-b80bccccffea7aab68d4af9580664f77fecc45b2.tar.gz
micropython-b80bccccffea7aab68d4af9580664f77fecc45b2.zip
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.
-rw-r--r--ports/esp32/modnetwork.c2
1 files changed, 1 insertions, 1 deletions
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.