# how to detect error and restart microcontroller for embedded system with Esp 12 or Esp 32 [duplicate]

one thing that make me confused is how the microcontroller notice the errors and restart by itself let me give an example we have cooler system with Esp 32 and temperature sensor,when temperature be Above 25 centigrade degrees cooler will work until temperature reduce to 25 degree . all the thing will work in the loop .

for example after 1 week of work errors come to esp , how is possible that Esp notice the error and restart automatically for fixing the error .

i don't want restart the board manually

• it probably uses a watchdog timer ... the program has to "feed the dog" at a regular intervals to keep it from waking up .... basically it is a timer that gets reset by the running program often ... if the program hangs up and does not reset the timer, then the timer will count up to its trigger point and reset the microcotroller Nov 3 '20 at 7:06
• duckduckgo.com/?q=watchdog+ic&ia=web Nov 3 '20 at 7:24
• @A.R.C. a thermal watchdog is available Nov 3 '20 at 7:29
• I think the best way would be to debug and test your program to fix this error and not find a solution to restart regulary. (A watchdog is nevertheless always a good idea.) Nov 3 '20 at 7:29
• "esp 32 hang itself" is not a description in terms of the esp32 itself, so no, it won't be able to detect that. Ot migt detect circuistances that have the same external effect, via a watchodg, a brownout circuit, or even by software. Nov 3 '20 at 18:03