scheduler: improve all the things
This commit is contained in:
parent
3a4a368038
commit
3f8f174a07
1 changed files with 132 additions and 130 deletions
14
boot.py
14
boot.py
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue