webrepl: introduce command to start webrepl

This commit is contained in:
Arne Zachlod 2025-03-07 15:18:01 +01:00
parent 4b5c322a1a
commit 0eb5ce375e

13
main.py
View file

@ -190,7 +190,8 @@ def exec_cmd(json_cmd):
exec_reset(cmd)
elif cmd['cmd'] == "telemetry":
exec_telemetry(cmd)
elif cmd['cmd'] == "webrepl":
exec_webrepl(cmd)
def exec_rtc(cmd):
global RTC0
@ -306,6 +307,16 @@ def exec_telemetry(cmd):
r = requests.request("GET", URL, timeout=60)
reset()
def exec_webrepl(cmd):
# options:
# wlan_ssid
# wlan_password - optional
# webrepl_pass
setup_wdt(3600)
network_connect(cmd)
import webrepl
webrepl.start(password=cmd['webrepl_pass'])
def control():
"""main control loop"""
if UART0.any():