20 lines
396 B
Python
20 lines
396 B
Python
import network
|
|
import time
|
|
|
|
SSID = "BAILIE"
|
|
PASSWORD = "hellothere"
|
|
|
|
wlan = network.WLAN(network.STA_IF)
|
|
wlan.active(True)
|
|
|
|
if not wlan.isconnected():
|
|
print("Connecting...")
|
|
wlan.connect(SSID, PASSWORD)
|
|
|
|
timeout = 20
|
|
while timeout > 0 and not wlan.isconnected():
|
|
time.sleep(1)
|
|
timeout -= 1
|
|
|
|
print("Connected:", wlan.isconnected())
|
|
print("Config:", wlan.ifconfig()) |