Show Contents

# 5. Connect to AWS IoT

Once everything is properly configured, you can execute the demo application in the device:

    #> awsiot-sample

The device console displays information with every new update:

    =========================================
    Updating shadow...
    Temperature variation greater than 1C

    Temperature: 44.512000C
    CPU Load: 0.000000%
    LED status: OFF
    =========================================

Follow these steps to control the LED:

1. Log into your AWS IoT Console.
2. Click Test.
3. Enter # in the Subscription topic text field to subscribe to all topics.
4. In Publish > Specify a topic to publish to, type $aws/things/<thing_name>/shadow/update, where <thing_name> is the thing name of your registered device.
5. To switch on the LED, copy this in the text box:

    {
        "state" : {
            "desired" : {
                "ledON" : true
             }
         }
    }

Click to see a sample dialog box.

6. Press Publish to topic to send the message. The LED on the board switches on.
7. To switch off the LED, change "ledON" : true to "ledON" : false and publish the message.

    {
        "state" : {
            "desired" : {
                "ledON" : false
             }
         }
    }

© 2018 Digi International Inc. All rights reserved.
5. Connect to AWS IoT updated on 22 January 2018 02:43:38 PM