Task watchdog got triggered

  • ESP32

You may see

Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
Interrupt wdt timeout on CPU

Why it happens

  • A while loop with no pause.
  • Waiting a long time inside an async web handler or interrupt.

How to fix it

  1. Put delay(1); or yield(); inside long loops.
  2. Set a flag in the handler and do the slow work in loop().

It worked if: No restart for a few minutes.

From the official documentation. From Espressif's watchdog documentation. Sources: Espressif: watchdogs.

Didn't help? Search another error or ask us.