Hello All,
I’m new to Blynk Community. I’m using this Blynk MQ2 Smoke Detector Notification Gauge example.
I followed Instructions as per this link
But in my Android phone the device shows “wasn’t online yet”. Pls help me out. I have checked the auth token correctly.
//Viral Science www.viralsciencecreativity.com www.youtube.com/c/viralscience
//Blynk MQ-2 Smoke Detector
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
char auth[] = "xgur6Yb0E3dUySTk6D7U8bwZr-UBgSDg"; //Enter Authentication code sent by Blynk
char ssid[] = "****"; //Enter WIFI Name
char pass[] = "*****"; //Enter WIFI Password
SimpleTimer timer;
int mq2 = A0; // smoke sensor is connected with the analog pin A0
int data = 0;
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
timer.setInterval(1000L, getSendData);
}
void loop()
{
timer.run(); // Initiates SimpleTimer
Blynk.run();
}
void getSendData()
{
data = analogRead(mq2);
Blynk.virtualWrite(V2, data);
if (data > 700 )
{
Blynk.notify("Smoke Detected!");
}
}