{"id":40387,"date":"2025-12-22T10:00:00","date_gmt":"2025-12-22T15:00:00","guid":{"rendered":"https:\/\/www.dmcinfo.com\/?p=40387"},"modified":"2026-01-20T17:22:43","modified_gmt":"2026-01-20T22:22:43","slug":"siemens-mqtt-setup-with-aws-iot-core","status":"publish","type":"post","link":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/","title":{"rendered":"Siemens MQTT Setup with AWS IoT Core"},"content":{"rendered":"\n<p>As technology advances and security standards improve, clients in the automation industry are transitioning to newer communications standards for both future-proofing and improved plant security.\u00a0This blog covers the implementation of the MQTT standard, which is known for being simple, secure, and lightweight, with the AWS IoT Core service and the Siemens LMQTT library. The primary goal of this blog is to provide a centralized resource to demystify the setup process.<\/p>\n\n\n\n<p><em>Note: This blog uses a Siemens S71214 G2 PLC and TIA Portal V20 Update 3, with version 2.3.0 the Siemens \u201cLibraries for Communication\u201d.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-certificates\">Why Certificates?<\/h2>\n\n\n\n<p>Instead of user credentials, which can be easily compromised, the industry is slowly shifting towards more secure certificate-based security. Certificates are authorized and signed by a \u201cCertificate Authority\u201d (CA) and come with a public and private key.<\/p>\n\n\n\n<p>A public key is shared openly to encrypt data or verify signatures, while the private key is stored locally by the certificate owner to decrypt data and create signatures, enabling secure communications.<\/p>\n\n\n\n<p>Typically, an MQTT connection is secured through TLS and leverages a unique certificate per device. Devices can share the same certificate, but if one of the certificates is compromised, all devices will need to have their certificates updated.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-s-the-catch\">What&#8217;s the Catch?<\/h3>\n\n\n\n<p>One way that certificates are more secure is that they have limited lifespans. Each certificate has a specified time frame (usually a decade or more, up to a limit) where it is valid. Upon expiration, communications relying on the certificate will fail until a new certificate is signed by the CA and manually rotated on the device. For Siemens PLCs, this is a manual process that requires a hardware download and downtime.<\/p>\n\n\n\n<p>A similar lifespan issue arises for the CA. The current Amazon Root CA 1 at the time of writing expires January 2038 and has a lifespan of 10-20 years.<\/p>\n\n\n\n<p>However, AWS helps with mitigating this issue by allowing users to remotely monitor and even revoke certificates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-configuring-aws-iot-core\">Configuring AWS IoT Core<\/h2>\n\n\n\n<p>In AWS IoT Core, every device is registered as a Thing and has associated certificates to secure the communications and \u201cPolicies\u201d to determine the permissions a certificate is allowed to have. Before the PLC can communicate with AWS, it must first be configured in the IoT Core with at least one of each (Thing, Certificate, Policy).<\/p>\n\n\n\n<p><em>Note: It is possible to use user credentials with AWS, but this is less secure and requires the configuration of a custom authorizer and downloading the Amazon Root Certificate to the PLC. More information can be found here: <\/em><a href=\"https:\/\/docs.aws.amazon.com\/apigateway\/latest\/developerguide\/apigateway-use-lambda-authorizer.html\"><em>Use API Gateway Lambda authorizers &#8211; Amazon API Gateway<\/em><\/a><em>.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-creating-a-thing\">Creating a Thing<\/h3>\n\n\n\n<p>A Thing can be created under the \u201cManage &gt; All devices &gt; Things\u201d menu. Creating a Thing will prompt the user to assign a certificate and a policy. In this example, an auto-generated AWS certificate was used.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"482\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153420\/creating-a-thing1-1024x482.png\" alt=\"creating a thing\" class=\"wp-image-40423\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153420\/creating-a-thing1-1024x482.png 1024w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153420\/creating-a-thing1-300x141.png 300w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153420\/creating-a-thing1-768x361.png 768w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153420\/creating-a-thing1.png 1048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-creating-a-policy\">Creating a Policy<\/h3>\n\n\n\n<p>As part of the steps to create a Thing, you can also create a Policy. Policies are used to Allow\/Deny actions that a device can perform when connected using the attached certificate. A policy can be reused across multiple certificates, and a certificate can have multiple attached policies, allowing for flexible configuration.<\/p>\n\n\n\n<p>For testing basic communications and setup, it is recommended that an unrestricted policy be used to allow all policy actions and resources to be accessed (notated by the wildcard character, *). Policies can be updated at any time to remotely modify the permissions of any device.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"684\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153501\/creating-a-policy2-1024x684.png\" alt=\"Creating a Policy\" class=\"wp-image-40424\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153501\/creating-a-policy2-1024x684.png 1024w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153501\/creating-a-policy2-300x200.png 300w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153501\/creating-a-policy2-768x513.png 768w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153501\/creating-a-policy2.png 1056w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><em>Note: For more information regarding policy configuration, see <\/em><a href=\"https:\/\/docs.aws.amazon.com\/iot\/latest\/developerguide\/example-iot-policies.html\"><em>AWS IoT Core policy examples &#8211; AWS IoT Core<\/em><\/a><em>.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-creating-your-certificates\">Creating your Certificates<\/h3>\n\n\n\n<p>Once a Thing has been created, a pop-up will appear with download links to the generated certificates. Click the \u201cDownload All\u201d button to download a copy of the certificate, keys, and root CA certificates. Don\u2019t close the dialog box without downloading a copy of the certificate and keys, as this is the only time they are available for security reasons!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"610\" height=\"862\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153547\/creating-certificates3.png\" alt=\"creating certificates \" class=\"wp-image-40425\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153547\/creating-certificates3.png 610w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153547\/creating-certificates3-212x300.png 212w\" sizes=\"(max-width: 610px) 100vw, 610px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-configuring-the-siemens-plc\">Configuring the Siemens PLC<\/h2>\n\n\n\n<p>Configuring the PLC to communicate via MQTT requires 3 steps. First, the LMQTT library must be added to the project and configured for the connection. Next, project security must be enabled to allow the user to access the \u201cCertificate Manager\u201d and import the certificates to the project.<\/p>\n\n\n\n<p><em>Note: More information and a detailed guide of each step can be found here: <\/em><a href=\"https:\/\/support.industry.siemens.com\/cs\/ww\/en\/view\/109748872\"><em>Use the SIMATIC controller as an MQTT client &#8211; ID: 109748872 &#8211; Industry Support Siemens<\/em><\/a><em>.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-adding-the-library-to-the-project\">Adding the Library to the Project<\/h3>\n\n\n\n<p>The LMQTT Library and documentation can be found as part of the communications library here: <a href=\"https:\/\/support.industry.siemens.com\/cs\/document\/109780503\/simatic-s7-1500-s7-1200-libraries-for-communication-(lcommsuite)?dti=0&amp;lc=en-CO\">SIMATIC S7-1500\/S7-1200 Libraries for Communication (LCommSuite) &#8211; ID: 109780503 &#8211; Industry Support Siemens<\/a><\/p>\n\n\n\n<p>After downloading the Siemens Libraries for Communication, unzip the file and move the resulting folder to a permanent location. Then, import the \u201cLibraries_Comm_Controller.al20\u201d as a global library into your project.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"309\" height=\"252\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17102448\/adding-the-library-to-the-project.png\" alt=\"Adding the library to the project\" class=\"wp-image-40398\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17102448\/adding-the-library-to-the-project.png 309w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17102448\/adding-the-library-to-the-project-300x245.png 300w\" sizes=\"(max-width: 309px) 100vw, 309px\" \/><\/figure>\n\n\n\n<p>The communications library will then appear. For this blog, only the LMQTT library objects are used. Drag and drop the \u201cLMQTT_Client\u201d object from the Global Library into the \u201cProgram blocks\u201d folder of your PLC. All dependencies will automatically be imported into the project along with the library block.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"352\" height=\"310\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17162841\/library-block.png\" alt=\"library block\" class=\"wp-image-40402\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17162841\/library-block.png 352w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17162841\/library-block-300x264.png 300w\" sizes=\"(max-width: 352px) 100vw, 352px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-creating-a-data-block\"><em>Creating a Data Block<\/em><\/h3>\n\n\n\n<p>Next, create a Global Data Block to hold the tag values of the LMQTT Client. This can be done by expanding the \u201cProgram blocks\u201d folder in the Project tree and clicking \u201cAdd new block\u201d. From the dialog box, select \u201cData Block\u201d, name the block, and choose \u201cGlobal DB\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"530\" height=\"459\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163026\/creating-a-data-block.png\" alt=\"creating a data block\" class=\"wp-image-40403\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163026\/creating-a-data-block.png 530w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163026\/creating-a-data-block-300x260.png 300w\" sizes=\"(max-width: 530px) 100vw, 530px\" \/><\/figure>\n\n\n\n<p>The Data Block used by our example project is shown below. Some notes on our implementation:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Outgoing and Received message have a constant defining the length of the message byte-array.<\/li>\n\n\n\n<li>The error struct is used to log a history of errors and record the status of the system and are not mandatory.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"477\" height=\"616\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163122\/dbmqtt.png\" alt=\"dbMQTT\" class=\"wp-image-40404\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163122\/dbmqtt.png 477w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163122\/dbmqtt-232x300.png 232w\" sizes=\"(max-width: 477px) 100vw, 477px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-configuring-connection-parameters\"><em>Configuring Connection Parameters<\/em><\/h3>\n\n\n\n<p>The connection parameters in our example are configured as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"624\" height=\"164\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163241\/configuring-connection-parameters.png\" alt=\"Configuring connection parameters\" class=\"wp-image-40405\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163241\/configuring-connection-parameters.png 624w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163241\/configuring-connection-parameters-300x79.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Some notes on our configuration:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u201chwId\u201d is best left as 0, as this will allow the library to select a suitable hardware interface automatically. To specify it directly, Hardware IDs can be found by going to the \u201cDevice Configuration &gt; Properties &gt; System constants\u201d tab of your PLC.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"608\" height=\"295\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163353\/configuration-notes.png\" alt=\"Configuration notes\" class=\"wp-image-40406\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163353\/configuration-notes.png 608w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163353\/configuration-notes-300x146.png 300w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u201cconnId\u201d must be unique for each connected device.<\/li>\n\n\n\n<li>\u201cbroker\u201d will be your unique AWS IoT Data Endpoint. This can be found in the AWS Portal under the \u201cSettings\u201d menu.<\/li>\n\n\n\n<li>\u201cport\u201d for our application will be 8883 (certificate authenticated pub\/sub). A list of standard AWS ports are found here: <a href=\"https:\/\/docs.aws.amazon.com\/iot\/latest\/developerguide\/protocols.html\">Device communication protocols &#8211; AWS IoT Core<\/a>.<\/li>\n\n\n\n<li>The \u201ctls\u201d settings enable encryption. The important settings here are that the broker certificate and client certificate numbers match the certificates in the Certificate Manager (covered later in the blog).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-connecting-the-lmqtt-client-function-block\"><em>Connecting the LMQTT Client Function Block<\/em><\/h3>\n\n\n\n<p>An instance of the LMQTT Client function block can be created by dragging an instance of \u201cLMQTT_Client\u201d into any LAD block on the PLC and linking the corresponding tags in the database. An example of how the tags can be linked is shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"624\" height=\"680\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163518\/connecting-the-lmgtt-client-function-block.png\" alt=\"connecting the LMGTT client function block\" class=\"wp-image-40407\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163518\/connecting-the-lmgtt-client-function-block.png 624w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163518\/connecting-the-lmgtt-client-function-block-275x300.png 275w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-enabling-project-security-amp-importing-certificates\">Enabling Project Security &amp; Importing Certificates<\/h3>\n\n\n\n<p>To enable project security, navigate to the PLC\u2019s \u201cProperties &gt; General &gt; Certificate manager\u201d menu and enable the \u201cUse global security settings for certificate manager\u201d setting.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"624\" height=\"388\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163731\/certificate-manager.png\" alt=\"certificate manager\" class=\"wp-image-40408\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163731\/certificate-manager.png 624w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/17163731\/certificate-manager-300x187.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Next, enable project security by navigating in the Project Tree to \u201cSecurity settings &gt; Settings &gt; Project protection\u201d and password-protect the program. This is necessary to enable the project \u201cCertificate manager\u201d menu under \u201cSecurity Settings &gt; Security features.\u201d<\/p>\n\n\n\n<p>Before the certificate is imported into TIA Portal, the AWS client certificate and private key must be merged using a text editor. This can be done by opening both the *.pem certificate and the private.key file and pasting the private key in the line below the certificate. After doing so, your certificate file should look like the one below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"777\" height=\"1024\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152548\/root-certificates12-777x1024.png\" alt=\"Root certificates\" class=\"wp-image-40418\" style=\"width:491px;height:auto\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152548\/root-certificates12-777x1024.png 777w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152548\/root-certificates12-228x300.png 228w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152548\/root-certificates12-768x1012.png 768w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152548\/root-certificates12.png 1021w\" sizes=\"(max-width: 777px) 100vw, 777px\" \/><\/figure>\n\n\n\n<p>To import a certificate, navigate to the \u201cTrusted Certificates and root certificates\u201d menu in the project \u201cCertificate Manager\u201d, right-click the table and select import. The two files that will be needed are the:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Amazon Root CA1 (SHA-256)<\/li>\n\n\n\n<li>AWS IoT Certificate (Modified with key appended to certificate)<\/li>\n<\/ol>\n\n\n\n<p>Once complete, the two certificates should appear as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The ID of the \u201cAmazon Root CA 1\u201d MUST correspond to the \u201cbrokerCert\u201d in the connection parameters.<\/li>\n\n\n\n<li>The ID of the \u201cAWS IoT Certificate\u201d MUST correspond to the \u201cclientCert\u201d in the connection parameters.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"946\" height=\"84\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152637\/trusted-certificates13.png\" alt=\"trusted certificates\" class=\"wp-image-40419\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152637\/trusted-certificates13.png 946w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152637\/trusted-certificates13-300x27.png 300w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152637\/trusted-certificates13-768x68.png 768w\" sizes=\"(max-width: 946px) 100vw, 946px\" \/><\/figure>\n\n\n\n<p>Next, return to the PLC \u201cProperties &gt; Certificate manager\u201d and add the IoT Certificate under \u201cDevice certificates\u201d and the Root CA1 certificate as a \u201cCertificates of partner device.\u201d<\/p>\n\n\n\n<p>Finally, the IP, gateway, and time settings of the PLC need to be configured before downloading to the PLC.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-operation-of-lmqtt-client\">Operation of LMQTT Client<\/h2>\n\n\n\n<p>The LMQTT Client can be directly controlled by monitoring the runtime values of the Data Block. To start a connection, bring the \u201cconnect\u201d input on the Client high and wait for the block to connect.<\/p>\n\n\n\n<p>The status of the block can be seen by monitoring the \u201coutput &gt; diagnostics &gt; status\u201d tag. A tag value of 16#7004 indicates a successful connection.<\/p>\n\n\n\n<p>The publish\/subscribe\/unsubscribe signals are level-triggered, and only a single command is allowed to be active at any given moment, or else an error will occur.<\/p>\n\n\n\n<p>A message can be published to a topic by setting the topic, populating the byte array and setting the data length, and setting the \u201cpublish\u201d control signal. Any MQTT client subscribed to the same topic and connected to the AWS Endpoint will be able to see your published message.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-troubleshooting-common-errors\">Troubleshooting Common Errors<\/h2>\n\n\n\n<p><em>Note: An additional guide accompanying the LMQTT library is the <\/em><a href=\"https:\/\/support.industry.siemens.com\/cs\/document\/109772284\/cloud-connection-%E2%80%93-simple-and-secure-with-simatic-s7-1200-s7-1500?dti=0&amp;lc=en-WW\"><em>Cloud connection \u2013 simple and secure with SIMATIC S7-1200\/S7-1500 &#8211; ID: 109772284 &#8211; Industry Siemens Support<\/em><\/a><em> by Siemens, which provides more detail about configuring an AWS broker and setting up the PLC project from scratch.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-the-lmqtt-client-is-timing-out-when-trying-to-connect\">The LMQTT Client is timing out when trying to connect<\/h3>\n\n\n\n<p>This is most likely caused by an incorrect connection parameter or improper network configuration on the PLC. Some steps to try to remedy this error:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Check that the AWS IoT Data Endpoint is pingable from the device network.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"415\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152908\/aws-iot-data-endpoint14-1024x415.png\" alt=\"AWS IoT data end point\" class=\"wp-image-40420\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152908\/aws-iot-data-endpoint14-1024x415.png 1024w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152908\/aws-iot-data-endpoint14-300x122.png 300w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152908\/aws-iot-data-endpoint14-768x311.png 768w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18152908\/aws-iot-data-endpoint14.png 1236w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A known issue of older versions of the LMQTT library is that the broker string needed to be terminated with a period, but this is resolved in current versions of the library.<\/li>\n\n\n\n<li>Check your PLC network configuration. Since the PLC needs an internet connection to reach the AWS Endpoint, the correct router address is mandatory. To find the router address, run a \u201cipconfig\u201d command in Command Prompt and look for the \u201cGateway\u201d setting for your network adapter while connected to the PLC network.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"689\" height=\"175\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153006\/profient-interface15.png\" alt=\"profinet interface\" class=\"wp-image-40421\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153006\/profient-interface15.png 689w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153006\/profient-interface15-300x76.png 300w\" sizes=\"(max-width: 689px) 100vw, 689px\" \/><\/figure>\n\n\n\n<p>The DNS server might not be properly configured. This will prevent the PLC from resolving the Endpoint. DNS servers can be configured in the PLC \u201cProperties &gt; Advanced Configuration\u201d menu. The DNS addresses can be your router gateway or a trusted server such as Google (8.8.8.8).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"217\" src=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153105\/advanced-configuration16-1024x217.png\" alt=\"advanced configuration\" class=\"wp-image-40422\" srcset=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153105\/advanced-configuration16-1024x217.png 1024w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153105\/advanced-configuration16-300x64.png 300w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153105\/advanced-configuration16-768x163.png 768w, https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18153105\/advanced-configuration16.png 1126w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-the-lmqtt-client-is-stuck-in-a-reconnection-loop\">The LMQTT Client is stuck in a reconnection loop<\/h3>\n\n\n\n<p>A connection loop is a sign that the certificate authentication or AWS policy is configured incorrectly. Ensure that the certificate is set up properly and that the Client block is not attempting to connect with a denied Publish topic for the Will topic for the active AWS Policy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-i-want-to-test-my-mqtt-connection-without-the-plc\">I want to test my MQTT connection without the PLC<\/h3>\n\n\n\n<p>There are many free downloadable MQTT clients that can be set up on your computer, such as MQTTx or MQTT Explorer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>Although the setup process is more complex than traditional methods, secure MQTT communications from a PLC to the cloud can allow remote communications that would cause security risks with traditional methods. At its core, MQTT is a secure and lightweight protocol that is versatile and can suit the needs of hobbyists and industry alike.<\/p>\n\n\n\n<p><strong>Ready to take your <a href=\"https:\/\/www.dmcinfo.com\/services\/manufacturing-automation-and-intelligence\/\">Automation<\/a> project to the next level? <a href=\"https:\/\/www.dmcinfo.com\/contact#get-in-touch\">Contact us today<\/a> to learn more about our solutions and how we can help you achieve your goals.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As technology advances and security standards improve, clients in the automation industry are transitioning to newer communications standards for both future-proofing and improved plant security.\u00a0This blog covers the implementation of the MQTT standard, which is known for being simple, secure, and lightweight, with the AWS IoT Core service and the Siemens LMQTT library. The primary [&hellip;]<\/p>\n","protected":false},"author":350,"featured_media":40428,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[731,757],"tags":[],"class_list":["post-40387","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-manufacturing-automation-intelligence","category-siemens-plc"],"yoast_head":"<title>Siemens MQTT Setup with AWS IoT Core | DMC, Inc.<\/title>\n<meta name=\"description\" content=\"Explore Siemens MQTT implementation for enhanced security and communication in the automation industry with AWS IoT Core.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Siemens MQTT Setup with AWS IoT Core\" \/>\n<meta property=\"og:description\" content=\"Explore Siemens MQTT implementation for enhanced security and communication in the automation industry with AWS IoT Core.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/\" \/>\n<meta property=\"og:site_name\" content=\"DMC, Inc.\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/DMC-Inc\/107982009242929\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-22T15:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-20T22:22:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1107\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jiasen Zhang\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jiasen Zhang\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/\"},\"author\":{\"name\":\"Jiasen Zhang\",\"@id\":\"https:\/\/www.dmcinfo.com\/#\/schema\/person\/9981060cefd0d7c54b42c0c3aa7eeaad\"},\"headline\":\"Siemens MQTT Setup with AWS IoT Core\",\"datePublished\":\"2025-12-22T15:00:00+00:00\",\"dateModified\":\"2026-01-20T22:22:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/\"},\"wordCount\":1954,\"publisher\":{\"@id\":\"https:\/\/www.dmcinfo.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg\",\"articleSection\":[\"Manufacturing Automation &amp; Intelligence\",\"Siemens PLC\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/\",\"url\":\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/\",\"name\":\"Siemens MQTT Setup with AWS IoT Core | DMC, Inc.\",\"isPartOf\":{\"@id\":\"https:\/\/www.dmcinfo.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg\",\"datePublished\":\"2025-12-22T15:00:00+00:00\",\"dateModified\":\"2026-01-20T22:22:43+00:00\",\"description\":\"Explore Siemens MQTT implementation for enhanced security and communication in the automation industry with AWS IoT Core.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#primaryimage\",\"url\":\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg\",\"contentUrl\":\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg\",\"width\":2560,\"height\":1107,\"caption\":\"siemens mqtt setup aws iot core\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dmcinfo.com\/#website\",\"url\":\"https:\/\/www.dmcinfo.com\/\",\"name\":\"DMC, Inc.\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.dmcinfo.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dmcinfo.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.dmcinfo.com\/#organization\",\"name\":\"DMC, Inc.\",\"url\":\"https:\/\/www.dmcinfo.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dmcinfo.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/05\/27171146\/dmc-logo-1.png\",\"contentUrl\":\"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/05\/27171146\/dmc-logo-1.png\",\"width\":418,\"height\":167,\"caption\":\"DMC, Inc.\"},\"image\":{\"@id\":\"https:\/\/www.dmcinfo.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pages\/DMC-Inc\/107982009242929\",\"https:\/\/www.instagram.com\/dmcengineering\",\"https:\/\/www.youtube.com\/DMCEngineering\",\"https:\/\/www.linkedin.com\/company\/dmc-engineering\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dmcinfo.com\/#\/schema\/person\/9981060cefd0d7c54b42c0c3aa7eeaad\",\"name\":\"Jiasen Zhang\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dmcinfo.com\/#\/schema\/person\/image\/\",\"url\":\"\/\/www.dmcinfo.com\/wp-content\/uploads\/wpo365\/profile-images\/350.png\",\"contentUrl\":\"\/\/www.dmcinfo.com\/wp-content\/uploads\/wpo365\/profile-images\/350.png\",\"caption\":\"Jiasen Zhang\"},\"url\":\"https:\/\/www.dmcinfo.com\/blog\/author\/jiasenz\/\"}]}<\/script>","yoast_head_json":{"title":"Siemens MQTT Setup with AWS IoT Core | DMC, Inc.","description":"Explore Siemens MQTT implementation for enhanced security and communication in the automation industry with AWS IoT Core.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/","og_locale":"en_US","og_type":"article","og_title":"Siemens MQTT Setup with AWS IoT Core","og_description":"Explore Siemens MQTT implementation for enhanced security and communication in the automation industry with AWS IoT Core.","og_url":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/","og_site_name":"DMC, Inc.","article_publisher":"https:\/\/www.facebook.com\/pages\/DMC-Inc\/107982009242929","article_published_time":"2025-12-22T15:00:00+00:00","article_modified_time":"2026-01-20T22:22:43+00:00","og_image":[{"width":2560,"height":1107,"url":"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg","type":"image\/jpeg"}],"author":"Jiasen Zhang","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jiasen Zhang","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#article","isPartOf":{"@id":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/"},"author":{"name":"Jiasen Zhang","@id":"https:\/\/www.dmcinfo.com\/#\/schema\/person\/9981060cefd0d7c54b42c0c3aa7eeaad"},"headline":"Siemens MQTT Setup with AWS IoT Core","datePublished":"2025-12-22T15:00:00+00:00","dateModified":"2026-01-20T22:22:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/"},"wordCount":1954,"publisher":{"@id":"https:\/\/www.dmcinfo.com\/#organization"},"image":{"@id":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg","articleSection":["Manufacturing Automation &amp; Intelligence","Siemens PLC"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/","url":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/","name":"Siemens MQTT Setup with AWS IoT Core | DMC, Inc.","isPartOf":{"@id":"https:\/\/www.dmcinfo.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#primaryimage"},"image":{"@id":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg","datePublished":"2025-12-22T15:00:00+00:00","dateModified":"2026-01-20T22:22:43+00:00","description":"Explore Siemens MQTT implementation for enhanced security and communication in the automation industry with AWS IoT Core.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dmcinfo.com\/blog\/40387\/siemens-mqtt-setup-with-aws-iot-core\/#primaryimage","url":"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg","contentUrl":"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/12\/18160938\/siemens-mqtt-setup-with-aws-iot-core.jpg","width":2560,"height":1107,"caption":"siemens mqtt setup aws iot core"},{"@type":"WebSite","@id":"https:\/\/www.dmcinfo.com\/#website","url":"https:\/\/www.dmcinfo.com\/","name":"DMC, Inc.","description":"","publisher":{"@id":"https:\/\/www.dmcinfo.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dmcinfo.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dmcinfo.com\/#organization","name":"DMC, Inc.","url":"https:\/\/www.dmcinfo.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dmcinfo.com\/#\/schema\/logo\/image\/","url":"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/05\/27171146\/dmc-logo-1.png","contentUrl":"https:\/\/cdn.dmcinfo.com\/wp-content\/uploads\/2025\/05\/27171146\/dmc-logo-1.png","width":418,"height":167,"caption":"DMC, Inc."},"image":{"@id":"https:\/\/www.dmcinfo.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pages\/DMC-Inc\/107982009242929","https:\/\/www.instagram.com\/dmcengineering","https:\/\/www.youtube.com\/DMCEngineering","https:\/\/www.linkedin.com\/company\/dmc-engineering"]},{"@type":"Person","@id":"https:\/\/www.dmcinfo.com\/#\/schema\/person\/9981060cefd0d7c54b42c0c3aa7eeaad","name":"Jiasen Zhang","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dmcinfo.com\/#\/schema\/person\/image\/","url":"\/\/www.dmcinfo.com\/wp-content\/uploads\/wpo365\/profile-images\/350.png","contentUrl":"\/\/www.dmcinfo.com\/wp-content\/uploads\/wpo365\/profile-images\/350.png","caption":"Jiasen Zhang"},"url":"https:\/\/www.dmcinfo.com\/blog\/author\/jiasenz\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/posts\/40387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/users\/350"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/comments?post=40387"}],"version-history":[{"count":7,"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/posts\/40387\/revisions"}],"predecessor-version":[{"id":41031,"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/posts\/40387\/revisions\/41031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/media\/40428"}],"wp:attachment":[{"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/media?parent=40387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/categories?post=40387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dmcinfo.com\/wp-json\/wp\/v2\/tags?post=40387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}