The Xentara MQTT client v1.1
User Manual
|
A JSON object describing MQTT Client has the following syntax:
id | A string value containing the ID of the MQTT Client. The ID is used to construct the MQTT client’s primary key. | ||||||||||||
uuid | A string value containing the unique UUID of the MQTT Client. | ||||||||||||
brokerAddress | A string value containing the broker address for the connection from client to the host. broker address should be of the form “host:port”, where:
For connection with Azure Iot Hub port number should be 8883. It should follow the form:
Tip: host name for the azure IoT Hub can be found in the create IoT hub under the option “Overview” | ||||||||||||
clientId | A string value containing MQTT client ID. Devices can be directly created in the Azure IoT Hub. MQTT client is connected as a device with Azure IoT Hub therefore the name of the device must be same as the device created in Azure IoT hub. Note : This is optional if there will be no client ID specified MQTT Client will run without it. However in order to run it with Azure IoT Hub Client ID is not optional. | ||||||||||||
mqttVersion | A integer value containing the Version. MQTT Client supports all the versions:
For the connection with Azure IoT Hub only mqttVersion: “3.1.1” should be use. | ||||||||||||
timeoutMs | A interger value containing the time in milliseconds. This value gets set in the main network loop of the MQTT client. | ||||||||||||
keepaliveIntervalS | A interger value containing the time in seconds. This value gets set when the connection to MQTT broker is established. The value must be <5 | ||||||||||||
verifyCertificate | A Boolean value (true or false) containing the flag that enables or disables the verification of the server certificate. Note: This is optional. | ||||||||||||
useTLS | A Boolean value (true or false) containing the flag that enables or disables the TLS. Note: This is optional. | ||||||||||||
caCertificateFile | A string value containing the file path to certificate store containing the trusted digital certificates. The certificate could be self-signed certificate or could be downloaded from DigiCert Baltimore Root Certificate Understanding Azure IoT Hub MQTT support | Microsoft Docs (refer to the section “TLS/SSL Configuration”) For running it under the Linux following path can be used:
| ||||||||||||
caCertificateDirectory | A string value containing the directory path to certificate store containing the trusted digital certificates. Either caCertificateFile or caCertificateDirectory can be used for server authentication. Note : This is optional if there will be no caCertificateFile / caCertificateDirectory specified MQTT Client will run without it. | ||||||||||||
lastWill | A JSON object to set last will topic and message.
Last will topic must be same as one of the publishing topic. Note : This is optional if there will be no last will message specified MQTT Client will run without it. | ||||||||||||
username | A string value to set user name. For Azure IoT hub connection it should follow a specific format
Understanding Azure IoT Hub MQTT support | Microsoft Docs(refer to the section “Using the MQTT protocol directly (as a device)”) | ||||||||||||
password | A string value to set the password. For Azure connection the device needs authentication at the IoT Hub. It uses SAS token that can be generated from [Visual Studio Code Azure IoT Tools - Visual Studio Marketplace] (https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-tools) or Azure CLI az iot hub | Microsoft Docs(refer to the section “az iot hub generate-sas-token”) The generate SAS token has a expiry Understanding Azure IoT Hub MQTT support | Microsoft Docs(refer to the section “For Azure IoT Tools”) Note: User name and password are optional, if there are no credential specified MQTT Client will run without it. | ||||||||||||
clientCertificate | A JSON object to set client certificates.
There are different approaches to get client certification. MQTT client has been tested using openSSL with following:
Note: This is optional but if client certificates are specified useTLS flag must be set to "true". | ||||||||||||
Microservice.MQTT.Topic | A MQTT Topic microservice inside a MQTT Client as a sub service. It is to set parameters for publishing telemetry.
Note: Each topic has a separate publish task. Therefore topics can be published as per the user need. |