← All guides

Secure V2 · SDK 0.3.0

Send your first Secure V2 reading

Updated October 11, 2026 · verified against repository implementation

From a new workspace to stored telemetry, with ESP32 hardware or a Node.js computer.

1. Account and device

Create an account and verify your email if requested. Sign in to Overview, then open Devices → Add device. A device represents one independent sender and has a private Secure V2 credential. New customer devices are enrolled automatically; an unavailable rollout produces an explicit error rather than falling back to an older protocol.

An owner or admin can create devices. Viewers can inspect data. If device capacity is reached, review usage and Billing before adding more.

2. Schema and example

Open Schema for your device. Start with the environmental example: temperature −40..125°C in 0.1°C steps, humidity 0..100% in 0.1% steps, and active boolean. These declared fixed-point ranges trade precision for size; humidity 61.25 becomes 61.3. Choose Float32/Float64 instead when the declared floating format is required.

Publish an unused schema slot. Slots 0..15 are immutable: changing a layout requires another slot and newly generated firmware. The dashboard reports payload and secure frame sizes separately.

3. Choose a platform and download

In Schema → Download your starter project, choose ESP32 / PlatformIO or Node.js / local computer. No physical hardware is required for Node. Select the published slot and download the private ZIP. Keep the entire extracted directory.

ESP32 projects include platformio.ini, src/main.cpp, include/struct_config.h, include/struct_packet.h, schema.json, and pinned SDK source in lib/Struct. Node projects include send.cjs, sample.json, schema.json, private-config.json, and the actual SDK/encoder in sdk/. No snippets need to be assembled manually.

One credential must have one sender and one counter owner. Create a separate device for a laptop and a physical board. Never flash the same private project to multiple boards.

4. ESP32: configure, build and upload

Install VS Code and the PlatformIO IDE extension. Open the extracted project folder. Edit only WIFI_SSID and WIFI_PASSWORD in include/struct_config.h; the device wire ID, secret and bootstrap token are already filled in. Select the actual board model. Keep private configuration out of Git.

Connect the board with a data-capable USB cable. Open the PlatformIO terminal, identify the serial port, build, upload, then open the serial monitor. Replace COM3 below with your port (for example /dev/ttyUSB0). Close other serial monitors before uploading. Some boards require holding BOOT during upload.

First provisioning needs Wi-Fi, time synchronization for certificate validation, and authenticated HTTPS. Telemetry uses ingest.usestruct.com UDP 8081, already configured by the SDK. You do not configure Supabase, gateway servers or internal master keys. Modify the sample assignments in src/main.cpp after the first reading works.

pio device list
pio run
pio run -t upload --upload-port COM3
pio device monitor --baud 115200 --port COM3

5. Node.js: send without hardware

Install Node.js 22 or newer, extract the Node starter, and run the commands below from that directory. No npm packages are required. Edit sample.json to change values without altering the schema. The computer must reach HTTPS provisioning and UDP ingestion.

Expected output includes status committed after an authenticated receipt; unknown means storage could not be established from the receipt. Counter files must survive restarts. After counter-state loss, rotate the credential and export a replacement starter; never reset the sequence manually.

node --version
node send.cjs

6. Verify the stored reading

Open Overview and select this device. Latest stored event shows decoded JSON and its timestamp; the chart appears for numeric readings. Confirmed ESP32 result 3 or Node status committed proves authenticated database acceptance. Result 2 / sent means only the local send completed. Result 4 / unknown can mean the receipt was lost even if storage succeeded.

Getting Started is completed by committed telemetry for the workspace and does not reappear after retention deletes history. Downloads are recorded separately; configuration is a manual acknowledgment, not proof that firmware was uploaded. Use Getting Started in the sidebar to revisit the guide.

A database receipt does not prove webhook delivery. Inspect Deliveries for downstream outcomes. If no data appears, open Troubleshooting and Diagnostics for the same device.

Open device setup · Contact support