How libremelon/csi_stress_detector works
This repository estimates heart rate from Wi-Fi CSI and pairs CSI samples with Galaxy Watch readings for supervised training. The main workflow is ESP-NOW transmission, CSI capture over serial, host-side parsing and signal shaping, then either labeled-data collection or prediction with a trained LSTM. Watch telemetry is received and logged separately, and train.py builds a model from the collected files. The menu and firmware setup are documented but not mapped as product components. Firmware excerpts show CSI output and transmission; host links beyond shown behavior are limited to README documentation.
Main entry points: read_and_process_csi.py CSI parser and processor · app_main.c CSI receiver · watch_hr.py Watch HR receiver · train.py LSTM trainer
Components 12
ESP32 telemetry
- CSI transmitter
csi_send/main/app_main.c - CSI receiver
csi_recv/main/app_main.c
Host CSI processing
- CSI parser and processor
read_and_process_csi.py - Live HR estimate
read_and_process_csi.py
Heart-rate reference
- Watch HR receiver
watch/watch_hr.py - HR log
Model lifecycle
- Labeled training data
- LSTM trainer
train.py - Saved HR model
Other components
- Operator
- USB serial
- Galaxy Watch app
Connections 15
- Operator → CSI transmitter: runs firmware
README.md - Operator → CSI receiver: runs firmware
README.md - CSI transmitter → CSI receiver: sends ESP-NOW
README.md - CSI receiver → USB serial: prints CSI
csi_recv/main/app_main.c - USB serial → CSI parser and processor: streams CSI
README.md - Galaxy Watch app → Watch HR receiver: sends HR
README.md - Watch HR receiver → HR log: logs readings
watch/watch_hr.py - Operator → Watch HR receiver: starts receiver
watch/watch_hr.py - CSI parser and processor → HR log: reads latest BPM
read_and_process_csi.py - CSI parser and processor → Labeled training data: writes paired samples
read_and_process_csi.py - Operator → LSTM trainer: starts training
README.md - Labeled training data → LSTM trainer: loads data
train.py - LSTM trainer → Saved HR model: saves model
train.py - CSI parser and processor → Live HR estimate: predicts live HR
read_and_process_csi.py - Saved HR model → CSI parser and processor: loads for inference