Need help Connecting Raspberry pi W with Blynk Servers

Details: i am new to Rasp Pi W (loaded with MicroPython) and Blynk But not new to Python :wink:
so i am tryin to connect my Pi with Blynk it seems that i got no response the terminal shows nothing as you will see in my code i added some code to check if it is a server issue or Pi is not connected to Wi-Fi(tho pi is successfully connected with my hotspot) . Also, i tried pinging blynk-cloud.com in CMD which returned
Ping request could not find host blynk - cloud . com. Please check the name and try again.
Then i searched on the forum and i got a post that mentioned some server addresses one of them was
fra1.blynk.cloud i pinged this and got pong from it, so i thought a handshake might be possible with this server then i used this example
blynk = blynklib.Blynk(BLYNK_AUTH,server='fra1.blynk.cloud', port=443, ssl_cert='/certificate/blynk-cloud.com.crt',heartbeat=30, rcv_buffer=1024, log=print)
didn’t work even tried without the ssl_cert=NoneNothing happened
print(blynk.connected()) this always print False
then i tried changing server address within lib replaced the default address with fra1.blynk.cloud and tried blynk = blynklib.Blynk(BLYNK_AUTH) this simple example but no luck.

• Hardware model: Raspberry pi W
• Smartphone OS: Android 14
• Blynk server region: sgp1
(not sure, i am in China and use VPN, mostly i use a German Server)
• Blynk Library version 0.2.6
(So board is successfully connected to Wifi)
#below is code to connect with Blynk
any help will be appriciated :slight_smile:

BLYNK_AUTH = 'MY_AUTH_TOKEN'
blynk = blynklib.Blynk(BLYNK_AUTH,server='fra1.blynk.cloud', port=80,heartbeat=30, rcv_buffer=1024, log=print)
# blynk.connect()
if blynk.connected() == False:
    print(blynk.connected())
    print('Blynk not connected yet...')
    time.sleep(1)
@blynk.handle_event('read v0')
def read_virtual_pin_handler(pin):
    print(pin)
while True:
    blynk.run()```
below is my terminal Log
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ for Python v0.2.6
Connected to blynk server
Authenticating device...
[ERROR]: Auth stage failed. Status=4
Connection closed'

So i came to know that legacy servers used
http://blynk-cloud.com/ which is not longer used in V2 , but still with v2 server address blynk.cloud its not working

You’re using the wrong version of the Blynk Python library.

You should be using version 1.0.0 with Blynk IoT.
This is available here:

but not as a bundled package. You have to copy the files manually. You should also take a look at the Examples folder, as I believe the syntax has changed too.

Pete.

1 Like

Got it Pete, i will try and let you know :slight_smile:

1 Like

thanks, it worked like a charm <3

1 Like