Understanding Device to AWS IoT Core Communication

   Go back to the Task List

  [« Create IoT Rule ]    [IoT to Device Communication »]

Device to IoT Communication

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.

  1. 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.

    Inbound

  2. 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.

    Inbound

  3. 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.

    Inbound

  4. 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.

    Inbound

  5. 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.

    Inbound

  6. 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.

    Inbound

  7. 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.

  8. 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.