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.
On this page:
Communication Driver Information | |
---|---|
Driver name | MQTTAWS |
Assembly Name | T.ProtocolDriver.MQTTAWS |
Assembly Version | 1.0.0.0 |
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. |
AWS IoT Core is a managed cloud service that enables communication between Internet of Things (IoT) devices and AWS cloud applications or services using the MQTT protocol, HTTPS, and WebSockets. It provides secure, bi-directional message exchange between connected devices and the AWS infrastructure.
The requirements for a successful configuration of MQTT and Azure are listed below:
First, register a Thing in AWS IoT Core.
To do this, use an AWS account with all required registration information completed. Access the AWS Management Console and go to Internet of Things > IoT Core.
Expand the Security section and select Policies. Create a new security policy according to your requirements.
For testing purposes, you can create a security policy using *
in both the Policy action and Policy resource fields. However, for production use, these fields must be defined more specifically according to application requirements.
Once the policy is properly configured, click Create.
Next, proceed to create the Thing.
To do this, expand the Manage section, then navigate to All Devices > Things.
Create a new Thing.
Select the option to create a single Thing.
Specify the name of the Thing.
Specify the name of the Thing and select Auto-generate a new certificate.
Select the previously created security policy and click Create Thing.
After the Thing is created, download all certificates generated for it.
After downloading the certificates for the Thing, use the CertificateConverter.exe
utility located in the software installation directory:"\Program Files (x86)\<Company>\<Product>\Utilities"
.
This utility converts the certificates generated for the Thing into a single .pfx
file with a password.
To perform the conversion, execute CertificateConverter.exe
from the command line with the following four parameters:
-certificate.pem.crt;
-private.pem.key;
AmazonRootCA1.pem;
.pfx
file that will be generated.With this setup, open a command prompt in the directory where CertificateConverter.exe
is located.
Run a command similar to the following:
CertificateConverter.exe /certificate:"C:\my_folder\3e4...0e4-certificate.pem.crt" /key:"C:\my_folder\3e4...0e4-private.pem.key" /rootca:"C:\my_folder\AmazonRootCA1.pem" /password:"12345" |
After executing the command, the .pfx
certificate file will be generated in the same folder as the source certificate files, such as C:\my_folder
in the example above.
Not used in this driver.
Station syntax: <URL> ; <Port> ; <ClientID> ; <Username> ; <Password> ; <SslProtocol> ; <DeviceCertificate> ; <CertPassword> ; <PayloadFormat>
Where:
.pfx
certificate with a password..pfx
certificate with a password..pfx
certificate created with CertificateConverter.exe.
CertificateConverter.exe
.URL = agehf6lt8nnf1v-ats.iot.us-east-1.amazonaws.com
Port = 8883
Client ID = MQTT_Device
Username = <Blank>
Password = <Blank>
Ssl Protocol = Tls12
Device Certificate = < Certificate path (.pfx) >
Certificate Password = < Password of Certificate path >
Payload Format = JSON/SparkplugB
The MQTT for AWS IoT Core protocol supports Subcribe and Publish to AWS Topics.
The Address syntax is: [Payload] : <Group> ; <Node> ; <Device>
Where:
E.g.: Payload:GroupID;NodeID;DeviceID
Payload:AWSGroup;Factory1;Motor
Assuming the ClientID difined in node PrimaryStation as MyClientID
For this example device, the correct topic of published messages from the platform to AWS is:
MyClientID/AWSGroup/Factory1/Motor/messages
And the AWS topic which will be subscribed by the platform is:
MyClientID/AWSGroup/Factory1/Motor/#
This section details some errors you might see in your connection to AWS IoT Core via MQTT protocol and its possible causes.
MQTTAWS Revision History | |
---|---|
Version | Notes |
1.0.0.0 | Initial release on new documentation standards. |