amazon aws iot 利用 aws iot 開發智慧家居解決方案

31
建構可彈性擴展規模、無伺服器的 行動裝置與物聯網應用後端環境 John Chang 張書源 Ecosystem Solutions Architect [email protected]

Upload: cavedu-education

Post on 15-Apr-2017

1.382 views

Category:

Software


6 download

TRANSCRIPT

Page 1: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

建構可彈性擴展規模、無伺服器的行動裝置與物聯網應用後端環境

John Chang 張書源Ecosystem Solutions Architect

[email protected]

Page 2: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

What to Expect from the Session

Demonstration

Mobile and IoT Usage Scenarios

AWS IoT SDKs and API

Architecture with AWS IoT

Page 3: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS邁向創新

新服務發佈與更新數目

2009

48

280

722

82

2011 2013 2015

Page 4: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案
Page 5: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案
Page 6: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案
Page 7: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT

DEVICE SDKSet of client libraries to

connect, authenticate and exchange messages

DEVICE GATEWAYCommunicate with devices via

MQTT and HTTP

AUTHENTICATIONAUTHORIZATIONSecure with mutual

authentication and encryption

RULES ENGINETransform messages based on rules and

route to AWS Services

AWS Services-­ -­ -­ -­ -­

3P Services

DEVICE SHADOWPersistent thing state during intermittent connections

APPLICATIONS

AWS IoT API

DEVICE REGISTRYIdentity and Management of

your things

Page 8: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS Platform For IoT

AppBackend

API Gateway

Lambda

Edge Service

CloudFront

CompanionApps Analytics

RedShift

DataStorage

S3

SDKs

C, iOSAndroid

MachineLearning

Machine Learning

DynamoDB

AWS Global Infrastructure APN Partner Solutions

Kinesis

Ingestion, Protocols & Security

Device Shadows

Mobile Hub

EMR

Reference Hardware

RulesEngine

AWS IoT

Page 9: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案
Page 10: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

The Power Of Speech: Alexa

Alexa VoiceServices

AmazonEcho

AlexaSkills KitIoT Apps, Back

End System, Big Data, Machine Learning, Storage

Companion Apps

Lambda

AWS IoT

Voice Control

• Alexa -­ With the Alexa Skills Kit, you can easily build and add your own skills to Alexa.

• AWS IoT manages the connection devices and integration with ASK, as well as other backend systems and companion apps.

• Build skills for Alexa usingAWS Lambda. Simply write the code using and upload it as a Lambda function.

• Alexa Voice Service brings voice-­powered experiences to any connected devices.

Device Connection

Page 11: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Demonstration

Page 12: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Dashboard

Intel EdisonServerless

Web Dashboard

Amazon Cognito

AmazonDynamoDB

Rule

The rule pushes ALL data to an Amazon DynamoDB table

Rule

User

Mobile Application

User

AWS IoT

Page 13: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Dashboard

Amazon Cognito

AmazonDynamoDB

User

SmatphoneUser

ServerlessWeb Dashboard

Amazon S3

SDK JavaScript

SDK Android

Page 14: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT Thing Shadow: Desired state

Intel Edison

Desiredstate

Shadow

Desired state

Shadow

Ask for desired state to activate the pump

Mobile Application

User

AWS IoT

HTTPSMQTTS

Page 15: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT Thing Shadow: Desired state

Shadow

"state":"desired":”pump":”1"

POST /things/Edison/state

Page 16: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT Thing Shadow: Desired state

Shadow"state":”pump":”1"

,"version":"3","metadata":"color":<time-­stamp>

MQTT $aws/things/Edison/shadow/update

Page 17: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT Thing Shadow: Reported state

Intel Edison

Shadow

Reportedstate

Rule

Amazon SNS Mobile push

Send SNS Mobile Push Notification when pump has been activated

Rule

”reported": "pump": 1 Shadow

Mobile Application

User

AWS IoT

Page 18: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT Thing Shadow: Reported state

Shadow

"state":”reported":”pump":”1"

MQTT $aws/things/Edison/shadow/update

Page 19: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT Thing Shadow: Reported stateRule

"sql": "SELECT *FROM '$aws/things/Edison/shadow/update/delta'WHERE state.desired.pump = 1 AND state.reported.pump = 1","ruleDisabled": false,"actions": ["sns": "roleArn": "arn:aws:iam::xxxxxxxxxxx:role/iot-­role",”targetArn": "arn:aws:sns:us-­east-­1:xxxxxxxxxxx:ReInventDemo"

]

Page 20: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Server-­less

Intel Edison

Rule

AWS Lambda

Triggers Lambda function when humidity is too low

Rule

Mobile Application

User

AWS IoT

Page 21: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Server-­lessRule

"sql": "SELECT * FROM 'things/data'WHERE humidity < 20","ruleDisabled": false,"actions": ["lambda": "functionArn": "arn:aws:lambda:us-­east-­

1:xxxxxxxxxxx:function:pumpAlert"

]

Page 22: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT Button -­ “Hello World” of AWS IoT

• Based on the Amazon dash button hardware (Stateless Wi-­Fi Button)

• Code in the Cloud;; no device specific code or flashing required

• Learn Rules, Shadows and Topics

Build Cool Stuff

Page 23: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT to AWS Lambda to and External Endpoint

Lambda Function

Rules Engine

PolicyPrivate Key& Certificate

Thing/Device

RuleSDK

AWS IoT AWS Services

ExecutionRole Policy

External Endpoint

Permission

Select * from ‘iotbutton/+’

Action

Intel Edison

Page 24: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT to Amazon DynamoDB to Dashboard

DynamoDB Table

Rules Engine

PolicyPrivate Key& Certificate

Thing/Device

RuleSDK

AWS IoT AWS Services

Policy

Dashboard

IAM Role

Select * from ‘iotbutton/+’

Action DynamoDB S3 Website

Intel Edison

Page 25: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT SDKs and APIs

Page 26: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Get Started with AWS IoT Device SDK

C-­SDK(Ideal for embedded

OS)

JS-­SDK (Ideal for Embedded Linux Platforms)

Arduino Library(Arduino Yun)

Mobile SDK(Android and iOS)

Page 27: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

AWS IoT CLI and Web Console

Additional Access to AWS IoT available:• AWS CLI• AWS IoT Web Console

AWS CLI AWS Management Console

Page 28: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Common Design Architectures with AWS IoT

Page 29: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Building Automation / Mobile Control of IoT

• Dynamic Automation: Dynamically respond to Events happening in the Factoryex. Opening doors and requesting assistance when emergency button is pushed

• Mobile Control: Simplify mobile control of IoT/Factory automation devices with AWS IoT rules

IoT DevicesAWS cloudAWS Lambda

AWSIoT Rule

Mobile Application

Factory

Page 30: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Display complex metrics…… Using processing power from the AWS Cloud

AWS IoTConnecteddevice

AWS Lambda

AmazonDynamoDB

Mobile Application

User

Page 31: Amazon AWS IoT 利用 AWS IoT 開發智慧家居解決方案

Learn your user preferences…… And anticipate their needs

ServerlessWeb Dashboard

Millions of sources producing terabytes of data

IoT Devices

Mobile Application

AWS IoT AmazonKinesis

AmazonMachine Learning

Amazon S3