Constant Fast flashing red LED fault after 24-48 hr uses

Hi, my particle photon works for maybe 24hr-48hr before it starts to flash. I have looked up the sos codes but I can not see any pattern in it.

If you could share the code you’re running, that might help.

sorry, was a bit rushed to post. basically sending a serial command to my boiler every second. receiving a reply, Putting the information into an array, then using blynk to display that information. I am new to c++ and in that sort of awkward stage were I know just enough to get myself in to trouble. So be gentle lol

#define BLYNK_PRINT Serial
#include "blynk/BlynkSimpleParticle.h"

//#define BLYNK_PRINT Serial
//#include "blynk/blynk.h"

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "opps";

byte frame[31] = {};
int combine = 0;
int  dev = 0 ;      //not used 

int S1;
int S2;
int flow_temp;
int max_temp;
int dhw_temp;
int dhw_set;
int fan_setpoint;
int fan_speed;
int fan_pwn;
int ion;
    
Timer Sensor(1000, ask_boiler);
//Timer app(733, ask_iot);

void setup()
{
    Serial.begin(9600);
    Serial1.begin(9600);
    delay(10000); // Allow board to settle
    Blynk.begin(auth);
    Sensor.start();

   
    
}

void ask_boiler()
{
    Serial1.write((byte)0x53);
    Serial1.write((byte)0x3f);// ? = 0x3f
    Serial1.write((byte)0x0D);
    delay(250);
    if (Serial1.available())
    {
    for (int i = 0; i <= 31; i++)
     {
     frame[i] = Serial1.read();
     }
    }
    
    S1 = 0;
    S2 = 0;
    
}
void loop()
{
      Blynk.run();
      


//////////////////////////////////////////////////    
    combine = frame[1] << 8 | frame[0];                                         
    if (S1 != combine / 100)
    {
    S1 = combine / 100;
    Blynk.virtualWrite(V0, S1);
    }
    
////////////////////////////////////////////////////
    
    combine = frame[5] << 8 | frame[4];
    if (S2 != combine / 100)
    {
    S2 = combine / 100;
    Blynk.virtualWrite(V1, S2);
    }

////////////////////////////////////////////////////
    
    combine = frame[3] << 8 | frame[2];
    if (flow_temp != combine / 100)
    {
    flow_temp = combine / 100;
    Blynk.virtualWrite(V2, flow_temp);
    }
////////////////////////////////////////////////////
    
    combine = frame[7] << 8 | frame[6];
    if (dhw_temp != combine / 100)
    {
    dhw_temp = combine / 100;
    Blynk.virtualWrite(V3, dhw_temp);
    }
////////////////////////////////////////////////////
    
    combine = frame[15] << 8 | frame[14];
    if (max_temp != combine / 100)
    {
    max_temp = combine / 100;
    Blynk.virtualWrite(V4, max_temp);
    }
    
////////////////////////////////////////////////////

    combine = frame[17] << 8 | frame[16];
    if (fan_setpoint != combine)
    {
    fan_setpoint = combine;
    Blynk.virtualWrite(V6, fan_setpoint);
    }
    
////////////////////////////////////////////////////

    combine = frame[19] << 8 | frame[18];
    if (fan_speed != combine)
    {
    fan_speed = combine;
    Blynk.virtualWrite(V7, fan_speed);
    }
    
////////////////////////////////////////////////////

    combine = frame[21] << 8 | frame[20];
    if (fan_pwn != combine / 10)
    {
    fan_pwn = combine / 10;
    Blynk.virtualWrite(V8, fan_pwn);
    }
    
////////////////////////////////////////////////////

    combine = frame[23] << 8 | frame[22];
    if (ion != combine / 10)
    {
    ion = combine / 10;
    Blynk.virtualWrite(V9, ion);
    }

    


    
}

is it that bad? what does the fast red flashing even mean?

This frantic red blink is no known error code, so there is definetly something very fishy, but I can’t really see anything in your code that would cause that behaviour.
So my next guess would be something wrong with the Blynk functions, but that’d be a big task to find.

Although slowing down your Timer and checking if you actually got 31 bytes back from the boiler would be worth a try.
If you get more, you should flush the rest out and if you got less you’d need to deal with the error.

1 Like

@mehran, it seems that the IDE library for Blynk (0.3.2)is not matching the version on their github (0.3.3) even though the IDE version history says otherwise. The reason I know is that BLYNKSIMPLESPARKCORE.H is not in the new library. I will post a message on the Blynk forum.

I am not sure why you would want to wait 10sec in setup() before calling Blynk.begin() (sooner the better).

You are using a timer to read your boiler every second and use a S1 and S2 (for example) to make sure you don’t Blynk.virtualWrite() when values have not changed. A simple approach would be to simply set a flag in the Timer which is sampled in loop. When triggered, you sample the boiler, do the virtual writes (only if new values), reset the flag and continue. That keeps the timer callback simple and requires no synchronization (S1, S2) in loop(). :smile:

1 Like