Why nobody uses bridge?

Oh, I am sorry. Let me rephrase it.
All the tips I found regarding to bridge refers to digitalWrite function only, like in “bridge1.digitalWrite(5, LOW)” which means I can change pin 5 state at that blynk HW. I was trying to understand if itś possible to read values also, and most important, not only raw values, but results of some math. For example, to read temperature in Celsius or GPS coordinates in Lat/Long from remote blynk HW using bridge.

1 Like

Yes. It is possible. Quick pseudo code:

//device A
Bridge bridge(1); //virtual pin 1
bridge.init(token_deviceB);
bridge.virtualWrite(1, my_sensor_value);

//device B
BLYNK_WRITE(V1)  {//triggered when virtual write came from device A or from app.
 double sensor_val = param.asDouble();
}
2 Likes

My setup for testing was as follows;

Ubuntu as the Blynk server ( Standard Blynk works only ad-hoc / unreliable for bridge functionality at my place )

One ESP12 (A) at one site of the bridge receiving “bridge virtualWrites” from the other side ESP12 (B) of the bridge. This works without failures with Ubuntu as a Blynk Server. Received values are displayed in A.
B uses a timer to sent virtualWrites to A. The timer interval was varied between 250 mS and 20 Sec. But this did not influence the problem.

The problem:
Normally I can activate widgets like button or history on A. But as soon as the other side B is switched on and starts sending virtualWrites A is still displaying B’s messages (Values) but widgets like button or led don’t function anymore.

Any idea?

1 Like

Aah,

Reading your message above I see you use the Blynk_READ. I’ll give it a try.

Sorry, my mistake. It should be BLYNK_WRITE. For now you could do only Blynk.virtualWrite() back to device 1 in order to get value.

1 Like

hi , I want to send value from one Arduino to some other Arduinos, via Blynk. I think Bridge is tool to do it, but I dont know how to do it, pls some one help me. Thanks in advance

Hello, http://docs.blynk.cc/#widgets-other-bridge

1 Like

I follow the code
bridge1.setAuthToken(“OtherDeviceAuthToken”);
bridge1.digitalWrite(9, HIGH);
bridge1.analogWrite(10, 123);
bridge1.virtualWrite(1, “hello”);
But I only digitalWrite on D9, I cant write to analog A1 or Virtual V1 any character

If you have any problem please create separate topic with detailed description what is wrong + your code snippet.

1 Like

I want to do the same project like you, but I want to write value =1234 (for example) to the 2nd, 3 rd Arduino, but I dont know how to do it, can you help me. I think the code maybe the same, There’s some change in virtualWrite. But I dont know how to write from 1st Arduino to the 2nd, 3 rd Arduino & then read the value in the 2nd & 3 rd Arduinos

can you give more detail on above quick code, such as the full code

I already answered you in another topic.

1 Like

But until now i dont get the result, only blink led on D9

Hi I’m building a meteo station but if I have understand with bridge I can’t receive and transmit value between arduino a and arduino b, I must send some value from a to b and read two values from b to a. It’s planned some features like this?

You can. We updated doc. You can find all info here.

Really sorry, but I can’t find what I search, only write function from arduino a to b, but I don’t find how arduino b send data to arduino a. It seems one way communication, anyway greetings for this great platform!

You can do the same on B arduino =). You only need to manage AUTH_TOKEN correctly. You may consider them as id of arduino you want to work with.

1 Like

Ah, I declare a bridge from arduino a to b and vice versa, and after I send data? That’s wonderful! Last thing, I have see how get data sent but how I can read multiple data? You have do an example when you send multiple values by command virtualwrite(vpin, value, value, value) this solution is perfect for me but how I can get these value? Thanks for your precious support

To send :

Blynk.virtualWrite(V1, "hello", 123, 12.34);

To receive :

BLYNK_WRITE(V1) {
  String x = param[0].asString(); // "hello"
  int y = param[1].asInt(); // 123
  float z = param[2].asFloat(); // 12.34
}
1 Like

Same could be applied to bridge :

bridge.virtualWrite(V1, "hello", 123, 12.34);

2 Likes