Using the MQTT API – Atmosphere IoT

Using the MQTT API


Atmosphere currently supports v3.1.1 of the MQTT protocol which will allow you to send device events to Atmosphere IoT managed devices and also recieve cloud events as well.


Connecting to MQTT Server


You can simply connect with any supported MQTT client to the hostname “” to subscribe to and publish on MQTT topics.

Authentication will be required by passing your device’s ID as the username and the device’s token as the password to connect.


Sending Device Events


A device can send device events from your device my publishing data on the following topic.


You can send an event along with data to all of the Device Event elements in your project by simply dropping the element name in the MQTT topic path like so


All data published to this topic will then be processed by your device’s cloud plane by triggering the “Event Recieved” on your specified Device Event Element with the data sent to this topic.


Example with mosquitto_pub


To use this example you will need to download and install the mosquitto clients from

mosquitto_pub -h -u -P -t
atmosphere/events//device/ NAME> -m "Data" -p 8883 --capath /etc/ssl/certs


Receiving Cloud Events


Just as before but instead of publishing to the device topic we subscribe to the cloud topic using the following topic


Just like the Device Events you can remove the Cloud Event name from the path and get cloud events from all Cloud Event elements in your project like the following,



Example with mosquitto_sub


mosquitto_sub -h -u -P -t
atmosphere/events//cloud/ NAME> -p 8883 --capath /etc/ssl/certs