-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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-NOW Examples crash during runtime (esp_wifi_set_channel failure) (IDFGH-2156) #4311
Comments
Still happening in v3.3 it'd seem I (372) espnow_example: WiFi started
ESP_ERROR_CHECK failed: esp_err_t 0x3002 (ESP_ERR_WIFI_NOT_STARTED) at 0x400876c4 tried down to v3.1. Tried adding a delay in between esp_wifi_start() and the set_channel() function but no change. Issue with set_channel()? How do you set the channel otherwise to enable discovery? I (362) phy: phy_version: 4102, 2fa7a43, Jul 15 2019, 13:06:06, 0, 0
I (362) wifi: mode : sta (30:ae:a4:fe:52:d4)
I (372) espnow_example: WiFi started
I (1372) espnow_example: starting wifi
E (1372) wifi: esp_wifi_set_channel 1453 wifi not start or sniffer not enabled, should start wifi and enable sniffer first
ESP_ERROR_CHECK failed: esp_err_t 0x3002 (ESP_ERR_WIFI_NOT_STARTED) at 0x40087674 |
@alexanderturner this is NOT bug, in the latest v3.3, we added the limitation to esp_wifi_set_channel(), it can be called only both of following conditions are met:
|
Thanks @liuzfesp! The issue is that the example crashes during runtime; the example provided in ESP-IDF. The issue is to correct the example. There's a bit of a lack of documentation/example with ESP-NOW, does it require the wifi to be in promiscuous mode? If it does; can the radio also act as SoftAP? Alex |
Really need some help with this one - any follow up from Espressif? |
Should always work unless STA mode is connected to an AP or a scan is in progress. Required for espnow and esp_wifi_80211_tx. |
Thanks @negativekelvin any chance you can try run the example and see what's happening. I've tried to get espnow running a few times now and I'm not having any luck at all - I'd love to avoid spinning up a BLE stack if possible |
Anything here guys? @negativekelvin @liuzfesp |
For now, fix is to just not set the channel b9da410#diff-71d4a3ad5cf2dcb1e3f6bd8eff374134 But hopefully it will be fixed later so that user can set any channel |
@negativekelvin I'm trying to use this to discover ESP32's, is it possible to discover them without setting the channel? |
If they all stay on default channel |
Thanks - not sure if I can guarantee that. Looking to discover ESP's then have them join the 'master's' AP which may be on a different channel. Makes it hard to guarantee that they'll stay on the same channel. Is there another way to change the channel? Even if I bounce it into another mode - this is very valuable to me as it prevents me from enabling the BLE stack |
I'm sorry I can't understand you. Do you mean you want to discover an ESP32 with ESP-NOW ? |
Hi @zhangyanjiaoesp that's right. In a network of ESP32's, I want a "master" to be able to discover a "slave" so it can adopt it. |
@alexanderturner |
Correct @zhangyanjiaoesp |
@alexanderturner |
@zhangyanjiaoesp ,我碰到了同样的情况
错误信息:
同样的代码用IDF 3.3的版本是没问题的,但是现在的4.0的就报错,这个功能对我的项目很重要,设定channel功能也是必要的. 请问什么时候能修复这个问题呢? |
I think it will be merged into IDF this month. |
I have the same error/issue using the ESP32 on PlatformIO under the Arduino framework.
Run-time error occurs on this line: What needs to be done to make sure the conditions are met please? This is code that used to work. |
@alexanderturner I'm not sure exactly where you should change the code in your example, but I had to do this to get it to work as per the documentation. Without esp_wifi_start and esp_wifi_set_promiscuous the channel set method would always fail with the run-time error you described.
|
Fix following WiFi issues: 1. Fix WiFi buffer reload issue 2. Fix AMSDU decrypt issue 3. Fix some WiFi timer issues 4. Fix the crash caused by too big of association request RSN information 5. Fix the crash caused by block scan 6. Fix the bug for getting channel and bandwidth 7. Fix some Sniffer bugs 8. Fix some ESP-NOW issues 1> fix the bug when modifying the channel info of peer node 2> fix the crash when modifying peer node between unencrypted and encrypted 3> fix the bug for fetch peer 4> modify the esp_wifi_set_channel() function 5> fix the bug that the channel parameter doesn't work when adding peer node Closes #2833 Closes #4311
Environment
git describe --tags
to find it): v4.1-dev-474-g2e6398affxtensa-esp32-elf-gcc --version
to find it): xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0Problem Description
ESP-NOW example in master fails at
esp_wifi_set_channel
command in bothstation
andsoftAp
mode.Expected Behavior
ESP-NOW examples to work as per Readme. For esp_wifi_set_channel to execute without error.
Actual Behavior
Steps to repropduce
// It helps if you attach a picture of your setup/wiring here.
Code to reproduce this issue
Debug Logs
Other items if possible
espnow_error.zip
The text was updated successfully, but these errors were encountered: