From dd8653bbeb44f24a4d6d92d902a577d7f297d037 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Wed, 3 Jun 2026 10:52:43 +0800 Subject: [PATCH 1/5] fix(coex): remove unsupported external coex soc caps --- components/soc/esp32c2/include/soc/Kconfig.soc_caps.in | 4 ---- components/soc/esp32c2/include/soc/soc_caps.h | 1 - components/soc/esp32c3/include/soc/Kconfig.soc_caps.in | 8 -------- components/soc/esp32c3/include/soc/soc_caps.h | 2 -- components/soc/esp32c5/include/soc/Kconfig.soc_caps.in | 4 ---- components/soc/esp32c5/include/soc/soc_caps.h | 1 - components/soc/esp32c6/include/soc/Kconfig.soc_caps.in | 4 ---- components/soc/esp32c6/include/soc/soc_caps.h | 1 - components/soc/esp32c61/include/soc/Kconfig.soc_caps.in | 4 ---- components/soc/esp32c61/include/soc/soc_caps.h | 1 - components/soc/esp32h2/include/soc/Kconfig.soc_caps.in | 4 ---- components/soc/esp32h2/include/soc/soc_caps.h | 1 - components/soc/esp32h21/include/soc/Kconfig.soc_caps.in | 4 ---- components/soc/esp32h21/include/soc/soc_caps.h | 1 - components/soc/esp32h4/include/soc/Kconfig.soc_caps.in | 4 ---- components/soc/esp32h4/include/soc/soc_caps.h | 1 - components/soc/esp32s2/include/soc/Kconfig.soc_caps.in | 4 ---- components/soc/esp32s2/include/soc/soc_caps.h | 1 - components/soc/esp32s3/include/soc/Kconfig.soc_caps.in | 4 ---- components/soc/esp32s3/include/soc/soc_caps.h | 1 - 20 files changed, 55 deletions(-) diff --git a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in index 9e9309cd006..c597f2e3ebe 100644 --- a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in @@ -663,10 +663,6 @@ config SOC_EXTERNAL_COEX_ADVANCE bool default y -config SOC_EXTERNAL_COEX_LEADER_TX_LINE - bool - default n - config SOC_PHY_DIG_REGS_MEM_SIZE int default 21 diff --git a/components/soc/esp32c2/include/soc/soc_caps.h b/components/soc/esp32c2/include/soc/soc_caps.h index 6821a360267..28bc3beb8b2 100644 --- a/components/soc/esp32c2/include/soc/soc_caps.h +++ b/components/soc/esp32c2/include/soc/soc_caps.h @@ -304,7 +304,6 @@ /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ #define SOC_EXTERNAL_COEX_ADVANCE (1) /*!< HARDWARE ADVANCED EXTERNAL COEXISTENCE CAPS */ -#define SOC_EXTERNAL_COEX_LEADER_TX_LINE (0) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ /*--------------- PHY REGISTER AND MEMORY SIZE CAPS --------------------------*/ #define SOC_PHY_DIG_REGS_MEM_SIZE (21*4) diff --git a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in index 1f7763cc4a3..60d9a4eaa2d 100644 --- a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in @@ -879,14 +879,6 @@ config SOC_COEX_HW_PTI bool default y -config SOC_EXTERNAL_COEX_ADVANCE - bool - default n - -config SOC_EXTERNAL_COEX_LEADER_TX_LINE - bool - default n - config SOC_PHY_DIG_REGS_MEM_SIZE int default 21 diff --git a/components/soc/esp32c3/include/soc/soc_caps.h b/components/soc/esp32c3/include/soc/soc_caps.h index 8eb3101f3a4..62958a85867 100644 --- a/components/soc/esp32c3/include/soc/soc_caps.h +++ b/components/soc/esp32c3/include/soc/soc_caps.h @@ -393,8 +393,6 @@ #define SOC_COEX_HW_PTI (1) /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ -#define SOC_EXTERNAL_COEX_ADVANCE (0) /*!< HARDWARE ADVANCED EXTERNAL COEXISTENCE CAPS */ -#define SOC_EXTERNAL_COEX_LEADER_TX_LINE (0) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ /*--------------- PHY REGISTER AND MEMORY SIZE CAPS --------------------------*/ #define SOC_PHY_DIG_REGS_MEM_SIZE (21*4) diff --git a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in index c4f2b17aaaf..d24da7e619c 100644 --- a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in @@ -1391,10 +1391,6 @@ config SOC_EXTERNAL_COEX_ADVANCE bool default y -config SOC_EXTERNAL_COEX_LEADER_TX_LINE - bool - default n - config SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH int default 12 diff --git a/components/soc/esp32c5/include/soc/soc_caps.h b/components/soc/esp32c5/include/soc/soc_caps.h index 4d544ae9e49..38d3fd6cf6d 100644 --- a/components/soc/esp32c5/include/soc/soc_caps.h +++ b/components/soc/esp32c5/include/soc/soc_caps.h @@ -564,7 +564,6 @@ /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ #define SOC_EXTERNAL_COEX_ADVANCE (1) /*!< HARDWARE EXTERNAL COEXISTENCE CAPS */ -#define SOC_EXTERNAL_COEX_LEADER_TX_LINE (0) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ /*--------------- PHY REGISTER AND MEMORY SIZE CAPS --------------------------*/ // #define SOC_PHY_DIG_REGS_MEM_SIZE (21*4) diff --git a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in index dd9257054c8..4a9808eb8e1 100644 --- a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in @@ -1147,10 +1147,6 @@ config SOC_EXTERNAL_COEX_ADVANCE bool default y -config SOC_EXTERNAL_COEX_LEADER_TX_LINE - bool - default n - config SOC_PHY_DIG_REGS_MEM_SIZE int default 21 diff --git a/components/soc/esp32c6/include/soc/soc_caps.h b/components/soc/esp32c6/include/soc/soc_caps.h index 08257dbc5dc..b02c5419c50 100644 --- a/components/soc/esp32c6/include/soc/soc_caps.h +++ b/components/soc/esp32c6/include/soc/soc_caps.h @@ -477,7 +477,6 @@ /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ #define SOC_EXTERNAL_COEX_ADVANCE (1) /*!< HARDWARE ADVANCED EXTERNAL COEXISTENCE CAPS */ -#define SOC_EXTERNAL_COEX_LEADER_TX_LINE (0) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ /*--------------- PHY REGISTER AND MEMORY SIZE CAPS --------------------------*/ #define SOC_PHY_DIG_REGS_MEM_SIZE (21*4) diff --git a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in index 10094678e85..51d30cd0c7f 100644 --- a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in @@ -1031,10 +1031,6 @@ config SOC_EXTERNAL_COEX_ADVANCE bool default y -config SOC_EXTERNAL_COEX_LEADER_TX_LINE - bool - default n - config SOC_PHY_DIG_REGS_MEM_SIZE int default 21 diff --git a/components/soc/esp32c61/include/soc/soc_caps.h b/components/soc/esp32c61/include/soc/soc_caps.h index ccf72e7a45a..dffe6673dd2 100644 --- a/components/soc/esp32c61/include/soc/soc_caps.h +++ b/components/soc/esp32c61/include/soc/soc_caps.h @@ -432,7 +432,6 @@ /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ #define SOC_EXTERNAL_COEX_ADVANCE (1) /*!< HARDWARE ADVANCED EXTERNAL COEXISTENCE CAPS */ -#define SOC_EXTERNAL_COEX_LEADER_TX_LINE (0) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ /*--------------- PHY REGISTER AND MEMORY SIZE CAPS --------------------------*/ #define SOC_PHY_DIG_REGS_MEM_SIZE (21*4) diff --git a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in index 818b2858052..e36a071b0d0 100644 --- a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in @@ -1159,10 +1159,6 @@ config SOC_EXTERNAL_COEX_ADVANCE bool default y -config SOC_EXTERNAL_COEX_LEADER_TX_LINE - bool - default n - config SOC_PHY_DIG_REGS_MEM_SIZE int default 21 diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index 9131393f563..0a3d6742591 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -502,7 +502,6 @@ /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ #define SOC_EXTERNAL_COEX_ADVANCE (1) /*!< HARDWARE ADVANCED EXTERNAL COEXISTENCE CAPS */ -#define SOC_EXTERNAL_COEX_LEADER_TX_LINE (0) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ // TODO: IDF-6337 /*--------------- PHY REGISTER AND MEMORY SIZE CAPS --------------------------*/ diff --git a/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in index c949f89f634..46c9e1b2708 100644 --- a/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in @@ -867,10 +867,6 @@ config SOC_EXTERNAL_COEX_ADVANCE bool default y -config SOC_EXTERNAL_COEX_LEADER_TX_LINE - bool - default n - config SOC_PHY_DIG_REGS_MEM_SIZE int default 21 diff --git a/components/soc/esp32h21/include/soc/soc_caps.h b/components/soc/esp32h21/include/soc/soc_caps.h index 90bff314944..bd5b93bdb6d 100644 --- a/components/soc/esp32h21/include/soc/soc_caps.h +++ b/components/soc/esp32h21/include/soc/soc_caps.h @@ -477,7 +477,6 @@ /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ #define SOC_EXTERNAL_COEX_ADVANCE (1) /*!< HARDWARE ADVANCED EXTERNAL COEXISTENCE CAPS */ -#define SOC_EXTERNAL_COEX_LEADER_TX_LINE (0) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ /*--------------- PHY REGISTER AND MEMORY SIZE CAPS --------------------------*/ #define SOC_PHY_DIG_REGS_MEM_SIZE (21*4) diff --git a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in index cc62f50a0e1..6b602b83c7b 100644 --- a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in @@ -899,10 +899,6 @@ config SOC_EXTERNAL_COEX_ADVANCE bool default y -config SOC_EXTERNAL_COEX_LEADER_TX_LINE - bool - default n - config SOC_PHY_DIG_REGS_MEM_SIZE int default 21 diff --git a/components/soc/esp32h4/include/soc/soc_caps.h b/components/soc/esp32h4/include/soc/soc_caps.h index 5de1bd36b51..728c9188cd7 100644 --- a/components/soc/esp32h4/include/soc/soc_caps.h +++ b/components/soc/esp32h4/include/soc/soc_caps.h @@ -475,7 +475,6 @@ /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ #define SOC_EXTERNAL_COEX_ADVANCE (1) /*!< HARDWARE ADVANCED EXTERNAL COEXISTENCE CAPS */ -#define SOC_EXTERNAL_COEX_LEADER_TX_LINE (0) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ /*--------------- PHY REGISTER AND MEMORY SIZE CAPS --------------------------*/ #define SOC_PHY_DIG_REGS_MEM_SIZE (21*4) diff --git a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in index 51917176e30..1aa624e7664 100644 --- a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in @@ -1019,10 +1019,6 @@ config SOC_COEX_HW_PTI bool default y -config SOC_EXTERNAL_COEX_ADVANCE - bool - default n - config SOC_EXTERNAL_COEX_LEADER_TX_LINE bool default y diff --git a/components/soc/esp32s2/include/soc/soc_caps.h b/components/soc/esp32s2/include/soc/soc_caps.h index 9f6955a2afe..1670bf8027d 100644 --- a/components/soc/esp32s2/include/soc/soc_caps.h +++ b/components/soc/esp32s2/include/soc/soc_caps.h @@ -459,7 +459,6 @@ // No contents /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ -#define SOC_EXTERNAL_COEX_ADVANCE (0) /*!< HARDWARE ADVANCED EXTERNAL COEXISTENCE CAPS */ #define SOC_EXTERNAL_COEX_LEADER_TX_LINE (1) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ /*-------------------------- Temperature Sensor CAPS -------------------------------------*/ diff --git a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in index 33fbcdda60c..f360b3143e8 100644 --- a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in @@ -1191,10 +1191,6 @@ config SOC_COEX_HW_PTI bool default y -config SOC_EXTERNAL_COEX_ADVANCE - bool - default n - config SOC_EXTERNAL_COEX_LEADER_TX_LINE bool default y diff --git a/components/soc/esp32s3/include/soc/soc_caps.h b/components/soc/esp32s3/include/soc/soc_caps.h index fb6c1b015f0..ea61b03e413 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -491,7 +491,6 @@ #define SOC_COEX_HW_PTI (1) /*-------------------------- EXTERNAL COEXISTENCE CAPS -------------------------------------*/ -#define SOC_EXTERNAL_COEX_ADVANCE (0) /*!< HARDWARE ADVANCED EXTERNAL COEXISTENCE CAPS */ #define SOC_EXTERNAL_COEX_LEADER_TX_LINE (1) /*!< EXTERNAL COEXISTENCE TX LINE CAPS */ /*-------------------------- SDMMC CAPS -----------------------------------------*/ From 7afed49b3f16c53c04dd0c6e6890b08ad48a3ef8 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Wed, 28 Jan 2026 20:36:08 +0800 Subject: [PATCH 2/5] fix(wifi): support weak func for wifi lmac assert --- components/esp_wifi/include/esp_private/wifi.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/esp_wifi/include/esp_private/wifi.h b/components/esp_wifi/include/esp_private/wifi.h index d95f3ffae30..4066a1a5d01 100644 --- a/components/esp_wifi/include/esp_private/wifi.h +++ b/components/esp_wifi/include/esp_private/wifi.h @@ -868,6 +868,17 @@ typedef esp_err_t (*esp_vendor_ie_cb_with_ret_t)(void *ctx, wifi_vendor_ie_type_ */ esp_err_t esp_wifi_set_vendor_ie_with_ret_cb(esp_vendor_ie_cb_with_ret_t cb, void *ctx); +/** + * @brief Weak Wi-Fi assert hook. + * + * The Wi-Fi library provides a weak default implementation. Applications may + * define this symbol to override the default behavior for debugging. + * + * @note This is intended for diagnostics only and is not part of normal Wi-Fi + * operation. + */ +void wifi_assert(bool expr, const char *file, const char *func, int line); + #ifdef __cplusplus } #endif From dbc974cbd8469539eb5bb79ab9b85e792884eef6 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Mon, 22 Jun 2026 17:50:50 +0800 Subject: [PATCH 3/5] fix(wifi): fix some wifi bugs 260706 v6.0 1. support weak func for wifi lmac assert 2. post disconnect event after disassociation tx callback 3. update auth mode threshold doc3. update auth mode threshold doc3. update auth mode threshold doc --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 7aaf787957c..2c6c436575a 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 7aaf787957c52e27c5cbdd8a5b86d277f4ef4b46 +Subproject commit 2c6c436575ac9e42ab782f1c02df88ae845180c8 From eda0d8dde102d749ac9d14f47a24d9c0e84663cd Mon Sep 17 00:00:00 2001 From: muhaidong Date: Tue, 11 Mar 2025 21:24:06 +0800 Subject: [PATCH 4/5] fix(wifi): update wifi scan threshold doc --- components/esp_wifi/include/esp_wifi_types_generic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi_types_generic.h b/components/esp_wifi/include/esp_wifi_types_generic.h index 8c6743984e4..a95694092b2 100644 --- a/components/esp_wifi/include/esp_wifi_types_generic.h +++ b/components/esp_wifi/include/esp_wifi_types_generic.h @@ -359,11 +359,11 @@ typedef enum { } wifi_sort_method_t; /** - * @brief Structure describing parameters for a Wi-Fi fast scan + * @brief Structure describing parameters for Wi-Fi scan during connection */ typedef struct { - int8_t rssi; /**< The minimum rssi to accept in the fast scan mode. Defaults to -127 if set to >= 0 */ - wifi_auth_mode_t authmode; /**< The weakest auth mode to accept in the fast scan mode + int8_t rssi; /**< The minimum rssi to accept in Wi-Fi scan. Defaults to -127 if set to >= 0 */ + wifi_auth_mode_t authmode; /**< The weakest auth mode to accept in Wi-Fi scan Note: In case this value is not set and password is set as per WPA2 standards(password len >= 8), it will be defaulted to WPA2 and device won't connect to deprecated WEP/WPA networks. Please set auth mode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks */ uint8_t rssi_5g_adjustment; /**< The RSSI value of the 5G AP is within the rssi_5g_adjustment range compared to the 2G AP, the 5G AP will be given priority for connection. */ } wifi_scan_threshold_t; From 0ed8d91726e672d9faf35e6d579eb4b2b8bd410a Mon Sep 17 00:00:00 2001 From: muhaidong Date: Tue, 11 Mar 2025 21:38:17 +0800 Subject: [PATCH 5/5] fix(wifi): update auth mode threshold doc --- components/esp_wifi/include/esp_wifi_types_generic.h | 5 +++-- docs/en/api-guides/wifi-driver/overview.rst | 4 ++-- docs/zh_CN/api-guides/wifi-driver/overview.rst | 4 ++-- docs/zh_CN/api-guides/wifi-driver/station-scenarios.rst | 2 +- examples/phy/antenna/main/antenna_switch_example_main.c | 7 ++++--- .../getting_started/station/main/station_example_main.c | 3 ++- examples/wifi/softap_sta/main/softap_sta.c | 7 ++++--- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi_types_generic.h b/components/esp_wifi/include/esp_wifi_types_generic.h index a95694092b2..7cc76451222 100644 --- a/components/esp_wifi/include/esp_wifi_types_generic.h +++ b/components/esp_wifi/include/esp_wifi_types_generic.h @@ -363,8 +363,9 @@ typedef enum { */ typedef struct { int8_t rssi; /**< The minimum rssi to accept in Wi-Fi scan. Defaults to -127 if set to >= 0 */ - wifi_auth_mode_t authmode; /**< The weakest auth mode to accept in Wi-Fi scan - Note: In case this value is not set and password is set as per WPA2 standards(password len >= 8), it will be defaulted to WPA2 and device won't connect to deprecated WEP/WPA networks. Please set auth mode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks */ + wifi_auth_mode_t authmode; /**< The weakest authentication mode to accept when scanning for Wi-Fi during connection. + Note: In case this value is not set and password is set as per WPA2 standards(password len >= 8), it will be defaulted to WPA2 and device won't connect to deprecated WEP/WPA networks. Please set auth mode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks. + If this is set to a mixed mode (for example, WPA_WPA2 or WPA2_WPA3), the minimum mode becomes the stronger of the two. For example, WPA_WPA2 becomes WPA2, and WPA2_WPA3 becomes WPA3. See `wifi_auth_mode_t` for details on relative strengths. */ uint8_t rssi_5g_adjustment; /**< The RSSI value of the 5G AP is within the rssi_5g_adjustment range compared to the 2G AP, the 5G AP will be given priority for connection. */ } wifi_scan_threshold_t; diff --git a/docs/en/api-guides/wifi-driver/overview.rst b/docs/en/api-guides/wifi-driver/overview.rst index bde7f8d228e..cad38e96e86 100644 --- a/docs/en/api-guides/wifi-driver/overview.rst +++ b/docs/en/api-guides/wifi-driver/overview.rst @@ -515,12 +515,12 @@ API :cpp:func:`esp_wifi_set_config()` can be used to configure the station. And * - threshold - The threshold is used to filter the found AP. If the RSSI or security mode is less than the configured threshold, the AP will be discarded. - If the RSSI is set to 0, it means the default threshold is used, and the default RSSI threshold is -127 dBm. If the authmode threshold is set to 0, it means the default threshold is used, and the default authmode threshold is open. + If the RSSI is set to 0, it means the default threshold is used, and the default RSSI threshold is -127 dBm. If the authmode threshold is set to 0, it means the default threshold is used, and the default authmode threshold is ``WIFI_AUTH_OPEN``. .. attention:: - WEP/WPA security modes are deprecated in IEEE 802.11-2016 specifications and are recommended not to be used. These modes can be rejected using authmode threshold by setting threshold as WPA2 by threshold.authmode as ``WIFI_AUTH_WPA2_PSK``. + WEP and TKIP are deprecated in IEEE 802.11-2016 and should not be used. To make the station connect only to APs with WPA2 or higher security, set ``wifi_config_t.sta.threshold.authmode`` to ``WIFI_AUTH_WPA2_PSK``. APs below this threshold, such as OPEN, WEP, and WPA-PSK, will be ignored during connection filtering. AP Basic Configuration +++++++++++++++++++++++++++++++++++++ diff --git a/docs/zh_CN/api-guides/wifi-driver/overview.rst b/docs/zh_CN/api-guides/wifi-driver/overview.rst index bad98dd0c4d..3a6a87dc2a9 100644 --- a/docs/zh_CN/api-guides/wifi-driver/overview.rst +++ b/docs/zh_CN/api-guides/wifi-driver/overview.rst @@ -515,12 +515,12 @@ API :cpp:func:`esp_wifi_set_config()` 可用于配置 station。配置的参数 * - threshold - 该字段用来筛选找到的 AP,如果 AP 的 RSSI 或安全模式小于配置的阈值,则不会被连接。 - 如果 RSSI 设置为 0,则表示默认阈值,默认 RSSI 阈值为 -127 dBm。如果 authmode 阈值设置为 0,则表示默认阈值,默认 authmode 阈值为开放模式。 + 如果 RSSI 设置为 0,则表示默认阈值,默认 RSSI 阈值为 -127 dBm。如果 authmode 阈值设置为 0,则表示默认阈值,默认 authmode 阈值为 ``WIFI_AUTH_OPEN``。 .. attention:: - WEP/WPA 安全模式在 IEEE802.11-2016 协议中已弃用,建议不要使用。可使用 authmode 阈值代替,通过将 threshold.authmode 设置为 ``WIFI_AUTH_WPA2_PSK`` 使用 WPA2 模式。 + IEEE 802.11-2016 已废弃 WEP 和 TKIP,不建议继续使用 WEP 或基于 TKIP 的 WPA 网络。若希望 station 只连接 WPA2 及以上安全级别的 AP,可将 ``wifi_config_t.sta.threshold.authmode`` 设置为 ``WIFI_AUTH_WPA2_PSK``;低于该阈值的 AP(如 OPEN、WEP、WPA-PSK)将在连接筛选时被忽略。 AP 基本配置 +++++++++++++++++++++++++++++++++++++ diff --git a/docs/zh_CN/api-guides/wifi-driver/station-scenarios.rst b/docs/zh_CN/api-guides/wifi-driver/station-scenarios.rst index a4735cfd1f7..8ac88ea3217 100644 --- a/docs/zh_CN/api-guides/wifi-driver/station-scenarios.rst +++ b/docs/zh_CN/api-guides/wifi-driver/station-scenarios.rst @@ -772,7 +772,7 @@ Wi-Fi 原因代码 - 乐鑫特有的 Wi-Fi 原因代码: 当 station 连续失去 N 个 beacon,将中断连接并报告该代码。 * - NO_AP_FOUND - 201 - - 乐鑫特有的 Wi-Fi 原因代码: 当 station 未扫描到目标 AP 时,将报告该代码。 + - 乐鑫特有的 Wi-Fi 原因代码: 当 station 未扫描到目标 AP 时,将报告该代码。如果是由于安全性不匹配或 station 配置不匹配导致未扫描到目标 AP,则会报告新的原因代码NO_AP_FOUND_XXX。 * - AUTH_FAIL - 202 - 乐鑫特有的 Wi-Fi 原因代码: authentication 失败,但并非由超时而引发。 diff --git a/examples/phy/antenna/main/antenna_switch_example_main.c b/examples/phy/antenna/main/antenna_switch_example_main.c index c81a07458e5..3d8cb05534c 100644 --- a/examples/phy/antenna/main/antenna_switch_example_main.c +++ b/examples/phy/antenna/main/antenna_switch_example_main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -117,10 +117,11 @@ void wifi_init_sta(void) .sta = { .ssid = EXAMPLE_ESP_WIFI_SSID, .password = EXAMPLE_ESP_WIFI_PASS, - /* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (password len => 8). + /* Authmode threshold resets to WPA2 as default if auth mode threshold equals WIFI_AUTH_OPEN + * and password matches WPA2 standards (password len => 8). * If you want to connect the device to deprecated WEP/WPA networks, Please set the threshold value * to WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK and set the password with length and format matching to - * WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK standards. + * WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK standards. */ .threshold.authmode = ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD, .sae_pwe_h2e = WPA3_SAE_PWE_BOTH, diff --git a/examples/wifi/getting_started/station/main/station_example_main.c b/examples/wifi/getting_started/station/main/station_example_main.c index 1cc82b0b834..e929c6eb176 100644 --- a/examples/wifi/getting_started/station/main/station_example_main.c +++ b/examples/wifi/getting_started/station/main/station_example_main.c @@ -121,7 +121,8 @@ void wifi_init_sta(void) .sta = { .ssid = EXAMPLE_ESP_WIFI_SSID, .password = EXAMPLE_ESP_WIFI_PASS, - /* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (password len => 8). + /* Authmode threshold resets to WPA2 as default if auth mode threshold equals WIFI_AUTH_OPEN + * and password matches WPA2 standards (password len => 8). * If you want to connect the device to deprecated WEP/WPA networks, Please set the threshold value * to WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK and set the password with length and format matching to * WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK standards. diff --git a/examples/wifi/softap_sta/main/softap_sta.c b/examples/wifi/softap_sta/main/softap_sta.c index d942fd230bd..0f496e55939 100644 --- a/examples/wifi/softap_sta/main/softap_sta.c +++ b/examples/wifi/softap_sta/main/softap_sta.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -152,10 +152,11 @@ esp_netif_t *wifi_init_sta(void) .password = EXAMPLE_ESP_WIFI_STA_PASSWD, .scan_method = WIFI_ALL_CHANNEL_SCAN, .failure_retry_cnt = EXAMPLE_ESP_MAXIMUM_RETRY, - /* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (password len => 8). + /* Authmode threshold resets to WPA2 as default if auth mode threshold equals WIFI_AUTH_OPEN + * and password matches WPA2 standards (password len => 8). * If you want to connect the device to deprecated WEP/WPA networks, Please set the threshold value * to WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK and set the password with length and format matching to - * WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK standards. + * WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK standards. */ .threshold.authmode = ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD, .sae_pwe_h2e = WPA3_SAE_PWE_BOTH,