fix wifi password, clean imports
This commit is contained in:
parent
0b848ae3d0
commit
14e142615d
8
boot.py
8
boot.py
@ -1,13 +1,13 @@
|
||||
import ujson
|
||||
import network
|
||||
from hal import *
|
||||
from time import sleep
|
||||
import socket, re, os, uwebsockets, network, binascii, ujson
|
||||
|
||||
print("Press Ctrl-C to stop boot script...")
|
||||
sleep(0.2)
|
||||
|
||||
# read the config file
|
||||
config = ujson.loads(open("config.json", "r").read())
|
||||
print(config)
|
||||
|
||||
# connect to WiFi
|
||||
wlan = network.WLAN(network.STA_IF)
|
||||
@ -25,9 +25,9 @@ if not wlan.isconnected():
|
||||
if ssid in config["wifis"].keys():
|
||||
print("connecting to: " + ssid)
|
||||
# start to connect to the pre-configured network
|
||||
wlan.connect(ssid, wifis[ssid])
|
||||
wlan.connect(ssid, config["wifis"][ssid])
|
||||
break
|
||||
|
||||
# Clean up
|
||||
# clean up
|
||||
import gc
|
||||
gc.collect()
|
||||
|
Loading…
Reference in New Issue
Block a user