docs: update esp32c6 api guides about wifi part

This commit is contained in:
xuxiao 2023-05-22 14:25:39 +08:00
parent aa741b90ad
commit 5a9cff0d34
6 changed files with 459 additions and 66 deletions

View File

@ -238,7 +238,7 @@ html_context['github_repo'] = 'esp-idf'
project_slug = 'esp-idf' project_slug = 'esp-idf'
versions_url = 'https://dl.espressif.com/dl/esp-idf/idf_versions.js' versions_url = 'https://dl.espressif.com/dl/esp-idf/idf_versions.js'
idf_targets = ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c2'] idf_targets = ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c2', 'esp32c6']
languages = ['en', 'zh_CN'] languages = ['en', 'zh_CN']
google_analytics_id = os.environ.get('CI_GOOGLE_ANALYTICS_ID', None) google_analytics_id = os.environ.get('CI_GOOGLE_ANALYTICS_ID', None)

View File

@ -1,14 +1,5 @@
api-guides/coexist
api-guides/wifi
api-guides/esp-wifi-mesh
api-guides/wifi-security
api-guides/openthread api-guides/openthread
api-reference/network api-reference/network
api-reference/network/esp_openthread api-reference/network/esp_openthread
api-reference/network/esp_dpp
api-reference/network/esp_now
api-reference/network/esp-wifi-mesh
api-reference/network/esp_smartconfig
api-reference/network/esp_wifi
api-reference/network/index api-reference/network/index
api-reference/protocols/esp_spi_slave_protocol api-reference/protocols/esp_spi_slave_protocol

View File

