Can't read pin data from server using blynk-library-python==0.2.0

Hi all.

I’m trying to implement reading and writing data from a server virtual pin, but I can’t find examples of how to do it.

All I see are examples from two years ago in the library blynk-library-python/examples at master · vshymanskyy/blynk-library-python · GitHub. Those examples that are, do not help and it seems that they do not work. Nevertheless, sending data to the server is successful - I use virtual_write(), but I can’t read data from the pin. Intuitively, it seems to me that there must be some kind of mechanism, but I cannot find it.

python3.10
blynk-library-python==0.2.0
22.04.1 - Ubuntu

I would like to see the actual documentation on the data reading mechanism for python3.10, well, or a fresh library that supports the functionality. Is it possible that you have a REST API and can work directly? Didn’t find any documentation.Снимок экрана от 2023-05-09 17-33-15

You’re using the wrong library version.
The 0.2.0 release from 4 years ago is for Blynk Legacy. The 1.0.0 version for Blynk IoT hasn’t been bundled into a release, so you need to copy the .py files and install them manually.
The examples from 2 years ago are for the 1.0.0 version and will work once you have the correct version installed.

Yes, it’s described in the documentation…
https://docs.blynk.io/en/blynk.cloud/https-api-overview

Pete.

First of all, thanks for such a quick response. Can you please tell me which one is better to use in the product? library or REST API?

The answer is usually the library, but it depends what you want to achieve.

Pete.

Stability and ease of use, but the scary thing is that you have to take some additional steps to configure the library. It seems that it is easier to write in REST.

If you’re wanting to obtain virtual pin data from the server then you need to keep polling the server, on a pin by pin basis, to obtain the latest value for each pin.
It’s easy to flood the server with requests, and/or exceed the daily limits.

Opening an always-on connection via the library is a far better approach in these situations.

TBH, the Python library isn’t very mature or fully-featured. Most people use the C++ library, which is where the development focus is.

Pete.

I want to clarify, is there a pooling functionality in the python library?

I’m not sure what you mean.

Pete.

Is there a functionality in the python library that allows you to communicate with the server through non-rest api requests? and maintain a long connection to the server?

Yes, of course. That’s what the library does.

Pete.

Can you share a link to a manual that describes in detail how to prepare a python library? I’m afraid I misunderstood.

There isn’t one.
What is it that you misunderstood?

Pete.

Can you tell me where I should get the 1.0.0 library? Just to be absolutely sure. And again, should I just take the contents of 1.0.0 and put all the .py files in the 0.2.0 root?

It’s not really that complicated.

The files are available via the green “Code” button, or you can replace the previously installed files with the ones in the file list. Both circled in red…

Pete.

Do I need to have the 1.0.0 library installed before doing this? Right ? Where can I get it? How to put it?

Then apparently you need to perform the actions described by you above.

This is the 1.0.0 library.

Pete.

Once again I ask you can you give a link to the library with version 1.0.0 that you mentioned?

You provided the link in your first post.
You’ve installed the 0.2.0 packaged release from there already, you need to install the 1.0.0 version which isn’t available as a packaged release, so you need to download and install the files manually.

Pete.

Thank you Piter!
It was very counter intuitive, not sure possible to find out without your help!

all examples is working ! no questions anymore)