9
0
Fork 0

fix wifi password, clean imports

This commit is contained in:
Silver Kuusik 2018-01-12 10:23:12 +01:00
parent 0b848ae3d0
commit 14e142615d
1 changed files with 4 additions and 4 deletions

View File

@ -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()