Child pages
  • MQTT Communications Protocol
Skip to end of metadata
Go to start of metadata

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 NamespaceDevices AccessApplication Access
/EnterpriseName/DeviceTemplateName/requestREADWRITE
/EnterpriseName/DeviceTemplateName/DeviceName/requestREADWRITE
/EnterpriseName/DeviceTemplateName/DeviceName/dataCSVWRITEN/A
/EnterpriseName/DeviceTemplateName/DeviceName/DataModelName/DataTypeName/dataN/AREAD

 

 

MQTT Messages Format

Topic NamespaceFormat
/EnterpriseName/DeviceTemplateName/requestUser-defined (String)
/EnterpriseName/DeviceTemplateName/DeviceName/requestUser-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:

{

"value":"DATA RECORD VALUE",

"longitude":"GPS LONGITUDE",

"latitude":"GPS LATITUDE",

"altitude":"GPS ALTITUDE",

"receptionTime":"DATA RECORD RECEPTION TIME AT THE PLATFORM",

"generationTime":"DATA RECORD GENERATION TIME AT THE DEVICE"

}