This document has only the specific information about the device connection settings and its address syntax.
Refer to the User Guide for more information on the Device Module.
Communication Driver Information | |
---|---|
Driver name | MQTTAzure |
Assembly Name | T.ProtocolDriver.MQTTAzure |
Assembly Version | 1.0.0.3 |
Available for Linux | True |
Devices supported | Any device compatible with the MQTT protocol |
Manufacturer | Microsoft |
Protocol | MQTT (Message Queuing Telemetry Transport) is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. |
Interface | TCP/IP |
PC Requirements | Ethernet port |
Implemented Methods | Connect, Disconnect, Subscribe, UnSubscribe and Publish. |
Not used in this driver.
Station syntax: <URL> ; <Port> ; <ClientID> ; <Username> ; <Password> ; <SslProtocol> ; [X509Certificate] ; <PayloadFormat>
Where:
One of the easiest ways to install the certificate on client computer is to use the wizard to import the certificates is through the "Internet Options" to import the certificate in the "Trusted Root Certification Authorities”. You need to import the certificate in DER format. |
URL = CustomHub-MQTT.azure-devices.net
Port = 8883
Client ID = MQTT_Device
Username = CustomHub-MQTT.azure-devices.net/ MQTT_Device
Password = SharedAccessSignature sr=CustomHub-MQTT.azure devices.net&sig=ygIt%2FG8fIFAXhUwGXBlm6WKDK5IhbmVHkUs4atsbXFU%3D&skn=iothubowner&se=1612 031715
Ssl Protocol = <TLS>
X059 Certificate =
Payload Format = JSON/SparkplugB
For more information about how to set up a connection with Azure IoT Hub and find the required parameters, see the appendix. <<<<. please note there is no appendix in this article, so should we remove this info? >>>>
The MQTT and Azure protocol supports Write Commands only.
The Address syntax is: [Payload] : <Group > ; <Node> ; <Device> ;
E.g.: Payload:GroupID;NodeID;DeviceID;
Payload:AzureGroup;Factory1;Motor
This section details some errors you might see in your connection to Azure IoT Hub via MQTT protocol and its possible causes.
If you see this message on the Trace Window Logs (with modules Debug and Devices enabled), check the port number parameter on Devices → Nodes → PrimaryStation.
If you get this error code on Devices.Node.<NodeName>.Status, check if the URL defined on Devices → Nodes → PrimaryStation is correct.
If you see this message on the Trace Window Logs (with modules Debug and Devices enabled)check the following parameters on Devices → Nodes → PrimaryStation:
If you see this message on the Trace Window Logs (with modules Debug and Devices enabled), check the QoS setting on Devices → Nodes → PrimaryStation. As stated in a previous section, IoT Hub will automatically disconnect your client if the QoS value is 2 (Exactly Once).
Another reason is that someone else tried to connect to your IoT Device using the same ClientID. IoT Hub only supports one active MQTT connection per device. Any new MQTT connection on behalf of the same device ID causes IoT Hub to drop the existing connection.
MQTTAzure Revision History | |
---|---|
Version | Notes |
1.0.0.3 | Initial release on new documentation standards. |