- Remove duplicate type declarations from session.go (Space, Wall,
wallAttenuationDB, Vector3, Walker, WalkerType) — space.go and
walker.go contain the newer, more complete versions
- Update session.go to use new type names: WalkerTypeRandomWalk,
WalkerTypePathFollow, WalkerTypeNodeToNode; use Space.Bounds()
instead of .Width/.Depth; use Point instead of Vector3
- Merge ShoppingList structs: remove duplicate from gdop.go, add
OptimalPositions []Point to the canonical struct in accuracy.go
- Fix unused variables: minZ/maxZ (accuracy.go), z (accuracy.go),
nodeType (node.go), maxZ (walker.go), noise (propagation.go),
lastHealthTime and angle (cmd/sim/main.go), id (virtual_state.go)
- Fix BoundingBox field capitalization in virtual_state.go
- Fix virtualMAC to hash string nodeID to uint32 before bit-shifting
- Fix mrand alias usage in propagation.go (rand -> mrand)
- Fix PhaseAtSubcarrier capitalization in physics.go
- Fix WalkerTypePath/WalkerTypeRandom references in engine.go/handler.go
- Rename Walker to SimWalker in cmd/sim/walker.go to avoid conflict
with main.go's local Walker type
- Remove 3 duplicate OUI map keys (0x0001C8, 0x080030 ×2)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implemented mothership/cmd/sim with full CSI simulation capabilities:
- Virtual nodes connect via WebSocket with hello/health/role protocol
- Synthetic CSI binary frame generation with proper header format
- Walker simulation with random walk motion and wall bouncing
- BLE advertisement simulation (optional)
- Blob count verification mode for CI integration
- CSV ground truth export for offline analysis
- Comprehensive test coverage
The simulator enables integration testing without ESP32 hardware:
sim --mothership localhost:8080 --nodes 4 --walkers 2 --rate 20 --duration 60
sim --verify --nodes 2 --walkers 1 --duration 10 --seed 42
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements a complete CSI simulator CLI that connects to the mothership
as virtual nodes and streams synthetic CSI frames for automated
integration testing without ESP32 hardware.
CLI Implementation (mothership/cmd/sim/):
- main.go: CLI entry point with all required flags (--mothership, --nodes,
--walkers, --rate, --duration, --seed, --space, --ble, --verify,
--noise-sigma, --wall, --output-csv)
- generator.go: synthetic CSI frame generation with proper binary format
- walker.go: random walk and path-following simulation
- verify.go: blob count verification with exit code reporting
Features:
- Virtual nodes connect via WebSocket with hello/health/BLE messages
- Synthetic CSI frames match Phase 1 protocol (24-byte header + I/Q payload)
- Configurable noise sigma for I/Q generation
- Wall definitions affecting path loss model
- CSV ground truth output for offline analysis
- Seed-based reproducibility for testing
- Verification mode for CI smoke testing
Physics Model (mothership/internal/simulator/):
- propagation.go: two-ray model (direct + reflection) with wall attenuation
- physics.go: path loss, RSSI computation, Fresnel zone calculations
- Reusable package shared with pre-deployment simulator
Tests:
- Binary header format validation (magic, version, fields in correct positions)
- RSSI range validation for given distances
- I/Q clamping to int8 range [-127, 127]
- Hello message format validation
- Verification mode blob detection
- Seed reproducibility for identical walker paths
- CSV output format validation
- Wall parsing validation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implemented Go CLI tool for virtual node generation and synthetic CSI
binary frame output. Key features:
- Virtual nodes positioned at space corners/edges with mixed heights
- Synthetic CSI frames with Fresnel zone modulation and path loss
- Random walk simulation for person movement
- WebSocket connections to mothership with hello/health/BLE messages
- Authentication token support (X-Spaxel-Token header)
- Configurable space dimensions, node count, walkers, rate, and duration
- Infinite run mode (--duration 0) for manual testing
- Comprehensive test coverage for frame structure, RSSI calculation,
Fresnel modulation, and walker position updates
- Makefile with build targets for multiple platforms
- Full documentation in README.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AnomalyDetector initialized in main() with periodic model updates.
Anomaly events broadcast to dashboard WS as 'alert' messages via
BroadcastAlert. GET /api/anomalies?since=24h lists recent events.
POST /api/security/arm and /api/security/disarm manage security mode.
GET /api/security/status returns armed state, learning progress, and
24h anomaly count. Arm/disarm state persisted to learning_state table
and restored on restart.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Firmware (already implemented):
- ntp.c: Call esp_sntp_setservername() before esp_sntp_init()
- ntp.c: 10-minute periodic resync via esp_timer
- main.c: Read ntp_server from NVS (default: pool.ntp.org)
- main.c: 10-second sync attempt after WiFi connect with WARN on failure
- websocket.c: Include ntp_synced status in health JSON
Mothership (added):
- message.go: Add NTPSynced field to HealthMessage struct
- message.go: Add NTPServer field to ConfigMessage struct
- server.go: Add SendNTPServerToMAC() method for runtime NTP config
- server.go: Update sendConfig() to accept NTP server parameter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements a comprehensive e2e test system that:
- Starts mothership container/binary
- Waits for /healthz with 15s timeout
- Handles PIN auth setup if needed
- Runs CSI simulator against mothership
- Asserts during run (health, nodes online, blob detection)
- Validates frame rate doesn't drop >20%
- Asserts detection events recorded
Components added:
- mothership/cmd/sim: CSI simulator that generates synthetic frames
- mothership/tests/e2e: Go test suite with WebSocket assertions
- tests/e2e/run.sh: Shell script with comprehensive assertions
- .github/workflows/e2e.yml: CI workflow for automated testing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>