Cyan breathing as a watchdog timer to do a software reset

The udp server with a crude watchdog described above in post 10 (deep sleep rather than system reset) has not missed an hourly measurement in 5 days - promising :sunny:
In my case I assume that loop() is still running - because when I lose communication the LED is still breathing Cyan. I wonder whether it would be more robust to use the @peekay123 's Interval Timer library instead.

1 Like

Same as
Two sparks, both hanging randomly???

I am using Peekay’s library, same issue

Rats - hung after 8 days.

My Spark hangs on TCP transactions anywhere from 20 minutes to a day or so. I poll it for data every 30 seconds. I have the spark reboot itself if it has not had a transaction in roughly 5 minutes. I time it by counting loops through main. I thought about using the watchdog timer. I am concerned the timer might be usurped someday by a Spark function. My spark code is simple, so counting loops seems reliable enough. I don’t log the reboots, but my spark has been giving me data for 2 days now. A personal best!

I did this, and printed the subtraction of millis() - start (with the variable casting) and one of the variables was negative!
[snip]
Secs:60
-64530

Did you print with printf and "%d"? That would convert your uint16_t to signed. Try "%u" for unsigned values.

1 Like