Possible to use 3 devices, 1 app and NO bridge?

I’ve got a weather project that pulls data from the web as well as an outside weather monitor. It is also connected to my IoT garage door opener - 3 ESP’s in total. I know there is Bridge, and had it working at one point with some issues.

My question is this - can I have all devices talking to 1 app (single Auth token) BUT allow the devices to pass data between each other. i.e. use VirtualWrite? So, is there an option to have hardware talk to each other without using Bridge?

Example:

Master + slave 1 + slave 2

  • slave 1 passes data to master
  • master passes data to slave 2 & slave 2 passes data to master.

Here is my project.

1 Like

I should say it is possible! I have about 6 devices with one auth. One of the devices is an uptime monitor… 5 devices send their current RTC minute to a vPin, the 6th device makes sure all those match (admittedly a single point of failure if that 6th device drops).

There may be a more elegant solution, but once per minute this 6th device runs vPinSync():

void vPinSync() {
  Blynk.syncAll();
}

BLYNK_WRITE(V100) {
  v100State = param.asInt();
}
BLYNK_WRITE(V101) {
  v101State = param.asInt();
}
BLYNK_WRITE(V102) {
  v102State = param.asInt();
}
BLYNK_WRITE(V103) {
  v103State = param.asInt();
}
BLYNK_WRITE(V104) {
  v104State = param.asInt();
}

So I have device #1 writing to V100, device #2 to V101 and so on. The above is how device #6 gets all that info.

That’s my take on it!

3 Likes

Perfect! I’ll give it a go.

So, I gave it a go, and it didn’t work. @structure7, what version of Blynk library are you using? I’m on 0.3.8 (latest to date). For the sake of simplicity, I have 2 ESP devices a weather transmitter (TX) and receiver (RX). Both are using the same Blynk app on my phone (same auth).

In the TX: I send: Blynk.virtualWrite(V30, “some data”); I have verified this works by dropping a value display widget on my phone and see the data string on my app.

In the RX: I have:

BLYNK_WRITE(V30) 
{
  outsideValues = param.asString();
  Serial.println("Received outside value data on v30");
}

When I run the RX and use my serial monitor, my debug statement never triggers even though I see the data change on my phone after the TX sends it. Note I also have tried this without the label widget (v30) on my phone. I also tried adding a Blynk.syncVirtual(V30); in my RX app when it makes calls to refresh its data.

Any ideas?

It’s alive! Forget above. After a while it started to work. Not sure why however…

Oh good! On your RX, do you have anything “initiating” BLYNK_WRITE such as a Blynk.syncAll(); or a Blynk.syncVirtual(V30)?

On your RX something like this should have the effect of pulling V30 and V31 every ten seconds (assuming the TX “sent” something):

void setup(){
timer.setInterval(10000L, syncPins);
}

void syncPins(){
Blynk.syncVirtual(V30);
Blynk.syncVirtual(V31);
}

BLYNK_WRITE(V30) 
{
  outsideValues = param.asString();
  Serial.println("Received outside value data on v30");
}

BLYNK_WRITE(V31) 
{
  someOtherValues = param.asString();
  Serial.println("Received some other value data on v31");
}

A side note: I don’t know if it’s a best practice to use Blynk.syncAll(); or just sync the individual pins. Maybe someone can chime in on that. I suppose there are cases maybe where you wouldn’t want to sync everything.

I added a Blynk.syncAll(); to my data refresh statement… it began working sometime after that latest build, so I am assuming that did the trick… Thx for your help!