Details: i am new to Rasp Pi W (loaded with MicroPython) and Blynk But not new to Python
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=None
Nothing 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
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'