17 lines
413 B
Python
17 lines
413 B
Python
from time import sleep
|
|
def do_connect():
|
|
import network
|
|
wlan = network.WLAN(network.STA_IF)
|
|
wlan.active(True)
|
|
if not wlan.isconnected():
|
|
print('connecting to network...')
|
|
wlan.connect('nubbe', 'MFhBB!MThAuE!')
|
|
while not wlan.isconnected():
|
|
sleep(0.1)
|
|
print("Connecting")
|
|
pass
|
|
print('network config:', wlan.ifconfig())
|
|
|
|
do_connect()
|
|
|