MQTT
The Message Queue Telemetry Transport (MQTT) is a standard protocol for the communication with the remote IoT Devices and Applications.
More information regarding MQTT can be found on the following link: http://mqtt.org/
Free and open source implementations of MQTT clients can be found on the following link: https://github.com/mqtt/mqtt.github.io/wiki/libraries
MQTT Overview
MQTT is a publish / subscribe protocol, as shown in the below figure:
IoT devices act as MQTT client to publish their data records to the Labeeb IoT MQTT broker.
IoT applications act as MQTT client to subscribe on the devices topics and receive the published data records in real-time.
MQTT Broker Topic Namespace
The following MQTT topic namespace is implemented at the Labeeb IoT platform level:
Topic Namespace | Devices Access | Application Access |
---|---|---|
/EnterpriseName/DeviceTemplateName/request | READ | WRITE |
/EnterpriseName/DeviceTemplateName/DeviceName/request | READ | WRITE |
/EnterpriseName/DeviceTemplateName/DeviceName/dataCSV | WRITE | N/A |
/EnterpriseName/DeviceTemplateName/DeviceName/DataModelName/DataTypeName/data | N/A | READ |
MQTT Messages Format
Topic Namespace | Format |
---|---|
/EnterpriseName/DeviceTemplateName/request | User-defined (String) |
/EnterpriseName/DeviceTemplateName/DeviceName/request | User-defined (String) |
/EnterpriseName/DeviceTemplateName/DeviceName/dataCSV | CSV-based data records published by IoT devices should contain 1 or multiple lines, as follows: TIMESTAMP, LONGITUDE : LATITUDE : ALTITUDE, DATA_MODEL_NAME, DATA_TYPE_NAME : DATA_TYPE_VALUE, …, DATA_TYPE_NAME : DATA_TYPE_VALUE \n TIMESTAMP, LONGITUDE : LATITUDE : ALTITUDE, DATA_MODEL_NAME, DATA_TYPE_NAME : DATA_TYPE_VALUE, …, DATA_TYPE_NAME : DATA_TYPE_VALUE \n ... TIMESTAMP, LONGITUDE : LATITUDE : ALTITUDE, DATA_MODEL_NAME, DATA_TYPE_NAME : DATA_TYPE_VALUE, …, DATA_TYPE_NAME : DATA_TYPE_VALUE |
/EnterpriseName/DeviceTemplateName/DeviceName/DataModelName/DataTypeName/data | JSON-based data records received by IoT applications are formatted as follows: |