Hi,
I am trying to connect two Arduino UNO board with same Auth No for data sharing,
but only data transfer is possible from Blynk App to both devices.
i need to transfer data from one Arduino to other using virtual register is this Possible?
In actuality, it is the server that does all the āsharingā of vPin data, the App is just a control and display interface.
There have been a few topics similar to thisā¦ you will need to do some creative keyword searching and a bit of reading as I canāt think of any titles off the top of head.
But one option is to use separate auths for each device, then you can use Bridge for data ātransferā.
Or Device Selector might also work for your needs.
One option I recall, using same auth for multiple devices, was to have dedicated vPins for each deviceā¦ well they all had access to all vPins for āreadingā but each used specific vPins to āWriteā toā¦ If I recall correctly. Shouldnāt need to have any actual widgets associated with the vPins as the server retains all that infoā¦ just write data to a vPin from one device and keep scanning for updated data on same vPin on another device.
Thank you Gunner,
for verry Soon Reply
suggested link is valuable.
I think using this my task will complete soon. Thank you
hi Gunner,
i diid the setting and got success with device on off from one device to another.
thank you for your suggestion.
What method did you use?
I USE ONE ARDUINO UNO WITHled and blynk app interface, OTHER ARDUINO BOARD WITH LED INTERFACED
AUTH NO is different of both the device.
the code is given below
for Board 1:
#define BLYNK_PRINT DebugSerial
// You could use a spare Hardware Serial on boards that have it (like Mega)
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
#include <BlynkSimpleStream.h>
int Countdown;
char auth[] = āAuth no 1ā;
WidgetBridge bridge1(V0); // Bridge widget on virtual pin 0
BlynkTimer timer; // Timer for blynking
static bool value = true;
void blynkAnotherDevice() // Here we will send HIGH or LOW once per second
{
if (value) {
bridge1.digitalWrite(9, HIGH); // Digital Pin 9 on the second board will be set HIGH
bridge1.virtualWrite(V5, 1); // Sends 1 value to BLYNK_WRITE(V5) handler on receiving side.
} else {
bridge1.digitalWrite(9, LOW); // Digital Pin 9 on the second board will be set LOW
bridge1.virtualWrite(V5, 0); // Sends 0 value to BLYNK_WRITE(V5) handler on receiving side.
}
}
BLYNK_CONNECTED() {
bridge1.setAuthToken(āAuth no of second Boardā); // Place the AuthToken of the second hardware here
}
BLYNK_WRITE(V1)
{
Countdown = param.asInt();
}
void setup()
{
// Debug console
DebugSerial.begin(9600);
pinMode(13, OUTPUT);
// Blynk will work through Serial
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Blynk.begin(Serial, auth);
timer.setInterval(1000L, blynkAnotherDevice);
}
void loop()
{
Blynk.run();
timer.run();
if(Countdown>100)
{
digitalWrite(13, HIGH);
Blynk.virtualWrite(0,1023);
value= true;
}
else
{
digitalWrite(13, LOW);
Blynk.virtualWrite(0,0);
value=false;
}
}
CODE FOR BOARD 2:
#define BLYNK_PRINT DebugSerial
// You could use a spare Hardware Serial on boards that have it (like Mega)
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
#include <BlynkSimpleStream.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
int Countdown1;
char auth[] = āAuth No 2ā;
BLYNK_CONNECTED(){
Blynk.syncVirtual(V0);
}
BLYNK_WRITE(V5)
{
Countdown1 = param.asInt();
}
void setup()
{
// Debug console
DebugSerial.begin(9600);
pinMode(13, OUTPUT);
// Blynk will work through Serial
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Blynk.begin(Serial, auth);
}
void loop()
{
Blynk.run();
if(Countdown1==1)
{
digitalWrite(13, HIGH);
}
else
{
digitalWrite(13, LOW);
}
}
create Blynk app
unable to send app image
but by using code u can understand very well