BLYNK
BLYNK.IO       馃摬 GETTING STARTED       馃摋 DOCS       馃憠 SKETCH BUILDER

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

Hi all.

I鈥檓 trying to implement reading and writing data from a server virtual pin, but I can鈥檛 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鈥檛 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鈥檛 find any documentation.小薪懈屑芯泻 褝泻褉邪薪邪 芯褌 2023-05-09 17-33-15

You鈥檙e 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鈥檛 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鈥檚 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鈥檙e 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鈥檚 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鈥檛 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鈥檓 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鈥檚 what the library does.

Pete.

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

There isn鈥檛 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鈥檚 not really that complicated.

The files are available via the green 鈥淐ode鈥 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鈥檝e installed the 0.2.0 packaged release from there already, you need to install the 1.0.0 version which isn鈥檛 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)