From 1c63e3e70c18e51e4b53c8b667f5ae277a81294e Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 13 Feb 2025 14:44:28 +0800 Subject: [PATCH 1/6] docs(wifi): update the description for esp_mesh_send() return value Closes https://github.com/espressif/esp-idf/issues/14440 --- components/esp_wifi/include/esp_mesh.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi/include/esp_mesh.h b/components/esp_wifi/include/esp_mesh.h index 7a7e85cf89..9bd8cbf034 100644 --- a/components/esp_wifi/include/esp_mesh.h +++ b/components/esp_wifi/include/esp_mesh.h @@ -111,7 +111,7 @@ extern "C" { #define ESP_ERR_MESH_DISCARD_DUPLICATE (ESP_ERR_MESH_BASE + 20) /**< discard the packet due to the duplicate sequence number */ #define ESP_ERR_MESH_DISCARD (ESP_ERR_MESH_BASE + 21) /**< discard the packet */ #define ESP_ERR_MESH_VOTING (ESP_ERR_MESH_BASE + 22) /**< vote in progress */ -#define ESP_ERR_MESH_XMIT (ESP_ERR_MESH_BASE + 23) /**< XMIT */ +#define ESP_ERR_MESH_XMIT (ESP_ERR_MESH_BASE + 23) /**< TX fail, the tx state is a value other than timeout and disconnect */ #define ESP_ERR_MESH_QUEUE_READ (ESP_ERR_MESH_BASE + 24) /**< error in reading queue */ #define ESP_ERR_MESH_PS (ESP_ERR_MESH_BASE + 25) /**< mesh PS is not specified as enable or disable */ #define ESP_ERR_MESH_RECV_RELEASE (ESP_ERR_MESH_BASE + 26) /**< release esp_mesh_recv_toDS */ @@ -682,6 +682,8 @@ esp_err_t esp_mesh_stop(void); * - ESP_ERR_MESH_QUEUE_FULL * - ESP_ERR_MESH_NO_ROUTE_FOUND * - ESP_ERR_MESH_DISCARD + * - ESP_ERR_MESH_NOT_SUPPORT + * - ESP_ERR_MESH_XMIT */ esp_err_t esp_mesh_send(const mesh_addr_t *to, const mesh_data_t *data, int flag, const mesh_opt_t opt[], int opt_count); From b8a242abcac45954900d96711a5929c3343e5e72 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Wed, 11 Dec 2024 17:01:44 +0800 Subject: [PATCH 2/6] fix(wifi): Fixed the max log level not work when it exceeds the default log level --- .../getting_started/station/main/station_example_main.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 f416ff8d92..2d0dba1205 100644 --- a/examples/wifi/getting_started/station/main/station_example_main.c +++ b/examples/wifi/getting_started/station/main/station_example_main.c @@ -168,6 +168,12 @@ void app_main(void) } ESP_ERROR_CHECK(ret); + if (CONFIG_LOG_MAXIMUM_LEVEL > CONFIG_LOG_DEFAULT_LEVEL) { + /* If you only want to open more logs in the wifi module, you need to make the max level greater than the default level, + * and call esp_log_level_set() before esp_wifi_init() to improve the log level of the wifi module. */ + esp_log_level_set("wifi", CONFIG_LOG_MAXIMUM_LEVEL); + } + ESP_LOGI(TAG, "ESP_WIFI_MODE_STA"); wifi_init_sta(); } From 63f167570d3533dcc0dc597f6eebc16b818dfd07 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Tue, 17 Dec 2024 19:05:24 +0800 Subject: [PATCH 3/6] fix(wifi): Fixed the scan information error when AP in LR only mode --- components/esp_rom/esp32c2/ld/esp32c2.rom.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index 0e920f8387..4cbf475a0b 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -903,7 +903,7 @@ ieee80211_add_rates = 0x40002054; ieee80211_is_ht_cipher = 0x4000205c; ieee80211_setup_lr_rates = 0x40002068; ieee80211_ht_node_init = 0x4000206c; -ieee80211_is_support_rate = 0x40002070; +/* ieee80211_is_support_rate = 0x40002070; */ ieee80211_setup_rates = 0x40002074; ieee80211_is_lr_only = 0x40002078; ieee80211_setup_phy_mode = 0x4000207c; From 3f15dfa3132b6fd1d00ef44940256c034c0a2dd9 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Mon, 17 Mar 2025 15:34:49 +0800 Subject: [PATCH 4/6] fix(wifi): Update the doc for espnow add peer --- docs/en/api-reference/network/esp_now.rst | 10 +++++++--- docs/zh_CN/api-reference/network/esp_now.rst | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/en/api-reference/network/esp_now.rst b/docs/en/api-reference/network/esp_now.rst index 4bec914dca..b324dd9243 100644 --- a/docs/en/api-reference/network/esp_now.rst +++ b/docs/en/api-reference/network/esp_now.rst @@ -76,7 +76,13 @@ When :cpp:func:`esp_now_deinit()` is called, all of the information of paired de Add Paired Device ----------------- -Call :cpp:func:`esp_now_add_peer()` to add the device to the paired device list before you send data to this device. If security is enabled, the LMK must be set. You can send ESP-NOW data via both the Station and the SoftAP interface. Make sure that the interface is enabled before sending ESP-NOW data. +Call :cpp:func:`esp_now_add_peer()` to add the device to the paired device list before you send data to this device. If security is enabled, the LMK must be set. A device with a broadcast MAC address must be added before sending broadcast data. + +You can send ESP-NOW data via both the Station and the SoftAP interface. Make sure that the interface is enabled before sending ESP-NOW data. + +The range of the channel of paired devices is from 0 to 14. If the channel is set to 0, data will be sent on the current channel. Otherwise, the channel must be set as the channel that the local device is on. + +For the receiving device, calling :cpp:func:`esp_now_add_peer()` is not required. If no paired device is added, it can only receive broadcast packets and unencrypted unicast packets. To receive encrypted unicast packets, a paired device must be added, and the same LMK must be set. .. only:: esp32c2 @@ -86,8 +92,6 @@ 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 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. -A device with a broadcast MAC address must be added before sending broadcast data. The range of the channel of paired devices is from 0 to 14. If the channel is set to 0, data will be sent on the current channel. Otherwise, the channel must be set as the channel that the local device is on. - Send ESP-NOW Data ----------------- diff --git a/docs/zh_CN/api-reference/network/esp_now.rst b/docs/zh_CN/api-reference/network/esp_now.rst index dbb7af47b4..3fd1fc9bd5 100644 --- a/docs/zh_CN/api-reference/network/esp_now.rst +++ b/docs/zh_CN/api-reference/network/esp_now.rst @@ -73,7 +73,13 @@ ESP-NOW 采用 CCMP 方法保护供应商特定动作帧的安全,具体可参 添加配对设备 ----------------- -在将数据发送到其他设备之前,请先调用 :cpp:func:`esp_now_add_peer()` 将其添加到配对设备列表中。如果启用了加密,则必须设置 LMK。ESP-NOW 数据可以从 Station 或 SoftAP 接口发送。确保在发送 ESP-NOW 数据之前已启用该接口。 +在将数据发送到其他设备之前,请先调用 :cpp:func:`esp_now_add_peer()` 将其添加到配对设备列表中。如果启用了加密,则必须设置 LMK。 + +ESP-NOW 数据可以从 Station 或 SoftAP 接口发送。确保在发送 ESP-NOW 数据之前已启用该接口。 + +配对设备的信道范围是从 0 ~ 14。如果信道设置为 0,数据将在当前信道上发送。否则,必须使用本地设备所在的通道。 + +对于接收设备,调用 :cpp:func:`esp_now_add_peer()` 不是必需的。如果没有添加配对设备,只能接收广播包和不加密的单播包。如果需要接收加密的单播包,则必须添加配对设备并设置相同的 LMK。 .. only:: esp32c2 @@ -83,8 +89,6 @@ ESP-NOW 采用 CCMP 方法保护供应商特定动作帧的安全,具体可参 配对设备的最大数量是 20,其中加密设备的数量不超过 17,默认值是 7。如果想要修改加密设备的数量,在 Wi-Fi menuconfig 设置 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`。 -在发送广播数据之前必须添加具有广播 MAC 地址的设备。配对设备的信道范围是从 0 ~ 14。如果信道设置为 0,数据将在当前信道上发送。否则,必须使用本地设备所在的通道。 - 发送 ESP-NOW 数据 ----------------- From e8c42bd62d7454876e2dbbe49d79996335d4014a Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 20 Mar 2025 17:36:57 +0800 Subject: [PATCH 5/6] fix(wifi): fix the noise floor error on ESP32C5 Closes https://github.com/espressif/esp-idf/issues/15594 --- components/esp_wifi/include/esp_wifi_he_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/include/esp_wifi_he_types.h b/components/esp_wifi/include/esp_wifi_he_types.h index fa139131df..71a9c31a13 100644 --- a/components/esp_wifi/include/esp_wifi_he_types.h +++ b/components/esp_wifi/include/esp_wifi_he_types.h @@ -192,7 +192,7 @@ typedef struct { unsigned : 15; /**< reserved */ unsigned : 15; /**< reserved */ unsigned : 2; /**< reserved */ - unsigned noise_floor: 8; /**< the noise floor of the reception frame */ + signed noise_floor: 8; /**< the noise floor of the reception frame */ signed : 8; /**< reserved */ signed : 8; /**< reserved */ unsigned : 8; /**< reserved */ From bccec2b6c1bdfd34d3a9024879e73ef974c917c0 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Tue, 22 Apr 2025 11:56:57 +0800 Subject: [PATCH 6/6] fix(wifi): update wifi lib for scan and connect issues --- 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 d1e2500da3..7a2011279d 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit d1e2500da379bdcc4ae06a893b3115131b0f88cf +Subproject commit 7a2011279ddf210d0858a75840cf1a7a79939661