building end to end iot solutions

27
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. John Chang 張書源 Ecosystem Solutions Architect May 2016 建構可彈性擴展規模、無伺服器的 行動裝置與物聯網應用後端環境

Upload: amazon-web-services

Post on 12-Apr-2017

529 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Building End to end IoT solutions

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

John Chang 張書源

Ecosystem Solutions Architect

May 2016

建構可彈性擴展規模、無伺服器的

行動裝置與物聯網應用後端環境

Page 2: Building End to end IoT solutions

What to Expect from the Session

Demonstration

Mobile and IoT Usage Scenarios

AWS IoT SDKs and API

Architecture with AWS IoT

Page 3: Building End to end IoT solutions

Demonstration

Page 4: Building End to end IoT solutions

Dashboard

Intel EdisonServerless

Web Dashboard

Amazon Cognito

Amazon

DynamoDB

Rule

The rule pushes ALL data to an Amazon DynamoDB table

Rule

User

Mobile

ApplicationUser

AWS IoT

Page 5: Building End to end IoT solutions

Dashboard

Amazon Cognito

Amazon

DynamoDB

User

SmatphoneUser

Serverless

Web Dashboard

Amazon S3

SDK JavaScript

SDK Android

Page 6: Building End to end IoT solutions

AWS IoT Thing Shadow: Desired state

Intel Edison

Desired

state

Shadow

Desired state

Shadow

Ask for desired state to activate the pump

Mobile

ApplicationUser

AWS IoT

HTTPSMQTTS

Page 7: Building End to end IoT solutions

AWS IoT Thing Shadow: Desired state

Shadow

{

"state":{

"desired":{

”pump":”1"

}

}

}

POST /things/Edison/state

Page 8: Building End to end IoT solutions

AWS IoT Thing Shadow: Desired state

Shadow

{

"state":{

”pump":”1"

},

"version":"3",

"metadata":{

"color":<time-stamp>

}

}

MQTT $aws/things/Edison/shadow/update

Page 9: Building End to end IoT solutions

AWS IoT Thing Shadow: Reported state

Intel Edison

Shadow

Reported

state

Rule

Amazon SNS

Mobile push

Send SNS Mobile Push Notification when pump has been activated

Rule

”reported": { "pump": 1 }

Shadow

Mobile

ApplicationUser

AWS IoT

Page 10: Building End to end IoT solutions

AWS IoT Thing Shadow: Reported state

Shadow

{

"state":{

”reported":{

”pump":”1"

}

}

}

MQTT $aws/things/Edison/shadow/update

Page 11: Building End to end IoT solutions

AWS IoT Thing Shadow: Reported state

Rule

{

"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 12: Building End to end IoT solutions

Server-less

Intel Edison

Rule

AWS Lambda

Triggers Lambda function when humidity is too low

Rule

Mobile

ApplicationUser

AWS IoT

Page 13: Building End to end IoT solutions

Server-less

Rule

{

"sql": "SELECT * FROM 'things/data' WHERE humidity < 20",

"ruleDisabled": false,

"actions": [

{

"lambda": {

"functionArn": "arn:aws:lambda:us-east-

1:xxxxxxxxxxx:function:pumpAlert"

}

}

]

}

Page 14: Building End to end IoT solutions

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 15: Building End to end IoT solutions

AWS IoT to AWS Lambda to and External Endpoint

Lambda Function

Rules Engine

PolicyPrivate Key

& Certificate

Thing/Device

RuleSDK

AWS IoT AWS Services

Execution

RolePolicy

External Endpoint

Permission

Select * from ‘iotbutton/+’

Action

Intel Edison

Page 16: Building End to end IoT solutions

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/+’

ActionDynamoDB S3 Website

Intel Edison

Page 17: Building End to end IoT solutions

AWS IoT SDKs and APIs

Page 18: Building End to end IoT solutions

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 19: Building End to end IoT solutions

AWS IoT

DEVICE SDKSet of client libraries to

connect, authenticate and

exchange messages

DEVICE GATEWAYCommunicate with devices via

MQTT and HTTP

AUTHENTICATION

AUTHORIZATIONSecure 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 20: Building End to end IoT solutions

The Power Of Speech: Alexa

Alexa Voice

Services

Amazon

EchoAlexa

Skills 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 using AWS

Lambda. Simply write the code

using and upload it as a Lambda

function.

• Alexa Voice Service brings voice-

powered experiences to any

connected devices.

Dev

ice C

on

necti

on

Page 21: Building End to end IoT solutions

AWS Platform For IoT

App

Backend

API

Gateway

Lambda

Edge Service

CloudFront

Companion

AppsAnalytics

RedShift

Data

Storage

S3

SDKs

C, iOS

Android

Machine

Learning

Machine

Learning

DynamoDB

AWS Global Infrastructure APN Partner Solutions

Kinesis

Ingestion,

Protocols &

Security

Device

Shadows

Mobile Hub

EMR

Reference

Hardware

Rules

Engine

AWS IoT

Page 22: Building End to end IoT solutions

AWS IoT CLI and Web Console

Additional Access to AWS IoT available:

• AWS CLI

• AWS IoT Web Console

AWS CLI AWS Management

Console

Page 23: Building End to end IoT solutions

Common Design Architectures

with AWS IoT

Page 24: Building End to end IoT solutions

Building Automation / Mobile Control of IoT

• Dynamic Automation: Dynamically respond to Events happening

in the Factory

ex. 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

AWS

IoT Rule

Mobile

Application

Factory

Page 25: Building End to end IoT solutions

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

AWS IoTConnected

device

AWS Lambda

Amazon

DynamoDB

Mobile

ApplicationUser

Page 26: Building End to end IoT solutions

Learn your user preferences…… And anticipate their needs

Serverless

Web Dashboard

Millions of sources

producing

terabytes of data

IoT Devices

Mobile

Application

AWS IoT Amazon

Kinesis

Amazon

Machine Learning

Amazon S3

Page 27: Building End to end IoT solutions

Thank You!