I’m using the ApplicationWatchdog
functionality to trigger a System.reset()
in case something goes wrong, and I thought it would be nice to publish a Particle event before restarting so I could get some logging of the event, however whenever the code gets to the Particle.publish
line, the light runs through it’s SOS thing with 13 blinks (Stack Overflow). Set up the following code:
ApplicationWatchdog watchdog(10000, watchdogReset);
void loop() {
while(true) {
// hang it up!
}
}
void watchdogReset() {
Serial.println("watchdog restart");
delay(1000);
Particle.publish("watchdog restart");
delay(1000);
System.reset();
}
Added the delays just to make sure I narrowed down the problem. Any thoughts on if what I’m trying to do is possible?
Thanks,
-Eli