@ -22,6 +22,25 @@ The following features are supported:
- Multiple antennas - Multiple antennas
- Channel state information - Channel state information
.. only:: esp32c6
- 4 virtual Wi-Fi interfaces, which are STA, AP, Sniffer and reserved.
- Station-only mode, AP-only mode, station/AP-coexistence mode
- IEEE 802.11b, IEEE 802.11g, IEEE 802.11n, IEEE 802.11ax, and APIs to configure the protocol mode
- WPA/WPA2/WPA3/WPA2-Enterprise/WPA3-Enterprise/WAPI/WPS and DPP
- AMSDU, AMPDU, HT40, QoS, and other key features
- Modem-sleep
- The Espressif-specific ESP-NOW protocol and Long Range mode, which supports up to **1 km** of data traffic
- Up to 20 MBit/s TCP throughput and 30 MBit/s UDP throughput over the air
- Sniffer
- Both fast scan and all-channel scan
- Multiple antennas
- Channel state information
- Support TWT
- Supoort downlink MU-MIMO
- Support OFDMA
- Support BSS Color
.. only:: esp32c2 .. only:: esp32c2
- 3 virtual Wi-Fi interfaces, which are STA, AP and Sniffer. - 3 virtual Wi-Fi interfaces, which are STA, AP and Sniffer.
@ -1289,7 +1308,7 @@ API :cpp:func:`esp_wifi_set_config()` can be used to configure the AP. And the c
- 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. - 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:: esp32c3 .. only:: esp32c3 or esp32c6
.. list-table:: .. list-table::
:header-rows: 1 :header-rows: 1
@ -1371,7 +1390,34 @@ Currently, the ESP-IDF supports the following protocol modes:
**This mode is an Espressif-patented mode which can achieve a one-kilometer line of sight range. Please make sure both the station and the AP are connected to an ESP device.** **This mode is an Espressif-patented mode which can achieve a one-kilometer line of sight range. Please make sure both the station and the AP are connected to an ESP device.**
.. only:: esp32c6
.. list-table::
:header-rows: 1
:widths: 15 55
* - Protocol Mode
- Description
* - 802.11b
- Call esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B) to set the station/AP to 802.11b-only mode.
* - 802.11bg
- Call esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G) to set the station/AP to 802.11bg mode.
* - 802.11g
- Call esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G) and esp_wifi_config_11b_rate(ifx, true) to set the station/AP to 802.11g mode.
* - 802.11bgn
- Call esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B| WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N) to set the station/ AP to BGN mode.
* - 802.11gn
- Call esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N) and esp_wifi_config_11b_rate(ifx, true) to set the station/AP to 802.11gn mode.
* - 802.11 BGNLR
- Call esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B| WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_LR) to set the station/AP to BGN and the LR mode.
* - 802.11bgnax
- Call esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B| WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX) to set the station/ AP to 802.11bgnax mode.
* - 802.11 BGNAXLR
- Call esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B| WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX|WIFI_PROTOCOL_LR) to set the station/ AP to 802.11bgnax and LR mode.
* - 802.11 LR
- Call esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_LR) to set the station/AP only to the LR mode.
**This mode is an Espressif-patented mode which can achieve a one-kilometer line of sight range. Please make sure both the station and the AP are connected to an ESP device.**
.. only:: esp32c2 .. only:: esp32c2
@ -1394,7 +1440,7 @@ Currently, the ESP-IDF supports the following protocol modes:
.. only:: esp32 or esp32s2 or esp32c3 or esp32s3 .. only:: esp32 or esp32s2 or esp32c3 or esp32s3 or esp32c6
Long Range (LR) Long Range (LR)
+++++++++++++++++++++++++ +++++++++++++++++++++++++
@ -1404,27 +1450,53 @@ Currently, the ESP-IDF supports the following protocol modes:
LR Compatibility LR Compatibility
************************* *************************
Since LR is Espressif-unique Wi-Fi mode, only {IDF_TARGET_NAME} devices can transmit and receive the LR data. In other words, the {IDF_TARGET_NAME} device should NOT transmit the data in LR data rate if the connected device does not support LR. The application can achieve this by configuring suitable Wi-Fi mode. If the negotiated mode supports LR, the {IDF_TARGET_NAME} may transmit data in LR rate. Otherwise, {IDF_TARGET_NAME} will transmit all data in traditional Wi-Fi data rate. Since LR is Espressif-unique Wi-Fi mode, only ESP32 series chips devices (except esp32c2) can transmit and receive the LR data. In other words, the ESP32 series chips devices (except esp32c2) should NOT transmit the data in LR data rate if the connected device does not support LR. The application can achieve this by configuring suitable Wi-Fi mode. If the negotiated mode supports LR, the ESP32 series chips devices (except esp32c2) may transmit data in LR rate. Otherwise, ESP32 series chips devices (except esp32c2) will transmit all data in traditional Wi-Fi data rate.
The following table depicts the Wi-Fi mode negotiation: The following table depicts the Wi-Fi mode negotiation:
+-------+-----+----+---+-------+------+-----+----+ .. only:: esp32 or esp32s2 or esp32c3 or esp32s3
|AP\STA | BGN | BG | B | BGNLR | BGLR | BLR | LR |
+=======+=====+====+===+=======+======+=====+====+ +-------+-----+----+---+-------+------+-----+----+
| BGN | BGN | BG | B | BGN | BG | B | - | |AP\STA | BGN | BG | B | BGNLR | BGLR | BLR | LR |
+-------+-----+----+---+-------+------+-----+----+ +=======+=====+====+===+=======+======+=====+====+
| BG | BG | BG | B | BG | BG | B | - | | BGN | BGN | BG | B | BGN | BG | B | - |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| B | B | B | B | B | B | B | - | | BG | BG | BG | B | BG | BG | B | - |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| BGNLR | - | - | - | BGNLR | BGLR | BLR | LR | | B | B | B | B | B | B | B | - |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| BGLR | - | - | - | BGLR | BGLR | BLR | LR | | BGNLR | - | - | - | BGNLR | BGLR | BLR | LR |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| BLR | - | - | - | BLR | BLR | BLR | LR | | BGLR | - | - | - | BGLR | BGLR | BLR | LR |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| LR | - | - | - | LR | LR | LR | LR | | BLR | - | - | - | BLR | BLR | BLR | LR |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| LR | - | - | - | LR | LR | LR | LR |
+-------+-----+----+---+-------+------+-----+----+
.. only:: esp32c6
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| AP\STA | BGNAX | BGN | BG | B | BGNAXLR | BGNLR | BGLR | BLR | LR |
+=========+=======+=====+====+===+=========+=======+======+=====+====+
| BGNAX | BGAX | BGN | BG | B | BGAX | BGN | BG | B | - |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BGN | BGN | BGN | BG | B | BGN | BGN | BG | B | - |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BG | BG | BG | BG | B | BG | BG | BG | B | - |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| B | B | B | B | B | B | B | B | B | - |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BGNAXLR | - | - | - | - | BGAXLR | BGNLR | BGLR | BLR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BGNLR | - | - | - | - | BGNLR | BGNLR | BGLR | BLR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BGLR | - | - | - | - | BGLR | BGLR | BGLR | BLR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BLR | - | - | - | - | BLR | BLR | BLR | BLR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| LR | - | - | - | - | LR | LR | LR | LR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
In the above table, the row is the Wi-Fi mode of AP and the column is the Wi-Fi mode of station. The "-" indicates Wi-Fi mode of the AP and station are not compatible. In the above table, the row is the Wi-Fi mode of AP and the column is the Wi-Fi mode of station. The "-" indicates Wi-Fi mode of the AP and station are not compatible.
@ -1432,7 +1504,7 @@ Currently, the ESP-IDF supports the following protocol modes:
- For LR-enabled AP of {IDF_TARGET_NAME}, it is incompatible with traditional 802.11 mode, because the beacon is sent in LR mode. - For LR-enabled AP of {IDF_TARGET_NAME}, it is incompatible with traditional 802.11 mode, because the beacon is sent in LR mode.
- For LR-enabled station of {IDF_TARGET_NAME} whose mode is NOT LR-only mode, it is compatible with traditional 802.11 mode. - For LR-enabled station of {IDF_TARGET_NAME} whose mode is NOT LR-only mode, it is compatible with traditional 802.11 mode.
- If both station and AP are {IDF_TARGET_NAME} devices and both of them have enabled LR mode, the negotiated mode supports LR. - If both station and AP are ESP32 series chips devices (except esp32c2) and both of them have enabled LR mode, the negotiated mode supports LR.
If the negotiated Wi-Fi mode supports both traditional 802.11 mode and LR mode, it is the Wi-Fi driver's responsibility to automatically select the best data rate in different Wi-Fi modes and the application can ignore it. If the negotiated Wi-Fi mode supports both traditional 802.11 mode and LR mode, it is the Wi-Fi driver's responsibility to automatically select the best data rate in different Wi-Fi modes and the application can ignore it.
@ -1465,7 +1537,6 @@ Currently, the ESP-IDF supports the following protocol modes:
- Long distance Wi-Fi connection and data transmission is required. - Long distance Wi-Fi connection and data transmission is required.
- Data throughput requirements are very small, such as remote device control. - Data throughput requirements are very small, such as remote device control.
Wi-Fi Country Code Wi-Fi Country Code
+++++++++++++++++++++++++ +++++++++++++++++++++++++
@ -1639,7 +1710,7 @@ Refer ESP-IDF example :idf_file:`examples/wifi/roaming/README.md` to set up and
- {IDF_TARGET_NAME} as FTM Initiator in station mode. - {IDF_TARGET_NAME} as FTM Initiator in station mode.
- {IDF_TARGET_NAME} as FTM Responder in AP mode. - {IDF_TARGET_NAME} as FTM Responder in AP mode.
Distance measurement using RTT is not accurate, and factors such as RF interference, multi-path travel, antenna orientation, and lack of calibration increase these inaccuracies. For better results, it is suggested to perform FTM between two {IDF_TARGET_NAME} devices as station and AP. Distance measurement using RTT is not accurate, and factors such as RF interference, multi-path travel, antenna orientation, and lack of calibration increase these inaccuracies. For better results, it is suggested to perform FTM between two ESP32 series chips devices (except esp32c2) as station and AP.
Refer to ESP-IDF example :idf_file:`examples/wifi/ftm/README.md` for steps on how to set up and perform FTM. Refer to ESP-IDF example :idf_file:`examples/wifi/ftm/README.md` for steps on how to set up and perform FTM.
@ -1880,6 +1951,50 @@ The table below shows the best throughput results gained in Espressif's lab and
When the throughput is tested by iperf example, the sdkconfig is :idf_file:`examples/wifi/iperf/sdkconfig.defaults.esp32c3`. When the throughput is tested by iperf example, the sdkconfig is :idf_file:`examples/wifi/iperf/sdkconfig.defaults.esp32c3`.
.. only:: esp32c6
.. list-table::
:header-rows: 1
:widths: 10 10 10 15 20
* - Type/Throughput
- Air In Lab
- Shield-box
- Test Tool
- IDF Version (commit ID)
* - Raw 802.11 Packet RX
- N/A
- **130 MBit/s**
- Internal tool
- NA
* - Raw 802.11 Packet TX
- N/A
- **130 MBit/s**
- Internal tool
- NA
* - UDP RX
- 30 MBit/s
- 45 MBit/s
- iperf example
- 420ebd20
* - UDP TX
- 30 MBit/s
- 40 MBit/s
- iperf example
- 420ebd20
* - TCP RX
- 20 MBit/s
- 30 MBit/s
- iperf example
- 420ebd20
* - TCP TX
- 20 MBit/s
- 31 MBit/s
- iperf example
- 420ebd20
When the throughput is tested by iperf example, the sdkconfig is :idf_file:`examples/wifi/iperf/sdkconfig.defaults.esp32c6`.
.. only:: esp32s3 .. only:: esp32s3
.. list-table:: .. list-table::
@ -2140,7 +2255,7 @@ Generally, following steps can be taken to configure the multiple antennas:
Wi-Fi HT20/40 Wi-Fi HT20/40
------------------------- -------------------------
.. only:: esp32 or esp32s2 or esp32c3 or esp32s3 .. only:: esp32 or esp32s2 or esp32c3 or esp32s3 or esp32c6
{IDF_TARGET_NAME} supports Wi-Fi bandwidth HT20 or HT40 and does not support HT20/40 coexist. :cpp:func:`esp_wifi_set_bandwidth()` can be used to change the default bandwidth of station or AP. The default bandwidth for {IDF_TARGET_NAME} station and AP is HT40. {IDF_TARGET_NAME} supports Wi-Fi bandwidth HT20 or HT40 and does not support HT20/40 coexist. :cpp:func:`esp_wifi_set_bandwidth()` can be used to change the default bandwidth of station or AP. The default bandwidth for {IDF_TARGET_NAME} station and AP is HT40.
@ -2208,7 +2323,7 @@ Wi-Fi Fragment
supports Wi-Fi receiving fragment, but does not support Wi-Fi transmitting fragment. supports Wi-Fi receiving fragment, but does not support Wi-Fi transmitting fragment.
.. only:: esp32c3 or esp32s3 .. only:: esp32c3 or esp32s3 or esp32c6
{IDF_TARGET_NAME} supports Wi-Fi receiving and transmitting fragment. {IDF_TARGET_NAME} supports Wi-Fi receiving and transmitting fragment.
@ -2328,6 +2443,17 @@ Increasing the size or number of the buffers mentioned above properly can improv
- :ref:`CONFIG_LWIP_IRAM_OPTIMIZATION` - :ref:`CONFIG_LWIP_IRAM_OPTIMIZATION`
If this option is enabled, some LwIP functions are moved to IRAM, improving throughput. This increases IRAM usage by 13 kB. If this option is enabled, some LwIP functions are moved to IRAM, improving throughput. This increases IRAM usage by 13 kB.
.. only:: esp32c6
- :ref:`CONFIG_ESP_WIFI_IRAM_OPT`
If this option is enabled, some Wi-Fi functions are moved to IRAM, improving throughput. This increases IRAM usage by 13 kB.
- :ref:`CONFIG_ESP_WIFI_RX_IRAM_OPT`
If this option is enabled, some Wi-Fi RX functions are moved to IRAM, improving throughput. This increases IRAM usage by 7 kB.
- :ref:`CONFIG_LWIP_IRAM_OPTIMIZATION`
If this option is enabled, some LwIP functions are moved to IRAM, improving throughput. This increases IRAM usage by 14 kB.
.. only:: esp32s2 .. only:: esp32s2
**CACHE:** **CACHE:**
@ -2668,6 +2794,65 @@ The parameters not mentioned in the following table should be set to the default
- 44.5 - 44.5
- 44.2 - 44.2
.. only:: esp32c6
.. list-table::
:header-rows: 1
:widths: 10 10 10 15
* - Rank
- Iperf
- Default
- Minimum
* - Available memory (KB)
- 223
- 276
- 299
* - WIFI_STATIC_RX_BUFFER_NUM
- 20
- 8
- 3
* - WIFI_DYNAMIC_RX_BUFFER_NUM
- 40
- 16
- 6
* - WIFI_DYNAMIC_TX_BUFFER_NUM
- 40
- 16
- 6
* - WIFI_RX_BA_WIN
- 32
- 16
- 6
* - TCP_SND_BUF_DEFAULT (KB)
- 40
- 16
- 6
* - TCP_WND_DEFAULT (KB)
- 40
- 16
- 6
* - LWIP_IRAM_OPTIMIZATION
- 13
- 13
- 0
* - TCP TX throughput (Mbit/s)
- 30.5
- 25.9
- 16.4
* - TCP RX throughput (Mbit/s)
- 27.8
- 21.6
- 14.3
* - UDP TX throughput (Mbit/s)
- 37.8
- 36.1
- 34.6
* - UDP RX throughput (Mbit/s)
- 41.5
- 36.8
- 36.7
.. only:: esp32c2 .. only:: esp32c2
.. list-table:: .. list-table::
@ -2824,6 +3009,12 @@ The parameters not mentioned in the following table should be set to the default
The test was performed with a single stream in a shielded box using an ASUS RT-N66U router. The test was performed with a single stream in a shielded box using an ASUS RT-N66U router.
{IDF_TARGET_NAME}'s CPU is single core with 160 MHz. {IDF_TARGET_NAME}'s flash is in QIO mode with 80 MHz. {IDF_TARGET_NAME}'s CPU is single core with 160 MHz. {IDF_TARGET_NAME}'s flash is in QIO mode with 80 MHz.
.. only:: esp32c6
.. note::
The test was performed with a single stream in a shielded box using an XIAOMI AX-6000 router.
{IDF_TARGET_NAME}'s CPU is single core with 160 MHz. {IDF_TARGET_NAME}'s flash is in QIO mode with 80 MHz.
.. only:: esp32c2 .. only:: esp32c2
.. note:: .. note::
@ -2868,7 +3059,7 @@ The parameters not mentioned in the following table should be set to the default
- **Minimum rank** - **Minimum rank**
This is the minimum configuration rank of {IDF_TARGET_NAME}. The protocol stack only uses the necessary memory for running. It is suitable for scenarios where there is no requirement for performance and the application requires lots of space. This is the minimum configuration rank of {IDF_TARGET_NAME}. The protocol stack only uses the necessary memory for running. It is suitable for scenarios where there is no requirement for performance and the application requires lots of space.
.. only:: esp32c3 or esp32s3 .. only:: esp32c3 or esp32s3 or esp32c6
**Ranks:** **Ranks:**

