So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By shejan0
#81077 Hello ESP8266 Forum,

I am using the ESP8266 Arduino Core, on a NodeMCU board (loaded Firmware), and I am having issues with the Software WatchDog (as explained by https://arduino-esp8266.readthedocs.io/en/latest/faq/a02-my-esp-crashes.html). I cannot use the ESP Exception Decoder, as I am missing xtensa-lx106-elf-gdb.exe for some reason.

Anytime I use a while loop, it always seems to incite the Software Watch Dog to reset. I currently have my code use the looping system of the void loop and using if statements. But I need to seriously use while loops in the future.

How do I execute while loops without inciting the WatchDog?
User avatar
By btidey
#81082 You can also normally avoid using extended while loops within the outer main loop by using state machines to determine what logic is executed.

A simple state machine just has a state variable which is tested in a switch statement. Each case then determines what to do and when to make a transition to another state.

This helps clarify the code logic and assists with keeping things like handleClient() regularly called from the main loop if required.
User avatar
By shejan0
#81095
btidey wrote:You can also normally avoid using extended while loops within the outer main loop by using state machines to determine what logic is executed.

A simple state machine just has a state variable which is tested in a switch statement. Each case then determines what to do and when to make a transition to another state.

This helps clarify the code logic and assists with keeping things like handleClient() regularly called from the main loop if required.


So you are saying to make variables and switch cases?