-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp_wifi_config_espnow_rate bug or undocumented calling order (IDFGH-10505) #11751
Comments
`
不管是ap还是站,也不管在esp_now_init();之前还是之后设置LR_500K或者LR_250K,只要能运行,在混杂模式下读出的速率都不是对应的速率, 为什么?我的代码有错误? |
@CmosC1CA Thanks for your report, we have identified this issue and have the MR for it, will merge it ASAP. |
@sywxf 你期望读到的速率是什么?实际读到的速率是什么?你的场景是什么?使用 ESP-NOW 的时候设置为 LR only 模式,然后用 sniffer 抓包得到对应的 rssi 和速率吗? |
感谢您的回复,我只是在源码里看到接收回调中可以转换wifi_pkt_rx_ctrl_t类型,其中有rate和rssi,当使用AP设置速率,没有报错,日志输出RATE的值对应设置的速率并不相同,并没有用sniffer抓包. 我期望在速率大于3200bps不丢包的情况下距离越远越好. |
@sywxf 因为这个问题已经关闭,而且你的问题和原问题并不相同,请你创建一个新的 ticket 来记录你的问题。 |
1. Fix the LR rate set fail for espnow and 80211 tx 2. Check phy bandwidth when setting espnow peer rate Closes #11751
Answers checklist.
IDF version.
v5.0.2-dirty
Operating System used.
Linux
How did you build your project?
Eclipse IDE
If you are using Windows, please specify command line type.
None
Development Kit.
NodeMCU ESP-32S (ESP-WROOM-32)
Power Supply used.
USB
What is the expected behavior?
I should be able to call esp_wifi_config_espnow_rate after esp_wifi_start according to the documentation. (https://docs.espressif.com/projects/esp-idf/en/v5.0.2/esp32/api-reference/network/esp_now.html?highlight=esp_wifi_config_espnow_rate#_CPPv427esp_wifi_config_espnow_rate16wifi_interface_t15wifi_phy_rate_t)
But this is not the case if WIFI_IF_STA and WIFI_PROTOCOL_LR is used.
What is the actual behavior?
The buggy behavior is ONLY present in WIFI_IF_STA mode WIFI_IF_AP works as expected.
This calling order is valid, according to the docs but results in an assert crash, at esp_wifi_config_espnow_rate
BUT
If you call esp_wifi_config_espnow_rate AFTER esp_now_init it works fine.
Either this should be fixed, or the documentation should mention that esp_wifi_config_espnow_rate should be called after esp_now_init in case WIFI_IF_STA is used.
But based on that this behavior is not present with WIFI_IF_AP, I would guess that this is a bug.
(Suggestion) Also your example code (https://github.com/espressif/esp-idf/blob/v5.0.2/examples/wifi/espnow/main/espnow_example_main.c) should contain a call to esp_wifi_config_espnow_rate with LORA values, so the users would not have to spend hours to figure out the call order.
Steps to reproduce.
Using WIFI_MODE_STA / WIFI_IF_STA , WIFI_PROTOCOL_LR mode, call esp_wifi_config_espnow_rate with an LR value (WIFI_PHY_RATE_LORA_500K/WIFI_PHY_RATE_LORA_250K) before esp_now_init.
Debug Logs.
More Information.
Related :
#11595
The text was updated successfully, but these errors were encountered: