From 852feea9dda91fe92504cb61a06550a7653ef3fe Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Mon, 17 Mar 2025 15:34:49 +0800 Subject: [PATCH 1/5] 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 072f28efc6..298b162129 100644 --- a/docs/en/api-reference/network/esp_now.rst +++ b/docs/en/api-reference/network/esp_now.rst @@ -73,7 +73,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 @@ -83,8 +89,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 3d758c3963..9b92c2489b 100644 --- a/docs/zh_CN/api-reference/network/esp_now.rst +++ b/docs/zh_CN/api-reference/network/esp_now.rst @@ -70,7 +70,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 @@ -80,8 +86,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 7157645d65aa44a4ea7310c847f0e9576e561e50 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 13 Feb 2025 14:44:28 +0800 Subject: [PATCH 2/5] 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 8b5b272799..ae0930c39c 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 */ @@ -680,6 +680,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 b7a612cd00d101e3fd12bcfb342d793c9f6be8b6 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Wed, 11 Dec 2024 17:01:44 +0800 Subject: [PATCH 3/5] 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 10cb7b35ce..535ea2ff4c 100644 --- a/examples/wifi/getting_started/station/main/station_example_main.c +++ b/examples/wifi/getting_started/station/main/station_example_main.c @@ -157,6 +157,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 f41ea3257de19ee211e11729b3bc037162400ff6 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Tue, 17 Dec 2024 19:05:24 +0800 Subject: [PATCH 4/5] fix(wifi): Fixed the scan information error 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 aa1e77a445..b14a8367c5 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -978,7 +978,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 02cebb097576baa8170e3095b03bbbcb9015fb0d Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 27 Mar 2025 10:48:02 +0800 Subject: [PATCH 5/5] fix(wifi): Added timer to send wake null after STA received assoc response --- 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 4b800a2382..da070fc743 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 4b800a23826101523f2ea221e38097c9ce2fa8e9 +Subproject commit da070fc74378cbe75bce174d27713ac8bcdaef4d