building end to end iot solutions
TRANSCRIPT
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
John Chang 張書源
Ecosystem Solutions Architect
May 2016
建構可彈性擴展規模、無伺服器的
行動裝置與物聯網應用後端環境
What to Expect from the Session
Demonstration
Mobile and IoT Usage Scenarios
AWS IoT SDKs and API
Architecture with AWS IoT
Demonstration
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
Dashboard
Amazon Cognito
Amazon
DynamoDB
User
SmatphoneUser
Serverless
Web Dashboard
Amazon S3
SDK JavaScript
SDK Android
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
AWS IoT Thing Shadow: Desired state
Shadow
{
"state":{
"desired":{
”pump":”1"
}
}
}
POST /things/Edison/state
AWS IoT Thing Shadow: Desired state
Shadow
{
"state":{
”pump":”1"
},
"version":"3",
"metadata":{
"color":<time-stamp>
}
}
MQTT $aws/things/Edison/shadow/update
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
AWS IoT Thing Shadow: Reported state
Shadow
{
"state":{
”reported":{
”pump":”1"
}
}
}
MQTT $aws/things/Edison/shadow/update
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"
}
}
]
}
Server-less
Intel Edison
Rule
AWS Lambda
Triggers Lambda function when humidity is too low
Rule
Mobile
ApplicationUser
AWS IoT
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"
}
}
]
}
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
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
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
AWS IoT SDKs and APIs
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)
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
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
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
AWS IoT CLI and Web Console
Additional Access to AWS IoT available:
• AWS CLI
• AWS IoT Web Console
AWS CLI AWS Management
Console
Common Design Architectures
with AWS IoT
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
Display complex metrics…… Using processing power from the AWS Cloud
AWS IoTConnected
device
AWS Lambda
Amazon
DynamoDB
Mobile
ApplicationUser
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
Thank You!