Introduction: AWS IOT - Set Up MQTT.fx, Sigfox Callback and DragonBoard
With AWS IoT, keep Track of & Communicate with All Your Devices, all the Time!
AWS IoT is a managed cloud platform that lets connected devices easily and securely interact with cloud applications and other devices. AWS IoT can support billions of devices and trillions of messages, and can process and route those messages to AWS endpoints and to other devices reliably and securely.
In this tutorial, you will connect to aws mqtt broker using MQTT.fx software and see messages in DragonBoard using AWS IOT Python SDK.
Step 1: Set Up MQTT.fx
MQTT.fx is a MQTT Client written in Java based on Eclipse Paho.
Go to the website and download teh software:
Since you have installed mqtt.fx, open the software and lets configure it to connect to AWS IOT
- Profile Name: As you like
- Broker Address: to get broker address go to the settings of your AWS IOT dashboard. (see in images)
- Broker port: 8883
- Client ID: Random
- Click on Enable SSL/TLS checkbox
- Select TLSv1.2 Protocol
- Check Self Signed certificates box:
- CA file: Upload your root-CA.crt file
- Client Certificate File: Upload your THING.cert.pem file
- Client key File: Upload your THING.private.key file
To know how to connect your thing ang get certificates files, follow this tutorial:
Step 2: Set Up Sigfox Callback
Login into your sigfox backend account, and go to Device Type screen to create a callback.
Ok, now click on CALLBACKS, in the left tab and next in new button.
Create an AWS IOT callback, in next screen select BASIC config method and click on launch stack button.
You will be redirected to AWS to create an IAM USER stack used by Sigfox to connect and push data to AWS IoT.
Now, copy your AWSAccountID, found in my account screen and the region you can find in URL, topic name use sigfox. Click next, next and create your stack.
Since the stack was created check stack button and click on Outputs, in there you can find your Access key, Secret key and topic to fill in Sigfox callback configuration.
In JSON body you can put:
You will receive the data sent by sigfox device.
Step 3: Connect DragonBoard to AWS
You can follow this tutorial to see how to connect things to AWS IOT: https://www.instructables.com/id/Getting-Started-With-AWS-IOT
After connect the board, go to:
- $ cd aws-iot-device-sdk-python/samples/basicPubSub
- $ vi basicPubSub.py
- replace the subscribed and published topics "sdk/test/Python" by "sigfox"
All the messages sent to sigfox topic is displayed in MQTT.fx software and if there is a rule in this topic, the data is sent to smartphone and email too.
We have a be nice policy.
Please be positive and constructive.