Communication between devices in Blynk 2.0

No, not really - see my comments above.

Pete.

Hi @PeteKnight, I guess you wanted to reply to me rather than @John93:wink:

I did something similar in the past using Blynk Legacy a few years ago and the result was good, it’s true that the on/off status will be confusing… you are absolutely right, but I don’t really think my idea was so bad at all…lol.

Anyway, your comments are accurate as always and you are in a better position that me with your knowledge and experience using Blynk 2.0… I’m always learning a lot with your comments.

Best Regards!!!

Yes, thank for pointing that out, and apologies to @John93 :wink:

I was trying to do more than one thing at once, and as Mrs K is always keen to remind me, I just don’t have the necessary chromosomes to multi-task successfully :grinning:

Pete.

1 Like

There’s no need to apologize, it’s not a big deal :slightly_smiling_face:

2 Likes

Automation will soon allow that. In fact, it’s already supported on the server side. We need just to fix few UI/UX issues and it will be done.

3 Likes

How soon?

Are there any limits on the frequency of data writes from one device to another?
For example, can you send data for multiple datastreams once every 5 seconds 24/7 ?

Any restrictions based on the type of subscription?

Pete.

2 Likes

I have had a look at the https api. It doesn’t seem to be difficult. My question is: the device (esp32) that has to read the Virtual pins of the other esp32 through the api has to be connected to blynk at the same time, to send the data from an internal temperature sensor. How can I make the https requests with the blynk firmware? Also because the blynk firmware is really good for handling disconnections from wifi. Thanks again, you are giving me an amazing help!

I don’t understand why you would use a 3rd party product to do the data interchange.

Pete.

Very good questions Pete.

At the moment automations have a default minimum 1 minute ignore period, meaning you can’t trigger the same automation more than once within 1 minute. However, this will be tuned based on the plan. Paying users should be allowed to trigger more often.

2 Likes

As 3rd party product you mean the blynk firmware? Because you suggested me to use the blynk api’s.

You should use the HttpClient library.

1 Like

Thanks, i will see if it works and if it is reliable.

Sorry, I misunderstood what you were asking.
You shouldn’t be using the API to read virtual pin values (this is why I thought you were using something like Thingspeak or IFTTT as3rd party middleware).

The API is used to write data from the sensors to the device that will be mounted internally and have the display attached.
When the external device uses the API to make these data writes, the corresponding BLYNK_WRITE(vPin) callback will trigger on the receiving device. You then extract the incoming data values using the param.asInt or param.asFloat methods.

Pete.

So, Peter, you are saying that each device has its own set of data streams which cannot be accessed by any other device?

If a datastream could be shared then data can easily be sent by one device and read by another device. That’s what I would like to do- send a temperature reading from one device to be displayed on a display on a different device (hardware).

Is there any way that can be im[plementsd ? Or is that a bad or problematic idea ?

thanks
Mike

That’s not a great way of wording it, but basically yes. The restriction is actually that each device has its own Auth token, and that Auth token can only be used on one device.

You can however use the HTTP(S) API to write data to the datastreams belonging to that Auth token, and this can be done from any device. The device doesn’t even need to be connected to Blynk, and the API can even be called from a web browser.

Another way of transferring data from one device to another is to use Automations in Blynk.

Both of these approaches, plus the third option of using Node-Red are discussed above.

Yes, it can be achieved with either of the three methods described above - HTTP(S) API, Automations or Node-Red.

Pete.

Hi Pete,

I’m lookinmg at your HTTP code. I see the part that sends to the web server (push_some_data() ) but I was wondering what code would be needed to receive the data on the other device? Or is that included in the code that you posted?

Please advise.

Thank you
Mike

A standard Blynk sketch, using the auth token that you’ve sent the data to using push_some_data() with a BLYNK_WRITE(Vpin) function to receive the values and do something with them - like send them on your display.

Pete.

Hi Pete,

I have looked at your code to send a number to the Blynk server. The example is for an ESP32 but I need code for an ESP8266.

I changed the include lines as follows:
#include <BlynkSimpleEsp8266_SSL.h>
#include <ESP8266HTTPClient.h>

But I am having an error with the HTTP call in the void api_bridge():

Compilation error: call to ‘HTTPClient::begin’ declared with attribute error: obsolete API, use ::begin(WiFiClient, url)

What am I doing wrong? Is there an example for the ESP8266 ? The guy said he hasn’t tested it with an ESP8266.

Thanks
Mike

If you’d have continued reading that topic you’d have seen that I posted an ESP8266 version in post #45

Pete.