I am testing the application watchdog feature, but I can’t seem to get it to work. In the following code, my loop prints “hello world”, then runs for 20 seconds in standby stop mode. For testing, I inserted the watchdog for 10 seconds. What I expected was that the system would be in standby mode for 10 seconds, then the watchdog’s timer would reset it. Instead the electron briefly turns cyan, then goes back to sleeps for 20 seconds (i.e. no watchdog triggered). How can I get the watchdog to trigger even if the electron is in standby mode?
// This #include statement was automatically added by the Particle IDE.
#include <electronsample.h>#include “AppWatchdogWrapper.h”
AppWatchdogWrapper watchdog(10000); // reset if loop not returned after 10 seconds
void setup() {
Serial.begin(9600);
}void loop() {
Serial.println(“hello world”);
System.sleep(D4,RISING,SLEEP_NETWORK_STANDBY,20); // standby for 20 seconds
}