📄️ Step 1: Register the device
Create a device on the RelayX console to get the credentials the firmware and dashboard need.
📄️ Step 2: Wire the hardware
Connect the ESP32, INA219 current sensor, and mechanical relay on a breadboard.
📄️ Step 3: Scaffold the firmware
Create the ESP-IDF project, add the RelayX Device SDK dependency, and define the shared config header.
📄️ Step 4: Connect to RelayX
Bring up WiFi, create the RelayDevice, and wait for the connection to establish.
📄️ Step 5: Publish telemetry
Read the INA219 on a loop and publish current, voltage, and power as RelayX telemetry.
📄️ Step 6: Handle the state RPC
Register an RPC handler that toggles the relay when the dashboard calls it.
📄️ Step 7: Handle the sample-rate RPC
Add a second RPC handler that retunes the telemetry sample rate at runtime, without reflashing.