I am getting an invalid auth message when run the following test code using my raspberry pi Pico with micropython on my wi-fi service. i am using windows11. blynk lib version__ = “1.0.0”
The code is a test for debugging the auth problem.
I deleted my project and generated a new auth code but I still get this invalid auth message.
Connected to Wi-Fi
Connecting to blynk.cloud:443…
Invalid auth token
start of my code:
# Connect to Wi-Fi
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('ssid', 'password')
# Wait for Wi-Fi connection
while not wlan.isconnected():
print('Connecting to Wi-Fi...')
time.sleep(1)
print('Connected to Wi-Fi')
# Auth token from Blynk
BLYNK_AUTH = 'xxxx'
# Initialize Blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH, server='blynk.cloud', port=443)
# Run the Blynk loop
while True:
blynk.run()
@hib1 Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your serial output and your code so that they display correctly.
Triple backticks look like this:
```
Copy and paste these if you can’t find the correct symbol on your keyboard.
Thanks for contacting me promptly. I did have the tic marks in my initial post. I copied your tic marks and put them at the beginning and end of my code. The message system seems to have formatted the code with large fonts for some of the headings
I revised the message with the tic marks.
If this is not a proper format how should I submit the code?
Originally, you had a quotation mark and an apostrophe rather than three backticks.
You are now using triple backticks for your code, but you’ve not added them to your serial output.
Have you tried using one of the example sketches in the library, rather than your slightly strange code?
Are you copying and pasting the auth token from the web console, or typing it manually?
Thank you for your help. I found some sample code that I modified, and it allowed me to get my Blynk device connected to my Raspberry Pi Pico W device. My device on the Blynk console shows I am online. The sketch does not contain code that allows me to activate hardware connected to my Raspberry Pi Pico. I think I can take it from here after I find the location of examples for micropython so I can see more info. However I cannot find that group of examples anywhere on the blynk web site. Can you help me find the library with example sketches for micrpopython, as opposed to C++?
The code starts off as this:
“This example shows how to initialize your WiPy board and connect it to Blynk.”