// Meter A (disturbution side meter )
#define BLYNK_PRINT Serial
//Dependiences
#include "EmonLib.h"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
EnergyMonitor emon;
// calibrate() method calibrates zero point of sensor,
#define vCalibration 160
#define currCalibration 1
//Global variable
char auth[] = "hoTrirFa5RWtBFYvxS6I-JMkosOOlvfO";//Token for Meter-A
char ssid[] = "Research Cell";//
char pass[] = "Welcome@RE";//
//Bridge Widget Blynk Server
WidgetMap bridge1(V10);
BLYNK_CONNECTED()
{
Blynk.auth("nRF0cEsICPXlgrb0icLP26U6_AipaATc"); //(Meter B token )allow permission to write the values to Meter B++++++
}
void setup()
{
// Debug console
Serial.begin(9600);
WiFi.begin();
Blynk.begin(auth, ssid, pass, IPAddress(192,168,0,144));// Put you Local machine IPAddress if using Local Machine as server++++++++
// ZMPT101B sensor connected to GPIO 35
emon.voltage(35, vCalibration, 1.7); // Voltage: input pin, calibration, phase_shift
// Acs712 sensor connected to GPIO 34
emon.current(34, currCalibration); // Current: input pin, calibration.
}
void loop()
{
//-------------------------------------------------Data Setup---------------------------------------
emon.calcVI(20, 2000);
// Serial.println(String(" A ") + emon.Irms + (" Voltage ") + emon.Vrms + (" Watts ") + emon.apparentPower );
delay(100);
Blynk.virtualWrite(V0, emon.Irms );// display amps temporary
Blynk.virtualWrite(V1, emon.apparentPower); // send Watt to Device B (Consumer meter for match )web interface
delay(100);
Blynk.run();
}
in this code i get an error like
C:\Users\sakth\OneDrive\Documents\Arduino\sketch_sep17a\sketch_sep17a.ino: In function âvoid BlynkOnConnected()â:
C:\Users\sakth\OneDrive\Documents\Arduino\sketch_sep17a\sketch_sep17a.ino:20:9: error: âclass BlynkWifiâ has no member named âauthâ
Blynk.auth(ânRF0cEsICPXlgrb0icLP26U6_AipaATcâ); //(Meter B token )allow permission to write the values to Meter B++++++
^~~~
exit status 1
Compilation error: âclass BlynkWifiâ has no member named âauthâ
in which i have to give the token for meter b to allow that meter to write the values from meter a
We are using 2 templates in blynk and two separate circuitsâŚ
Iâll rate myself 5/10 in C++ coding skillsâŚ
And if bridge is no longer
Supported in blynk iot want am I supposed to do now ?
Okey sir
We measure power produced in one device and consumed in another device and from both the devices the details are send and the difference is noted and displayed in blynk
The produced power from device 1 also displaced in blynk template
Thank you
Okay, the simplest method of sending data from one device to another is to use Automations. There are some restrictions to this method, but if it fits your use-case then you should use that method.
Otherwise you can use the HTTP(S) API to simulate the use of Legacy Bridge, or you could use Node-Red, but this seems like an overkill for your project.
You also need to make some changes to your code, inserting the Blynk Template ID and Template Name from Device > Device Into at the very top of each sketch.