Skip to content

Commit

Permalink
esp32/modnetwork: Still try to reconnect to WLAN even with AUTH_FAIL.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dpgeorge committed Jun 22, 2019
1 parent 34c04d2 commit b80bccc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ports/esp32/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b80bccc

Please sign in to comment.