I am beginner in this topic, especially using blynk. i want to make a project similarly like this
http://www.jogjarobotika.com/blog/modul-iot-internet-of-things-untuk-smart-home-appliance-b136.html
i got an error in the blynk app when i start it, it shows “Smarthome is not online yet” i am using a Wemos D1 R1, when i upload the program there is no error
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266_SSL.h>
#include <DHT.h>
#include <Servo.h>
#define DHTPIN D2
#define DHTTYPE DHT11
char auth[] = "BpbIgYw3wu9j7rPKAJ6jNAPnzKlH9KBI";
char ssid[] = "xiaomi";
char pass[] = "aaabbbccc";
#define pirPin D5
int pirValue;
int pinValue;
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;
Servo servo;
BLYNK_WRITE(V0)
{
pinValue = param.asInt();
}
BLYNK_WRITE(V3)
{
servo.write(param.asInt());
}
void sendSensor()
{
float h = dht.readHumidity();
float t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
Blynk.virtualWrite(V5, h);
Blynk.virtualWrite(V6, t);
}
void setup()
{
Serial.begin(9600);
delay(10);
Blynk.begin(auth, ssid, pass);
pinMode(pirPin, INPUT);
dht.begin();
timer.setInterval(100L, sendSensor);
servo.attach(D10);
}
void loop()
{
Blynk.run();
timer.run();
getPirValue();
}
void getPirValue(void)
{
pirValue = digitalRead(pirPin);
if (pinValue == HIGH)
{if (pirValue==HIGH)
{
Serial.println("Motion detected");
Blynk.notify("Motion detected");
Blynk.virtualWrite(V1, 1);
}
if (pirValue==LOW)
{
Serial.println("Motion undetected");
Blynk.virtualWrite(V1, 0);
}}
else{
if (pirValue==HIGH)
{
Serial.println("Motion detected");
Blynk.virtualWrite(V1, 1);
}
if (pirValue==LOW)
{
Serial.println("Motion undetected");
Blynk.virtualWrite(V1, 0);
}
}
}
for the auth token, I copy it from my blynk, and for SSID and password, I think there is no error.
i don’t know where the error is, I appreciate if there is an explanation for this, thank you.