Documentation / User guide

Add a device and send a first measurement

Create a device, get its token, send a measurement over HTTP with curl and then over MQTT with mosquitto_pub, and watch incoming messages live.

Create the device

A device is a sensor or a piece of equipment that sends measurements. Each device has its own token: it authenticates with it, and can only publish for itself.

  1. In the sidebar, click Devices.
  2. In New device, enter a name (for example Greenhouse E).
  3. Leave the Type on Sensor / equipment. (The Modbus / OPC-UA gateway type is for the gateway installed on site.)
  4. Click Create.
The New device form, on the Devices page
The New device form, on the Devices page

Copy the token

Right after creation, a box shows the device token and sending examples ready to copy.

Copy the token right away: it is shown only once. If you lose it, open the device page and click Regenerate token (at the bottom of the page, in the Access token box): the old token stops working immediately.

The device token and the curl example (HTTP tab)
The device token and the curl example (HTTP tab)

Send a measurement over HTTP

  1. In the token box, stay on the HTTP tab and copy the curl command.
  2. Run it in a terminal:
curl -X POST https://apiv1.opensensorcloud.com/ingest/v1/telemetry \
  -H "Authorization: Bearer osc_dev_…" \
  -H "Content-Type: application/json" \
  -d '{"temperature": 21.5, "humidity": 48}'
  1. The response is 202 with the number of accepted points: {"accepted":2}.

Each JSON key becomes a channel of the device (temperature, humidity), created automatically on the first message. Values can be numbers, booleans or text.

To set the measurement timestamp yourself, or to send several measurements at once:

{ "ts": "2026-11-13T08:00:00Z", "values": { "temperature": 21.4 } }
[
  { "ts": "2026-11-13T08:00:00Z", "values": { "temperature": 21.4 } },
  { "ts": "2026-11-13T08:10:00Z", "values": { "temperature": 21.9 } }
]

A batch contains at most 1,000 points. The full format (gzip, binary, errors) is described in the ingestion reference.

Send a measurement over MQTT

  1. In the token box, click the MQTT tab. It shows the server, the Username (the device id), the password (the token) and the Topic.
  2. Copy the mosquitto_pub command and run it:
mosquitto_pub -h mqtt.opensensorcloud.com -p 8883 --capath /etc/ssl/certs -q 1 \
  -u <device id> \
  -P osc_dev_… \
  -t osc/<organization identifier>/<device id>/telemetry \
  -m '{"temperature": 21.5, "humidity": 48}'
The MQTT tab: server, username, topic and mosquitto_pub command
The MQTT tab: server, username, topic and mosquitto_pub command

The message body follows the same rules as over HTTP. The device can only publish on its own topic; QoS 0 and 1 are accepted. Use the TLS port (8883) from the Internet; use the unencrypted port only on a trusted network.

Find a device in the list

The Devices page shows a table: name, type, profile, last message, position and identifiers (devEUI, Sigfox ID). By default the devices that sent a message most recently come first. Click a column header (name, type, profile, last message) to sort by it, click again to reverse the order; devices without a profile or that never sent anything always stay at the bottom. Filter by name keeps the devices whose name, devEUI or Sigfox ID contains the typed text (case and accents ignored), and Profile keeps those of one profile; the count shows how many devices remain. Hover over a last message to see its exact date; an orange dot marks a device silent for more than 24 hours, a green dot a device online. Sort and filters are remembered per organization in this browser. On a phone, only the name and the last message are shown.

Deleting a device (button Delete device on its page, editors and above) takes effect at once: the device stops receiving data and you are taken back to the list, where it stays greyed with the label deleting while its history is removed in the background.

View the measurements

  1. Click the device name (in the creation box, or in the Devices list).
  2. At the top, each channel shows its latest value and its age. The green dot next to the name means the device is online (message received less than 5 minutes ago).
  3. Click a channel to show its chart. Choose the period with 1 h, 24 h, 7 d or 30 d. Over long periods, the chart shows averages.
  4. Export CSV downloads the raw measurements of the device for the chosen period (columns time,channel,value).
The device page: latest values and chart
The device page: latest values and chart

Watch messages live (Live debug)

When a sensor does not show up, Live debug shows each received message, accepted or rejected, with the reason for the rejection.

  1. On the device page, in the Live debug box, click Start.
  2. Send a message (with curl or mosquitto_pub). It appears within a few milliseconds:
    • accepted, N points: the message is stored;
    • rejected: the reason is shown in red (invalid JSON, unsupported value, quota exceeded…).
  3. ASCII / HEX switches the display of the raw content (useful for binary payloads).
  4. Click Stop when you are done. Nothing is kept.
Live debug: an accepted message, and a rejected message with its reason
Live debug: an accepted message, and a rejected message with its reason

Messages received earlier are kept 3 months in Received messages, below. Click a row to see its raw content and, under Decoded, what the profile's decoder makes of it (values, or the decoder's error in red). The decoder run is the profile's current one: after fixing a decoder, open a message rejected with decoder_error to check that it now decodes. Nothing is stored again.

Next steps

  • Give the channels units and labels with a profile.
  • Show the measurements on a dashboard.
  • Get notified when a value goes out of range with an alert.