Restart project based on regular ESP32 and Microdot

This commit is contained in:
Lexi / Zoe 2022-11-04 20:28:35 +01:00
parent 167847cd28
commit 56e7a1d2de
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
12 changed files with 1661 additions and 119 deletions

View file

@ -1,26 +1,10 @@
# boot.py -- run on boot-up
# boot.py -- This file is executed on every boot (including wake-boot from deepsleep)
import network
import pycom
from lightbar import wlan_manager
import webrepl
from config import Config
import wlan_manager
# Connect to WLAN as defined in wlan_cfg.py
wlan_manager.connect()
# Disable Pybytes and smart configuration
pycom.pybytes_on_boot(False)
pycom.smart_config_on_boot(False)
# Load config from flash memory
config = Config()
config.load()
# Enable or disable heartbeat
pycom.heartbeat(config.get('heartbeat'))
# Reconfigure FTP and Telnet server
server = network.Server()
server.deinit()
server.init(login=(config.get('login_user'), config.get('login_password')), timeout=600)
# Connect to WLAN
wlan_manager.connect(config)
# Start WebREPL on default port 8266 with password defined in webrepl_cfg.PASS
webrepl.start()