chore(release): beta-1.03

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-10 16:13:59 +12:00
parent 170a0e05ab
commit 2a768376d0
6 changed files with 232 additions and 35 deletions

View File

@@ -3,6 +3,9 @@ import gc
import utime
from hello import broadcast_hello_udp
from wifi_sta import try_reconnect
_UDP_HELLO_ATTEMPT = 0
async def presets_loop(presets, wdt):
@@ -21,11 +24,26 @@ async def presets_loop(presets, wdt):
async def udp_hello_loop_after_http_ready(sta_if, settings, wdt, runtime_state):
"""Broadcast hello at startup-fast cadence, then slower cadence."""
"""UDP hello on cadence; if STA drops, one reconnect campaign per iteration."""
global _UDP_HELLO_ATTEMPT
await asyncio.sleep(1)
started_ms = utime.ticks_ms()
while True:
if runtime_state.hello:
try:
wifi_ok = sta_if.isconnected()
except Exception:
wifi_ok = False
if not wifi_ok:
ssid = settings.get("ssid") or ""
if ssid:
try_reconnect(sta_if, ssid, settings.get("password") or "", wdt)
try:
wifi_ok = sta_if.isconnected()
except Exception:
wifi_ok = False
if wifi_ok and runtime_state.hello:
_UDP_HELLO_ATTEMPT += 1
print("UDP hello broadcast attempt", _UDP_HELLO_ATTEMPT)
try:
broadcast_hello_udp(
sta_if,
@@ -37,5 +55,5 @@ async def udp_hello_loop_after_http_ready(sta_if, settings, wdt, runtime_state):
except Exception as ex:
print("UDP hello broadcast failed:", ex)
elapsed_ms = utime.ticks_diff(utime.ticks_ms(), started_ms)
interval_s = 5 if elapsed_ms < 60000 else 60
interval_s = 10 if elapsed_ms < 120000 else 30
await asyncio.sleep(interval_s)