csi-webserver
csi-webserver is a host-side HTTP and WebSocket server for ESP32 CSI collection.
It reads CSI frames from an ESP32 over USB serial and forwards them to:
- WebSocket clients (
/api/ws) - Session dump files (
csi_dump_YYYYMMDD_HHmmss.bin) - Or both at the same time
This crate is intended to be run as an executable service.
Install
Run
CLI options
csi-webserver [OPTIONS]
Options:
--interface <INTERFACE> Network interface to bind to [default: 0.0.0.0]
--port <PORT> TCP port to listen on [default: 3000]
--baud-rate <BAUD_RATE> UART baud rate to the ESP32 [env: CSI_BAUD_RATE]
[default: 115200]
-h, --help Print help
-V, --version Print version
Firmware requirement
Flash the ESP32 with esp-csi-cli-rs first:
Supported board families:
- ESP32
- ESP32-C3
- ESP32-C5
- ESP32-C6
- ESP32-S3
Quick start
# 1) Start the server
# 2) Verify the device is running esp-csi-cli-rs
# 3) Set log mode
# 4) Start an indefinite collection session
# 5) Read runtime status
# 6) Stop the collection
Pass {"duration": <secs>} to /api/control/start for a timed run.
Output modes
| Mode | WebSocket stream | Dump file |
|---|---|---|
stream (default) |
yes | no |
dump |
no | yes |
both |
yes | yes |
Switch at runtime with POST /api/config/output-mode.
Environment variables
| Variable | Default | Description |
|---|---|---|
CSI_SERIAL_PORT |
auto-detect | Override serial port path |
CSI_BAUD_RATE |
115200 |
Override serial baud rate (also --baud-rate) |
RUST_LOG |
csi_webserver=debug |
Tracing filter |
Full references
- HTTP API reference: https://github.com/csi-rs/csi-webserver-rs/blob/main/API.md
- Repository README: https://github.com/csi-rs/csi-webserver-rs/blob/main/README.md
- Generated Rust docs: https://docs.rs/csi-webserver
License
Apache-2.0.