With AWS IoT, you can keep track of and 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.Set up MQTT.fx
MQTT.fx is a MQTT client written in Java, based on Eclipse Paho. Go to the website and download the software: http://mqttfx.jfx4ee.org/index.php/download.
Since you have installed MQTT.fx, open the software and let's 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.
- 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 learn how to connect your thing and get certificates files, follow this tutorial.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.Connect DragonBoard to AWS
If you don't know how to connect things to AWS, you can follow this tutorial to see how. After you 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 the Sigfox topic are displayed in MQTT.fx software, and if there is a rule in this topic, the data can be sent to smartphone and email, too.