View File

@ -70,7 +70,7 @@ Call :cpp:func:`esp_now_add_peer()` to add the device to the paired device list
The maximum number of paired devices is 20, and the paired encryption devices are no more than 4, the default is 2. If you want to change the number of paired encryption devices, set :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` in the Wi-Fi component configuration menu. The maximum number of paired devices is 20, and the paired encryption devices are no more than 4, the default is 2. If you want to change the number of paired encryption devices, set :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` in the Wi-Fi component configuration menu.
.. only:: esp32 or esp32s2 or esp32s3 or esp32c3 .. only:: esp32 or esp32s2 or esp32s3 or esp32c3 or esp32c6
The maximum number of paired devices is 20, and the paired encryption devices are no more than 17, the default is 7. If you want to change the number of paired encryption devices, set :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` in the Wi-Fi component configuration menu. The maximum number of paired devices is 20, and the paired encryption devices are no more than 17, the default is 7. If you want to change the number of paired encryption devices, set :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` in the Wi-Fi component configuration menu.
@ -92,7 +92,17 @@ Instead, post the necessary data to a queue and handle it from a lower priority
Config ESP-NOW Rate Config ESP-NOW Rate
------------------- -------------------
Call :cpp:func:`esp_wifi_config_espnow_rate()` to config ESPNOW rate of specified interface. Make sure that the interface is enabled before config rate. This API should be called after :cpp:func:`esp_wifi_start()`. .. only:: esp32 or esp32s2 or esp32s3 or esp32c2 or esp32c3
Call :cpp:func:`esp_wifi_config_espnow_rate()` to config ESPNOW rate of specified interface. Make sure that the interface is enabled before config rate. This API should be called after :cpp:func:`esp_wifi_start()`.
.. only:: esp32c6
Call :cpp:func:`esp_now_set_peer_rate_config()` to config ESPNOW rate of each peer. Make sure that the peer is added before config rate. This API should be called after :cpp:func:`esp_wifi_start()` and :cpp:func:`esp_now_add_peer()`.
.. note::
:cpp:func:`esp_wifi_config_espnow_rate()` is deprecated, please use cpp::func:`esp_now_set_peer_rate_config()` instead.
Config ESP-NOW Power-saving Parameter Config ESP-NOW Power-saving Parameter
-------------------------------------------- --------------------------------------------

