Closed hznupeter closed 5 years ago
Fix by:
it's need add
while True:
blynk.run()
pass
just like loop() in arduino
the Full code as below:
import network
import BlynkLib
import time
from mpython import *
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect('Xxxxi_0432', 'xxxxxxxxxxx')
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())
BLYNK_AUTH = 'e8d3214523d148a1beacc8022af2273b'
# Initialize Blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH)
while True:
blynk.run()
pass
v0.2.0 is released and available via pip: https://github.com/vshymanskyy/blynk-library-python/releases/latest
I uploaded the 02_virtual_read ,it will connect to Blynk app, but after 30 seconds ,it will disconnected. I have tried different boards ,but the same result.