How to fixed disconnected of Blynk and esp8266 wifi

I try to show data temperature of DS18B20 on Blynk App, pls advise

*** Found point on graph is no data received , right

Code:

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <stdlib_noniso.h>

#define ONE_WIRE_BUS 12   //go12  d6

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);
float oldTemp;
WidgetLED led1(16);
//WidgetLED led1(11)
//int relay =5;

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

SimpleTimer timer;

void sendUptime()

{
  delay(10000);
  float temp;
  
  DS18B20.requestTemperatures();
  temp = DS18B20.getTempCByIndex(0);
  
  Serial.print("Temperature: ");
  Serial.println(temp);
  while (Blynk.connect() == false) {
    
    //digitalWrite(V3, LOW);
    // Wait until connected
}
  //digitalWrite(relay, HIGH);  // relay on
 // led1.off();    //led on
  Blynk.virtualWrite(V2,temp);
  Blynk.virtualWrite(V1,temp);
 //led1.on();
}


void setup()
{
  Serial.begin(9600);
  //Blynk.begin(auth,"xxxx2015","xxx2015","192,168,0,35");
  //Blynk.begin(auth, "wireless2012", "xxxx263A24451E100AE3AC");
   Blynk.begin(auth, "xxxx2015", "xxx2015");
   Blynk.config(192.168.4.1,80);
   //Blynk.begin(auth, "xxxxx", "22222");
  
/**while (Blynk.connect() == false) {
    // Wait until connected
}*/
   // pinMode(relay, OUTPUT);  //define to output
      timer.setInterval(3000L, sendUptime);  //1 sec
      DS18B20.begin();
  
}

void loop()
{
  Blynk.run();
  timer.run();
  
}

try to remove delay(10000)

maybe??

here is your time scale: timer.setInterval(3000L, sendUptime);

1 Like

Hi Dava1829
cannot fixed the problem…
How to disable timer interval during processing of DS18B20 reading temperature

remove you token from the pasted code in your post , any body can control you hardware now :imp:

Timer.disable(nameoftimer);

That wil disable the timer. With enable you can enable it again, but I used a ds18 too and there is no need to disbale the timer. Just set the timer to 10000 (10s) interval and it will work fine.