Tests and feedback on new watchdog feature

I'd be interested to hear how many of you guys have experimented with the new watchdog feature yet, and if/how it worked out for you.

Any good examples of when it's kept your project running when it would otherwise have sat down?

I did not get a chance yet to play with this but was wondering if yield() would reset the watchdog?

Ah, no, the watchdog is continuously reset with "ArduinoCloud.update()".

It's enabled by default, but you can turn it off if needs be.

Are you thinking of implementing it into an existing project or something?

it's just exploratory - no specific project

The ESP8266 runs a lot of utility functions in the background -- keeping WiFi connected, managing the TCP/IP stack, and performing other duties. Blocking these functions from running can cause the ESP8266 to crash and reset itself. So I've many codes where I use yield() when I want to block a process for a random, possible long time, and not have the board reset itself. Something like

while(condition) yield();

so I guess that my question was about forward compatibility and avoiding unexpected resets.

1 Like

Absolutely welcome, this is the feature I was looking for in the last couple of months. I could workaround using "WDTZero" but this seems not to be compatible with the cloud anymore...
In order to save power and data, I do not use the cloud permanenetly so I would also need a way to reset the watchdog without the need for an "ArduinoCloud.update()".

  • How can we do that ?
    Further questions:
  • What is the period after which the watchdog activates without being reset?
  • Is there a way to control it, what are the limits?
  • Is there a "pre-reset warning" possibility, such as the "EarlyWarning interrupt" of "WDTZero" ?
    Any advice will be greatly appreciated, kind regards
1 Like

Ah, excellent questions all! Let me ask around internally and see what we can find out for you @schwend...

Okay, sorry for the delay on this. So...

  1. You can manually feed the watchdog by calling samd_watchdog_reset on SAMD. However, we don't recommend using the internal API as it will change in the future.
  2. It takes roughly 16 seconds for the watchdog to kick in.
  3. There aren't currently any ways to configure it in that respect, but that could change. Do let us know if that'd be of interest.
  4. Unfortunately not. But looking at WDTZero, it provides interesting capabilities that might find its way into the Arduino Cloud firmware stack at some point.

As always, the challenge isn't so much about making it work for one platform, but for every supported platform. :grinning_face_with_smiling_eyes:

So, in summary, you can still disable the internal watchdog via ArduinoIoTCloud.begin(ArduinoIoTPreferredConnection, false) and there's a bit more info in the repository FAQ.

Hope this helps!

Many thanks for your feedback,
I took your advice and simply disabled the watchdog. To my surprise (and great satisfaction), the board did run smoothly without any "hang-up" for a couple of days :slight_smile: ... This means to me that the reliability of the cloud functions has been greatly improved, which is even better than the need for a watchdog...
Anyway, to make it even safer, I would like to re-activate the watchdog, therefore, could you tell me what would be the code for " calling samd_watchdog_reset ?
I understand the challenge for implementing the functionalities of "WDTzero" in the cloud but anyway, I would strongly suggest that you realize it in a further FW update.
kind regards,

Hello again,
It happens here and there that the system "hangs-up" when calling "ArduinoCloud.update()". This means I have to re-activate the watchdog.
So let me re-iterate the question:

  • Could anyone tell me what would be the code for "calling samd_watchdog_reset ?
    (in other words: how to reset the watchdog without calling "ArduinoCloud.update()")
    Kind regards,

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.