Core flashing cyan after running fine for long periods of time

My core has been running fine for about a year. I don’t believe the code nor anything on the hardware side has been changed in many months but it’s started flashing cyan out of the blue lately. Technically there is a brief flash of red in between long periods of flashing cyan. It happened for the first time 2 days ago and the second time just now after running fine about 24 hours. Each time time the only way to resolve the issue is to press the reset button.

Any ideas?

That indicated it was unable to connect to the internet for flashing cyan with some red flashes.

You can add more checks in your code to restart the Wifi when that happens!

Do you have some example code or link to where I can find some?

Actually I just found this; is this what you were thinking?
if (!Spark.connected())
Spark.connect();
}

From: Losing Spark.subscribe() connection/subscription

This is what i have been using:

SYSTEM_MODE(SEMI_AUTOMATIC);


uint8_t retry_count = 0;
unsigned long old_time = millis();

void setup(){
    WiFi.on();
}



void loop(){
     if(millis() - old_time >= 2000){
        if(retry_count < 10){
            if(!WiFi.ready()){
                WiFi.connect();
                retry_count++;

            }
            else if (!Spark.connected()){
                Spark.connect();
                retry_count++;
            }
        }
        else{
            WiFi.off();
            retry_count = 0;
            WiFi.on();
        }
        old_time = millis();
    }
    
    
    // Insert code here
} 

I’ve been using your code for about a month with no issues until today. My core went offline last night and has failed to reconnect over the past 8 hours. Interestingly this time it’s breathing blue and then white on the RGB LED. It seems steady, it’ll jump to solid blue and slowly fade out and then back in and then jump to white and fade out and back in before the cycle repeats. The code on the core is still running as I have several LEDs to show me what it’s doing; so it appears the connection to the cloud is the only thing impacted.

After hitting the reset button it was back online within a few seconds.

That’s good to know! Thanks for reporting back. I’m glad it served well for a month though :smiley:

@Fragma , @kennethlimcp - I’ve had a similar experience with the core (losing cloud connection) whereas the photon seems to reconnect to cloud better than the core with the newer firmware