-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot.py
46 lines (37 loc) · 926 Bytes
/
boot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
#import webrepl
#webrepl.start()
def setup():
import utils.setup
utils.setup.setup()
def octopus():
try:
import utils.octopus
utils.octopus.octopus()
return utils.octopus
except:
print("Err. import octopus")
def reset():
from machine import reset
reset()
def shell():
try:
import shell
shell.shell()
except:
print("Err. import shell")
try:
print("auto start from: config/boot.json")
from config import Config
autostart = Config("boot")
if autostart.get("connect_wifi"):
from utils.octopus import w
w()
if autostart.get("start_web_server"):
from utils.octopus import web_server
web_server()
except:
print("Autostart Err.")
# when user enters REPL and executes setup()