Chat freely about anything...

User avatar
By FernandoBas
#85533 Hi everyone.
I know it's a trivial question but it would be very important for those who start in the world of ESP8266 programming.
how to calculate the time required for each for or while or in general each loop () for my code to work well and or not have reset problems or wdt reset. I am seeing reboot problems of my esp8266 random. It can happen after 8 hours as after two days. How can I calculate and give enough time for each sensor analysis connected to my esp8266?
User avatar
By eriksl
#86471 If you're using loops that are running so long that the watchdog timer kicks in, you're doing something seriously wrong. Soft watchdog is about 2 seconds, hard watchdog is about 6 seconds...

If you have any work that must run for more than a few milliseconds (!) have it call back by the SDK code in small chunks until the work is done.

Or use the OS SDK, then you won't have this problem.