The device and AWS IoT Core use publish-subscribe based communication model using topics. In this task, you will configure AWS IoT to subscribe to a topic and then will use MQTT client (device) to send the message to the same topic. AWS IoT rule will take care of routing the message data in Amazon S3 bucket.
-
On the AWS IoT Core console, click on Test menu in the left. Enter iot/dojoinbound for the Subscription topic and click on the Subscribe to topic button. It is the same topic which AWS IoT rule is watching for the messages.
-
It moves to the subscriptions page where you can see all the messages sent to the topic. Keep the subscriptions page open in the browser.
-
While keeping the subscriptions page in the browser, open MQTT.fx client. Select dojodeviceprofile as the connection profile and click on the Connect button. Wait till the connection turns green.
-
On Publish tab, type in iot/dojoinbound next to the Publish button. Again, it is the same topic which AWS IoT rule is watching for the messages. Type in some message which you want to send from the device and click on the Publish button. The message is sent to the AWS IoT core.
-
Switch back to the AWS IoT subscriptions page already open in the browser, you can see the device message recieved by the AWS IoT core.
-
AWS IoT rule has also written the message to the configured Amazon S3 bucket. On the AWS S3 Console, when you open the bucket which you used for the message in the AWS IoT rule, you can see the message stored in an object.
-
This was a test of the inbound communication from the device to the AWS IoT core and then routing the message in Amazon S3 bucket.
-
Keep the AWS IoT Subscription page open and also the MQTT client (device) running as you will use them in the next task to send communication from the AWS IoT core to the device.