Merge branch 'bugfix/fix_some_wifi_bugs_260519_v5.3' into 'release/v5.3'

fix(wifi): fix some wifi bugs 260519 v5.3(Backport v5.3)

See merge request espressif/esp-idf!48723
This commit is contained in:
Jiang Jiang Jian
2026-05-20 17:17:42 +08:00
17 changed files with 123 additions and 137 deletions

View File

@@ -884,8 +884,8 @@ ampdu_dispatch_as_many_as_possible = 0x4000182c;
ampdu_dispatch_movement = 0x40001830;
ampdu_dispatch_upto = 0x40001834;
chm_is_at_home_channel = 0x40001838;
cnx_node_is_existing = 0x4000183c;
cnx_node_search = 0x40001840;
/*cnx_node_is_existing = 0x4000183c;*/
/*cnx_node_search = 0x40001840;*/
ic_ebuf_recycle_rx = 0x40001844;
ic_ebuf_recycle_tx = 0x40001848;
ic_reset_rx_ba = 0x4000184c;

View File

@@ -26,8 +26,8 @@ ampdu_dispatch_as_many_as_possible = 0x40000b28;
ampdu_dispatch_movement = 0x40000b2c;
ampdu_dispatch_upto = 0x40000b30;
chm_is_at_home_channel = 0x40000b34;
cnx_node_is_existing = 0x40000b38;
cnx_node_search = 0x40000b3c;
/*cnx_node_is_existing = 0x40000b38;*/
/*cnx_node_search = 0x40000b3c;*/
ic_ebuf_recycle_rx = 0x40000b40;
ic_ebuf_recycle_tx = 0x40000b44;
ic_reset_rx_ba = 0x40000b48;

View File

@@ -25,8 +25,8 @@ ampdu_dispatch_as_many_as_possible = 0x40000b58;
ampdu_dispatch_movement = 0x40000b5c;
ampdu_dispatch_upto = 0x40000b60;
chm_is_at_home_channel = 0x40000b64;
cnx_node_is_existing = 0x40000b68;
cnx_node_search = 0x40000b6c;
/*cnx_node_is_existing = 0x40000b68;*/
/*cnx_node_search = 0x40000b6c;*/
ic_ebuf_recycle_rx = 0x40000b70;
ic_ebuf_recycle_tx = 0x40000b74;
ic_reset_rx_ba = 0x40000b78;

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -333,12 +333,13 @@ 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
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 */
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 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. */
} wifi_scan_threshold_t;
/**
@@ -408,7 +409,7 @@ typedef struct {
uint8_t channel; /**< Channel of soft-AP. Set to 0 for auto selection (min channel: typically 1 for 2.4G, 36 for 5G). Other invalid values return ESP_ERR_INVALID_ARG. */
wifi_auth_mode_t authmode; /**< Auth mode of soft-AP. Do not support AUTH_WEP, AUTH_WAPI_PSK and AUTH_OWE in soft-AP mode. When the auth mode is set to WPA2_PSK, WPA2_WPA3_PSK or WPA3_PSK, the pairwise cipher will be overwritten with WIFI_CIPHER_TYPE_CCMP by default, unless explicitly set. */
uint8_t ssid_hidden; /**< Broadcast SSID or not, default 0, broadcast the SSID */
uint8_t max_connection; /**< Max number of stations allowed to connect in */
uint8_t max_connection; /**< Max number of stations allowed to connect in. Please note that soft-AP and ESP-NOW share the same encryption hardware keys, so the max_connection parameter will be affected by CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM. */
uint16_t beacon_interval; /**< Beacon interval which should be multiples of 100. Unit: TU(time unit, 1 TU = 1024 us). Range: 100 ~ 60000. Default value: 100 */
uint8_t csa_count; /**< Channel Switch Announcement Count. Notify the station that the channel will switch after the csa_count beacon intervals. Default value: 3 */
uint8_t dtim_period; /**< Dtim period of soft-AP. Range: 1 ~ 10. Default value: 1 */

View File

