In my sketch for ESP32, I call the network scanning function:


but sometimes it trigger a wdt reset:

E (372741) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (372741) task_wdt:  - async_tcp (CPU 0/1)
E (372741) task_wdt: Tasks currently running:
E (372741) task_wdt: CPU 0: IDLE
E (372741) task_wdt: CPU 1: IDLE
E (372741) task_wdt: Aborting.

abort() was called at PC 0x40113f64 on core 0

Backtrace: 0x40083db5:0x3ffbf1ac |<-CORRUPTED  

I added these lines in the setup() with no changes in the behavior:



My questions are:

  1. "Why it triggers a WDT reset even if I disabled the WDT?"
  2. "Why a scan network triggers a WDT reset? It should be a stock function"
  • what is your question? ... please add a clear, answerable question to your post
    – jsotola
    Dec 8, 2023 at 19:38
  • @jsotola done. Please tell me if now the questions are clear and answerable, or how to improve them further
    – Mark
    Dec 9, 2023 at 7:33
  • 1
    WiFi.scanNetworks(true); means async WiFi scan, it is non-blocking, so anything that causing the WDT trigger is in your code and we don't know how you setup the task and handing the state transitions. Do you have any problem running WiFi scan with sync mode WiFi.scanNetworks();?
    – hcheung
    Dec 11, 2023 at 8:26
  • 1
    @hcheung I'm fairly certain that it might be something inside Espressif's proprietary RF driver code. All of the task's setup and everything is hidden away as well from most Arduino users, so I don't think we'll be able to answer #2. For #1, it's because there is also a WDT for tasks, while the disabled WDTs are the "loop WDTs".
    – Nick S.
    Dec 14, 2023 at 5:14


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.