TECHNICAL NOTEBOOK / DATA
A graph starts with a verifiable point.
The Quiet Bee project uses a XIAO ESP32-C3, an HTTPS gateway, InfluxDB 3 and a dashboard. Here is how to check the boundaries between these components.
1. Define the chain and responsibilities
The board prepares the message. Wi-Fi provides network access. The HTTPS server authenticates and limits writes. InfluxDB stores points. A read API selects the data useful for graphs. The browser never needs to know the database administrator token.
On the project's VPS, InfluxDB listens locally and the IoT subdomain's write route is managed server-side. This architecture avoids exposing the database port directly. This tutorial does not authorise writes to that installation: create a database, domain and key for your own project.
2. Define an unambiguous message
Start with a diagnostic point, then add a real measurement after validating the sensor. Here is a fictitious test message in line protocol format, without an explicit timestamp:
diagnostic,device=atelier01 wifi_rssi=-65i,uptime_s=120idiagnostic is the measurement name; device is a tag used to select the source; wifi_rssi and uptime_s are integer fields thanks to the i suffix. The server assigns reception time if you do not send a timestamp. This time does not necessarily match acquisition, especially after a network outage.
For delayed sensor data, keep acquisition time and clock quality separately. Define units in field names or the data schema. Do not put a unique sequence in a tag: tags are useful for stable dimensions, not every detail of a sample.
3. Check HTTPS before completing the firmware
On a destination you control, configure a write route, a size limit and a restricted key. Inject the key through private configuration; do not put it in a web page, public repository or screenshot. Rotate it if exposed.
POST /api/esp32/write HTTP/1.1
Host: votre-domaine.example
Authorization: Bearer CLE_DE_VOTRE_PROJET
Content-Type: text/plain
diagnostic,device=atelier01 wifi_rssi=-65i,uptime_s=120iThis block describes a request, not a ready-to-use server. The gateway contract must fix the database and timestamp precision; an ESP32 must not be able to choose an arbitrary database. Status 204 is the expected result for the project's route, while other APIs may use a different contract.
4. Prepare Arduino transmission without weakening TLS
On the ESP32, establish Wi-Fi with a timeout, synchronise the clock and configure the certificate trust chain before sending. Do not use setInsecure() as a permanent fix for a TLS error. The root certificate, DNS name, time and server chain must be consistent.
The program must bound connection and read times, close the session, then wait before retrying. Do not loop immediately on a 401 error: it requires a key correction. For network errors, retrying with increasing delays limits load and energy use.
The complete reference project sources are still presented in the existing XIAO ESP32-C3 learning path. Check board and library versions before adapting its firmware; this text does not claim to provide a universal program compatible with every ESP32 board.
5. Read the point back in InfluxDB 3
An accepted write must be read back from the target database. From an authorised client, a bounded SQL query lets you inspect the diagnostic. The example below contains no secrets and requires a table with data:
SELECT time, device, wifi_rssi, uptime_s
FROM diagnostic
WHERE time >= now() - INTERVAL '1 hour'
AND device = 'atelier01'
ORDER BY time DESC
LIMIT 20;Check the source name, units and date ordering. InfluxDB 3 supports SQL; do not reuse a Flux procedure written for InfluxDB 2 without checking compatibility. Consult your edition's limits to choose suitable query windows and retention.
6. Diagnose at the correct level
| Result | Diagnostic lead |
|---|---|
| No Wi-Fi address | 2.4 GHz network, credentials, signal and connection timeout. |
| TLS failure before HTTP | Clock, root authority, DNS and certificate chain. |
| 401 / 403 | Missing or expired key, or insufficient permissions; do not show the key in logs. |
| 400 | Message syntax, field types, timestamp and precision. |
| 413 / 429 | Excessive size or frequency; reduce the batch and add a delay. |
| 204, then no visible point | Target database/table, time filter, identifier and read permissions. |
| Graph frozen despite new points | Read API response, time zone, cache and JavaScript errors. |
7. Move from the demonstration to the sensor
A public graph must state where its values come from. Replace the simulation only after independently checking the probe. For an invalid value, keep an error state or missing point instead of generating a reasonable temperature. Distinguish transmission interruption from physical change.
Accuracy also depends on the shelter, radiation, response time and sensor placement. Before environmental interpretation, record installation conditions and compare the data with a suitable reference. The platform transmits numbers; it does not, on its own, validate measurement quality.
Sources and references
The schematics for your hardware reference and the documentation for your software version take precedence over a generic example.