mirror of
https://github.com/ruvnet/RuView
synced 2026-06-09 10:13:17 +00:00
a4bd2308b7
Hardware-validated pipeline connecting ESP32-S3 CSI sensing to Cognitum Seed (Pi Zero 2 W) edge intelligence appliance via 8-dim feature vectors. Firmware: - New 48-byte feature vector packet (magic 0xC5110003) at 1 Hz with normalized presence, motion, breathing, heart rate, phase variance, person count, fall detection, and RSSI - Compressed frame magic reassigned 0xC5110003 → 0xC5110005 - Guard against uninitialized s_top_k read when count=0 Bridge (scripts/seed_csi_bridge.py): - UDP→HTTPS ingest with bearer token, hash-based vector IDs - --validate (kNN), --stats, --compact, --allowed-sources modes - NaN/inf rejection, retry logic, SEED_TOKEN env var support Validated on live hardware: - 941 vectors ingested, 100% kNN exact match - Witness chain SHA-256 verified (1,325 entries) - 1,463 Rust tests passed, Python proof VERDICT: PASS Research: 26 docs covering Arena Physica, Maxwell's equations in WiFi sensing, SOTA survey 2025-2026, GOAP implementation plan Security: removed hardcoded credentials, added NVS patterns to .gitignore, source IP filtering, NaN validation Co-Authored-By: claude-flow <ruv@ruv.net>
61 lines
1.8 KiB
Bash
61 lines
1.8 KiB
Bash
#!/bin/bash
|
|
# ESP32 Swarm Provisioning — ADR-065/066
|
|
#
|
|
# Provisions multiple ESP32-S3 nodes for a hotel happiness sensing deployment.
|
|
# Each node gets WiFi credentials, a unique node_id, zone name, and Seed token.
|
|
#
|
|
# Prerequisites:
|
|
# - ESP-IDF Python venv with esptool and nvs_partition_gen
|
|
# - Firmware already flashed to each ESP32
|
|
# - Seed paired (obtain token via: curl -X POST http://169.254.42.1/api/v1/pair)
|
|
#
|
|
# Usage:
|
|
# bash provision_swarm.sh
|
|
|
|
set -euo pipefail
|
|
|
|
# ---- Configuration ----
|
|
SSID="${SWARM_WIFI_SSID:?Set SWARM_WIFI_SSID env var}"
|
|
PASSWORD="${SWARM_WIFI_PASSWORD:?Set SWARM_WIFI_PASSWORD env var}"
|
|
SEED_URL="${SWARM_SEED_URL:?Set SWARM_SEED_URL env var}"
|
|
SEED_TOKEN="${SWARM_SEED_TOKEN:?Set SWARM_SEED_TOKEN env var}"
|
|
|
|
PROVISION="../../firmware/esp32-csi-node/provision.py"
|
|
|
|
# ---- Node definitions: PORT NODE_ID ZONE ----
|
|
NODES=(
|
|
"COM5 1 lobby"
|
|
"COM6 2 hallway"
|
|
"COM8 3 restaurant"
|
|
"COM9 4 pool"
|
|
"COM10 5 conference"
|
|
)
|
|
|
|
echo "========================================"
|
|
echo " ESP32 Swarm Provisioning"
|
|
echo " Seed: $SEED_URL"
|
|
echo " WiFi: $SSID"
|
|
echo " Nodes: ${#NODES[@]}"
|
|
echo "========================================"
|
|
echo
|
|
|
|
for entry in "${NODES[@]}"; do
|
|
read -r port node_id zone <<< "$entry"
|
|
echo "--- Node $node_id: $zone ($port) ---"
|
|
python "$PROVISION" \
|
|
--port "$port" \
|
|
--ssid "$SSID" \
|
|
--password "$PASSWORD" \
|
|
--node-id "$node_id" \
|
|
--seed-url "$SEED_URL" \
|
|
--seed-token "$SEED_TOKEN" \
|
|
--zone "$zone" \
|
|
&& echo " OK" || echo " FAILED (device not connected?)"
|
|
echo
|
|
done
|
|
|
|
echo "========================================"
|
|
echo " Provisioning complete."
|
|
echo " Monitor with: python seed_query.py monitor --seed $SEED_URL --token $SEED_TOKEN"
|
|
echo "========================================"
|