• Smartphone OS (iOS or Android) + version: Huawei P9 lite, Android 6.0
• Blynk server : cloud
• Blynk Library version : latest
2 WEMOS D1, the first (A) reads the brightness value from LDR and sends it to seconds (B) via bridge.
On Blynk app created project that only displays value on B (virtual V8 pin).
The problem: if I disconnect B from the power supply, the value on the app is always displayed and updated.
Question: if I unlink B, should the value update stop? I think yes.
Device " A" transmitter
//DEVICE "A"
//#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <RBD_Timer.h>
char auth[] = "TOKEN_A";
IPAddress staticIp(---,---,---,---);
IPAddress subnet(255,255,255,0);
IPAddress gateway(192,168,1,1);
char ssid[] = "SSID";
char pass[] = "pass";
WidgetBridge bridge1(V1);
RBD::Timer timer;
BLYNK_CONNECTED() {
bridge1.setAuthToken("TOKEN_B");
}
void setup(){
//Serial.begin(9600);
WiFi.config(staticIp, gateway, subnet);
Blynk.begin(auth, ssid, pass, IPAddress(139,59,206,133), 8442);
timer.setTimeout(1000);
}
void loop(){
Blynk.run();
if(timer.onRestart()){
reading();
}
}
void reading(){
int value= analogRead(A0);
if(lettura > 700){
digitalWrite(2, HIGH);
} else {
digitalWrite(2, LOW);
}
bridge1.virtualWrite(V8, value);
}
Device “B” receiver
//DEVICE "B"
//#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <RBD_Timer.h>
char auth[] = "TOKEN_B";
IPAddress staticIp(---,---,---,---);
IPAddress subnet(255,255,255,0);
IPAddress gateway(192,168,1,1);
char ssid[] = "SSID";
char pass[] = "pass";
RBD::Timer timer;
BLYNK_WRITE(V8){
int pinData = param.asInt();
}
void setup(){
//Serial.begin(9600);
WiFi.config(staticIp, gateway, subnet);
Blynk.begin(auth, ssid, pass, IPAddress(139,59,206,133), 8442);
}
void loop(){
Blynk.run();
}