Hello All,
I am currently having an issue with connecting to the Blynk server through my Wifi shield and after looking around for about 4 hours I have had no luck in finding anyone who has used the wifi shield specified to connect to the Blynk service. I was wondering:
- Is the DOIT firmware supported
- If so, how would one go about integrating that with Blynk on a code level
I have tried to reflash the original firmware with no luck so if anyone has any idea on how to do this, I would love to know.
Specifications:
- Arduino Leonardo with an ESP 13 Wifi Shield (ESP8266) from Jaycar running the DOIT firmware.
- Android ver: 8.1.0
- Blynk server
- Latest Blynk library (downloaded yesterday)
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#define EspSerial Serial1
#define ESP8266_BAUD 9600
int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
char auth[] = "*******************"; //Blynk key
char ssid[] = "WiFiName";
char pass[] = "WiFiPassword";
ESP8266 wifi(&EspSerial);
void setup() {
pinMode(inputPin, INPUT); // declare sensor as input
Serial.begin(9600);
delay(10);
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
Blynk.virtualWrite(V0, WiFi.localIP());
}
void loop(){
Blynk.run();
val = digitalRead(inputPin); // read input value
if (val == HIGH) { // check if the input is HIGH
if (pirState == LOW) {
Blynk.notify("Motion detected!");
pirState = HIGH;
}
} else {
if (pirState == HIGH){
Blynk.notify("Motion ended!");
pirState = LOW;
}
}
}
Thanks in advance for the help.