Photon flashing white (cyan) with 2-3 orange flashes intermittently (1-3 minutes)

This issue seems to be a popular one, I’ve already posted a similar thread on here but i have just uncovered more issues. When starting up my photon sometimes it will start as it should, but its increasingly becoming a problem either after flashing code or manually reseting it. I am still learning how to interface with hardware so i’m constantly flashing new code or manually reseting it. The flash pattern is described in the title, the rapid cyan flashes and short red bursts.

I’ve tried ( from other responses to this issue) in terminal:

particle keys doctor 'id'

particle keys server

in both possible orders

which seem to work for a minute or so when the device restarts but quickly turns to breathing green.I’m unsure what else to try, i just wish it would work. Any help is greatly appreciated!

I don’t think this issue is a keys problem as you normally can connect, so I’d suppose your code or external hardware is doing something that interferes with the cloud connection.

Can you show your code?

BTW, if you mention your “parallel” thread, can you provide a link to it too?

e.g. in this thread you never reported back what the outcome of my suggestions was

Thanks ScruffR, sorry for not replying i had to take a break from working on my project and after what you suggested intially worked i forgot to reply back to it.

Here is the code that i am working on

    // This #include statement was automatically added by the Particle IDE.
    #include <blynk.h>

    //Relay Stuff
    //WHICH IS WHAT??
    #define RELAY_OFF 1 
    #define RELAY_ON 0
    //Declare Relay pins
    #define pumpRelay 0
    #define nutrientRelay 1
    #define waterInRelay 2
    #define floodWaterInRelay 3
    #define floodBasinRelay 4
    #define floodBasinDrainRelay 5
    #define heaterRelay 6
    //Sensors

    //Blynk
    char auth[] = "omitted"; 

    void setup() {
        Blynk.begin(auth);
     
    	//Relays
        pinMode(pumpRelay, OUTPUT);
        pinMode(nutrientRelay, OUTPUT);
        pinMode(waterInRelay, OUTPUT);
        pinMode(floodWaterInRelay, OUTPUT);
        pinMode(floodBasinRelay, OUTPUT);
        pinMode(floodBasinDrainRelay, OUTPUT);
        pinMode(heaterRelay, OUTPUT);



        digitalWrite(pumpRelay, RELAY_OFF);
        digitalWrite(nutrientRelay, RELAY_OFF);
        digitalWrite(waterInRelay, RELAY_OFF);
        digitalWrite(floodWaterInRelay, RELAY_OFF);
    }

    void loop() {
        Blynk.run();
       // digitalWrite(pumpRelay, RELAY_OFF);
       // digitalWrite(nutrientRelay, RELAY_OFF);
       //  digitalWrite(waterInRelay, RELAY_OFF);
       // digitalWrite(floodWaterInRelay, RELAY_OFF);
        
       // delay(500);
      //  digitalWrite(pumpRelay, RELAY_ON);
       // delay(500);
       // digitalWrite(nutrientRelay, RELAY_ON);
       // delay(500);
       // digitalWrite(waterInRelay, RELAY_ON);
        //delay(500);
       // digitalWrite(floodWaterInRelay, RELAY_ON);
   
        
        //delay(1000);
        
    }

I was trying to get blynk to work, i.e. push button to control the relay, which the above code does, the device just doesn’t respond 100% of the time. Thanks again

@jjlee32, first, you need to use Particle designations for the pins like D2, D3, etc. For Blynk to work properly, you can’t have any delay() in your code stopping loop() from running. How does Blynk run with all those lines commented out in loop()?

the first line in the loop isnt commented out,
Blynk.Run();
I know its probably not the best way to do it but this problem transends any code i have flashed to the device so far.

Update:

my device is showing new patterns when it isn’t working. So i just plugged my photon in via USB to my computer and it started up and was breathing cyan and worked for an extended amount of time (30 minutes) then went to breathing green. when i pressed the reset button on the device the original problem reared its ugly head, and every so often it’ll breathe cyan and start the vicious cycle over again.

@jjlee32, something in your code is blocking loop(), causing the Photon to lose the cloud connection (leaving WiFi connected - breathing green). Are you running with SYSTEM_THREAD(ENABLED)?

I am using the browser to flash code to the photon, I don’t know what SYSTEM_THREAD(ENABLED) is, or how to enable it. Is it possible that i could have done it by mistake?

Update;

This problem is still haunting me, I am using the same code from above. When the photon get stuck in the rapid cyan flashing cycle i use particle flash --usb tinker which usually works, as it itll breathe cyan and will show online in the web IDE and on the phone app.

However, when i try to flash my code (above) even with the SYSTEM_THREAD(ENABLED)at the very top of the script it will sometimes work, but before or if i have to press the reset button it jumps into the same loop as before.

