Skip to content

feat: ADR-063/064 mmWave sensor fusion + multimodal ambient intelligence#270

Merged
ruvnet merged 6 commits intomainfrom
feat/adr-063-mmwave-sensor-fusion
Mar 15, 2026
Merged

feat: ADR-063/064 mmWave sensor fusion + multimodal ambient intelligence#270
ruvnet merged 6 commits intomainfrom
feat/adr-063-mmwave-sensor-fusion

Conversation

@ruvnet
Copy link
Owner

@ruvnet ruvnet commented Mar 15, 2026

Summary

ADR-063 + ADR-064: Full mmWave sensor fusion implementation with WiFi CSI.

Firmware (ADR-063)

  • mmwave_sensor.c/h — UART driver with auto-detection for Seeed MR60BHA2 (60 GHz, HR/BR/presence) and HLK-LD2410 (24 GHz, presence/distance)
  • Correct protocols — MR60BHA2: SOF=0x01, XOR+NOT checksums, types 0x0A14/0x0A15/0x0A16/0x0F09. LD2410: 256000 baud, 0xAA report marker
  • Auto-detection — probes UART at boot (115200 then 256000), registers device capabilities
  • Mock generator — QEMU testing: synthetic HR 72±2 bpm, BR 16±1/min, person presence/absence scenarios
  • 48-byte fused vitals packet (magic 0xC5110004) — Kalman fusion: mmWave 80% + CSI 20%
  • Graceful fallback — no mmWave = standard 32-byte CSI-only packet (backward compatible)

Server-Side Fusion Bridge (ADR-063 Phase 6)

  • scripts/mmwave_fusion_bridge.py — reads COM4 (ESP32-C6 + MR60BHA2) and COM7 (ESP32-S3 CSI) simultaneously
  • Real-time Kalman fusion display with source attribution

Roadmap (ADR-064)

  • 25+ applications across 4 tiers from practical to exotic
  • Priority matrix: P0 = zero-FP fall detection, P1 = sleep/baby monitor/bathroom safety/HVAC

Hardware Verification

COM7 (ESP32-S3): Real WiFi CSI, mmWave auto-detect runs at boot, CSI-only mode when no mmWave wired
COM4 (ESP32-C6 + MR60BHA2): Live HR=75 bpm, BR=25/min at 52cm range
Fusion bridge: Both sensors feeding data simultaneously for 30 seconds

Test plan

  • QEMU mock build passes (mock mmWave generator)
  • All 11 CI jobs green (fuzz, QEMU tests, NVS matrix, swarm)
  • Real hardware: COM7 boots with mmWave auto-detect
  • Real hardware: COM4 streams HR/BR data
  • Fusion bridge: concurrent dual-sensor capture verified

Refs #269

🤖 Generated with claude-flow

ruvnet added 6 commits March 15, 2026 15:28
60 GHz mmWave radar (Seeed MR60BHA2, HLK-LD2410/LD2450) fusion
with WiFi CSI for dual-confirm fall detection, clinical-grade
vitals, and self-calibrating CSI pipeline.

Covers auto-detection, 6 supported sensors, Kalman fusion,
extended 48-byte vitals packet, RuVector/RuvSense integration
points, and 6-phase implementation plan.

Based on live hardware capture from ESP32-C6 + MR60BHA2 on COM4.

Co-Authored-By: claude-flow <ruv@ruv.net>
Phase 1-2 of ADR-063:

mmwave_sensor.c/h:
- MR60BHA2 UART parser (60 GHz: HR, BR, presence, distance)
- LD2410 UART parser (24 GHz: presence, distance)
- Auto-detection: probes UART for known frame headers at boot
- Mock generator for QEMU testing (synthetic HR 72±2, BR 16±1)
- Capability flag registration per sensor type

edge_processing.c/h:
- 48-byte fused vitals packet (magic 0xC5110004)
- Kalman-style fusion: mmWave 80% + CSI 20% when both available
- Automatic fallback to CSI-only 32-byte packet when no mmWave
- Dual presence flag (Bit3 = mmwave_present)

main.c:
- mmwave_sensor_init() called at boot with auto-detect
- Status logged in startup banner

Fuzz stubs updated for mmwave_sensor API.
Build verified: QEMU mock build passes.

Co-Authored-By: claude-flow <ruv@ruv.net>
MR60BHA2: SOF=0x01 (not 0x5359), XOR+NOT checksums on header and
data, frame types 0x0A14 (BR), 0x0A15 (HR), 0x0A16 (distance),
0x0F09 (presence). Based on Seeed Arduino library research.

LD2410: 256000 baud (not 115200), 0xAA report head marker,
target state byte at offset 2 (after data_type + head_marker).

Auto-detect: probes MR60 at 115200 first, then LD2410 at 256000.
Sets final baud rate after detection.

Co-Authored-By: claude-flow <ruv@ruv.net>
Python script reads both serial ports simultaneously:
- COM4 (ESP32-C6 + MR60BHA2): parses ESPHome debug output for HR, BR, presence, distance
- COM7 (ESP32-S3): reads CSI edge processing frames

Kalman-style fusion: mmWave 80% + CSI 20% for vitals, OR gate for presence.

Verified on real hardware: mmWave HR=75bpm, BR=25/min at 52cm range,
CSI frames flowing concurrently. Both sensors live for 30 seconds.

Co-Authored-By: claude-flow <ruv@ruv.net>
25+ applications across 4 tiers from practical to exotic:
- Tier 1 (build now): zero-FP fall detection, sleep monitoring,
  occupancy HVAC, baby breathing, bathroom safety
- Tier 2 (research): gait analysis, stress detection, gesture
  control, respiratory screening, multi-room activity
- Tier 3 (frontier): cardiac arrhythmia, RF tomography, sign
  language, cognitive load, swarm sensing
- Tier 4 (exotic): emotion contagion, lucid dreaming, plant
  monitoring, pet behavior

Priority matrix with effort estimates. All P0-P1 items work with
existing hardware (ESP32-S3 + MR60BHA2 + BH1750).

Co-Authored-By: claude-flow <ruv@ruv.net>
mmwave_sensor stub returns ESP_ERR_NOT_FOUND which wasn't
defined in the minimal esp_stubs.h for host-based fuzz testing.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet changed the title docs: ADR-063 mmWave sensor fusion with WiFi CSI feat: ADR-063/064 mmWave sensor fusion + multimodal ambient intelligence Mar 15, 2026
@ruvnet ruvnet merged commit 66e2fa0 into main Mar 15, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant