Giter Site home page Giter Site logo

stevenxdeng / aws_autohome Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 942 KB

A Serverless solution of home automation with different types of IoT devices implemented in Amazon Web Services (AWS).

License: MIT License

Python 100.00%
aws serverless aws-lambda iot

aws_autohome's Introduction

AWS Autohome

Author: Hsien-wen "Steven" Deng
See my demo video here

Introduction

    This is a Serverless solution of home automation with different types of IoT devices implemented in Amazon Web Services (AWS). In this case, two type of IoT devices are tested in this application, light and Thermostat. Users can interact with these devices through a client program. User can add, remove or switch a light, and set temperature for a thermostat.
    All the actions are taken place in AWS with a serverless architecture. As figure 1 shows, two DynamoDB databases (i.e. Device Database, Event Database) are deployed for devices and events. After the user making an action, the client program will deliver a message through Kinesis Data Stream (KDS) and trigger the Autohome Function. The Autohome function then updates both Device Database and Event Database, and publish a message using MQTT through AWS IoT Core. Devices subscribe to this MQTT topic can then act based on the message. In this case, there are no physical devices deployed, all the presentations only cover client side and cloud side. Nevertheless, physical devices connections are still possible as future extensions.

There are two major components in this branch to help you build up Autohome:
Template: The template includes a system of AWS services allows you to establish this application.
Client Program: The client program is a Python script running to test the availability of your cloud application and interact with IoT devices.

alt text
Figure 1. Architecture review of Autohome

Prerequisite

  1. Python 3.8
  2. AWS Account
    AWS Educate may not be eligible due to lack of permission configuring CLI
  3. AWS User Credential
    1. From AWS Console go to IAM
    2. Select to users
    3. Click Add user
    4. Select Programmatic access for the AWS access type to generate an access key ID and secret access key for use with the AWS API, CLI, SDK, and other development tools
    5. Select the created user and select Security Credentials tab
    6. Click Create access key and copy the access key ID and secret access key after a new user is created
      For more details, please check: AWS IAM
  4. AWS CLI
    1. Download AWS CLI and install
    2. Open CMD (Windows) or Terminal (Linux): aws configure
    3. Input access key ID and secret access key copied from 3
    4. Configure region (default "us-east-1")
    5. Configure output (default "json")
      For more details, please check: AWS CLI Configuration Guide

Build-up Application

  1. From AWS Console go to CloudFormation
  2. Click Create stack
  3. Select Upload a template file and upload Autohome_Template.json
  4. Input a name and click Create stack
    Check you AWS region to be US-EAST-1 (N. Virginia)

Test Application

  1. Install boto3: python -m pip install boto3
  2. Run Autohome_Client.py: python Autohome_Client.py(Linux / OS X)
                                             py Autohome_Client.py(Windows)
  3. Check the changes you applied
    1. Through Client Program: Select 4) See Device Database or 5) See Event Database
    2. Through AWS: You can use both DynamoDB and IoT Core
      1. DynamoDB
        1. From AWS Console go to DynamoDB
        2. Select Tables
        3. Enter Autohome_collection (Device Database) or Autohome_logs (Event Database)
        4. Select items to find applied changes
      2. IoT Core
        1. From AWS Console go to IoT Core
        2. Select Test then choose MQTT test client
        3. Select Subscribe to a topic
        4. In Topic filter, input /autohome/topic
        5. Click the Subsribe button

Destroy Application

  1. From AWS Console go to CloudFormation
  2. Choose target stack
  3. Delete target stack

License

MIT

aws_autohome's People

Contributors

stevenxdeng avatar

Watchers

 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.