Initial code commit

This commit is contained in:
Lexi / Zoe 2021-12-28 22:10:27 +01:00
parent c9eba67347
commit 167847cd28
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
5 changed files with 138 additions and 0 deletions

26
src/boot.py Normal file
View file

@ -0,0 +1,26 @@
# boot.py -- run on boot-up
import network
import pycom
from config import Config
import wlan_manager
# 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)