Dépot de code divers pour mon TTGO v1.1
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

15 lines
384 B

import network
file = open('creds', 'r')
wifi_ssid = file.readline().rstrip("\n")
wifi_pass = file.readline().rstrip("\n")
file.close()
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect(wifi_ssid, wifi_pass)
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())