arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.04k stars 4.78k forks source link

Enabled watchdog for ESP32 and variants #21414

Closed s-hadinger closed 4 months ago

s-hadinger commented 4 months ago

Description:

Enable watchdog for ESP32x variants. The watchdog automatically resets the CPU if the main loop is not called for over 5 seconds. It is meant to detect situations when the CPU is stuck and frozen.

We tried the watchdog years ago, but it had some serious issues. They seem all solved now. It is however possible that the watchdog fires during normal long operations. Please report any such circumstances.

In C code, any call to yield() resets the watchdog. Similarly, in Berry, any call to tasmota.yields() resets both the Berry-specific watchdog (4 seconds) and the main watchdog (5 seconds)

Note: watchdog is already enabled on ESP8266.

Checklist:

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass