<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MQTT config for AWS IoT Core - SOLVED]]></title><description><![CDATA[<p dir="auto">Does anyone have a working configuration for MQTT and AWS IoT core?  Micropython code would be really helpful.  I have my certificate and private key uploaded to the device but am not sure where it's failing. Here is how my code looks:</p>
<pre><code>while True:
  m5mqtt = M5mqtt('m5stack', 'iot.us-west-2.amazonaws.com', 1883, '', '', 300, ssl = True, ssl_params = {'key': "/flash/res/m5.key", 'cert': "/flash/res/m5.crt"})
  m5mqtt.start()
  m5mqtt.publish(str('test'),str('hello world'))
  wait(1)
  wait_ms(2)
  wait(1)
  wait_ms(2)
</code></pre>
<p dir="auto">Re: <a href="/topic/1891/connecting-to-aws-iot-core">Connecting to AWS IoT Core</a></p>
]]></description><link>https://community.m5stack.com/topic/2688/mqtt-config-for-aws-iot-core-solved</link><generator>RSS for Node</generator><lastBuildDate>Thu, 07 May 2026 19:09:09 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2688.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 03 Jan 2021 04:13:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MQTT config for AWS IoT Core - SOLVED on Sun, 14 Mar 2021 15:05:41 GMT]]></title><description><![CDATA[<p dir="auto">Trying out the new AWS blocks but only getting<br />
<code>MQTTException -&gt; Server close socket link </code></p>
]]></description><link>https://community.m5stack.com/post/13006</link><guid isPermaLink="true">https://community.m5stack.com/post/13006</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 14 Mar 2021 15:05:41 GMT</pubDate></item><item><title><![CDATA[Reply to MQTT config for AWS IoT Core - SOLVED on Wed, 06 Jan 2021 01:39:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/greenleaf" aria-label="Profile: greenleaf">@<bdi>greenleaf</bdi></a> I've played around with it more tonight and the receipt of the publish on the device seems really random. I turned it on and sent 3 messages back to back and then nothing. I wonder if it has something to do with the port 8883.</p>
]]></description><link>https://community.m5stack.com/post/11559</link><guid isPermaLink="true">https://community.m5stack.com/post/11559</guid><dc:creator><![CDATA[ksprayberry]]></dc:creator><pubDate>Wed, 06 Jan 2021 01:39:04 GMT</pubDate></item><item><title><![CDATA[Reply to MQTT config for AWS IoT Core - SOLVED on Tue, 05 Jan 2021 03:14:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/greenleaf" aria-label="Profile: greenleaf">@<bdi>greenleaf</bdi></a> This is an excellent tutorial, I was able to follow through with it really well.  I can subscribe to the "test" topic on AWS and it is coming through regularly, but I am not able to receive a published topic "receive" on the device. It could be the internet service. ATT has been sketchy here in Georgia the past couple days.</p>
<p dir="auto">I was able to get the device to receive a couple times, but it seeks to be intermittent Again, thinking it's the sketch internet. Need to feed the squirrels in the router again or something.</p>
<p dir="auto">Thanks for posting this. I can see how this can be useful.</p>
]]></description><link>https://community.m5stack.com/post/11544</link><guid isPermaLink="true">https://community.m5stack.com/post/11544</guid><dc:creator><![CDATA[ksprayberry]]></dc:creator><pubDate>Tue, 05 Jan 2021 03:14:19 GMT</pubDate></item><item><title><![CDATA[Reply to MQTT config for AWS IoT Core - SOLVED on Sun, 03 Jan 2021 19:12:38 GMT]]></title><description><![CDATA[<p dir="auto">This took me way too long to figure out so here is a simple step by step guide for anyone else who's struggling with this:</p>
<h3>AWS Setup</h3>
<ol>
<li>Log onto your AWS account and pick a supported region for your IoT device. For example:<br />
<a href="https://us-west-2.console.aws.amazon.com/iot/home?region=us-west-2#/thinghub" target="_blank" rel="noopener noreferrer nofollow ugc">https://us-west-2.console.aws.amazon.com/iot/home?region=us-west-2#/thinghub</a></li>
<li>Click on Secure &gt; Policies.</li>
<li>Create a new policy and edit it in advanced mode. We're going to create a simple, open policy that is appropriate for development and experimenting. You can name your policy <code>m5stack</code>. Fill the policy contents with this JSON:</li>
</ol>
<pre><code>{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "iot:*",
      "Resource": "*"
    }
  ]
}
</code></pre>
<ol start="3">
<li>Click on 'Things' and then click 'Create'.</li>
<li>Click on 'Create a Single Thing'.</li>
<li>Give your thing a name. Example: <code>m5stick</code></li>
<li>You can leave the type, group, and attributes settings blank for now. Click Next.</li>
<li>Click on the top 'Create Certificate' button.</li>
<li>Download the cert file and the private key file.  You do not need the public key file. Rename these as simply <code>cert.pem</code> and <code>priv.key</code>. The shorter names are important as they can't be longer than 10 characters.</li>
<li>Click the 'Activate' button.</li>
<li>Click 'Attach a Policy'. Attach the m5stack policy you created in the previous step. Click 'Register Thing'.</li>
</ol>
<h3>AWS Monitoring</h3>
<p dir="auto">Now you're ready to monitor for published messages.</p>
<ol>
<li>Click on the 'Test' link on the left side of the page.</li>
<li>Enter <code>#</code> in the Subscription topic. This is a wildcard that will receive <em>all</em> messages for all topics.  Click 'Subscribe to Topic'.</li>
<li>View your endpoint. You can find it in the pulldown menu on the upper right:</li>
</ol>
<p dir="auto"><img src="/assets/uploads/files/1609660966420-view_endpoint.png" alt="0_1609660966279_view_endpoint.png" class=" img-fluid img-markdown" /></p>
<h3>UIFlow configuration</h3>
<p dir="auto">Finally you can upload your cert and key onto your device, and create some UIFlow code.</p>
<ol>
<li>Connect your device to UIFlow. Create a new MQTT block that looks like this, using your own URL:</li>
</ol>
<p dir="auto"><img src="/assets/uploads/files/1609661085944-example.png" alt="0_1609661085404_example.png" class=" img-fluid img-markdown" /></p>
<ol start="2">
<li>Change the port to <code>8883</code>. This is important, don't forget it. AWS runs MQTT on a non-standard port.</li>
<li>Click on the plus icon to upload your cert.pem and priv.key files onto your device. They will then be available in the pulldown menus.</li>
</ol>
<p dir="auto"><img src="/assets/uploads/files/1609661205877-example2.png" alt="0_1609661203820_example2.png" class=" img-fluid img-markdown" /></p>
<ol start="4">
<li>Finally, run the code on your device. You will now begin to see "hello world" messages appearing in the queue every second:</li>
</ol>
<p dir="auto"><img src="/assets/uploads/files/1609661278374-b0bd34a6-fc22-48f9-9eab-2d3331e803a3-image-resized.png" alt="0_1609661277903_b0bd34a6-fc22-48f9-9eab-2d3331e803a3-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Here's one last screenshot that includes an example of how to subscribe to messages on your device.  In this example you'd Publish a test message to the 'receive' topic. Just make sure you have a label0 somewhere on the screen.</p>
<p dir="auto"><img src="/assets/uploads/files/1609664736151-6227262f-c431-4a03-b840-2822e018980d-image-resized.png" alt="0_1609664735105_6227262f-c431-4a03-b840-2822e018980d-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/11513</link><guid isPermaLink="true">https://community.m5stack.com/post/11513</guid><dc:creator><![CDATA[greenleaf]]></dc:creator><pubDate>Sun, 03 Jan 2021 19:12:38 GMT</pubDate></item></channel></rss>