RuView icon indicating copy to clipboard operation
RuView copied to clipboard

Using two ESP32-S3 modules, real-time human detection and blinking

Open QuHuiWan opened this issue 8 months ago • 14 comments

https://github.com/user-attachments/assets/0d091e57-c1fb-4eef-885c-1779981a83df As shown in the video, I used two ESP32-S3 modules, but the real-time human body detection flickers

QuHuiWan avatar Mar 05 '26 08:03 QuHuiWan

I configured two modules and obtained RSSI and AMP data through a serial port tool

python firmware/esp32-csi-node/provision.py --port COM15 --ssid "TP-LINK_D05A" --password "88888888" --target-ip 192.168.1.100 --target-port 5005 --tdm-slot 0 --tdm-total 2

QuHuiWan avatar Mar 05 '26 08:03 QuHuiWan

i have same issue. i put 4 esp32, they work correctly, but i have flicker

i tried training section to record csi and train but it doesnt do anything. it doesnt start training

executionreverted avatar Mar 05 '26 09:03 executionreverted

我也有同样的问题。我插了4个ESP32,它们都能正常工作,但是屏幕会闪烁。

我尝试在训练部分录制 CSI 并进行训练,但没有任何反应,训练根本没有开始。 请问人的数量是正确的吗

xiaoji525 avatar Mar 05 '26 09:03 xiaoji525

I encountered the same problem using three ESP32-S3 chips; the character skeletons were jumping around erratically and were completely unstable, making me even suspect that these character skeletons were virtual data.

Image

https://github.com/user-attachments/assets/334192d2-999e-4109-bc53-3da8863782fa

shushu789 avatar Mar 05 '26 10:03 shushu789

How did you calibrate your esp32s and what settings are you using? Please share them. Sounds like you didn’t do any room specific calibration.

ruvnet avatar Mar 05 '26 13:03 ruvnet

Thanks for reporting this, and thanks to everyone sharing their experiences. The flickering/jumping you're seeing is expected behavior before room-specific calibration — here's why and how to fix it.

Why It Flickers

ESP32 CSI signals are extremely environment-dependent. Raw CSI amplitude varies with:

  • Room geometry, furniture, wall materials
  • ESP32 placement (height, orientation, distance between nodes)
  • WiFi channel noise, interference from other APs
  • Frame-to-frame jitter inherent in ~10 FPS CSI sampling

The default threshold-based classifier uses static values that work for a "generic room" but will produce noisy, unstable classifications in your specific environment. This is what causes the skeleton to jump between states.

How to Fix: Adaptive Classifier (ADR-048)

We recently merged the Adaptive CSI Activity Classifier (PR #139) which addresses exactly this problem with a 3-stage smoothing pipeline:

Step 1: Record Training Data

Record ~30 seconds of each activity state in your room:

# Empty room (leave the room!)
curl -X POST http://localhost:3000/api/v1/recording/start -H 'Content-Type: application/json' -d '{"id":"train_empty_room"}'
# Wait 30s, then:
curl -X POST http://localhost:3000/api/v1/recording/stop

# Standing still in the room
curl -X POST http://localhost:3000/api/v1/recording/start -H 'Content-Type: application/json' -d '{"id":"train_still_presence"}'
# Wait 30s, then:
curl -X POST http://localhost:3000/api/v1/recording/stop

# Walking around
curl -X POST http://localhost:3000/api/v1/recording/start -H 'Content-Type: application/json' -d '{"id":"train_walking"}'
# Wait 30s, then:
curl -X POST http://localhost:3000/api/v1/recording/stop

# Active movement (waving arms, exercising)
curl -X POST http://localhost:3000/api/v1/recording/start -H 'Content-Type: application/json' -d '{"id":"train_active_movement"}'
# Wait 30s, then:
curl -X POST http://localhost:3000/api/v1/recording/stop

Step 2: Train the Classifier

curl -X POST http://localhost:3000/api/v1/adaptive/train

This trains a multiclass logistic regression on 15 features extracted from your room's specific CSI patterns. Training takes <1 second for 3,000+ frames.

Step 3: Verify

curl http://localhost:3000/api/v1/adaptive/status

You should see per-class accuracy and the model will auto-load on server restart.

Multi-ESP32 Setup Tips

For 2-4 node setups:

  1. Stagger TDM slots — make sure each ESP32 has a unique --tdm-slot (0, 1, 2, 3) with --tdm-total matching the count
  2. Consistent placement — keep nodes at the same height (~1.2m recommended), spaced around the room perimeter
  3. Same WiFi channel — all nodes should connect to the same AP on the same channel
  4. Re-train after moving — if you move any ESP32, re-record and re-train

Re: Training Not Starting (@executionreverted)

The training endpoint requires recordings with filenames matching train_* pattern. Make sure:

  1. The recording ID starts with train_ (e.g., train_empty, train_still, train_walking, train_active)
  2. You have at least 2 different activity classes recorded
  3. The recordings are in data/recordings/ directory
  4. Check server logs for errors: the training endpoint returns a JSON response with accuracy metrics or error details

If training still doesn't start, please share the server log output and the response from the /api/v1/adaptive/train endpoint.

Built-in Smoothing

Even without adaptive training, the latest version includes:

  • Adaptive baseline subtraction (EMA α=0.003, ~30s time constant)
  • Hysteresis debounce (4 consecutive frames needed to change state)
  • Vital signs smoothing (21-frame median + trimmed mean + dead-band filtering)

Make sure you're on the latest main branch to get these improvements.

ruvnet avatar Mar 05 '26 16:03 ruvnet

I indeed haven't calibrated it. I will attempt to calibrate it using the steps you provided and then provide feedback

QuHuiWan avatar Mar 06 '26 00:03 QuHuiWan

Additionally, do I need a clean room? Can I place items such as tables and vases in it

QuHuiWan avatar Mar 06 '26 00:03 QuHuiWan

Is this project written by Claude AI?

1xhh1 avatar Mar 06 '26 03:03 1xhh1

Hey @ruvnet could you confirm that it is possible to really have a stable train set to see a decent render?

dlopez-create avatar Mar 06 '26 19:03 dlopez-create

You'll need to calibrate this based on your environment. I've only optimized it for me.

This is just a random project, not a job or primary focus for me.

ruvnet avatar Mar 06 '26 20:03 ruvnet

⚠️ 欺诈警报:技术审计显示该项目是一个无效的人工智能生成假象,使用假 CSI 数据,没有训练模型,且怀疑存在星象膨胀 https://github.com/deletexiumu/wifi-densepose

hzcoolwind avatar Mar 07 '26 02:03 hzcoolwind

ImageIt's been stuck in the running state for over half an hour.

ba-mao avatar Mar 07 '26 07:03 ba-mao

What esp32-s3 modules are people using? big dev-kits, small standalone, battery-powered?

tOMC5188 avatar Mar 17 '26 15:03 tOMC5188