New! Alpha version of the blynk-library for Python!

For an alpha version, it is not strange :wink:

Hi vhymanskyy,

first of all thank you so much for providing the library!

I was just wondering if it is something related to my own Pi configuration.

Is it related to very fast refresh rates?

Generally I need to link my Pi to blink cloud in order to forward Virtual Pin data
to SC though OSC (Open Sound communication). This is going to be a non stop
running installation so do you think I should move for now to the node.js version?
Is that more efficient CPU-wise?

Best
mDSP

Node.js is better in 2 ways:

  1. the Blynk library is tested better
  2. JavaScript is event-driven by itā€™s nature

If you donā€™t have intensive computations in your code/libraries you use, I wouldnā€™t be concerned about Node.js or Python usage at all.

Hey, Iā€™m kinda new to thisā€¦I need to sense a GPIO pinā€¦but I canā€™t because it keeps executing blynk.run
I need to continuously check the GPIO pins and excecute blynk.run at the same time ā€¦
Can someone help meā€¦thanks

@Aleric_Pinto Iā€™m planning to change this in a week or so. Iā€™ll update the library

Ohh okay thanksā€¦will I able to execte what I requireā€¦?
And also digital pins are not supported yet I thinkā€¦Any word on that.

Digital pins will not be supported. Youā€™ll have to add virtual pins for your digital pins (~5 lines of code)

Yes Iā€™ve been Doing that all alongā€¦thanks anyway

Good news here.
I found some time to do a major rewrite of the Python library!
It now contains only my code (previously some code was written by another guy), works better with MicroPython (LoBo/ESP32, etc.), and whatā€™s most interesting - does not have the ugly concept of ā€œtasksā€.
It now works similar to Arduino - you have to run Blynk in a loop (but you can also use _thread).

Iā€™m now polishing it, preparing some ā€œgetting startedā€ docs, etc.

4 Likes

So, how are things going in the micropython world? Tried importing blynklib to my m5stack module, but isnā€™t working :\

Hiā€¦Does the python library work with local server? i ran the blynk_write.py example and look what i gotā€¦ my pi is not connected to the internet.
Connecting to blynk-cloud.com:80
Error: connection with the Blynk servers failed, connection closed

I know nothing about Python, but Iā€™d assume that you need to edit your BlynkLib.py

def connect(self):
       try:
           self.conn = socket.socket()
           self.conn.connect(socket.getaddrinfo("blynk-cloud.com", 80)[0][4])
           self.conn.settimeout(0.05)
           BlynkProtocol.connect(self)
       except:
           raise ValueError('connection with the Blynk servers failed')

Pete.

3 Likes

Yesā€¦ and a little searching laterā€¦ :wink:

1 Like

Be aware that with the next update, it will be easier to change the server (still in the works)

2 Likes

Next update this week.
:thinking:

probably

1 Like

I have been slack in getting to this, but saw some recent changed on github, so after seeing that running the documented install file still gets 0.1.3. I just manually downloaded what looks like the latest Python 0.2.0 library and have it sitting in my RPiā€¦ There is a nice file called setup.py, but I canā€™t seem to get it to actually live up to its name :stuck_out_tongue:

The first lines in the file show thisā€¦

#!/usr/bin/env python

from setuptools import setup

Which doesnā€™t tell me much eitherā€¦ I looked for that folder, thinking I might find that setuptools program, but the folder doesnā€™t yet exist.

Googling a bit (yep I do that :wink: ) it seems I must setup setuptools in order to setup Blynkā€™s Python setup?? Wowā€¦ This linux/python stuff is hard :blush:

Any hints here? before I totally pooch my RPi setup :laughing:

In the same folder as setup.py, run:

pip3 install ./

or

pip2 install ./

Depending on the Python version you want to use the library with.
Anyway. The library 0.2.0 is almost ready for release (still working on some examples)

v0.2.0 is released and available via github and pip.

Please check out the new README and examples.

:star2: :star2::star2: And of course, do not forget to give it a github star! :slight_smile:

2 Likes