Skip to content

Commit e519dd3

Browse files
committed
Retry on all disconnect reasons other than: 2 exception reasons & 1 manual disconnect reason.
1 parent 92a4398 commit e519dd3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ports/esp32s2/common-hal/wifi/__init__.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ static void event_handler(void* arg, esp_event_base_t event_base,
6565
uint8_t reason = d->reason;
6666
ESP_LOGW(TAG, "reason %d 0x%02x", reason, reason);
6767
if (radio->retries_left > 0 &&
68-
(reason == WIFI_REASON_AUTH_EXPIRE ||
69-
reason == WIFI_REASON_NOT_AUTHED ||
70-
reason == WIFI_REASON_ASSOC_EXPIRE ||
71-
reason == WIFI_REASON_CONNECTION_FAIL ||
72-
reason == WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT)) {
68+
reason != WIFI_REASON_AUTH_FAIL &&
69+
reason != WIFI_REASON_NO_AP_FOUND &&
70+
reason != WIFI_REASON_ASSOC_LEAVE) {
7371
radio->retries_left--;
7472
ESP_LOGI(TAG, "Retrying connect. %d retries remaining", radio->retries_left);
7573
esp_wifi_connect();

0 commit comments

Comments
 (0)