# Core flashing cyan after running fine for long periods of time

**URL:** <https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302>\
**Category:** Troubleshooting\
**Created:** [July 15, 2015, 4:56pm UTC](https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302 "2015-07-15T16:56:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fragma](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@Fragma](https://community.particle.io/u/Fragma)\
**Post date:** [July 15, 2015, 4:56pm UTC](https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302/1 "2015-07-15T16:56:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 15, 2015, 11:42pm UTC](https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302/2 "2015-07-15T23:42:05Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Fragma](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@Fragma](https://community.particle.io/u/Fragma)\
**Post date:** [July 16, 2015, 4:19pm UTC](https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302/3 "2015-07-16T16:19:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fragma](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@Fragma](https://community.particle.io/u/Fragma)\
**Post date:** [July 16, 2015, 4:25pm UTC](https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302/4 "2015-07-16T16:25:53Z")

</div>

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

From: [Losing Spark.subscribe() connection/subscription](https://community.particle.io/t/loosing-spark-subscribe-connection-subscription/6518/9)

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 16, 2015, 5:04pm UTC](https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302/5 "2015-07-16T17:04:14Z")

</div>

This is what i have been using:

```auto
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
} 

```

---

<div class="post-metadata">

**Author:** ![Fragma](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@Fragma](https://community.particle.io/u/Fragma)\
**Post date:** [August 16, 2015, 3:05pm UTC](https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302/6 "2015-08-16T15:05:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [August 16, 2015, 11:29pm UTC](https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302/7 "2015-08-16T23:29:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bpr](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@bpr](https://community.particle.io/u/bpr)\
**Post date:** [August 17, 2015, 12:02am UTC](https://community.particle.io/t/core-flashing-cyan-after-running-fine-for-long-periods-of-time/13302/8 "2015-08-17T00:02:04Z")

</div>

@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
