This project implements a presence detection node for Home Assistant using the ESP32-C3 Super Mini and the HLK-LD2410S mmWave radar sensor. It is written in Rust using the esp-idf-svc framework.
- MCU: ESP32-C3 Super Mini (or generic ESP32-C3)
- Sensor: Hi-Link HLK-LD2410S (mmWave Radar)
- Rust Toolchain (Nightly required, configured in
rust-toolchain.toml) - ESP-IDF Prerequisites
- ESP-IDF Template (we follow the instructions from the template because we are NOT using 'no_std' environment)
- Configure Environment Variables:
Copy the example configuration and fill in your details (WiFi credentials, MQTT broker).
Edit
cp .env.example .env
.envwith your actual values:WIFI_SSID="YourWiFiName" WIFI_PASS="YourWiFiPassword" MQTT_USERNAME="mqtt_user" MQTT_PASSWORD="mqtt_password" MQTT_HOST="192.168.1.100" MQTT_PORT="1883"
-
Setup Environment (on startup of the project): We need to setup the linker to compile for the right env You need to run this for every time you start the project.
make init
-
Build the project: This will compile the ESP-IDF framework and the application. The first run will take significantly longer as it builds the entire framework.
make build
-
Flash and Monitor: Connect your ESP32-C3 via USB and run:
make dev
This command will build, flash the firmware to the device, and open the serial monitor to see the logs.