ESP32 WiFi Radar: A Complete Build Guide
A step-by-step technical guide to flashing ESP32-S3 boards, streaming CSI data over UDP, and configuring the RuView Rust processing engine.
Overview of the DIY WiFi Sensing Architecture
Building your own WiFi radar system might sound like a highly complex engineering task, but with the open-source tools provided by RuView and the affordability of ESP32 hardware, you can have a working system running in under an hour.
The system architecture consists of three main layers:
- **Sensor Nodes (ESP32-S3)**: Microcontrollers flashed with custom firmware that captures raw Channel State Information (CSI) packets and streams them over your local network.
- **Edge Gateway (Rust Engine)**: A central computer (like a Raspberry Pi or Mini PC) running the RuView engine, which denoises, compiles, and performs AI inference on the raw CSI streams.
- **Client Applications**: Visual dashboards, smart home automations (Home Assistant), or cloud integrations that react to occupancy and vital sign events.
In this build guide, we will walk you through the step-by-step process of setting up your hardware nodes, compiling the firmware, and configuring the Rust gateway.
Step 1: Gathering and Preparing the Hardware
Before you begin, you will need to acquire the necessary hardware components. We recommend using two **ESP32-S3 DevKitC** boards. One board will act as the transmitter (TX) and the other as the receiver (RX).
While it is possible to use an existing home Wi-Fi router as the transmitter, using a dedicated ESP32 node as the TX gives you complete control over the packet rate, channel configuration, and transmission power, resulting in a much more stable signal.
If you are not sure which ESP32 variant to buy, read our hardware analysis on Best ESP32 Boards for CSI Projects or refer directly to the Hardware Section.
Step 2: Flashing the ESP32 CSI Firmware
To capture raw CSI, we must flash the ESP32 nodes with the RuView CSI firmware. The firmware is built using Espressif's ESP-IDF development framework.
1. **Set Up the Toolchain**: Install the ESP-IDF toolchain on your computer. Detailed instructions are available in the Espressif documentation, but for most systems, running the installer script is sufficient:
./install.sh esp32s3
2. **Clone the RuView Firmware**: Clone the repository and navigate to the firmware folder:
cd RuView/firmware
3. **Configure and Build**: Run the configuration tool to enter your Wi-Fi credentials and select the target channel (e.g. channel 6, 20 MHz). Then build and flash:
idf.py menuconfig
idf.py build flash monitor
Once flashed, the receiver node will boot, connect to the transmitter, and begin outputting CSI streams.
Step 3: Setting Up the RuView Rust Processing Engine
The receiver node streams raw CSI packets over UDP to your local edge gateway. To process this data, we must build and run the RuView Rust engine on the gateway.
1. **Install Rust**: If you do not have Rust installed, run the official installer:
2. **Build the Engine**: Navigate to the engine directory and compile the binary in release mode for optimal performance:
cargo build --release
3. **Run the Engine**: Start the server, specifying the UDP port configured in the firmware (default is 8082):
The Rust engine will start, bind to the UDP port, and begin processing the CSI time-series packets. It will perform noise filtering, PCA dimensionality reduction, and execute neural network inference.
To understand the math behind the PCA and Butterworth filters used in the engine, see How WiFi CSI Works.
Step 4: Visualizing and Integrating the Data
With the Rust engine running, human detection events are streamed over local WebSockets. Open the RuView dashboard web app in your browser to view the real-time CSI amplitude heatmaps and motion classification timelines.
If you want to integrate this with Home Assistant, configure the engine's `config.toml` file with your MQTT broker credentials. The engine will automatically register home automation binary sensors for each room, allowing you to trigger lights or alarms based on human occupancy.
For a list of what features and classes the AI model can identify, visit the Features Page. If you run into issues, consult the FAQ Page or get in Contact.
FAQ
What should I do if the ESP32 is dropping packets?
Ensure you are using a high-quality USB-C cable for power and serial data. If streaming over Wi-Fi, place the nodes closer to your network access point or reduce the packet rate in the firmware configuration.
Can I run the Rust engine on Windows?
Yes. Rust compiles natively on Windows, macOS, and Linux. Ensure you allow the executable through the Windows Defender Firewall to receive UDP packets.
How do I update the AI models?
You can download updated model files (.onnx format) from the RuView website and place them in the /models directory. The Rust engine will automatically reload them on startup.
Explore RuView on GitHub
Browse the Rust engine, ESP32 firmware and examples.