From 0de5180d8ac886012aa38850d4e89f6d05006ba1 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Fri, 28 Feb 2025 14:52:41 +0530 Subject: [PATCH 1/2] fix(esp_wifi): Increase WPS timeout --- components/wpa_supplicant/esp_supplicant/src/esp_wps.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index 41fdf0ab3c..3dd2f00838 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -919,13 +919,12 @@ int wps_start_msg_timer(void) } if (sm->wps->state == WPS_FINISHED) { - msg_timeout = 100; wpa_printf(MSG_DEBUG, "start msg timer WPS_FINISHED %" PRId32 " ms", msg_timeout); eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL); - eloop_register_timeout(0, msg_timeout*1000, wifi_station_wps_msg_timeout, NULL, NULL); + eloop_register_timeout(5, 0, wifi_station_wps_msg_timeout, NULL, NULL); ret = 0; } else if (sm->wps->state == RECV_M2) { - msg_timeout = 5; + msg_timeout = 20; wpa_printf(MSG_DEBUG, "start msg timer RECV_M2 %" PRId32 " s", msg_timeout); eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL); eloop_register_timeout(msg_timeout, 0, wifi_station_wps_msg_timeout, NULL, NULL); @@ -1663,7 +1662,7 @@ wifi_wps_scan_done(void *arg, ETS_STATUS status) esp_wifi_connect(); sm->state = WAIT_START; eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL); - eloop_register_timeout(2, 0, wifi_station_wps_msg_timeout, NULL, NULL); + eloop_register_timeout(20, 0, wifi_station_wps_msg_timeout, NULL, NULL); } else if (wps_get_status() == WPS_STATUS_SCANNING) { if (wps_get_type() == WPS_TYPE_PIN && sm->scan_cnt > WPS_IGNORE_SEL_REG_MAX_CNT) { wpa_printf(MSG_INFO, "WPS: ignore selected registrar after %d scans", sm->scan_cnt); From 71fde740e1427983e472b105b3895700c21ea5e5 Mon Sep 17 00:00:00 2001 From: akshat Date: Wed, 16 Apr 2025 18:30:39 +0530 Subject: [PATCH 2/2] fix(wpa_supplicant): Fix build errors when Supplicant logs are enabled --- components/wpa_supplicant/esp_supplicant/src/esp_wps.c | 9 +++++---- examples/wifi/roaming/roaming_11kvr/sdkconfig.ci | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index 3dd2f00838..e6fb8ced74 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -919,15 +919,16 @@ int wps_start_msg_timer(void) } if (sm->wps->state == WPS_FINISHED) { + msg_timeout = 5; wpa_printf(MSG_DEBUG, "start msg timer WPS_FINISHED %" PRId32 " ms", msg_timeout); - eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL); - eloop_register_timeout(5, 0, wifi_station_wps_msg_timeout, NULL, NULL); + eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL); + eloop_register_timeout(msg_timeout, 0, wifi_station_wps_msg_timeout, NULL, NULL); ret = 0; } else if (sm->wps->state == RECV_M2) { msg_timeout = 20; wpa_printf(MSG_DEBUG, "start msg timer RECV_M2 %" PRId32 " s", msg_timeout); - eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL); - eloop_register_timeout(msg_timeout, 0, wifi_station_wps_msg_timeout, NULL, NULL); + eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL); + eloop_register_timeout(msg_timeout, 0, wifi_station_wps_msg_timeout, NULL, NULL); ret = 0; } return ret; diff --git a/examples/wifi/roaming/roaming_11kvr/sdkconfig.ci b/examples/wifi/roaming/roaming_11kvr/sdkconfig.ci index 3c3a0e74c7..72b1fcbbec 100644 --- a/examples/wifi/roaming/roaming_11kvr/sdkconfig.ci +++ b/examples/wifi/roaming/roaming_11kvr/sdkconfig.ci @@ -1,2 +1,3 @@ # Add CI coverage for WPA supplicant debug feature +CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y CONFIG_ESP_WIFI_DEBUG_PRINT=y