/aws-iot-dragonconnect-c

Primary LanguageHTMLApache License 2.0Apache-2.0

aws-iot-dragconnect-c

Arrow DragonConnect

For more information on the DragonConnect project, including how it is deployed and configured, visit the DragonConnect Project Page.

The DragonConnect project demonstrates recording events originating from the DragonBoard™ and managing an LED. The events are generated by pressing the volume up and volume down keys on the DragonBoard™. When one of the buttons is pressed, a client application written using the Amazon IoT C SDK for embedded platforms uses MQTT to transfer the event to an Amazon data center where it is stored in a DynamoDB table.

The LED is managed through the General Purpose IO (GPIO) of the DragonBoard™ and uses AWS IoT Device Shadows.

The functionality of DragonConnect and how the application is configured is detailed. The documentation includes information on how to execute the client and visit the dashboard.

Getting Started

Your DragonBoard™ must properly configured to connect to the internet and have Debian installed.

Prerequisite: These instructions are based on a clean install of the 16.09 version of Debian from the 96Boards site.

Please have the following information available:

After the setup has completed, there are a few urls that are provided. Please make note of them: AWS Endpoint, AWS API Gateway, and Dashboard

Setup AWS

Create a new user on AWS

  1. Log into the AWS management console
  2. Select the Identity & Access Management service
  3. From the navigation bar click the 'Users' link then click the 'Create New Users' button
  4. Enter name (i.e. IoTtester) and click the 'Create' button
  5. Click the 'Show User Security Credentials' link. Either copy or download credentials then click 'Close'
  6. Click the new user's name to bring up 'Summary' then select the 'Permissions' tab
  7. Click 'Attach Policy' and add the following (Note that less restrictive permission may work but have not been tested):
  • AWSLambdaFullAccess
  • IAMFullAccess
  • AmazonDynamoDBFullAccess
  • AmazonAPIGatewayAdministrator
  • AWSIoTFullAccess

Setup DragonConnect

Prepare Dragonboard

Install needed dependencies. Login as user:password == linaro:linaro, open a terminal window, and execute the following:

   $ sudo apt-get update
   $ sudo apt-get -y install python-pip libperl-dev libgtk2.0-dev
   $ sudo apt-get -y install python-dev python-yaml
   $ sudo apt-get -y install groff less
   $ pip install awscli

Verify the awscli installed correctly by executing $ aws help from the terminal command line and seeing that help is invoked.

Set up aws on Dragonboard

Still logged in as linaro, perform the following steps from the terminal window

  1. Create the working directory:
   $ mkdir -p /home/linaro/Documents/arrow
  1. Navigate to the working directory and clone the git repository
    $ cd /home/linaro/Documents/arrow
    $ git clone https://github.com/ArrowElectronics/aws-iot-dragonconnect-c.git
  1. Log in as root to execute the remaining steps of the demo
   $ sudo su -
  1. Run the aws configure command
   $ aws configure
   AWS Access Key ID [None]: <enter Access Key Id>
   AWS Secret Access Key [None]: <enter Secret Access Key>
   Default region name [None]: us-east-1
   Default output format [None]: <leave blank and just press enter/return>
  1. Run the setup script
    $ cd /home/linaro/Documents/arrow/aws-iot-dragonconnect-c/scripts
    $ cp -r /root/.aws /home/linaro
    $ ./setup.sh

Enter your amazon account ID and s3 unique identifier when prompted.

Note: You may see warnings during this step. Continue on before attempting to debug. The libaries in node and aws continue to evolve. Chances are the demo will still work. Also note the ThingID, synonomous with Device ID that you will need to select from the DragonConnect Dashboard below.

  1. Start the Client
    $ cd /home/linaro/Documents/arrow/aws-iot-dragonconnect-c/DragonBoard/bin
    $ ./aws_demo
  1. Visit the DragonConnect Dashboard shown at the end of setup script
   ###############################################
   # Build Complete
   ################################################
   #### Access your DragonConnect AWS Endpoint here: xxxx.amazonaws.com
   #### Access your DragonConnect AWS API Gateway here: https://xxx.amazonaws.com
   #### Access your DragonConnect Dashboard here: <THIS ONE> http://xxxx.amazonaws.com
  1. In the upper right corner of the DragonConnect Dashboard click on the "Select a Thing" dropdown and select your device

Test the demo

Press the + / - volume buttons on the DB410c and observe the DragonConnect Dashboard Volume Change Log update dynamically.

On the DragonConnect Dashboard select on or off on the LED Control and observer the LED on the Dragonboard turn on and off.

Uninstall and Cleanup

All the settings from the install are stored scripts/.settings

    $ cd scripts
    $ ./uninstall.sh 

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information