<?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[Initiating connection to AWS]]></title><description><![CDATA[<p dir="auto">Dear People<br />
I am currently working on a System that needs to connect to AWS. Sadly i get the following Error messages when I Execute my code: <img src="/assets/uploads/files/1679405031282-support-resized.png" alt="0_1679405029035_Support.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">I am using an ATOM Lite and UIFlow 1.11.3</p>
<p dir="auto">I hope you guys can help me</p>
<p dir="auto">With kind regards,<br />
TD</p>
]]></description><link>https://community.m5stack.com/topic/5147/initiating-connection-to-aws</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 15:16:57 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5147.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Mar 2023 13:25:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Initiating connection to AWS on Fri, 24 Mar 2023 16:42:00 GMT]]></title><description><![CDATA[<p dir="auto">Combination of error 09 (authentication acknowledgment error) and OS error shown in the command terminal</p>
]]></description><link>https://community.m5stack.com/post/20435</link><guid isPermaLink="true">https://community.m5stack.com/post/20435</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Fri, 24 Mar 2023 16:42:00 GMT</pubDate></item><item><title><![CDATA[Reply to Initiating connection to AWS on Fri, 24 Mar 2023 14:55:46 GMT]]></title><description><![CDATA[<p dir="auto">I tried restarting it, that didnt change anything.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> said in <a href="/post/20426">Initiating connection to AWS</a>:</p>
<blockquote>
<p dir="auto">If I read correctly it means that the MQTT connection to AWS wasn't acknowledge which meant permission was refused.<br />
Have you restarted the ATOM or has AWS changed anything?<br />
Sorry, I haven't used AWS in a while</p>
</blockquote>
<p dir="auto">Were did you read that the connection wasnt established?</p>
]]></description><link>https://community.m5stack.com/post/20434</link><guid isPermaLink="true">https://community.m5stack.com/post/20434</guid><dc:creator><![CDATA[bmtd111]]></dc:creator><pubDate>Fri, 24 Mar 2023 14:55:46 GMT</pubDate></item><item><title><![CDATA[Reply to Initiating connection to AWS on Thu, 23 Mar 2023 18:19:15 GMT]]></title><description><![CDATA[<p dir="auto">If I read correctly it means that the MQTT connection to AWS wasn't acknowledge which meant permission was refused.<br />
Have you restarted the ATOM or has AWS changed anything?<br />
Sorry, I haven't used AWS in a while</p>
]]></description><link>https://community.m5stack.com/post/20426</link><guid isPermaLink="true">https://community.m5stack.com/post/20426</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Thu, 23 Mar 2023 18:19:15 GMT</pubDate></item><item><title><![CDATA[Reply to Initiating connection to AWS on Thu, 23 Mar 2023 18:11:48 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for your reply!</p>
<p dir="auto">Here is my Pythoncode:</p>
<p dir="auto">from m5stack import *<br />
from m5ui import *<br />
from uiflow import *<br />
import machine<br />
import wifiCfg<br />
from IoTcloud.AWS import AWS<br />
import ntptime<br />
import json<br />
PingCounter = None<br />
ThingsName = None<br />
currentDoorState = None<br />
lastDoorState = None<br />
from numbers import Number</p>
<p dir="auto">@timerSch.event('AWSTimer')<br />
def tAWSTimer():<br />
global PingCounter, ThingsName, currentDoorState, lastDoorState, pin1<br />
if wifiCfg.wlan_sta.isconnected():<br />
PingCounter = (PingCounter if isinstance(PingCounter, Number) else 0) + 1<br />
aws.publish(str('DoorState/ping'),str((json.dumps(({'time':(ntp.formatDatetime('-', ':')),'ping':PingCounter,'reconnect':False})))))<br />
else:<br />
wifiCfg.doConnect('BesserMITTAG-IOT', "Zsip-uwYpDe'")<br />
PingCounter = (PingCounter if isinstance(PingCounter, Number) else 0) + 1<br />
aws.publish(str('DoorState/ping'),str((json.dumps(({'ping':PingCounter,'time':(ntp.formatDatetime('-', ':')),'reconnect':True})))))<br />
pass</p>
<p dir="auto">@timerSch.event('restartTimer')<br />
def trestartTimer():<br />
global PingCounter, ThingsName, currentDoorState, lastDoorState, pin1<br />
machine.reset()<br />
pass</p>
<p dir="auto">import gc<br />
wifiCfg.doConnect('blank', "blank'")<br />
ntp = ntptime.client(host='<a href="http://de.pool.ntp.org" target="_blank" rel="noopener noreferrer nofollow ugc">de.pool.ntp.org</a>', timezone=1)<br />
timerSch.run('restartTimer', 10800000, 0x00)<br />
PingCounter = 0<br />
ThingsName = 'D30002'<br />
aws = AWS(things_name=ThingsName, host='hostName', port=8883, keepalive=1000, cert_file_path="/flash/res/certificate.pem.crt", private_key_path="/flash/res/private.pem.key")<br />
aws.start()<br />
gc.collect()<br />
aws.publish(str('DoorState/connect'),str((json.dumps(({'connect':'request'})))))<br />
timerSch.run('AWSTimer', 900000, 0x00)<br />
pin1 = machine.Pin(26, <a href="http://mode=machine.Pin.IN" target="_blank" rel="noopener noreferrer nofollow ugc">mode=machine.Pin.IN</a>, pull=machine.Pin.PULL_UP)<br />
currentDoorState = pin1.value()<br />
while True:<br />
lastDoorState = currentDoorState<br />
currentDoorState = pin1.value()<br />
if lastDoorState == 1 and currentDoorState == 0:<br />
rgb.setColorAll(0x33cc00)<br />
aws.publish(str('DoorState/test'),str((json.dumps(({'open':(ntp.formatDatetime('-', ':')),'Message':'15','TopicArn':'arn:aws:sns:eu-central-1:684143602652:L-from-device','MessageAttributes':({'DataType':'String','StringValue':'door-opened'}),'DeviceID':({'DataType':'String','StringValue':'A1005'})})))))<br />
elif lastDoorState == 0 and currentDoorState == 1:<br />
rgb.setColorAll(0xff0000)<br />
aws.publish(str('DoorState/test'),str((json.dumps(({'close':(ntp.formatDatetime('-', ':')),'Message':'16','TopicArn':'arn:aws:sns:eu-central-1:684143602652:L-from-device','MessageAttributes':({'DataType':'String','StringValue':'door-closed'}),'DeviceID':({'DataType':'String','StringValue':'A1005'})})))))<br />
wait_ms(2)</p>
<p dir="auto">I have set everything up in AWS, the connection was already established and worked fine.<br />
Do you mean a device shadow with digital twin? I dont see how that could resolve the issue.</p>
<p dir="auto">With kind regards,<br />
TD</p>
]]></description><link>https://community.m5stack.com/post/20423</link><guid isPermaLink="true">https://community.m5stack.com/post/20423</guid><dc:creator><![CDATA[bmtd111]]></dc:creator><pubDate>Thu, 23 Mar 2023 18:11:48 GMT</pubDate></item><item><title><![CDATA[Reply to Initiating connection to AWS on Tue, 21 Mar 2023 20:46:21 GMT]]></title><description><![CDATA[<p dir="auto">Please post all the python code.<br />
errors don't always apply to a specific line and also don't count empty lines.<br />
IIRC (and there's a possibility I don't as it was last year) have you set up the digital twin and permissions on AWS for the code to connect?</p>
]]></description><link>https://community.m5stack.com/post/20400</link><guid isPermaLink="true">https://community.m5stack.com/post/20400</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Tue, 21 Mar 2023 20:46:21 GMT</pubDate></item><item><title><![CDATA[Reply to Initiating connection to AWS on Tue, 21 Mar 2023 15:14:50 GMT]]></title><description><![CDATA[<p dir="auto">Line 51 in my code is just aws.start() and it seems to call functions in the libraries. Maybe there is a bug in IoTCloud/AWS.py?</p>
]]></description><link>https://community.m5stack.com/post/20391</link><guid isPermaLink="true">https://community.m5stack.com/post/20391</guid><dc:creator><![CDATA[bmtd111]]></dc:creator><pubDate>Tue, 21 Mar 2023 15:14:50 GMT</pubDate></item></channel></rss>