Watchdog in future release?


I have asked questions before about a hardware watchdog timer, and looking at the issues list for 0.5.x and 0.6.x - it seems that nothing is proposed :open_mouth: - is this true ???.

In my opinion we really need an integrated watchdog solution, to guard agains any form of software/firmware failure/lockup.

I have a Photon which has been running perfectly since mid-Feb, controlling my pool heater. On Wednesday, something went awry and it was no longer controlling the heat pump. The ONLY way I could tell (apart from guests saying the pool was like a sauna :wink: was that it had stopped sending out some messages (both UDP status reporting and messages being forwarded to Librato). The cloud seemed to believe that the Photon was all OK - said it was ‘breathing’ cyan) - but somehow my own code loop had failed (its 5000 miles away so I can’t debug it easily ;-).

A watchdog timer being refreshed from within my main loop would have rebooted the photon and recovered within minutes (depending on timeout). I have successfully used a watchdog on numerous PIC-based projects/products with excellent success.

So - if its not likely to become part of the Photon OS - then I guess I’ll have to ‘roll my own’ - which is probably going to be a simple external hardware option - as I worry about tinkering down in the hardware timers when the OS might be changed in the future :open_mouth:

Of course - if I’ve missed it somewhere (as I really don’t know the roll-out schedule) then I apologise for asking again…


Hi @GrahamS

Previous versions of the firmware for the Spark Core did use the built-in watchdog timer in the ARM, but it seemed to cause just and many problems as it helped. Not a clear win and one problem is that on these processors, once you start the watchdog you can never stop it!

In the past when the boot loader started the watchdog and you wrote bad software, it led to strange reboot cycles that were hard to get out of so you could flash new software.

So the ARM has a watchdog timer and your application can surely use it, but I would not expect Particle to turn it back on by default in the future. Just my experience, your mileage may vary.

Check out this: Watchdogs on the Photon

Let me know if it works. I agree the WatchDog timer is important and I just used it on a few micro processors in systems that will be remotely located that I need to be reset if the code hangs.