Particle Photon occasionally unresponsive; status LED stays dark

Hi everyone,

I’ve been running the latest stable firmware (0.7.0) on a Particle Photon operating 24/7, and have occasionally observed that it becomes unresponsive (every couple weeks or so).

When unresponsive, the status LED is off (as opposed to breathing, flashing, or anything of the sort), and the Particle dashboard shows the device as being offline.

I have in my code a watchdog timer set to trigger a system reset after 60 seconds without loop() being called, but the system never resets. So, I can’t tell if the Photon has entered some type of unresponsive panic state, or if this is a bug in code (the app is fairly simple, just monitoring a GPIO line and activating several peripherals when a signal is detected).

All I can think of is that the device is somehow stuck in a non-panic yet infinite loop state that somehow gets around the watchdog timer requiring loop() to be called at least every 60 seconds. So I’ve added the following code to loop() just in case it helps here:

if (!waitFor(Particle.connected, 50*1000)) {
  System.reset();
}

One more thing: After resetting the device after it’s unresponsive (by disconnecting and then reconnecting its power supply), I have code that sends me the system reset reason. That reason code is 40 (RESET_REASON_POWER_DOWN // Power-down reset). So does that mean the device was actually running even though its status LED and wifi connection were both inactive?

Any ideas would be greatly appreciated. Thanks!

The LED can be off (or stuck on one color) if your code gets stuck in a loop, so it is possible that it was still running. Posting your code would help us diagnose your problem.

1 Like

Update: It looks like this was most likely due to an issue[1] where using the Application Watchdog to call System.reset() without specifying a large enough stack size results in a panic state. The panic state causes the status LED to flash red a number of times, then turn off completely. This would explain the behavior I observed.

Hope this is helpful to others!