Sensorclouds Docs
Step-by-Step Guides

First Device Setup

End-to-end guide: register a device, connect via MQTT, and view data

This guide walks you through connecting your first device to Sensorclouds — from creating an application to seeing live telemetry on screen.

Prerequisites

  • A Sensorclouds account with ADMIN or ENGINEER role
  • A device capable of MQTT communication (or a computer to simulate one)
  • An MQTT client for testing (e.g., mosquitto_pub, MQTT Explorer, or a Python script)

Steps

Create an Application

Navigate to Applications in the sidebar and click Add Application.

  • Name: Give it a descriptive name (e.g., "Weather Stations")
  • Description: Optional but helpful for team context

The application groups related devices together.

Create a Device Profile

Go to Device Profiles and click Create Profile.

  • Name: e.g., "ESP32 Sensor"
  • MQTT Settings: Configure the topic structure or use defaults
  • Payload Decoder: Select NONE for JSON payloads, or CUSTOM if your device sends binary/hex data

The profile defines how the platform interprets data from this type of device.

Register a Device

Navigate to your application's Devices tab and click Add Device.

  • Name: e.g., "Sensor-001"
  • Device Profile: Select the profile you created
  • Description: Optional details about the device

Click Save. The device is created with a unique Device Token (MQTT username), but the MQTT password is not generated automatically — you need to generate it manually.

Generate MQTT Credentials

Open the device detail page and go to the Settings tab. In the MQTT Credentials section:

  1. Copy the Device Token (this is your MQTT username)
  2. Click Generate Password to create a new MQTT password
  3. The password is displayed once — copy it immediately

You will also see the Broker URL, Port, and MQTT Topics for your device.

The MQTT password is shown only once and cannot be recovered. If you lose it, you must generate a new one from the Settings tab.

Connect to the MQTT Broker

Use the credentials from the previous step to connect your device. You'll need these values (all visible on the device's Settings tab):

SettingValue
Broker URLYour instance URL (e.g., your-instance.sensorclouds.io)
Port443 (WSS) or 8883 (MQTTS) for production, 1883 (TCP) for dev only
UsernameYour Device Token (e.g., dev_a1b2c3d4e5)
PasswordThe generated password from the previous step
Client IDUse your Device Token
Telemetry Topictenant/{tenantId}/app/{appId}/device/{deviceToken}/data

The full topic path including your tenant ID, application ID, and device token is shown on the device's Overview tab under MQTT Topics. You can copy it directly from there.

Quick test with mosquitto_pub:

mosquitto_pub \
  -h your-instance.sensorclouds.io \
  -p 8883 \
  --capath /etc/ssl/certs \
  -u "dev_a1b2c3d4e5" \
  -P "your-generated-password" \
  -i "dev_a1b2c3d4e5" \
  -t "tenant/{tenantId}/app/{appId}/device/dev_a1b2c3d4e5/data" \
  -m '{"temperature": 23.5, "humidity": 60}'

Python example:

import paho.mqtt.client as mqtt
import ssl
import json

BROKER = "your-instance.sensorclouds.io"
PORT = 8883
DEVICE_TOKEN = "dev_a1b2c3d4e5"
PASSWORD = "your-generated-password"
TOPIC = "tenant/{tenantId}/app/{appId}/device/dev_a1b2c3d4e5/data"

client = mqtt.Client(client_id=DEVICE_TOKEN)
client.username_pw_set(DEVICE_TOKEN, PASSWORD)
client.tls_set(tls_version=ssl.PROTOCOL_TLS)

client.connect(BROKER, PORT)
client.publish(TOPIC, json.dumps({"temperature": 23.5, "humidity": 60}))
client.disconnect()

Replace {tenantId} and {appId} with your actual tenant and application IDs from the MQTT Topics section.

Verify Device Status

Go back to the Devices list. Your device should now show as Online (green indicator). If it's still offline, check:

  • Credentials are correct (copy-paste, no extra spaces)
  • Broker host and port are reachable from your network
  • Your device's MQTT client connects successfully (no errors in logs)

View Telemetry Data

Open your device's detail page and navigate to the Telemetry tab. You should see:

  • Latest values for each field (temperature, humidity)
  • Time-series chart showing data over time
  • Field discovery — new fields appear automatically as data arrives

Send a few more data points to see the chart populate.

Next Steps

On this page