Part 1: Telemetry and RPCs
This part builds the foundation of the series. An ESP32 publishes current, voltage, and power to RelayX. A React dashboard displays the readings live and controls the device's relay over the internet through two RPC endpoints.
Part 1 is organized into two parallel tracks:
- Device, seven steps that register the device and build the firmware: register the device to get credentials, wire the hardware, scaffold the project, connect to RelayX, publish telemetry, handle the state RPC, handle the sample-rate RPC.
- Dashboard, seven steps that register the app and build the React dashboard: register the app to get credentials, scaffold the project, connect to RelayX, render telemetry, control the relay, retune the sample rate, assemble the final view.
Work through the Device track first to the point where the device is publishing telemetry. Then switch to the Dashboard track. Steps that close an end-to-end loop end with a Test it section.
Prerequisites
- An ESP32 dev board (WROOM-32D or similar)
- An INA219 current sensor breakout
- A mechanical relay module (active-LOW)
- A switchable load (a lightbulb, a small DC motor, or a USB fan)
- A RelayX account with an API key and secret (sign up)
- A device registered on the RelayX console with the ident
current-sensor - ESP-IDF v5 or later installed
- Node.js 18 or later