View File

@ -22,6 +22,25 @@ Wi-Fi 驱动程序
- 支持多个天线 - 支持多个天线
- 支持获取信道状态信息 - 支持获取信道状态信息
.. only:: esp32c6
- 支持 4 个虚拟接口,即 STA、AP、Sniffer 和 reserved。
- 支持仅 station 模式、仅 AP 模式、station/AP 共存模式
- 支持使用 IEEE 802.11b、IEEE 802.11g、IEEE 802.11n、IEEE 802.11ax 和 API 配置协议模式
- 支持 WPA/WPA2/WPA3/WPA2-企业版/WPA3-企业版/WAPI/WPS 和 DPP
- 支持 AMSDU、AMPDU、HT40、QoS 以及其它主要功能
- 支持 Modem-sleep
- 支持乐鑫专属协议,可实现 **1 km** 数据通信量
- 空中数据传输最高可达 20 MBit/s TCP 吞吐量和 30 MBit/s UDP 吞吐量
- 支持 Sniffer
- 支持快速扫描和全信道扫描
- 支持多个天线
- 支持获取信道状态信息
- 支持 TWT
- 支持下行 MU-MIMO
- 支持 OFDMA
- 支持 BSS Color
.. only:: esp32c2 .. only:: esp32c2
- 支持 3 个虚拟接口即STA、AP 和 Sniffer。 - 支持 3 个虚拟接口即STA、AP 和 Sniffer。
@ -1289,7 +1308,7 @@ API :cpp:func:`esp_wifi_set_config()` 可用于配置 AP。配置的参数信息
- beacon 间隔。值为 100 ~ 60000 ms默认值为 100 ms。如果该值不在上述范围AP 默认取 100 ms。 - beacon 间隔。值为 100 ~ 60000 ms默认值为 100 ms。如果该值不在上述范围AP 默认取 100 ms。
.. only:: esp32c3 .. only:: esp32c3 or esp32c6
.. list-table:: .. list-table::
:header-rows: 1 :header-rows: 1
@ -1371,7 +1390,34 @@ Wi-Fi 协议模式
**此模式是乐鑫的专利模式,可以达到 1 公里视线范围。请确保 station 和 AP 同时连接至 ESP 设备。** **此模式是乐鑫的专利模式,可以达到 1 公里视线范围。请确保 station 和 AP 同时连接至 ESP 设备。**
.. only:: esp32c6
.. list-table::
:header-rows: 1
:widths: 15 55
* - 协议模式
- 描述
* - 802.11b
- 调用函数 esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B),将 station/AP 设置为仅 802.11b 模式。
* - 802.11bg
- 调用函数 esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G),将 station/AP 设置为 802.11bg 模式。
* - 802.11g
- 调用函数 esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G) 和 esp_wifi_config_11b_rate(ifx, true),将 station/AP 设置为 802.11g 模式。
* - 802.11bgn
- 调用函数 esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N),将 station/AP 设置为 802.11bgn 模式。
* - 802.11gn
- 调用函数 esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N) 和 esp_wifi_config_11b_rate(ifx, true),将 station/AP 设置为 802.11gn 模式。
* - 802.11 BGNLR
- 调用函数 esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_LR),将 station/AP 设置为 802.11bgn 和 LR 模式。
* - 802.11bgnax
- 调用函数 esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX),将 station/AP 设置为 802.11bgnax 模式。
* - 802.11 BGNAXLR
- 调用函数 esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX|WIFI_PROTOCOL_LR),将 station/AP 设置为 802.11bgnax 和 LR 模式。
* - 802.11 LR
- 调用函数 esp_wifi_set_protocol(ifx, WIFI_PROTOCOL_LR),将 station/AP 设置为 LR 模式。
**此模式是乐鑫的专利模式,可以达到 1 公里视线范围。请确保 station 和 AP 同时连接至 ESP 设备。**
.. only:: esp32c2 .. only:: esp32c2
@ -1394,7 +1440,7 @@ Wi-Fi 协议模式
.. only:: esp32 or esp32s2 or esp32c3 or esp32s3 .. only:: esp32 or esp32s2 or esp32c3 or esp32s3 or esp32c6
长距离 (LR) 长距离 (LR)
+++++++++++++++++++++++++ +++++++++++++++++++++++++
@ -1404,27 +1450,53 @@ Wi-Fi 协议模式
LR 兼容性 LR 兼容性
************************* *************************
由于 LR 是乐鑫的独有 Wi-Fi 模式,只有 {IDF_TARGET_NAME} 设备才能传输和接收 LR 数据。也就是说,如果连接的设备不支持 LR{IDF_TARGET_NAME} 设备则不会以 LR 数据速率传输数据。可通过配置适当的 Wi-Fi 模式使您的应用程序实现这一功能。如果协商的模式支持 LR{IDF_TARGET_NAME} 可能会以 LR 速率传输数据,否则,{IDF_TARGET_NAME} 将以传统 Wi-Fi 数据速率传输所有数据。 由于 LR 是乐鑫的独有 Wi-Fi 模式,只有 ESP32 芯片系列设备除了esp32c2才能传输和接收 LR 数据。也就是说,如果连接的设备不支持 LR ESP32 芯片系列设备除了esp32c2则不会以 LR 数据速率传输数据。可通过配置适当的 Wi-Fi 模式使您的应用程序实现这一功能。如果协商的模式支持 LR ESP32 芯片系列设备除了esp32c2可能会以 LR 速率传输数据,否则, ESP32 芯片系列设备除了esp32c2将以传统 Wi-Fi 数据速率传输所有数据。
下表是 Wi-Fi 模式协商: 下表是 Wi-Fi 模式协商:
+-------+-----+----+---+-------+------+-----+----+ .. only:: esp32 or esp32s2 or esp32c3 or esp32s3
| APSTA | BGN | BG | B | BGNLR | BGLR | BLR | LR |
+=======+=====+====+===+=======+======+=====+====+ +-------+-----+----+---+-------+------+-----+----+
| BGN | BGN | BG | B | BGN | BG | B | - | |AP\STA | BGN | BG | B | BGNLR | BGLR | BLR | LR |
+-------+-----+----+---+-------+------+-----+----+ +=======+=====+====+===+=======+======+=====+====+
| BG | BG | BG | B | BG | BG | B | - | | BGN | BGN | BG | B | BGN | BG | B | - |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| B | B | B | B | B | B | B | - | | BG | BG | BG | B | BG | BG | B | - |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| BGNLR | - | - | - | BGNLR | BGLR | BLR | LR | | B | B | B | B | B | B | B | - |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| BGLR | - | - | - | BGLR | BGLR | BLR | LR | | BGNLR | - | - | - | BGNLR | BGLR | BLR | LR |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| BLR | - | - | - | BLR | BLR | BLR | LR | | BGLR | - | - | - | BGLR | BGLR | BLR | LR |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| LR | - | - | - | LR | LR | LR | LR | | BLR | - | - | - | BLR | BLR | BLR | LR |
+-------+-----+----+---+-------+------+-----+----+ +-------+-----+----+---+-------+------+-----+----+
| LR | - | - | - | LR | LR | LR | LR |
+-------+-----+----+---+-------+------+-----+----+
.. only:: esp32c6
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| AP\STA | BGNAX | BGN | BG | B | BGNAXLR | BGNLR | BGLR | BLR | LR |
+=========+=======+=====+====+===+=========+=======+======+=====+====+
| BGNAX | BGAX | BGN | BG | B | BGAX | BGN | BG | B | - |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BGN | BGN | BGN | BG | B | BGN | BGN | BG | B | - |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BG | BG | BG | BG | B | BG | BG | BG | B | - |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| B | B | B | B | B | B | B | B | B | - |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BGNAXLR | - | - | - | - | BGAXLR | BGNLR | BGLR | BLR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BGNLR | - | - | - | - | BGNLR | BGNLR | BGLR | BLR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BGLR | - | - | - | - | BGLR | BGLR | BGLR | BLR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| BLR | - | - | - | - | BLR | BLR | BLR | BLR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
| LR | - | - | - | - | LR | LR | LR | LR | LR |
+---------+-------+-----+----+---+---------+-------+------+-----+----+
上表中,行是 AP 的 Wi-Fi 模式,列是 station 的 Wi-Fi 模式。"-" 表示 AP 和 station 的 Wi-Fi 模式不兼容。 上表中,行是 AP 的 Wi-Fi 模式,列是 station 的 Wi-Fi 模式。"-" 表示 AP 和 station 的 Wi-Fi 模式不兼容。
@ -1432,7 +1504,7 @@ Wi-Fi 协议模式
- 对于已使能 LR 的 {IDF_TARGET_NAME} AP由于以 LR 模式发送 beacon因此与传统的 802.11 模式不兼容。 - 对于已使能 LR 的 {IDF_TARGET_NAME} AP由于以 LR 模式发送 beacon因此与传统的 802.11 模式不兼容。
- 对于已使能 LR 且并非仅 LR 模式的 {IDF_TARGET_NAME} station与传统 802.11 模式兼容。 - 对于已使能 LR 且并非仅 LR 模式的 {IDF_TARGET_NAME} station与传统 802.11 模式兼容。
- 如果 station 和 AP 都是 {IDF_TARGET_NAME} 设备,并且两者都使能 LR 模式,则协商的模式支持 LR。 - 如果 station 和 AP 都是 ESP32 芯片系列设备除了esp32c2,并且两者都使能 LR 模式,则协商的模式支持 LR。
如果协商的 Wi-Fi 模式同时支持传统的 802.11 模式和 LR 模式,则 Wi-Fi 驱动程序会在不同的 Wi-Fi 模式下自动选择最佳数据速率,应用程序无需任何操作。 如果协商的 Wi-Fi 模式同时支持传统的 802.11 模式和 LR 模式,则 Wi-Fi 驱动程序会在不同的 Wi-Fi 模式下自动选择最佳数据速率,应用程序无需任何操作。
@ -1465,7 +1537,6 @@ Wi-Fi 协议模式
- 需要长距离 Wi-Fi 连接和数据传输。 - 需要长距离 Wi-Fi 连接和数据传输。
- 数据吞吐量要求非常小,例如远程设备控制等。 - 数据吞吐量要求非常小,例如远程设备控制等。
Wi-Fi 国家/地区代码 Wi-Fi 国家/地区代码
+++++++++++++++++++++++++ +++++++++++++++++++++++++
@ -1639,7 +1710,7 @@ WPA2-Enterprise 是企业无线网络的安全认证机制。在连接到接入
- {IDF_TARGET_NAME} 在 station 模式下为 FTM 发起方。 - {IDF_TARGET_NAME} 在 station 模式下为 FTM 发起方。
- {IDF_TARGET_NAME} 在 AP 模式下为 FTM 响应方。 - {IDF_TARGET_NAME} 在 AP 模式下为 FTM 响应方。
使用 RTT 的距离测量并不准确RF 干扰、多径传播、天线方向和缺乏校准等因素会增加这些不准确度。为了获得更好的结果,建议在两个 {IDF_TARGET_NAME} 设备之间执行 FTM这两个设备可分别设置为 station 和 AP 模式。 使用 RTT 的距离测量并不准确RF 干扰、多径传播、天线方向和缺乏校准等因素会增加这些不准确度。为了获得更好的结果,建议在两个 ESP32 芯片系列设备(除了esp32c2)之间执行 FTM这两个设备可分别设置为 station 和 AP 模式。
请参考 IDF 示例 :idf_file:`examples/wifi/ftm/README.md` 了解设置和执行 FTM 的详细步骤。 请参考 IDF 示例 :idf_file:`examples/wifi/ftm/README.md` 了解设置和执行 FTM 的详细步骤。
@ -1880,6 +1951,50 @@ AP 睡眠
使用 iperf example 测试吞吐量时sdkconfig 是 :idf_file:`examples/wifi/iperf/sdkconfig.defaults.esp32c3` 使用 iperf example 测试吞吐量时sdkconfig 是 :idf_file:`examples/wifi/iperf/sdkconfig.defaults.esp32c3`
.. only:: esp32c6
.. list-table::
:header-rows: 1
:widths: 10 10 10 15 20
* - 类型/吞吐量
- 实验室空气状况
- 屏蔽箱
- 测试工具
- IDF 版本 (commit ID)
* - 原始 802.11 数据包接收数据
- N/A
- **130 MBit/s**
- 内部工具
- N/A
* - 原始 802.11 数据包发送数据
- N/A
- **130 MBit/s**
- 内部工具
- N/A
* - UDP 接收数据
- 30 MBit/s
- 45 MBit/s
- iperf example
- 420ebd20
* - UDP 发送数据
- 30 MBit/s
- 40 MBit/s
- iperf example
- 420ebd20
* - TCP 接收数据
- 20 MBit/s
- 30 MBit/s
- iperf example
- 420ebd20
* - TCP 发送数据
- 20 MBit/s
- 31 MBit/s
- iperf example
- 420ebd20
使用 iperf example 测试吞吐量时sdkconfig 是 :idf_file:`examples/wifi/iperf/sdkconfig.defaults.esp32c6`
.. only:: esp32s3 .. only:: esp32s3
.. list-table:: .. list-table::
@ -2140,7 +2255,7 @@ Wi-Fi 多根天线配置
Wi-Fi HT20/40 Wi-Fi HT20/40
------------------------- -------------------------
.. only:: esp32 or esp32s2 or esp32c3 or esp32s3 .. only:: esp32 or esp32s2 or esp32c3 or esp32s3 or esp32c6
{IDF_TARGET_NAME} 支持 Wi-Fi 带宽 HT20 或 HT40不支持 HT20/40 共存,调用函数 :cpp:func:`esp_wifi_set_bandwidth()` 可改变 station/AP 的默认带宽。{IDF_TARGET_NAME} station 和 AP 的默认带宽为 HT40。 {IDF_TARGET_NAME} 支持 Wi-Fi 带宽 HT20 或 HT40不支持 HT20/40 共存,调用函数 :cpp:func:`esp_wifi_set_bandwidth()` 可改变 station/AP 的默认带宽。{IDF_TARGET_NAME} station 和 AP 的默认带宽为 HT40。
@ -2208,7 +2323,7 @@ Wi-Fi 分片
支持 Wi-Fi 接收分片,但不支持 Wi-Fi 发送分片。 支持 Wi-Fi 接收分片,但不支持 Wi-Fi 发送分片。
.. only:: esp32c3 or esp32s3 .. only:: esp32c3 or esp32s3 or esp32c6
{IDF_TARGET_NAME} 支持 Wi-Fi 接收和发送分片。 {IDF_TARGET_NAME} 支持 Wi-Fi 接收和发送分片。
@ -2328,6 +2443,17 @@ Wi-Fi 使用的堆内存峰值是 Wi-Fi 驱动程序 **理论上消耗的最大
- :ref:`CONFIG_LWIP_IRAM_OPTIMIZATION` - :ref:`CONFIG_LWIP_IRAM_OPTIMIZATION`
如果使能该选项,一些 LWIP 功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 13 kB。 如果使能该选项,一些 LWIP 功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 13 kB。
.. only:: esp32c6
- :ref:`CONFIG_ESP_WIFI_IRAM_OPT`
如果使能该选项,一些 Wi-Fi 功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 13 kB。
- :ref:`CONFIG_ESP_WIFI_RX_IRAM_OPT`
如果使能该选项,一些 Wi-Fi 接收数据功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 7 kB。
- :ref:`CONFIG_LWIP_IRAM_OPTIMIZATION`
如果使能该选项,一些 LWIP 功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 14 kB。
.. only:: esp32s2 .. only:: esp32s2
**缓存:** **缓存:**
@ -2668,6 +2794,65 @@ Wi-Fi 使用的堆内存峰值是 Wi-Fi 驱动程序 **理论上消耗的最大
- 44.5 - 44.5
- 44.2 - 44.2
.. only:: esp32c6
.. list-table::
:header-rows: 1
:widths: 10 10 10 15
* - 等级
- Iperf
- 默认
- 最小
* - 可用内存 (KB)
- 223
- 276
- 299
* - WIFI_STATIC_RX_BUFFER_NUM
- 20
- 8
- 3
* - WIFI_DYNAMIC_RX_BUFFER_NUM
- 40
- 16
- 6
* - WIFI_DYNAMIC_TX_BUFFER_NUM
- 40
- 16
- 6
* - WIFI_RX_BA_WIN
- 32
- 16
- 6
* - TCP_SND_BUF_DEFAULT (KB)
- 40
- 16
- 6
* - TCP_WND_DEFAULT (KB)
- 40
- 16
- 6
* - LWIP_IRAM_OPTIMIZATION
- 13
- 13
- 0
* - TCP 发送数据吞吐量 (Mbit/s)
- 30.5
- 25.9
- 16.4
* - TCP 接收数据吞吐量 (Mbit/s)
- 27.8
- 21.6
- 14.3
* - UDP 发送数据吞吐量 (Mbit/s)
- 37.8
- 36.1
- 34.6
* - UDP 接收数据吞吐量 (Mbit/s)
- 41.5
- 36.8
- 36.7
.. only:: esp32c2 .. only:: esp32c2
.. list-table:: .. list-table::
@ -2824,6 +3009,12 @@ Wi-Fi 使用的堆内存峰值是 Wi-Fi 驱动程序 **理论上消耗的最大
以上结果使用华硕 RT-N66U 路由器,在屏蔽箱中进行单流测试得出。 以上结果使用华硕 RT-N66U 路由器,在屏蔽箱中进行单流测试得出。
{IDF_TARGET_NAME} 的 CPU 为单核,频率为 160 MHzflash 为 QIO 模式,频率为 80 MHz。 {IDF_TARGET_NAME} 的 CPU 为单核,频率为 160 MHzflash 为 QIO 模式,频率为 80 MHz。
.. only:: esp32c6
.. note::
以上结果使用小米 AX6000 路由器,在屏蔽箱中进行单流测试得出。
{IDF_TARGET_NAME} 的 CPU 为单核,频率为 160 MHzflash 为 QIO 模式,频率为 80 MHz。
.. only:: esp32c2 .. only:: esp32c2
.. note:: .. note::
@ -2868,7 +3059,7 @@ Wi-Fi 使用的堆内存峰值是 Wi-Fi 驱动程序 **理论上消耗的最大
- **最小等级** - **最小等级**
{IDF_TARGET_NAME} 的最小配置等级。协议栈只使用运行所需的内存。适用于对性能没有要求,而应用程序需要大量内存的场景。 {IDF_TARGET_NAME} 的最小配置等级。协议栈只使用运行所需的内存。适用于对性能没有要求,而应用程序需要大量内存的场景。
.. only:: esp32c3 or esp32s3 .. only:: esp32c3 or esp32s3 or esp32c6
**等级:** **等级:**

