Hi There,
A while back I posted about a cyan of death, and agreed that the most likely candidate was String use.
I’ve since removed all instances of String from my code, but am still able to reproduce the Cyan of death.
My setup is a Photon with a DS18B20.
I have SYSTEM_THREAD(ENABLED);
and by default in Automatic Mode.
I hit the DS18b20 every couple of seconds, but with a small modification to the library, rather than a delay(750ms) after requesting a temperature, I return back to the main loop, and after at least that much time has passed (counting millis() ) I retrieve the temperature (which I understand does some timing-related bitbanging and no-interrupt stuff.
Most of the time my code spends loop()'ing, waiting for the ds18b20 to be ready, or waiting until it’s a good time to request a new temperature.
REPRO:
The Photon is connected via a little wifi router on my desk on a powerbar. I can simply flip the powerbar on/off to trigger a photon disconnect.
Every 5th time or so, I can reproduce a Cyan Blink of Death.
I’ve put Serial.println(" ") debug statements all frigging over the place.
It doesn’t crash in the same spot all the time.
It doesn’t crash between requesting and retrieving a temperature (often just while waiting for a timer to elapse to request the next reading.
I’m pretty stuck. My next step is to start paring down my code to something that does almost nothing, and building it back up until I can start reproducing it again. What a painful proposition.
Q1). I’m wondering if anyone has some good debugging tips, or how I might get better information or crash reports ?
Q2) Is Serial.println() actually giving me good data here, or is it possible that the crash cuts off Serial flushing before the meat that really caused the issue?
I’m going bug-eyes from reading my terminal spitting out thousands of A,B,C,D,Es.