Coder Social home page Coder Social logo

awsiot's Introduction

AWS IoT Core - task

prerequisits

node LTS AWS account AWS CLI credentials

  1. checkout project
git clone ... && cd project
  1. generate keys and certificate
aws iot create-keys-and-certificate \
--set-as-active \
--certificate-pem-outfile cert.crt \
--public-key-outfile public.pem.key \
--private-key-outfile private.pem.key \
--region eu-west-1 \
--profile private-default
  1. register a thing type

    1. Go to AWS console
    2. Select Ireland region
    3. Go to IoT Core
    4. Manage
    5. Types
    6. Create a thing type
      • Name: AGD
    7. Add another searchable thing attributes
      • Attribute key: producent
    8. Create thing type
  2. Create policy

    1. Secure
    2. Policies
    3. Create
      • Name: IoTFullAccess
      • Action: iot:*
      • Resource ARN: *
      • Effect: Allow
      • Create
  3. Attach policy to certificate

    1. Secure
    2. Certificates
    3. (...)
    4. Attach policy
    5. Select IoTFullAccess
    6. Attach
  4. Create a thing

    1. Manage
    2. Things
    3. Create
    4. Create a single thing
      • Name: Czajnik
      • Thing type: AGD
      • producent: amica
      • Next
      • Create thing without certificate
  5. Attach certificate to a thing

    1. Secure
    2. Certificates
    3. (...)
    4. Attach thing
      • czajnik
    5. Attach
  6. Install project dependencies with

npm install
  1. Update clientId from settings and Endpoint url in index.js
  2. Run program with
node index.js
  1. Type on, off or status to play with device shadow state. Confirm each command with enter

  2. Set Action based on a rule

    1. Act
    2. Create a rule
      • Name: turnedOn
      • Query: select * from '$aws/things/czajnik/shadow/update/accepted'
      • Actions: Republish
      • Topic: AGD
      • Add action
      • Create Rule
  3. Update clientId from settings and Endpoint url in thing.js

  4. Turn on thing.js in new terminal window with

node thing.js
  1. Navigate to shadow program (previous terminal window)
  2. Type on and enter
  3. To vetify if thing was notified with shadow update navigate to thing.js terminal and check if message is visible.

awsiot's People

Stargazers

Boguslaw Tarnowski avatar

Watchers

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