Auth token problems on Raspberry Pi 4 using Python 3.7


I obtained an auth token at the getting started page for 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
def my_read_handler():
     currentTime =
     blynk.virtual_write(2, currentTime.strftime("%d/%m/%Y %H:%M:%S"))

while True:

But I am always getting an error:

pi@raspberrypi:~ $ python3 

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

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:


Are you using this version of the library…