Code: Select all
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print('connecting to network...')
sta_if.active(True)
sta_if.connect('<essid>', '<password>')
while not sta_if.isconnected():
pass
print('network config:', sta_if.ifconfig())
to connect to my WiFi,
this is what I get at the REPL by connectoing with screen /dev/ttyUSB0 115200:
I am (only) curious as what this makes the config persistent?scandone
no <essid> found, reconnect after 1s
reconnect
...
scandone
no <essid> found, reconnect after 1s
reconnect
Is that some Espressif stuff?
Would I need to
Code: Select all
sta_if.active(False)