webrepl: introduce command to start webrepl
This commit is contained in:
parent
4b5c322a1a
commit
0eb5ce375e
1 changed files with 12 additions and 1 deletions
13
main.py
13
main.py
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue