This is my first post on this forum so greetings to you all. I have been using blynk quite successfully now for several years and decided to migrate to the new version. I migrated my ESP32s and ESP8266s with no trouble.
I want to add the Raspberry Pi as a device and this is where I hit a problem.
I installed [vshymanskyy] blynk-library-python and tried a sample script.
import BlynkLib
import time
BLYNK_AUTH = ‘YourAuthToken’
initialize Blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH)
tmr_start_time = time.time()
while True:
blynk.run()
t = time.time()
if t - tmr_start_time > 1:
print("1 sec elapsed, sending data to the server...")
blynk.virtual_write(0, "time:" + str(t))
tmr_start_time += 1
Obviously adding my own AuthToken
This is the result.
%Run Blynk.py
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
///_, /////_
/__/ for Python v0.2.0 (Linux)
Invalid auth token
1 sec elapsed, sending data to the server…
1 sec elapsed, sending data to the server…
1 sec elapsed, sending data to the server…
Traceback (most recent call last):
File “/home/pi/Documents/Python/Blynk.py”, line 36, in
blynk.virtual_write(0, “time:” + str(t))
File “/home/pi/.local/lib/python3.7/site-packages/BlynkLib.py”, line 98, in virtual_write
self._send(MSG_HW, ‘vw’, pin, *val)
File “/home/pi/.local/lib/python3.7/site-packages/BlynkLib.py”, line 137, in _send
self._write(msg)
File “/home/pi/.local/lib/python3.7/site-packages/BlynkLib.py”, line 240, in _write
self.conn.send(data)
BrokenPipeError: [Errno 32] Broken pipe
I seem to have a invalid auth token
Having read around I suspect I may be connecting to the wrong cloud. This is where I become quite confused.
The git page states
Python client for Blynk IoT
Note: The library has been updated for Blynk 2.0.
Please remain on v0.2.0
for legacy Blynk."
v0.2.0 Latest
on 15 Feb 2019
So git says the latest version is 0.2.0 my raspi is running 0.2.0, so does this mean I am still on legacy blink.
Could somebody please explain which library I require, where it is and am I barking up the wrong tree.
Any help would be appreciated.
Regards
John