Sensorclouds Docs
MQTT Connectivity

Connecting Your Device

Step-by-step guide to connect your first IoT device to Sensorclouds via MQTT

Follow these steps to connect a physical device to the Sensorclouds platform.

Prerequisites

  • A registered device with MQTT credentials (see Registering Devices)
  • Your Sensorclouds instance broker URL

Connection Steps

Register the Device

If you haven't already, create an Application, a Device Profile, and register a Device within the application. The platform generates MQTT credentials on device creation.

Get MQTT Credentials

Navigate to Device → Settings and:

  • Copy the Device Token (this is your MQTT username)
  • Click Generate Password and copy the MQTT password immediately

The password is shown only once. Store it securely before closing the dialog.

Configure Your Device

Set the following on your device firmware:

ParameterValue
Broker URLyour-instance.sensorclouds.com
Port443 (WSS) or 8883 (MQTTS)
UsernameYour Device Token
PasswordThe generated password
Client IDAny unique string (device token recommended)
TLSRequired for production

Publish Telemetry

Send data to your device's telemetry topic:

tenant/{tenantId}/app/{applicationId}/device/{deviceToken}/data
Device → PlatformPublish sensor readings as JSON or encoded bytes

Payload can be:

  • JSON: {"temperature": 25.3, "humidity": 60}
  • Hex string: "48656C6C6F" (auto-detected and decoded)
  • Raw bytes: Decoded by the device profile's payload decoder

Set up Last Will and Testament for automatic offline detection:

tenant/{tenantId}/app/{applicationId}/device/{deviceToken}/status
Device → PlatformStatus messages for online/offline tracking
LWT ParameterValue
Will Topictenant/{tenantId}/app/{appId}/device/{token}/status
Will Payload{"status": "offline"}
Will QoS1
Will Retaintrue

On successful connection, publish {"status": "online"} to the same topic.

Verify the Connection

After connecting, navigate to your application's Live Data tab. You should see telemetry messages appearing in real-time as your device publishes data.

On this page