-
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
WiFi APSTA Mode, esp_wifi_scan_start in blocking mode triggers a WDT timeout (IDFGH-13854) #14703
Comments
A clarification to the following comment
After running upto many crashes - this is not true, I am also seeing the same lockup in the call to esp_wifi_scan_start() when the channel scan requested is NOT the channel currently connected |
@eroom1966 |
@hansw123 I am configuring an APSTA mode WiFi, and need to manage both sides of the connection. For the STA side, I have a user thread which is triggering a scan every 5 seconds, it is effectively this (channel is initially set to 0)
The intention is that the (esp)STA can obtain a list of available AP's after 120 seconds, with minimal 'off-air' time to the connected Stations on the (esp)AP
There is error checking on the return code from esp_wifi_scan_start() to check that a connect is not currently in progress. I am using this in background mode, so I need an event handler to detect WIFI_EVENT_SCAN_DONE, then perform some housekeeping to update a list of available WiFi Access Points There is an interlock to ensure that a scan request cannot be called again, until the WIFI_EVENT_SCAN_DONE event has been received. The goal is to manage a set of Known AP's that can be connected to the (esp)STA should one of them disappear. Hopefully this makes sense. UPDATE I have instrumented the code and what appears to happen is the scan is requested, but the event_handler never triggers with an event to indicate the SCAN_DONE. Hence the detection of the watch dog timeout seems legitimate |
@hansw123 |
Can anybody suggest a way forward on this ? |
@eroom1966
2.beacuse your mode is apsta,so you should checkout what ap do (espcially connecting process)during sta scan ,or some ohter sending packet action, or some wifi action special,you can post more logic of your code 3.apsta mode example can refer https://github.com/espressif/esp-idf/blob/master/examples/wifi/softap_sta/main/softap_sta.c |
release/v4.4 is end of life, and you can update idf to latest v5.x and have a try. thank you! |
This will take quite some time as many of the API calls I am using are deprecated in v5.x |
@eroom1966 |
Answers checklist.
IDF version.
v4.4.7
Espressif SoC revision.
ESP32-S3
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
Custom Board
Power Supply used.
USB
What is the expected behavior?
I am running the WIFI in APSTA mode.
I run successive blocking wifi scans every 5 seconds using
esp_err_t err = esp_wifi_scan_start(&scan_config, true);
the scan_config defines
The channel scan is changed for each call from 1-13 iteratively
I encounter a non-deterministic bug whereby after a long runtime, I hit a WDT timer, here is the output from the monitor
the call to esp_wifi_scan_start(&scan_config, true) does not return - it is blocked indefinitely
I think I have noticed a specific pattern that when the scan does not return, I have requested a scan on the same channel that I am currently connected
I am still confirming this is the case, but I have not yet seen a lockup on a channel scan, that is not the one I am currently connected, which in my case is channel 6
What is the actual behavior?
unfortunately the system locks up in a call to esp_wifi_scan_start()
I encounter a non-deterministic bug whereby after a long runtime, I hit a WDT timer, here is the output from the monitor
the call to esp_wifi_scan_start(&scan_config, true) does not return - it is blocked indefinitely
I think I have noticed a specific pattern that when the scan does not return, I have requested a scan on the same channel that I am currently connected
I am still confirming this is the case, but I have not yet seen a lockup on a channel scan, that is not the one I am currently connected, which in my case is channel 6
Steps to reproduce.
This may take some work my entire code stack is around 100,000 lines
Debug Logs.
The text was updated successfully, but these errors were encountered: