feat: UWB anchor auto-discovery (Issue #698) #706

Merged
sl-jetson merged 1 commits from sl-uwb/issue-698-anchor-discovery into salty/uwb-tag-display-wireless 2026-03-20 17:38:46 -04:00

1 Commits

Author SHA1 Message Date
sl-uwb
fd6893f684 feat: UWB anchor auto-discovery (Issue #698)
Replace hardcoded NUM_ANCHORS with dynamic discovery table.
Tag probes IDs 0..7 via standard DS-TWR POLL frames at startup
and after every DISC_RESCAN_MS (10 s); anchors that respond are
added to the active table, stale ones removed after
ANCHOR_MISS_LIMIT misses or ANCHOR_TIMEOUT_MS silence.

Key changes
-----------
- AnchorEntry table (8 slots): present/active flags, range_mm,
  rssi, last_ok_ms, miss_count
- DISC_SCAN → DISC_RANGE state machine
- range_and_update(): ranges, updates table, emits +DISC:FOUND /
  +DISC:LOST on serial and MSG_DISC (0x40) on ESP-NOW
- disc_scan_step(): advances cursor one probe per ranging slot,
  skips already-active IDs
- New OLED screens: ANCHOR SCAN progress bar, NO ANCHOR rescan
  countdown, active anchor count badge on normal screen
- platformio.ini: switch to MaUWB_DW3000 lib, remove NUM_ANCHORS
  build flag (discovery is now dynamic)
- No anchor firmware changes required

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 16:34:18 -04:00