diff --git a/boot.py b/boot.py index 0782dfd..92b730b 100644 --- a/boot.py +++ b/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()