I’m assuming their is a bug in my code, if someone could let me know what in the code causes the hardware to malfunction it’d be greatly appreciated. Side note; I’m trying to get the blynk app on my phone to switch power and even when the code (above, which has all the blynk lib and statements in it) it still says offline on the app.

If you are still running the code you posted you ignored everything anybody said to you…It’s late there’s probably a typo or 2 but have some mods

Sorry this is the code i am trying to run now, i’ve commented out some parts to try and isolate but to no avail.

    SYSTEM_THREAD(ENABLED);
    // This #include statement was automatically added by the Particle IDE.
    //#include <spark-dallas-temperature.h>

    // This #include statement was automatically added by the Particle IDE.
    //#include <OneWire/OneWire.h>

    // This #include statement was automatically added by the Particle IDE.
    #include "blynk.h"

    //Relay Stuff
    //WHICH IS WHAT??
    #define RELAY_OFF 1 
    #define RELAY_ON 0
    //Declare Relay pins
    #define pumpRelay D0
    //#define nutrientRelay D1
    //#define waterInRelay D2
    //#define floodWaterInRelay D3
    //#define floodBasinRelay D4
    //#define floodBasinDrainRelay D5
    //#define heaterRelay D6

    //#define bottomRead A0
    //#define bottomFloat D7


    //#define ONE_WIRE_BUS D7
    //#define TEMPERATURE_PRECISION 9

    //int bottomVolt=-1;

    //int waterTempF = -1;
    //double InTempC = -1;
    //Sensors
        //Water Temperature
    //OneWire oneWire(ONE_WIRE_BUS);
    //DallasTemperature sensors(&oneWire);
    //DeviceAddress inWaterThermometer = { 0x28, 0xB6, 0x78, 0x5E, 0x07, 0x0, 0x0, 0x4F };
    //void update18B20Temp(DeviceAddress deviceAddress, double &tempC);
    //Blynk
    char auth[] = "bf45e278b95f4458a7e447aa781af319"; 

    void setup() {
        Serial.begin(9600);  
        //water temperature
        //sensors.begin();
        //sensors.setResolution(inWaterThermometer, TEMPERATURE_PRECISION);
      //  Particle.variable("WaterTemp",waterTempF);
        
       
     
    	//Relays
        pinMode(pumpRelay, OUTPUT);
       // pinMode(nutrientRelay, OUTPUT);
       // pinMode(waterInRelay, OUTPUT);
      //  pinMode(floodWaterInRelay, OUTPUT);
      //  pinMode(floodBasinRelay, OUTPUT);
      //  pinMode(floodBasinDrainRelay, OUTPUT);
      //  pinMode(heaterRelay, OUTPUT);
        
       // pinMode(bottomFloat, OUTPUT);
      //  pinMode(bottomRead, INPUT);



        digitalWrite(pumpRelay, RELAY_OFF);
      //  digitalWrite(nutrientRelay, RELAY_OFF);
       // digitalWrite(waterInRelay, RELAY_OFF);
      //  digitalWrite(floodWaterInRelay, RELAY_OFF);
       // digitalWrite(floodBasinRelay, RELAY_OFF);
       // digitalWrite(floodBasinDrainRelay, RELAY_OFF);
       // digitalWrite(heaterRelay, RELAY_OFF);
       // digitalWrite(bottomFloat, LOW);
        
        Blynk.begin(auth);

    }

    void loop() {
        Blynk.run();
        
      // bottomVolt = analogRead(bottomRead);
       //Serial.println(bottomVolt);
       //if(bottomVolt >4000){
        //   digitalWrite(bottomFloat, HIGH);
           
           
      // }
        
       // digitalWrite(pumpRelay, RELAY_OFF);
       // digitalWrite(nutrientRelay, RELAY_OFF);
       //  digitalWrite(waterInRelay, RELAY_OFF);
       // digitalWrite(floodWaterInRelay, RELAY_OFF);
        
       // delay(500);
      //  digitalWrite(pumpRelay, RELAY_ON);
       // delay(500);
       // digitalWrite(nutrientRelay, RELAY_ON);
       // delay(500);
       // digitalWrite(waterInRelay, RELAY_ON);
        //delay(500);
       // digitalWrite(floodWaterInRelay, RELAY_ON);
        
       //sensors.requestTemperatures();
      // update18B20Temp(inWaterThermometer, InTempC);
      // waterTempF = (InTempC * 9)/5 + 32;
        
        //delay(1000);
        
    }
    //void update18B20Temp(DeviceAddress deviceAddress, double &tempC)
    //{
     // tempC = sensors.getTempC(deviceAddress);
    //}