ESP32 and Arduino sensor
Send ESP32 sensor readings over HTTPS with the Arduino example.
On this page
What you need
An ESP32, Arduino-ESP32 Core 3.x, Wi-Fi, a MetriBeacon series and a device key.
How to do it
- Create a Gauge series using count for the raw example. Copy secrets.example.h to a private secrets.h and set Wi-Fi, key, series ID, NTP and sensor pin.
- Compile for your actual board. The classic ESP32 example uses GPIO 34 and a five-minute interval; adapt these to your hardware.
- Wait for clock synchronisation and check the serial status and first reading in the dashboard.
Good to know
The example stores one pending batch across restarts and retries the same content. It verifies TLS with its supplied CA certificate. Calibrate and convert raw counts before using physical units.
If something goes wrong
Check NTP, Wi-Fi and certificate trust if sending fails. Do not disable TLS verification or publish secrets.h or credential-bearing firmware. After an outage beyond 24 hours, review the outdated pending batch.
Related guides
- Sensors and home automation
Connect home automation and sensors for temperature, energy or other readings.
- Local MQTT bridge
Forward selected topics from your own MQTT broker to numerical series over HTTPS.
- Send your own monitoring data
Send your own readings over HTTPS using the IDs and keys of your monitor.