feat(wifi): retry association with backoff in shared connect helper

The single-shot connect_wifi aborted boot on any transient association or
DHCP miss — common right after a reset, when the AP still holds the stale
pre-reset association. Add a bounded retry (5 attempts, 500ms→4s backoff,
disconnect between tries) so those transient failures recover instead of
failing the boot.

Extract the logic into firmware::net (new lib target) and rewire the
wifi_tls / git_push / git_sync spikes to it, removing three duplicated
copies. main.rs reuses this when Wi-Fi lands there instead of adding a
fourth copy.
This commit is contained in:
Julien Calixte
2026-07-10 23:44:02 +02:00
parent 4460475fb0
commit 875658a661
6 changed files with 104 additions and 75 deletions

View File

@@ -10,6 +10,13 @@ rust-version = "1.85"
# rust-analyzer — see README "harness = false" note).
autobins = false
# Shared library surface (currently just resilient Wi-Fi bring-up in
# `firmware::net`), reused by the editor bin and the spike bins so the connect
# retry logic lives in exactly one place rather than being copied per binary.
[lib]
name = "firmware"
path = "src/lib.rs"
[[bin]]
name = "firmware"
path = "src/main.rs"