Skip to content

Device Provisioning

The full picture on creating devices and sensors, registering credentials, and what’s actually happening on the wire when a device connects. If you just want the fastest path from zero to a working device, see Getting Started — this guide goes deeper.

From a project, go to Devices → New Device and give it a name. Then choose:

  • Single sensor — the device itself acts as one sensor. You pick its sensor type and data direction right here.
  • Multiple sensors — the device is just a container; sensors get added separately afterward (see below).

Sensor type and data direction are set once and can’t be changed later — this is deliberate, not a current limitation. A sensor’s identity is fixed at creation so that history and automations built against it stay meaningful.

  • Telemetry — continuous numeric readings: temperature, humidity, voltage, CO₂, and similar.
  • Binary — discrete on/off state: a relay, a door open/closed, a valve, motion detected.
  • State — a multi-value state machine: HVAC mode (heating/cooling/idle), a machine cycle, anything with more than two meaningful values.
  • Send — the device sends data to the platform. Use this for read-only sensors like a temperature probe.
  • Receive — the device receives commands from the platform. Use this for platform-controlled actuators.
  • Exchange — the device both reports its state and can receive commands — a smart relay or valve that can also be triggered by an automation.

Telemetry sensors are always Send — a continuous reading has no meaningful “command” to receive, so Receive and Exchange aren’t offered for that type. Binary and State sensors can be any of the three.

On a multi-sensor device’s page, Add Sensor opens the same Name / Type / Data Direction choices as above, one sensor at a time.

Your device code refers to the account, project, device and sensor by their keys, which are generated when you create them.

  • Account, project and device: the device’s page has a Connection strip with the device path and an SDK config copy button.
  • Sensor: a single-sensor device’s sensor is always default. On a multi-sensor device, the key is short and generated from the name, so “Temperature” gets a key like tempe. It’s shown on the sensor’s page and in the device’s sensor list.

Use the key exactly as shown. A reading sent with a key that doesn’t match a sensor won’t appear on any sensor’s page.

Devices authenticate with an EC (P-256) key pair. Only the public key is ever registered with Espoirnet — your private key should never leave the device.

Generate a key pair with OpenSSL:

Terminal window
openssl ecparam -name prime256v1 -genkey -noout | openssl pkcs8 -topk8 -nocrypt -out private.pem
openssl ec -in private.pem -pubout -out public.pem

On the device’s page, open Register Key and paste in public.pem.

The private key is in PKCS#8 format (-----BEGIN PRIVATE KEY-----), which the Node.js SDK and Test Authentication both require. If you already have a key that starts -----BEGIN EC PRIVATE KEY-----, convert it with openssl pkcs8 -topk8 -nocrypt -in key.pem -out private.pem.

On a microcontroller: the Embedded C SDK generates the key on the device itself, so you only register the public key it prints. For a key that can’t be read out even with physical access, see Secure Elements.

Or generate it in the browser: the same dialog has a Generate in Browser option, which creates the key pair for you and shows the private key once for you to save — only the public key is ever submitted.

Rotating a key: use Rotate Key on the same card to register a new public key in place of the old one. By default the old key keeps working for 10 days, so devices can be moved to the new private key without dropping offline.

If a key may be compromised: when rotating, tick Revoke the current key now. Within a minute the old key stops working and any device still connected with it is disconnected. To cut a device off entirely, use Revoke on the same card: within a minute every key for the device stops working, and it can’t reconnect until you register a new one. Only EC P-256 public keys can be registered; other key types are rejected.

Prefer certificates? Devices can also sign in with an X.509 client certificate over mutual TLS, issued from the console or by your own certificate authority. See Device Certificates.

Before wiring up real firmware, you can sanity-check a key pair using Test Authentication on the device’s page: paste a private key in the browser, and it mints a short-lived test JWT and validates it against the key currently registered for that device — confirming the pair actually matches before you go debug a device in the field.

This is what a device SDK does for you automatically — useful if you’re debugging a connection or implementing a client directly against the wire protocol.

MQTT client ID / username /{accountId}/{projectId}/{deviceId}
MQTT password An ES256-signed JWT, described below

The JWT is signed with the device’s registered private key and carries:

Claim Value
aud rayon://{accountId}/{projectId}
sub dev/{deviceId}
iat Issued-at time
exp Expiry — at most 24 hours after iat
jti A random ID, unique per token

The platform verifies the signature against the public key you registered in step 6 — if it checks out, the connection is authenticated as that device.

  • Telemetry — publishing readings, batching, and querying data back out.
  • Sending Commands — sending commands to a device and confirming they were applied.