Sensor data can't read in bylnk

Hi Everyone i want to ask, why my data sensor can’t read in bylnk, even though there is no error.

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
//Auth Code, Wi-Fi and others.
char auth[] = ""; //Auth code sent via Email
char ssid[] = ""; //Wifi name
char pass[] = "";  //Wifi Password
int flag=0;
int gas_value;
int gas_avalue;


void notifyOnFire() //Flame Sensor Code
{
  int isButtonPressed = digitalRead(D1);
 if (isButtonPressed==1 && flag==0)
 {
    Serial.println("Fire in the House");
    Blynk.notify("Alert : Fire in the House");
    flag=1;
 }
  else if (isButtonPressed==0)
  {
    flag=0;
  }
}

void notifyOnSmoke() //SMOKE Sensor Code
{
  int isButtonPressed = digitalRead(D2);
  if (isButtonPressed==1 && flag==0)
  {
    Serial.println("Alert!!! SMOKE is Detected.");
    Blynk.notify("Alert!!! SMOKE is Detected.");
    flag=1;
  }
  else if (isButtonPressed==0)
  {
    flag=0;
  } 
}


void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  pinMode(D1,INPUT_PULLUP);
  pinMode (D2,INPUT_PULLUP);
  timer.setInterval(1000L,notifyOnFire);
  delay(100);
  timer.setInterval(1000L,notifyOnSmoke); 
}

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

@Hanalarasti please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

Oke done so why bylnk cannot read my sensor data? even tough there is no errror?

What does your serial monitor show?

Pete.

Like this, serial monitor is blank.

And what happens if you change the serial monitor to 74880 and change your sketch to…

Serial.begin(74880);

Then press the RST button on the board with the serial monitor open?

BTW, please copy/paste the serial monitor contents when posting, rather than posting a screenshot.

Pete.

Okay done, i change serial.begin to 74880, and after that i press rst button on the boad. and like this serial monitor.

But my data sensor still can’t read to blynk.

Your serial monitor is still set to 9600…

image

Pete.

Yes because data in 74880 there is no in serial monitor, so i change to 9600 in source code and in baud. But blnyk can’t connect to esp and my sensor data can’t read.

74880 is the default baud rate for the majority of ESP8266 based dev boards.
When one of these dev boards boots-up it outpost some data, at its default baud rate, via the serial port. If you are setting your serial monitor to the boards correct baud rate and seeing no data in your serial monitor then either you have the wrong COM port selected, a faulty USB cable, or your board isn’t booting.

Pete.

After i change to 74880, notification is error downloading https://download.arduino.ee/package_index.json

so how solution for this condition?

What EXACTLY have you changed?

Pete.

so how solution for this condition?

1 Like

Well, answering this question is a good starting point…

Also, removing all connections to the dev board, except the USB cable, would be a good start.

Pete.

Sorry sorry i don’t understand, how to step removing all connections ?

I don’t understand your question.
It could be that something you have connected to your board (the sensor maybe?) is preventing it from booting. To check this, disconnect everything from the board.

Pete.