MQTT
info
You don't need to know anything about MQTT to use Golain. Our SDKs abstract away the complexity of MQTT, and provide you with a simple API to use.
Devices on Golain communicate with the platform using MQTT. We use MQTT because it's lightweight, and is designed for unreliable networks - which is perfect for IoT devices.
Unlike other platforms, MQTT topics are not freely definable.
We've defined a set of topics that are used for device management, OTA updates, data ingestion, and more.
Here is the list of topics and access types for each
Topics
Topic | Device Access Type |
---|---|
/+/+/device-data | WriteOnly |
/+/+/device-shadow/# | ReadWrite |
/+/+/device-metadata/ | ReadWrite |
/+/+/device-logs | WriteOnly |
/+/+/healthcheck | ReadWrite |
/+/+/ota | ReadWrite |
/+/+/rtc | ReadWrite |
Topic Structure
The topic structure is as follows:
/<slug>/<device-name>/<topic>
The slug is a unique identifier for your fleet, and is generated when you create a fleet.
Shadow Topics
- Devices can read shadow data from
/+/+/device-shadow/r
: this is a subscribe only topic. - Devices can update shadow data to
/+/+/device-shadow/u
: this is a publish only topic.