Coder Social home page Coder Social logo

aws-iot-intel's Introduction

Getting Started With Amazon Web Services IoT on Intel Edison

Intel Edison + AWS IoT

Prepare your Intel Edison:

Get started with your Intel Edison by updating to the latest firmware and setting up a serial terminal. You can find instructions here: Get started with Intel Edison technology

Install AWS CLI:

Install pip (Python package manager):

$ curl https://bootstrap.pypa.io/ez_setup.py -o - | python
$ easy_install pip

Install AWS CLI with pip:

$ pip install awscli

Install dependencies: In order to view help files ("aws iot help"), install Groff and a non-BusyBox version of less.

Groff:

$ wget http://ftp.gnu.org/gnu/groff/groff-1.22.3.tar.gz
$ tar -zxvf groff-1.22.3.tar.gz
$ cd groff-1.22.3
$ ./configure
$ make
$ make install
$ export PATH=$PATH:/usr/local/bin/
$ cd ~

Less: First rename the old version of less.

$ mv /usr/bin/less /usr/bin/less-OLD

Then install the new version of less:

$ wget http://www.greenwoodsoftware.com/less/less-458.zip
$ unzip less-458.zip
$ cd less-458
$ chmod 777 *
$ ./configure
$ make
$ make install
$ cd ~

To make sure everything has installed correctly, run the iot help file:

$ aws iot help

Get AWS credentials:

Aws Cli is now installed. Make new user and get credentials from the aws console following instructions at: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html#cli-signup. Once you have an access ID and key you can configure aws and enter the ID and key with:

aws configure 

NOTE: for default region you must enter us-east-1 in order to be able to configure AWS for IoT. The default format can be left as json.

In order to get permission to download the AWS IoT tools, attach the administrator account policy to the user. To do this go to the "Users Panel" in the IAM console, select the user you created, attach policy, and select administrator account.

Generate Certificates:

First create a folder to store your certificates in:

mkdir aws_certs
cd aws_certs

Generate a private key with open ssl:

$ openssl genrsa -out privateKey.pem 2048
$ openssl req -new -key privateKey.pem -out cert.csr
  • Fill out the fields with your info.
  • Run the following to activate the certificate:
$ aws iot --endpoint-url https://i.us-east-1.pb.iot.amazonaws.com create-certificate --certificate-signing-request file://cert.csr --set-as-active > certOutput.txt

Run the following to save the certificate into a cert.pem file:

$ aws iot --endpoint-url https://i.us-east-1.pb.iot.amazonaws.com describe-certificate --certificate-id <certificate ID> --output text --query certificateDescription.certificatePem  > cert.pem

NOTE: Replace with the ID stored in the "certificateId" field in certOutput.txt. To view the file enter:

$ more certOutput.txt.

Create a Json policy document for AWS IoT SDK: Copy the following text (ctrl-c):

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "iot:*"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}
  • Enter "$ vi policy.doc" hit "a" and right-click to paste the text.
  • Hit escape and type in ":wq" to save and quit.

** Attach the policy to your certificate ** First enter:

$ aws iot --endpoint-url https://i.us-east-1.pb.iot.amazonaws.com create-policy --policy-name PubSubToAnyTopic --policy-document file://policy.doc

Then attach the policy to the certificate with:

$ aws iot --endpoint-url https://i.us-east-1.pb.iot.amazonaws.com attach-principal-policy --principal-arn <principal arn> --policy-name "PubSubToAnyTopic" 

NOTE: replace with the value stored in "certifcateArn" in the outputCert.txt file.

aws-iot-intel's People

Contributors

vielmetti avatar w4ilun avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.