#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
int led = 13; // Connected to D7 pin of NodeMCU
int flame_sensor = 12; //Connected to D6 pin of NodeMCU
int buzzer = 4; //Connected to D2 pin of NodeMCU
int relay = 5; //Connected to D1 pin of NodeMCU
int smoke_sensor = A0; //Connected to A0 pin of NodeMCU
int temp_smoke_sensor;
int flame_sensor_read;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "318jrhvoHjbg6jN1xTfhxFbQlvNbjVCS"; // Enter Auth Token
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "SSIDIOT"; //Enter the wifi name
char pass[] = "SSIDIOT";// Enter the wifi password
void setup()
{
pinMode(led, OUTPUT);
pinMode(flame_sensor, INPUT);
pinMode(buzzer, OUTPUT);
pinMode(relay, OUTPUT);
pinMode(smoke_sensor, INPUT);
digitalWrite(led, LOW);
digitalWrite(buzzer, LOW);
digitalWrite(relay, LOW);
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
flame_sensor_read = digitalRead(flame_sensor); //reading the sensor data on A0 pin
Blynk.virtualWrite(V0, flame_sensor_read); //sending data to Blynk
Serial.print("Flame Status:");
Serial.println(flame_sensor_read);
int led_status = digitalRead(led);
if (led_status == HIGH)
{
Blynk.virtualWrite(V1, 255);
}
else
{
Blynk.virtualWrite(V1, 0);
}
temp_smoke_sensor = analogRead(smoke_sensor);
Blynk.virtualWrite(V2, temp_smoke_sensor);
Serial.print("Current Gas Level:");
Serial.println(temp_smoke_sensor);
if (temp_smoke_sensor > 500)
{
digitalWrite(led, HIGH);
digitalWrite(buzzer, HIGH);
digitalWrite(relay, HIGH);
Blynk.notify("Alert Smoke Detected");
}
else
{
digitalWrite(led, LOW);
digitalWrite(buzzer, LOW);
digitalWrite(relay, LOW);
}
if (flame_sensor_read == 0)
{
//Blynk.virtualWrite(V1, 255);
digitalWrite(led, HIGH);
digitalWrite(buzzer, HIGH);
digitalWrite(relay, HIGH);
Blynk.notify("Alert Fire Detected");
}
else
{
digitalWrite(led, LOW);
digitalWrite(buzzer, LOW);
digitalWrite(relay, LOW);
}
delay(500);
Blynk.run();
}
getting this error msg at end after verifying
C:\Users\om\Downloads\nm\nm.ino: In function âvoid loop()â:
C:\Users\om\Downloads\nm\nm.ino:65:11: error: âclass BlynkWifiâ has no member named ânotifyâ
- 65 | Blynk.notify(âAlert Smoke Detectedâ);*
-
| ^~~~~~*
C:\Users\om\Downloads\nm\nm.ino:80:11: error: âclass BlynkWifiâ has no member named ânotifyâ
- 80 | Blynk.notify(âAlert Fire Detectedâ);*
-
| ^~~~~~*
*Using library ESP8266WiFi at version 1.0 in folder: C:\Users\om\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi *
*Using library Blynk at version 1.2.0 in folder: C:\Users\om\Documents\Arduino\libraries\Blynk *
exit status 1
Compilation error: âclass BlynkWifiâ has no member named ânotifyâ
can any one helppp