BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

Auth token problems on Raspberry Pi 4 using Python 3.7

Hello,

I obtained an auth token at the getting started page for Blynk.io using my WiFi network name and password. I then pasted the token in as shown below:

import BlynkLib
from datetime import datetime
# Initialize Blynk
blynk = BlynkLib.Blynk('bkxA-owfgq9siEXzwgtmnaVU7O5HRTnv')

# Register Virtual Pin
@blynk.VIRTUAL_READ(2)
def my_read_handler():
     currentTime = datetime.now()
     blynk.virtual_write(2, currentTime.strftime("%d/%m/%Y %H:%M:%S"))

print("started!")
while True:
    blynk.run()

But I am always getting an error:

pi@raspberrypi:~ $ python3 myBlynkTest.py 

    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ for Python v0.2.0 (Linux)

started!
Invalid auth token

Am very uncertain what is causing this. Any advice? I’ve been poking around the documentation but am pretty sure this is some newbie error on my part. Thanks!

@rmukai please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code and your serial monitor output so that they display correctly.
Triple backticks look like this:
```

Pete.

Are you using this version of the library…

Pete.