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

its absolutely mad but is seems it works for pin3! I will check others and report.

Yes, it seems it is just pin2 not working! I randomly tried 2-3 others and it works!

Looking at other examples in the Blynk Python Library (above), it seems that defining a virtual pin is determined by the initial wording, not the word (value)…

def my_write_handler(value):
def v3_write_handler(value):
def v4_write_handler(value):

etc.

Also… you are already using V2 (or just pin 2) in this command… for the uptime display.

Ah I am so silly, I did not pay any attention that I am using already VP2. I just cope/pasted the code and forgot the last lines.

Thank you for pointing it out anyway!

1 Like

Hi again,

I have just noticed that when I use the library the CPU goes 100% on RPi3

Strange isn’t it?

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