scheduler: improve all the things

This commit is contained in:
Konstantin Koslowski 2019-07-04 21:21:29 +02:00
parent 3a4a368038
commit 3f8f174a07

14
boot.py
View file

@ -1,14 +1,15 @@
# ssid, password
import wifi
import usocket as socket
from utime import sleep
from machine import Pin, RTC, I2C
import network
from DS3231 import DS3231
import web
import esp
## wifi.py
# ssid = xxx
# password = yyy
import wifi
esp.osdebug(None)
import ure
@ -16,6 +17,7 @@ import uos
import ujson
import gc
gc.collect()
# global variables
@ -32,13 +34,13 @@ pin_cfg = Pin(12, Pin.IN)
pin_led = Pin(2, Pin.OUT)
## CONFIG
CONFIG_FILE="schedule.json"
CONFIG_FILE = "schedule.json"
config = {}
# try loading config from filesystem
files = uos.listdir()
if CONFIG_FILE in files:
f = open(CONFIG_FILE, "r")
config_raw=f.read()
config_raw = f.read()
config = ujson.loads(config_raw)
f.close()
for i in range(7):