|
|
@ -0,0 +1,15 @@ |
|
|
|
import network |
|
|
|
|
|
|
|
def connect(): |
|
|
|
sta_if = network.WLAN(network.STA_IF) |
|
|
|
|
|
|
|
if not sta_if.isconnected(): |
|
|
|
print('connecting to network...') |
|
|
|
|
|
|
|
sta_if.active(True) |
|
|
|
sta_if.connect('<ssid>', '<psk>') |
|
|
|
|
|
|
|
while not sta_if.isconnected(): |
|
|
|
pass |
|
|
|
|
|
|
|
print('network config:', sta_if.ifconfig()) |