View File

@ -70,7 +70,7 @@ ESP-NOW 采用 CCMP 方法保护供应商特定动作帧的安全,具体可参
配对设备的最大数量是 20其中加密设备的数量不超过 4默认值是 2。如果想要修改加密设备的数量在 Wi-Fi menuconfig 设置 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` 配对设备的最大数量是 20其中加密设备的数量不超过 4默认值是 2。如果想要修改加密设备的数量在 Wi-Fi menuconfig 设置 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`
.. only:: esp32 or esp32s2 or esp32s3 or esp32c3 .. only:: esp32 or esp32s2 or esp32s3 or esp32c3 or esp32c6
配对设备的最大数量是 20其中加密设备的数量不超过 17默认值是 7。如果想要修改加密设备的数量在 Wi-Fi menuconfig 设置 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` 配对设备的最大数量是 20其中加密设备的数量不超过 17默认值是 7。如果想要修改加密设备的数量在 Wi-Fi menuconfig 设置 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`
@ -92,7 +92,17 @@ ESP-NOW 采用 CCMP 方法保护供应商特定动作帧的安全,具体可参
配置 ESP-NOW 速率 配置 ESP-NOW 速率
---------------------- ----------------------
调用 :cpp:func:`esp_wifi_config_espnow_rate()` 配置指定接口的 ESPNOW 速率。确保在配置速率之前使能接口。这个 API 应该在 :cpp:func:`esp_wifi_start()` 之后调用。 .. only:: esp32 or esp32s2 or esp32s3 or esp32c2 or esp32c3
调用 :cpp:func:`esp_wifi_config_espnow_rate()` 配置指定接口的 ESPNOW 速率。确保在配置速率之前使能接口。这个 API 应该在 :cpp:func:`esp_wifi_start()` 之后调用。
.. only:: esp32c6
调用 :cpp:func:`esp_now_set_peer_rate_config()` 配置指定peer的 ESPNOW 速率。确保在配置速率之前添加peer。这个 API 应该在 :cpp:func:`esp_wifi_start()`:cpp:func:`esp_now_add_peer()` 之后调用。
.. note::
:cpp:func:`esp_wifi_config_espnow_rate()` 已经被废弃了,请用 :cpp:func:`esp_now_set_peer_rate_config()`
配置 ESP-NOW 功耗参数 配置 ESP-NOW 功耗参数
---------------------- ----------------------