@@ -18,10 +18,8 @@ extern "C" {
#if CONFIG_IDF_TARGET_ESP32C2
#define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C5
#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 soft-AP */
#else
#define ESP_WIFI_MAX_CONN_NUM (15) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2 soft-AP */
#define ESP_WIFI_MAX_CONN_NUM (15)
#endif
/** @brief List of stations associated with the Soft-AP */

View File

@@ -3,9 +3,11 @@ Wi-Fi Driver
:link_to_translation:`zh_CN:[中文]`
{IDF_TARGET_MAX_CONN_STA_NUM:default="15", esp32c2="4", esp32c3="10", esp32c6="10"}
{IDF_TARGET_MAX_CONN_STA_NUM:default="15", esp32c2="4"}
{IDF_TARGET_SUB_MAX_NUM_FROM_KEYS:default="2", esp32c3="7", esp32c6="7"}
{IDF_TARGET_SUB_MAX_NUM_FROM_KEYS:default="2", esp32c2="0"}
{IDF_TARGET_SUPPORT_ENCRYPT_NUM:default="17", esp32c2="4"}
{IDF_TARGET_NAME} Wi-Fi Feature List
------------------------------------
@@ -1307,68 +1309,40 @@ 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
+++++++++++++++++++++++++++++++++++++
API :cpp:func:`esp_wifi_set_config()` can be used to configure the AP. And the configuration will be stored in NVS. The table below describes the fields in detail.
.. only:: esp32 or esp32s2 or esp32s3 or esp32c3 or esp32c6
.. list-table::
:header-rows: 1
:widths: 15 55
.. list-table::
:header-rows: 1
:widths: 15 55
* - Field
- Description
* - ssid
- SSID of AP; if the ssid[0] is 0xFF and ssid[1] is 0xFF, the AP defaults the SSID to ``ESP_aabbcc``, where “aabbcc” is the last three bytes of the AP MAC.
* - password
- Password of AP; if the auth mode is ``WIFI_AUTH_OPEN``, this field will be ignored.
* - ssid_len
- Length of SSID; if ssid_len is 0, check the SSID until there is a termination character. If ssid_len > 32, change it to 32; otherwise, set the SSID length according to ssid_len.
* - channel
- Channel of AP; if the channel is out of range, the Wi-Fi driver defaults to channel 1. So, please make sure the channel is within the required range. For more details, refer to `Wi-Fi Country Code`_.
* - authmode
- Auth mode of ESP AP; currently, ESP AP does not support AUTH_WEP. If the authmode is an invalid value, AP defaults the value to ``WIFI_AUTH_OPEN``.
* - ssid_hidden
- If ssid_hidden is 1, AP does not broadcast the SSID; otherwise, it does broadcast the SSID.
* - max_connection
- The max number of stations allowed to connect in, the default value is 10. ESP Wi-Fi supports up to {IDF_TARGET_MAX_CONN_STA_NUM} (``ESP_WIFI_MAX_CONN_NUM``) Wi-Fi connections. Please note that ESP AP and ESP-NOW share the same encryption hardware keys, so the max_connection parameter will be affected by the :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`. The total number of encryption hardware keys is 17, if :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` <= {IDF_TARGET_SUB_MAX_NUM_FROM_KEYS}, the max_connection can be set up to {IDF_TARGET_MAX_CONN_STA_NUM}, otherwise the max_connection can be set up to (17 - :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`).
* - beacon_interval
- Beacon interval; the value is 100 ~ 60000 ms, with default value being 100 ms. If the value is out of range, AP defaults it to 100 ms.
.. only:: esp32c2
.. list-table::
:header-rows: 1
:widths: 15 55
* - Field
- Description
* - ssid
- SSID of AP; if the ssid[0] is 0xFF and ssid[1] is 0xFF, the AP defaults the SSID to ``ESP_aabbcc``, where “aabbcc” is the last three bytes of the AP MAC.
* - password
- Password of AP; if the auth mode is ``WIFI_AUTH_OPEN``, this field will be ignored.
* - ssid_len
- Length of SSID; if ssid_len is 0, check the SSID until there is a termination character. If ssid_len > 32, change it to 32; otherwise, set the SSID length according to ssid_len.
* - channel
- Channel of AP; if the channel is out of range, the Wi-Fi driver defaults to channel 1. So, please make sure the channel is within the required range. For more details, refer to `Wi-Fi Country Code`_.
* - authmode
- Auth mode of ESP AP; currently, ESP AP does not support AUTH_WEP. If the authmode is an invalid value, AP defaults the value to ``WIFI_AUTH_OPEN``.
* - ssid_hidden
- If ssid_hidden is 1, AP does not broadcast the SSID; otherwise, it does broadcast the SSID.
* - max_connection
- The max number of stations allowed to connect in, the default value is 2. ESP Wi-Fi supports up to {IDF_TARGET_MAX_CONN_STA_NUM} (``ESP_WIFI_MAX_CONN_NUM``) Wi-Fi connections. Please note that ESP AP and ESP-NOW share the same encryption hardware keys, so the max_connection parameter will be affected by the :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`. The total number of encryption hardware keys is {IDF_TARGET_MAX_CONN_STA_NUM}, the max_connection can be set up to ({IDF_TARGET_MAX_CONN_STA_NUM} - :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`).
* - beacon_interval
- Beacon interval; the value is 100 ~ 60000 ms, with default value being 100 ms. If the value is out of range, AP defaults it to 100 ms.
* - Field
- Description
* - ssid
- SSID of AP; if the ssid[0] is 0xFF and ssid[1] is 0xFF, the AP defaults the SSID to ``ESP_aabbcc``, where “aabbcc” is the last three bytes of the AP MAC.
* - password
- Password of AP; if the auth mode is ``WIFI_AUTH_OPEN``, this field will be ignored.
* - ssid_len
- Length of SSID; if ssid_len is 0, check the SSID until there is a termination character. If ssid_len > 32, change it to 32; otherwise, set the SSID length according to ssid_len.
* - channel
- Channel of AP; set to 0 for auto selection (min channel: typically 1 for 2.4G, 36 for 5G). Other invalid values return ``ESP_ERR_INVALID_ARG``. So, please make sure the channel is within the required range. For more details, refer to `Wi-Fi Country Code`_.
* - authmode
- Auth mode of ESP AP; currently, ESP AP does not support AUTH_WEP. If the authmode is an invalid value, AP defaults the value to ``WIFI_AUTH_OPEN``.
* - ssid_hidden
- If ssid_hidden is 1, AP does not broadcast the SSID; otherwise, it does broadcast the SSID.
* - max_connection
- The max number of stations allowed to connect in. {IDF_TARGET_NAME} supports up to {IDF_TARGET_MAX_CONN_STA_NUM} (``ESP_WIFI_MAX_CONN_NUM``) Wi-Fi connections. Please note that soft-AP and ESP-NOW share the same encryption hardware keys, so the max_connection parameter will be affected by the :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`. The total number of encryption hardware keys is {IDF_TARGET_SUPPORT_ENCRYPT_NUM}, if :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` <= {IDF_TARGET_SUB_MAX_NUM_FROM_KEYS}, the max_connection can be set up to {IDF_TARGET_MAX_CONN_STA_NUM}, otherwise the max_connection can be set up to ({IDF_TARGET_SUPPORT_ENCRYPT_NUM} - :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`).
* - beacon_interval
- Beacon interval; the value is 100 ~ 60000 ms, with default value being 100 ms. If the value is out of range, AP defaults it to 100 ms.
Wi-Fi Protocol Mode

View File

@@ -3,9 +3,11 @@ Wi-Fi 驱动程序
:link_to_translation:`en:[English]`
{IDF_TARGET_MAX_CONN_STA_NUM:default="15", esp32c2="4", esp32c3="10", esp32c6="10"}
{IDF_TARGET_MAX_CONN_STA_NUM:default="15", esp32c2="4"}
{IDF_TARGET_SUB_MAX_NUM_FROM_KEYS:default="2", esp32c3="7", esp32c6="7"}
{IDF_TARGET_SUB_MAX_NUM_FROM_KEYS:default="2", esp32c2="0"}
{IDF_TARGET_SUPPORT_ENCRYPT_NUM:default="17", esp32c2="4"}
{IDF_TARGET_NAME} Wi-Fi 功能列表
------------------------------------
@@ -1159,7 +1161,7 @@ Wi-Fi 原因代码
* - NO_AP_FOUND
- 201
- 保留
- 乐鑫特有的 Wi-Fi 原因代码: 当 station 未扫描到目标 AP 时,将报告该代码。
- 乐鑫特有的 Wi-Fi 原因代码: 当 station 未扫描到目标 AP 时,将报告该代码。如果是由于安全性不匹配或 station 配置不匹配导致未扫描到目标 AP则会报告新的原因代码 NO_AP_FOUND_XXX。
* - AUTH_FAIL
- 202
- 保留
@@ -1306,68 +1308,40 @@ 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 基本配置
+++++++++++++++++++++++++++++++++++++
API :cpp:func:`esp_wifi_set_config()` 可用于配置 AP。配置的参数信息会保存到 NVS 中。下表详细介绍了各个字段。
.. only:: esp32 or esp32s2 or esp32s3 or esp32c3 or esp32c6
.. list-table::
:header-rows: 1
:widths: 15 55
.. list-table::
:header-rows: 1
:widths: 15 55
* - 字段
- 描述
* - ssid
- 指 AP 的 SSID。如果 ssid[0] 和 ssid[1] 均为 0xFFAP 默认 SSID 为 ``ESP_aabbcc``”aabbcc” 是 AP MAC 的最后三个字节
* - password
- AP 的密码。如果身份验证模式为 ``WIFI_AUTH_OPEN``,此字段将被忽略
* - ssid_len
- SSID 的长度。如果 ssid_len 为 0则检查 SSID 直至出现终止字符。如果 ssid_len 大于 32请更改为 32或者根据 ssid_len 设置 SSID 长度。
* - channel
- AP 的信道。如果信道超出范围Wi-Fi 驱动程序将默认为信道 1。所以请确保信道在要求的范围内。有关详细信息请参阅 `Wi-Fi 国家/地区代码`_
* - authmode
- ESP AP 的身份验证模式。目前ESP AP 不支持 AUTH_WEP。如果 authmode 是一个无效值AP 默认该值为 ``WIFI_AUTH_OPEN``
* - ssid_hidden
- 如果 ssid_hidden 为 1AP 不广播 SSID。若为其他值则广播。
* - max_connection
- 允许连接 station 的最大数目,默认值是 10。ESP Wi-Fi 支持 {IDF_TARGET_MAX_CONN_STA_NUM} (``ESP_WIFI_MAX_CONN_NUM``) 个 Wi-Fi 连接。请注意, ESP AP 和 ESP-NOW 共享同一块加密硬件 keys因此 max_connection 参数将受到 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` 的影响。加密硬件 keys 的总数是 17如果 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` 小于等于 {IDF_TARGET_SUB_MAX_NUM_FROM_KEYS},那么 max_connection 最大可以设置为 {IDF_TARGET_MAX_CONN_STA_NUM},否则 max_connection 最大可以设置为 (17 - :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`)。
* - beacon_interval
- beacon 间隔。值为 100 ~ 60000 ms默认值为 100 ms。如果该值不在上述范围AP 默认取 100 ms。
.. only:: esp32c2
.. list-table::
:header-rows: 1
:widths: 15 55
* - 字段
- 描述
* - ssid
- 指 AP 的 SSID。如果 ssid[0] 和 ssid[1] 均为 0xFFAP 默认 SSID 为 ``ESP_aabbcc``”aabbcc” 是 AP MAC 的最后三个字节。
* - password
- AP 的密码。如果身份验证模式为 ``WIFI_AUTH_OPEN``,此字段将被忽略。
* - ssid_len
- SSID 的长度。如果 ssid_len 为 0则检查 SSID 直至出现终止字符。如果 ssid_len 大于 32请更改为 32或者根据 ssid_len 设置 SSID 长度。
* - channel
- AP 的信道。如果信道超出范围Wi-Fi 驱动程序将默认为信道 1。所以请确保信道在要求的范围内。有关详细信息请参阅 `Wi-Fi 国家/地区代码`_
* - authmode
- ESP AP 的身份验证模式。目前ESP AP 不支持 AUTH_WEP。如果 authmode 是一个无效值AP 默认该值为 ``WIFI_AUTH_OPEN``
* - ssid_hidden
- 如果 ssid_hidden 为 1AP 不广播 SSID。若为其他值则广播。
* - max_connection
- 允许连接 station 的最大数目,默认值是 2。ESP Wi-Fi 支持 {IDF_TARGET_MAX_CONN_STA_NUM} (``ESP_WIFI_MAX_CONN_NUM``) 个 Wi-Fi 连接。请注意, ESP AP 和 ESP-NOW 共享同一块加密硬件 keys因此 max_connection 参数将受到 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` 的影响。加密硬件 keys 的总数是 {IDF_TARGET_MAX_CONN_STA_NUM} max_connection 最大可以设置为 ({IDF_TARGET_MAX_CONN_STA_NUM} - :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`)。
* - beacon_interval
- beacon 间隔。值为 100 ~ 60000 ms默认值为 100 ms。如果该值不在上述范围AP 默认取 100 ms。
* - 字段
- 描述
* - ssid
- 指 AP 的 SSID。如果 ssid[0] 和 ssid[1] 均为 0xFFAP 默认 SSID 为 ``ESP_aabbcc``”aabbcc” 是 AP MAC 的最后三个字节。
* - password
- AP 的密码。如果身份验证模式为 ``WIFI_AUTH_OPEN``,此字段将被忽略。
* - ssid_len
- SSID 的长度。如果 ssid_len 为 0则检查 SSID 直至出现终止字符。如果 ssid_len 大于 32请更改为 32或者根据 ssid_len 设置 SSID 长度
* - channel
- AP 的信道。设为 0 表示自动选择最小信道2.4 GHz 通常为 15 GHz 通常为 36。其它非法值将返回 ``ESP_ERR_INVALID_ARG``。请确保信道在允许范围内。更多说明请参阅 `Wi-Fi 国家/地区代码`_
* - authmode
- ESP AP 的身份验证模式。目前ESP AP 不支持 AUTH_WEP。如果 authmode 是一个无效值AP 默认该值为 ``WIFI_AUTH_OPEN``
* - ssid_hidden
- 如果 ssid_hidden 为 1AP 不广播 SSID。若为其他值则广播。
* - max_connection
- 允许接入的 station 最大数量。{IDF_TARGET_NAME} 最多支持 {IDF_TARGET_MAX_CONN_STA_NUM}``ESP_WIFI_MAX_CONN_NUM`` 个 Wi-Fi 连接。请注意soft-AP 与 ESP-NOW 共享同一套加密硬件 keys因此 max_connection 会受到 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` 的影响。加密硬件 keys 总数为 {IDF_TARGET_SUPPORT_ENCRYPT_NUM}:若 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` <= {IDF_TARGET_SUB_MAX_NUM_FROM_KEYS},则 max_connection 最大可设为 {IDF_TARGET_MAX_CONN_STA_NUM};否则最大可设为 ({IDF_TARGET_SUPPORT_ENCRYPT_NUM} - :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`)
* - beacon_interval
- beacon 间隔。值为 100 ~ 60000 ms默认值为 100 ms。如果该值不在上述范围AP 默认取 100 ms。
Wi-Fi 协议模式

View File

@@ -40,6 +40,12 @@ menu "Example AP Wifi Configuration"
depends on EXAMPLE_BR_WIFI
int "Maximal STA connections"
default 4
range 1 4 if IDF_TARGET_ESP32C2
range 1 15
help
Max number of the STA connects to AP.
Maximum number of STAs allowed to connect to the bridged soft-AP (wifi_config_t.ap.max_connection).
Upper bound matches ESP_WIFI_MAX_CONN_NUM in esp_wifi_types_native.h:
1-4 on ESP32-C2, 1-15 on other Wi-Fi chips.
Soft-AP and ESP-NOW share encryption keys; see Wi-Fi driver documentation
if ESP-NOW is enabled.
endmenu

View File

@@ -22,7 +22,13 @@ menu "Example Configuration"
config EXAMPLE_MAX_STA_CONN
int "Maximum STA connections"
default 4
range 1 4 if IDF_TARGET_ESP32C2
range 1 15
help
Maximum number of the station that allowed to connect to current Wi-Fi hotspot.
Maximum number of STAs allowed to connect to the soft-AP (wifi_config_t.ap.max_connection).
Upper bound matches ESP_WIFI_MAX_CONN_NUM in esp_wifi_types_native.h:
1-4 on ESP32-C2, 1-15 on other Wi-Fi chips.
Soft-AP and ESP-NOW share encryption keys; see Wi-Fi driver documentation
if ESP-NOW is enabled.
endmenu

View File

@@ -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,

View File

@@ -15,6 +15,12 @@ menu "Example Configuration"
config ESP_MAX_STA_CONN
int "Maximal STA connections"
default 4
range 1 4 if IDF_TARGET_ESP32C2
range 1 15
help
Max number of the STA connects to AP.
Maximum number of STAs allowed to connect to the soft-AP (wifi_config_t.ap.max_connection).
Upper bound matches ESP_WIFI_MAX_CONN_NUM in esp_wifi_types_native.h:
1-4 on ESP32-C2, 1-15 on other Wi-Fi chips.
Soft-AP and ESP-NOW share encryption keys; see Wi-Fi driver documentation
if ESP-NOW is enabled.
endmenu

View File

@@ -21,6 +21,12 @@ menu "Example Configuration"
config ESP_MAX_STA_CONN
int "Maximal STA connections"
default 4
range 1 4 if IDF_TARGET_ESP32C2
range 1 15
help
Max number of the STA connects to AP.
Maximum number of STAs allowed to connect to the soft-AP (wifi_config_t.ap.max_connection).
Upper bound matches ESP_WIFI_MAX_CONN_NUM in esp_wifi_types_native.h:
1-4 on ESP32-C2, 1-15 on other Wi-Fi chips.
Soft-AP and ESP-NOW share encryption keys; see Wi-Fi driver documentation
if ESP-NOW is enabled.
endmenu

View File

@@ -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.

View File

@@ -25,8 +25,14 @@ menu "Example Configuration"
config ESP_MAX_STA_CONN_AP
int "Maximal STA connections"
default 4
range 1 4 if IDF_TARGET_ESP32C2
range 1 15
help
Max number of the STA connects to AP.
Maximum number of STAs allowed to connect to the soft-AP (wifi_config_t.ap.max_connection).
Upper bound matches ESP_WIFI_MAX_CONN_NUM in esp_wifi_types_native.h:
1-4 on ESP32-C2, 1-15 on other Wi-Fi chips.
Soft-AP and ESP-NOW share encryption keys; see Wi-Fi driver documentation
if ESP-NOW is enabled.
endmenu
menu "STA Configuration"

View File

@@ -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
*/
@@ -148,10 +148,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,

View File

@@ -22,8 +22,14 @@ menu "Example Configuration"
config EXAMPLE_MAX_STA_CONN
int "Maximal STA connections"
default 4
range 1 4 if IDF_TARGET_ESP32C2
range 1 15
help
Max number of the STA connects to AP.
Maximum number of STAs allowed to connect to the soft-AP (wifi_config_t.ap.max_connection).
Upper bound matches ESP_WIFI_MAX_CONN_NUM in esp_wifi_types_native.h:
1-4 on ESP32-C2, 1-15 on other Wi-Fi chips.
Soft-AP and ESP-NOW share encryption keys; see Wi-Fi driver documentation
if ESP-NOW is enabled.
choice EXAMPLE_WPS_TYPE
prompt "WPS mode"
@@ -44,7 +50,7 @@ menu "Example Configuration"
int "WPS PIN"
default 0
help
WPS PIN to be used for the connection, incase its not give, AP will derive a new one.
WPS PIN to be used for the connection, in case its not give, AP will derive a new one.
endif
endmenu