spaxel/cmd/sim/go.mod
jedarden b34892edfc simulator: implement spaxel-sim CLI tool
Implemented the CSI simulator CLI tool for testing Spaxel without
hardware. The simulator connects to a running mothership via WebSocket
and streams synthetic CSI binary frames.

Features:
- Virtual nodes positioned at corners, evenly distributed
- Walker random walk with Gaussian velocity updates (σ=0.3 m/s per axis per 50ms)
- Synthetic CSI generation using propagation model (path-loss + Fresnel zones)
- Binary frame format matching ingestion/frame.go (24-byte header + n_sub*2 payload)
- RSSI calculation: clamp(-30 - path_loss_dB, -90, -30)
- BLE advertisement simulation every 5s when --ble flag is set
- Reject detection: exits non-zero on {type:'reject'} from mothership
- Per-second stats: frame counts and blob count (from GET /api/blobs poll)

CLI Interface:
  spaxel-sim --mothership ws://localhost:8080/ws/node --token <token> \
             --nodes 4 --walkers 1 --rate 20 --duration 60s --ble \
             --seed 42 --space '6x5x2.5'

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-06 00:17:42 -04:00

5 lines
85 B
Modula-2

module github.com/spaxel/sim
go 1.25.0
require github.com/gorilla/websocket v1.5.3