Turn on a led with Blynk And Pi Pico W (Micropython)

Hi everybody! I’m new in community forum. I’m developing a simple project with Blynk and Raspberry Pi Pico W. My idea is to turn on/off a led with Blynk via Wi-Fi. I installed via Thonny both official Blynk Micropython library (version 0.2.6) and Blynk Library by Volodymyr Shymanskyy (version 0.2.0). My Pi Pico W connected correctly to Wi-Fi but after it gives me error when connecting to Blynk servers. This is my code:

import network
import BlynkLib

from time import sleep
from machine import Pin

builtin_led = Pin('LED', Pin.OUT)
builtin_led.on()

# Connection to Wi-Fi
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, password)

# Wait for connect or fail
while not wlan.isconnected():
    if wlan.status() < 0 or wlan.status() >= 3:
        break
    print("Waiting for connection...")
    sleep(1)

# Handle connection error
if wlan.status() != 3:
    print("Network connection failed")
else:
    print("Connected")
    status = wlan.ifconfig()
    print("IP:", status[0])

# Initialize Blynk
print("Connection to Blynk...", end=" ")
blynk = BlynkLib.Blynk(token)
if blynk.connect():
   print("done")
else:
   print("failed")

white_led = Pin(15, Pin.OUT)

@blynk.handle_event('write V0')
def read_virtual_pin(pin, value):
    print(f"Read from Virtual Pin V{pin} status {value}")
    white_led.value(int(value))

while True:
    blynk.run()

This is my output:

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

Waiting for connection...
Waiting for connection...
Waiting for connection...
Waiting for connection...
Waiting for connection...
Connected
IP: 192.168.1.32
Connection to Blynk... Traceback (most     recent call last):
File "<stdin>", line 36, in <module>
File "/lib/BlynkLib.py", line 224, in __init__
File "/lib/BlynkLib.py", line 59, in __init__
File "/lib/BlynkLib.py", line 236, in connect
ValueError: Connection with the Blynk server blynk-cloud.com:80 failed

My region area is fra1. My plan is FREE. My operating system is MacOS Ventura 13.2.1.

Hello, @techrevo please edit your post and read Recommendations for creating a new topic in Forum

Your code is not readable

Hello @Oleksii-QA, thank you for your answer. I edited the post.

But you didn’t provide the information requested in the link that you were given.

Pete.

I’m sorry. I have just edited the post. I hope I have provided all the necessary information.

You need to be running version 1.0.0, but as the files for this aren’t bundled into a release package, you need to manually copy them from the GitHub site.

Pete.

Hi Pete, thank you for the answer. I downloaded 1.0.0 version and I tried installing it using Tonny package manager but it says me that .zip file is not a valid Python package. I tried also from command line but seems to be in conflict with Python distribution installed on Mac.