Initial commit
This commit is contained in:
20
check_wifi.py
Normal file
20
check_wifi.py
Normal file
@@ -0,0 +1,20 @@
|
||||
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())
|
||||
Reference in New Issue
Block a user