Skip to content

Commit 95cf7af

Browse files
committed
src: Improve "bad auth" problems.
For most status codes of the CYW43_EV_AUTH we assume we have are suffering from a "bad auth". In a congested WiFi environment this can make it look like your WiFi credentials are wrong. Ignore "timeout" and "no ack" status codes as well as "unsolicitated auth packet" as this seems to make a connection more likely to succeed. Signed-off-by: Peter Harper <peter.harper@raspberrypi.com>
1 parent dd75682 commit 95cf7af

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/cyw43_ctrl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,11 @@ void cyw43_cb_process_async_event(void *cb_data, const cyw43_async_event_t *ev)
387387
self->wifi_join_state = (self->wifi_join_state & ~WIFI_JOIN_STATE_KIND_MASK) | WIFI_JOIN_STATE_ACTIVE;
388388
}
389389
self->wifi_join_state |= WIFI_JOIN_STATE_AUTH;
390-
} else if (ev->status == 6) {
391-
// Unsolicited auth packet, ignore it
390+
} else if (ev->status == 6 || ev->status == 2 || ev->status == 5) {
391+
// 2 = Timeout
392+
// 5 = No ack
393+
// 6 = Unsolicited auth packet
394+
// Ignore it, lets keep trying
392395
} else {
393396
// Cannot authenticate
394397
self->wifi_join_state = WIFI_JOIN_STATE_BADAUTH;

0 commit comments

Comments
 (0)