This guide will walk you through the ASCII delimited UDP integration of your Murata 1SC module and AWS IoT Core.
Murata AWS IoT Core Setup
solution template, and the associated Cloud Formation template.IoT Bridge
.Solution Templates
.Murata to AWS IoT Core (Delimited)
template and click Import
.Help
at the bottom of the screen and open a ticket requesting a port be assigned for your application.In the future this step will not be required, but while routing via the internet, unique ports are required.
4.2. Enter the AWS IoT Core MQTT endpoint. The value should be just your host, such as aukyn7vasdf0dt-ats.iot.ca-central-1.amazonaws.com
.
4.3. Set an appropriate timeout. If there is no UDP activity within the timeout window, the MQTT connection to AWS IoT Core will be closed.
5. Click Import
. There should be no errors.
We will use the MQTT client built into the AWS Console to view the messages from our device.
IoT Core
.MQTT Test Client
in the left hand menu.Topic Filter
field, enter "#" and click Subscribe
.AT+CGSN
351521109953556,Hello from my device
3.2. Hex encode the value to something like:
3335313532313130373935333535362C48656C6C6F2066726F6D206D7920646576696365
3.3. Note the length of the unencoded string, you will need this below.
AT%SOCKETCMD="ALLOCATE",1,"UDP","OPEN","nostromo-udp.tartabit.com",<port>,5000
AT%SOCKETCMD="ACTIVATE",1
AT%SOCKETCMD="ALLOCATE",1,"UDP","OPEN","nostromo-udp.tartabit.com",<port>,5000
%SOCKETCMD:1
OK
AT%SOCKETCMD="ACTIVATE",1
OK
We will be sending the string you encoded above, strings must first be hex encoded before being transmitted.
AT%SOCKETDATA="SEND",1,36,"3335313532313130373935333535362C48656C6C6F2066726F6D206D7920646576696365"
AT%SOCKETDATA="SEND",1,36,"3335313532313130373935333535362C48656C6C6F2066726F6D206D7920646576696365"
%SOCKETDATA:1,36
OK
Now let's send a packet from AWS IoT Core and see it on our module.
Because we are using the internet for our communications, we have to navigate NAT timeouts, as such, you must send server to cloud messages within 1-2 minutes of sending a device to cloud message.
Publish to a topic
.Publish
to send the message.Note, that sending message from IoT Core to your device do not need the device ID in the message, the device ID is encoded in the topic.
%SOCKETEV:1,1
AT%SOCKETDATA="RECEIVE",1,15
%SOCKETEV:1,1
AT%SOCKETCMD="INFO",1
%SOCKETCMD:"ACTIVATED","UDP","10.173.253.197","34.31.200.41",5000,5002
OK
AT%SOCKETDATA="RECEIVE",1,15
%SOCKETDATA:1,15,0,"48656C6C6F2066726F6D2073657276","34.31.200.41",5002
OK
AT%SOCKETCMD="DEACTIVATE",1
AT%SOCKETCMD="DELETE",1
``
> You have completed this getting started guide.
{.is-info}