Blocking my Particle Photon

Hello, I am using your app on a Photon since 2-3 weeks without any problems.

Yesterday I created a share with a friend to show your great product.
After 1 hour circa my code in Particle (probably) lost the contact with the Cloud (Particle cloud) and also all possibility to function properly. My Photon kept breathing green.

Usually I get this if I have a bug in my code.

I disabled any calls made to Blynk and resolved the problem. :frowning:

Any way to figure out what happen here?

I am disappointed because I just love your app.

Let me know what we could do.

Thank you

Could you show your code?

The Particle make the connection for 10 seconds breathing light blue and then turn in breathing green.
When eliminating all relations with Blynk all is fine.
The following code ran for 2 weeks error free till I made the share from my phone.

Following is the code in Photon:

/********************************************

  • BeachTech
    • Rev. 0.0
  • This is a temperature logger using PHOTON and Thingspeak
  • Use of HTTPCLIENT library as external
  • Use of DS18B20 library library as local
  • Use of PARTICLE-ONEWIRE library as local
  • Thingspeak API key is set in the string directly and not as a variable
  • See publishData() function
  • DS18B20 probe is set to pin D2
  • ******************************************/

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

// This #include statement was automatically added by the Particle IDE.
#include “DS18B20.h”

// This #include statement was automatically added by the Particle IDE.
#include “Particle-OneWire.h”

// This #include statement was automatically added by the Particle IDE.
#include “HttpClient/HttpClient.h”

DS18B20 ds18b20 = DS18B20(D2); //Sets Pin D2 for Water Temp Sensor
int led = D7;
int state = 0;
char szInfo[64];
float pubTemp;
double celsius;

unsigned int Metric_Publish_Rate = 30000;
unsigned int MetricnextPublishTime;
int DS18B20nextSampleTime;
int DS18B20_SAMPLE_INTERVAL = 2500;
int dsAttempts = 0;

/web/

HttpClient http;
// Headers currently need to be set at init, useful for API keys etc.
http_header_t headers[] = {
{ “Accept” , “/”},
{ “User-agent”, “Particle HttpClient”},
{ NULL, NULL } // NOTE: Always terminate headers will NULL
};

http_request_t request;
http_response_t response;

char auth[] = “myAuthcode”; //blynk auth code not shown

void setup() {

Blynk.begin(auth);//connect to Blynk
while (Blynk.connect() == false) {
// Wait until connected...
}

Time.zone(-5);
Particle.syncTime();
pinMode(D2, INPUT_PULLUP);//Pullup make no difference
Particle.variable("tempHotWater", &celsius, DOUBLE);
Serial.begin(115200);
pinMode(led, OUTPUT);//Blue LED

}

void loop() {

if (millis() > DS18B20nextSampleTime){

digitalWrite(led, HIGH);

getTemp();

digitalWrite(led, LOW);

//Blynk region
Blynk.run();
//End Blynk region

}

if (millis() > MetricnextPublishTime){
Serial.println(“Publishing now.”);
publishData();
}

}

void publishData(){
if(!ds18b20.crcCheck()){
return;
}
sprintf(szInfo, “%2.2f”, celsius);
Particle.publish(“dsTmp”, szInfo, PRIVATE);
MetricnextPublishTime = millis() + Metric_Publish_Rate;

  //ThingsSpeak region
  //code not shown
  //End ThingsSpeak region

//Blynk region
sprintf(szInfo, "%2.2f\n\r", celsius);
Blynk.virtualWrite(0, szInfo);  // Write values to the app display
sprintf(szInfo, "%2.2f", celsius);
Blynk.virtualWrite(1, szInfo);  // Write values to the app gauge
Blynk.run();
//End Blynk region

}

void getTemp(){
if(!ds18b20.search()){
ds18b20.resetsearch();
celsius = ds18b20.getTemperature();
Serial.println(celsius);
while (!ds18b20.crcCheck() && dsAttempts < 4){
Serial.println(“Caught bad value.”);
dsAttempts++;
Serial.print("Attempts to Read: ");
Serial.println(dsAttempts);
if (dsAttempts == 3){
delay(1000);
}
ds18b20.resetsearch();
celsius = ds18b20.getTemperature();
continue;
}
dsAttempts = 0;
//fahrenheit = ds18b20.convertToFahrenheit(celsius);
DS18B20nextSampleTime = millis() + DS18B20_SAMPLE_INTERVAL;
//Serial.println(farenheit);
}
}

I probably found the problem. My Auth token in the Project settings is not the same as the one I programmed and worked for weeks.
How is this possible. I just made a share, how come the Auth Token changed???

If someone can explain this?

Probably @Dmitriy should look at this

@jmjobin there is only 1 explanation. You refreshed it.

It could well be.
I am sometimes lost to find the page settings page.
I found the navigation from the Blynk page and my running project not enough different and sometimes click around lost to try to find either adding icons or adding projects.
I probably click too much stuff. This would explain the problem.
About my code? Is something wrong? Why doing a wrong token place my Photon to green breathing?