Hello,
As a first step in a large project, I am trying to set up a “hello world” with Blynk and a Raspberry Pi Zero W. This project will be in Python, thus I am following the instructions provided in the blynk-python-library repo.
I copied the usage example from the repo but get an invalid auth token error:
I am getting my auth token from the Blynk website under my device’s “Device Info” tab on the Blynk website.
Here’s my code. The only difference between this and the example on the repo is that I added printing the logs and obviously my auth token.
from __future__ import print_function
import BlynkLib
# Initialize Blynk
BLYNK_AUTH = "3Ngd6Tdw9djI17trS1AfVY5aXfhlBwiz"
blynk = BlynkLib.Blynk(BLYNK_AUTH, log=print)
# Register Virtual Pins
@blynk.VIRTUAL_WRITE(1)
def my_write_handler(value):
print('Current V1 value: {}'.format(value))
@blynk.VIRTUAL_READ(2)
def my_read_handler():
# this widget will show some time in seconds..
blynk.virtual_write(2, int(time.time()))
while True:
blynk.run()
A few other notes:
- The device is connected via wi-fi
- I believe I am using Bylnk 2.0 but am not sure how to check
- I do not know my Blynk server or how to find out, but I am near Vancouver, Canada
- This will eventually be connected to the Android app, but I think that’s irrelevant at this point
Thanks for any help,
Geoff