Initial code commit
This commit is contained in:
parent
c9eba67347
commit
167847cd28
5 changed files with 138 additions and 0 deletions
26
src/boot.py
Normal file
26
src/boot.py
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue