SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
AWS Cloud Kata for Start-Ups and Developers
Hong
Kong
Programming the Physical World
with Device Shadows and Rules
Engine
Dickson Yue
Solutions Architect, AWS
AWS Cloud Kata for Start-Ups and Developers
Outline
• Shadows
• Rules
• Sample code
• Demo
AWS Cloud Kata for Start-Ups and Developers
AWS IoT
AWS Cloud Kata for Start-Ups and Developers
AWS IoT
AWS Cloud Kata for Start-Ups and Developers
Interact with with unreliable
connections thing
Device Shadow
AWS Cloud Kata for Start-Ups and Developers
AWS IoT Device Shadows flow
Shadow
Thing
SDK
1. Device publishes current state
2. Persist JSON data store
3. App requests device’s current state
4. App requests change the state
5. Device Shadow syncs
updated state
6. Device publishes current state
7. Device Shadow confirms state change
report {light: off}
get {light : off}
desire {light : on}
delta {light : on}
report {light : on}
reported {turbine: off}
desired{turbine: on}
reported {turbine: on}
AWS Cloud Kata for Start-Ups and Developers
AWS IoT Device Shadow - Simple Yet
{
"state" : {
“desired" : {
"light": “on”
},
"reported" : {
"light" : “off”
},
"delta" : {
"light" : “on”
} },
"version" : 10
}
Device
Report its current state to one or multiple shadows
Retrieve its desired state from shadow
Mobile App
Set the desired state of a device
Get the last reported state of the device
Delete the shadow
Shadow
Shadow reports delta, desired and reported
states along with metadata and version
AWS Cloud Kata for Start-Ups and Developers
DEMO
AWS Cloud Kata for Start-Ups and Developers
AWS Cloud Kata for Start-Ups and Developers
http://bit.ly/iot-plb
AWS Cloud Kata for Start-Ups and Developers
http://bit.ly/iot-plb2
AWS Cloud Kata for Start-Ups and Developers
AWS IoT
Device gateway
reported: {temp:27,
humidity: 80%}
Light
Amazon Alexa
Service
AWS Lambda
Sensor Tag
Light Bulb
Shadow
4. Update shadow
desired: {light: off}
Environment
Monitor
2. Update shadow
Switch
1. Sensors update
MQTT
MQTT over the WebSocket
HTTP
Alexa + Lambda
$$ charged by
Prices are based on the number of
messages published to AWS IoT
(Publishing Cost), and the number
of messages delivered by AWS IoT
to devices or applications (Delivery
Cost).
6. Update shadow
reported: {light: off}
AWS Cloud Kata for Start-Ups and Developers
Create a thing
AWSREGION='us-east-1’
THINGSNAME="lightbulb02”
POLICYNAME='smarthome-devices’
aws iot create-thing --thing-name $THINGSNAME --region $AWSREGION >things/thing-$THINGSNAME.json
CERTARN=$(aws iot create-keys-and-certificate --set-as-active --certificate-pem-outfile
./certs/$THINGSNAME-cert.pem --public-key-outfile ./certs/$THINGSNAME-publicKey.pem --private-key-
outfile ./certs/$THINGSNAME-privateKey.pem --output text --query 'certificateArn' --region $AWSREGION)
aws iot attach-thing-principal --thing-name $THINGSNAME --principal $CERTARN --region $AWSREGION
aws iot attach-principal-policy --principal $CERTARN --policy-name $POLICYNAME --region $AWSREGION
aws iot list-thing-principals --thing-name $THINGSNAME --region $AWSREGION
AWS Cloud Kata for Start-Ups and Developers
Load cert and private key
certfile="../../certs/grove-cert.pem",
keyfile="../../certs/grove-privateKey.pem",
rootCA="../../certs/root.pem",
AWS Cloud Kata for Start-Ups and Developers
Connect through MQTT libary
import paho.mqtt.client as mqtt
def init():
global client
try:
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
client.clientid = clientid
client.tls_set( "../../certs/root.pem",
certfile="../../certs/grove-cert.pem",
keyfile="../../certs/grove-privateKey.pem",
tls_version=ssl.PROTOCOL_TLSv1_2, ciphers=None )
client.connect("data.iot.us-east-1.amazonaws.com", 8883, 10)
client.loop_forever()
except:
print "Mqtt Unexpected error:", sys.exc_info()[0]
AWS Cloud Kata for Start-Ups and Developers
Connect through Python SDK
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
def init():
global client
try:
client = AWSIoTMQTTClient(clientid)
client.configureEndpoint(host, 8883)
client.configureCredentials(rootCAPath, privateKeyPath, certificatePath)
client.configureAutoReconnectBackoffTime(1, 32, 20)
client.configureDrainingFrequency(2) # Draining: 2 Hz
client.configureConnectDisconnectTimeout(10) # 10 sec
client.configureMQTTOperationTimeout(5) # 5 sec
client.connect()
thingLightbulb = client.createShadowHandlerWithName(thingLightbulbName, True)
thingLightbulb.shadowRegisterDeltaCallback(lightbulbShadowCallback_Delta)
except:
print "Unexpected error at init:", sys.exc_info()[0]
AWS Cloud Kata for Start-Ups and Developers
Read sensor data from Grove
try:
[ temp,hum ] = dht(dht_sensor_port,dht_sensor_type)
ppm = grovepi.analogRead(air_sensor)
aq = getairquality(ppm)
loudness = grovepi.analogRead(loudness_sensor)
light = grovepi.analogRead(light_sensor)
state = {
"temp" : temp,
"humidity" : hum,
"lightsensorvalue" : light,
"lightsensorresistance" : resistance,
"ppm" : ppm,
"airquality" : aq,
"loudness" : loudness,
"createdat" : nowstr
}
AWS Cloud Kata for Start-Ups and Developers
Update shadow through MQTT
state = {
"temp" : temp,
"humidity" : hum,
"lightsensorvalue" : light,
"lightsensorresistance" : resistance,
"ppm" : ppm,
"airquality" : aq,
"loudness" : loudness,
"createdat" : nowstr
}
msg = {
"state":{
"reported": state
}
}
topicshadow = "$aws/things/grove/shadow/update"
client.publish(topicshadow,json.dumps(msg),1)
AWS Cloud Kata for Start-Ups and DevelopersAWS Cloud Kata for Start-Ups and Developers
Connect through JavaScript
AWS Cloud Kata for Start-Ups and Developers
Connect through JavaScript
var region = c.AWS.region; //'ap-northeast-1'
var iotEndpoint = c.AWS.iotEndpoint;
var identityPoolId = c.AWS.identityPoolId;
AWS.config.region = region;
AWS.config.credentials = new AWS.CognitoIdentityCredentials({ IdentityPoolId: identityPoolId
});
AWS.config.credentials.get(function(){
var signedUrl = getSignedUrl();
initClient(signedUrl);
});
var requestUrl = 'wss://' + host + canonicalUri + '?' + canonicalQuerystring;
AWS Cloud Kata for Start-Ups and Developers
Connect through JavaScript
function initClient(requestUrl) {
var clientId = String(Math.random()).replace('.', '');
var client = new Paho.MQTT.Client(requestUrl, clientId);
mqttClient = client;
var connectOptions = {
onSuccess: function() {
client.subscribe(topiclightbulb);
client.subscribe(topicgrove);
},
useSSL: true, timeout: 3, mqttVersion: 4,
onFailure: function() { console.error('connect failed'); }
};
client.connect(connectOptions);
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
}
AWS Cloud Kata for Start-Ups and Developers
Update shadow through MQTT
function updateLightShadow(state) {
lightstate = state;
msg = "{"state": {"desired" : { "light":"" + lightstate + "" }}}";
topicshadow = topiclightbulbUpdate;
console.log(msg);
mqttClient.send(topicshadow, msg);
}
AWS Cloud Kata for Start-Ups and Developers
Button
Control
Voice
Control
AWS Cloud Kata for Start-Ups and Developers
Update shadow through Lambda
var AWS = require('aws-sdk');
var config = {iotendpoint: 'A1OMFFL4UASE1E.iot.us-east-1.amazonaws.com'};
var iotdata = new AWS.IotData({endpoint:config.iotendpoint});
var newstate = reported.light === "on"? "off" : "on";
var state = {
"state" : {
"desired" :{
"light" : newstate
}
}
}
var params = {
payload: JSON.stringify(state),
thingName: thingName
};
iotdata.updateThingShadow(params, function(err, data) {
callback(data);
});
AWS Cloud Kata for Start-Ups and Developers
Update shadow through Alexa
if ("AskLightControlIntent" === intentName) {
handleLightControlIntent(intent, session, callback);
}
function handleLightControlIntent(intent, session, callback) {
var switchSlot = intent.slots.Switch;
var sw = "";
if(switchSlot)
sw = switchSlot.value;
speechOutput = "The light is now " + sw +".";
var data = sw=="on" ? LightblubShadow.on : LightblubShadow.off;
var next = function(){
callback(sessionAttributes,
buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession));
}
updateShadow("lightbulb",JSON.stringify(data),next);
AWS Cloud Kata for Start-Ups and Developers
Rules engine
AWS Cloud Kata for Start-Ups and Developers
Extracting the value from messages
• Filter messages with certain criteria
• Move messages to other topics
• Move messages to other systems
• Transform the payload of messages
• Predict messages based on trends
• React based on messages
AWS Cloud Kata for Start-Ups and Developers
But how?
instance
database
?
AWS Cloud Kata for Start-Ups and Developers
But how?
Highly available?
Scalable?
Easy to operate?
Easy to change?
Easy to implement?
instance
database
AWS Cloud Kata for Start-Ups and Developers
Rules Engine
AWS Cloud Kata for Start-Ups and Developers
AWS IoT rules engine
predict,
republish
Amazon Machine
Learning
index
archive,
analyze
Amazon
DynamoDB
AWS
Lambda
Amazon
Redshift
process
AWS Cloud Kata for Start-Ups and Developers
AWS IoT - SQL Reference
SELECT DATA FROM TOPIC WHERE FILTER
• Like scanning a database table
• Default source is an MQTT topic
EXAMPLES:
• FROM mqtt(‘my/topic’)
• FROM mqtt(‘my/wildcard/+/topic’)
• FROM (‘my/topic’)
AWS Cloud Kata for Start-Ups and Developers
Rules Engine
• Familiar SQL syntax
• SELECT * FROM topic WHERE filter
• Functions
• String manipulation (regex support)
• Mathematical operations
• Context based helper functions
• Crypto support
• UUID, timestamp, rand, etc.
• Execute Simultaneous Actions
AWS Cloud Kata for Start-Ups and Developers
Quick example
SELECT reading, timestamp() as time
FROM example-topic/input
WHERE reading > 0
Republish to example-topic/output
AWS Cloud Kata for Start-Ups and Developers
Quick example
Publish a message
Receive the re-published,
transformed message
AWS Cloud Kata for Start-Ups and Developers
Secure
Pub/Sub
broker
Rules
Log
{1,2,3,4}
Monitoring DB
{1,2,3,4}
Alarm
{4}
blue/1 {temp:15}
blue/2 {temp:16}
blue/3 {temp:12}
blue/4 {temp:40}
temp = *
temp = select temp, lux
temp > 30
temp = * Search
{1,2,3,4}
AWS Cloud Kata for Start-Ups and Developers
new: Elasticsearch Integration
AWS Cloud Kata for Start-Ups and Developers
new: Predict Function
AWS Cloud Kata for Start-Ups and Developers
DEMO
AWS Cloud Kata for Start-Ups and Developers
ES Index
PUT awsiot-grove{
"mappings": {
"grove": {
"properties": {
"temp": { "type": "double" },
"humidity": { "type": "double“ },
"lightsensorvalue": { "type": "double“ },
"lightsensorresistance": { "type": "double“ },
"createdat": { "type": "date","format" : "yyyy-MM-dd HH:mm:ss" },
"time": { "type": "date" },
"timestamp": { "type": "date" }
}
}
}
}
AWS Cloud Kata for Start-Ups and Developers
Get Started with AWS IoT Device SDK
C-SDK
(Ideal for embedded
OS)
JavaScript-SDK
(Ideal for Embedded
Linux Platforms)
Arduino Library
(Arduino Yun)
Mobile SDK
(Android and iOS)
Java-SDKPython
AWS Cloud Kata for Start-Ups and Developers
Summary
• Shadows
• Nodejs, Python, JavaScript code
• Rules
• Elasticsearch integration

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Leveraging Elastic Web Scale Computing with AWS
 Leveraging Elastic Web Scale Computing with AWS Leveraging Elastic Web Scale Computing with AWS
Leveraging Elastic Web Scale Computing with AWS
 
無伺服器架構和Containers on AWS入門
無伺服器架構和Containers on AWS入門 無伺服器架構和Containers on AWS入門
無伺服器架構和Containers on AWS入門
 
AWS Elastic Beanstalk運作微服務與Docker
AWS Elastic Beanstalk運作微服務與Docker AWS Elastic Beanstalk運作微服務與Docker
AWS Elastic Beanstalk運作微服務與Docker
 
Application Delivery Patterns
Application Delivery PatternsApplication Delivery Patterns
Application Delivery Patterns
 
AWS Lambda 與 Amazon API Gateway 新功能介紹
AWS Lambda 與 Amazon API Gateway 新功能介紹AWS Lambda 與 Amazon API Gateway 新功能介紹
AWS Lambda 與 Amazon API Gateway 新功能介紹
 
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
 
"How to optimize the architecture of your platform" by Julien Simon
"How to optimize the architecture of your platform" by Julien Simon"How to optimize the architecture of your platform" by Julien Simon
"How to optimize the architecture of your platform" by Julien Simon
 
Workshop: Building Containerized Swift Applications on Amazon ECS
Workshop: Building Containerized Swift Applications on Amazon ECSWorkshop: Building Containerized Swift Applications on Amazon ECS
Workshop: Building Containerized Swift Applications on Amazon ECS
 
AWS APAC Webinar Week - Introduction to Cloud Computing With Amazon Web Services
AWS APAC Webinar Week - Introduction to Cloud Computing With Amazon Web ServicesAWS APAC Webinar Week - Introduction to Cloud Computing With Amazon Web Services
AWS APAC Webinar Week - Introduction to Cloud Computing With Amazon Web Services
 
以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端
 
Serverless architecture with AWS Lambda (June 2016)
Serverless architecture with AWS Lambda (June 2016)Serverless architecture with AWS Lambda (June 2016)
Serverless architecture with AWS Lambda (June 2016)
 
Getting Started with Docker on AWS
Getting Started with Docker on AWSGetting Started with Docker on AWS
Getting Started with Docker on AWS
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
Advanced Container Management and Scheduling
Advanced Container Management and SchedulingAdvanced Container Management and Scheduling
Advanced Container Management and Scheduling
 
如何快速開發與測試App
如何快速開發與測試App如何快速開發與測試App
如何快速開發與測試App
 
A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)
 
Deep Dive on Serverless App Development
Deep Dive on Serverless App DevelopmentDeep Dive on Serverless App Development
Deep Dive on Serverless App Development
 
AWS Power Tools: Advanced AWS CloudFormation and CLI
AWS Power Tools: Advanced AWS CloudFormation and CLIAWS Power Tools: Advanced AWS CloudFormation and CLI
AWS Power Tools: Advanced AWS CloudFormation and CLI
 
Container Management on AWS with ECS, Docker and Blox - Level 400
Container Management on AWS with ECS, Docker and Blox - Level 400Container Management on AWS with ECS, Docker and Blox - Level 400
Container Management on AWS with ECS, Docker and Blox - Level 400
 
A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)
 

Andere mochten auch

Andere mochten auch (20)

Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
Deep Dive on Amazon S3
Deep Dive on Amazon S3Deep Dive on Amazon S3
Deep Dive on Amazon S3
 
AWS Summit Auckland - Building a Server-less Data Lake on AWS
AWS Summit Auckland - Building a Server-less Data Lake on AWSAWS Summit Auckland - Building a Server-less Data Lake on AWS
AWS Summit Auckland - Building a Server-less Data Lake on AWS
 
AWS Summit Auckland Sponsor Presentation - Vocus
AWS Summit Auckland Sponsor Presentation - VocusAWS Summit Auckland Sponsor Presentation - Vocus
AWS Summit Auckland Sponsor Presentation - Vocus
 
Getting Started with the Hybrid Cloud: Enterprise Backup and Recovery
Getting Started with the Hybrid Cloud: Enterprise Backup and RecoveryGetting Started with the Hybrid Cloud: Enterprise Backup and Recovery
Getting Started with the Hybrid Cloud: Enterprise Backup and Recovery
 
Deep Dive: Developing, Deploying & Operating Mobile Apps with AWS
Deep Dive: Developing, Deploying & Operating Mobile Apps with AWS Deep Dive: Developing, Deploying & Operating Mobile Apps with AWS
Deep Dive: Developing, Deploying & Operating Mobile Apps with AWS
 
Grow Your SMB Infrastructure on the AWS Cloud
Grow Your SMB Infrastructure on the AWS CloudGrow Your SMB Infrastructure on the AWS Cloud
Grow Your SMB Infrastructure on the AWS Cloud
 
Next-Generation Firewall Services VPC Integration
Next-Generation Firewall Services VPC IntegrationNext-Generation Firewall Services VPC Integration
Next-Generation Firewall Services VPC Integration
 
Hack-Proof Your Cloud: Responding to 2016 Threats
Hack-Proof Your Cloud: Responding to 2016 ThreatsHack-Proof Your Cloud: Responding to 2016 Threats
Hack-Proof Your Cloud: Responding to 2016 Threats
 
Getting started with amazon aurora - Toronto
Getting started with amazon aurora - TorontoGetting started with amazon aurora - Toronto
Getting started with amazon aurora - Toronto
 
Another Day, Another Billion Packets
Another Day, Another Billion PacketsAnother Day, Another Billion Packets
Another Day, Another Billion Packets
 
Session Sponsored by Trend Micro: 3 Secrets to Becoming a Cloud Security Supe...
Session Sponsored by Trend Micro: 3 Secrets to Becoming a Cloud Security Supe...Session Sponsored by Trend Micro: 3 Secrets to Becoming a Cloud Security Supe...
Session Sponsored by Trend Micro: 3 Secrets to Becoming a Cloud Security Supe...
 
Getting Started with the Hybrid Cloud: Enterprise Backup and Recovery
 Getting Started with the Hybrid Cloud: Enterprise Backup and Recovery Getting Started with the Hybrid Cloud: Enterprise Backup and Recovery
Getting Started with the Hybrid Cloud: Enterprise Backup and Recovery
 
Expanding Your Data Center with Hybrid Cloud Infrastructure
Expanding Your Data Center with Hybrid Cloud InfrastructureExpanding Your Data Center with Hybrid Cloud Infrastructure
Expanding Your Data Center with Hybrid Cloud Infrastructure
 
Sony DAD NMS & Our Migration to the AWS Cloud
Sony DAD NMS & Our Migration to the AWS CloudSony DAD NMS & Our Migration to the AWS Cloud
Sony DAD NMS & Our Migration to the AWS Cloud
 
Creating Your Virtual Data Center: VPC Fundamentals and Connectivity Options
 Creating Your Virtual Data Center: VPC Fundamentals and Connectivity Options Creating Your Virtual Data Center: VPC Fundamentals and Connectivity Options
Creating Your Virtual Data Center: VPC Fundamentals and Connectivity Options
 
AWS Summit Auckland- Developing Applications for IoT
AWS Summit Auckland-  Developing Applications for IoTAWS Summit Auckland-  Developing Applications for IoT
AWS Summit Auckland- Developing Applications for IoT
 
S'étendre à l'international
S'étendre à l'internationalS'étendre à l'international
S'étendre à l'international
 
Introduction to AWS X-Ray
Introduction to AWS X-RayIntroduction to AWS X-Ray
Introduction to AWS X-Ray
 
Cloud: The Commercial Silver Lining for Partners
Cloud: The Commercial Silver Lining for PartnersCloud: The Commercial Silver Lining for Partners
Cloud: The Commercial Silver Lining for Partners
 

Ähnlich wie Programming the Physical World with Device Shadows and Rules Engine

Scalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWSScalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWS
Fernando Rodriguez
 
AWS Cloud Kata 2014 | Jakarta - Startup Best Practices
AWS Cloud Kata 2014 | Jakarta - Startup Best PracticesAWS Cloud Kata 2014 | Jakarta - Startup Best Practices
AWS Cloud Kata 2014 | Jakarta - Startup Best Practices
Amazon Web Services
 
2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up
Alex Heneveld
 

Ähnlich wie Programming the Physical World with Device Shadows and Rules Engine (20)

Programming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules EngineProgramming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules Engine
 
Scalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWSScalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWS
 
(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules
(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules
(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules
 
Programming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules EngineProgramming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules Engine
 
서버리스 IoT 백엔드 개발 및 구현 사례 : 윤석찬 (AWS 테크에반젤리스트)
서버리스 IoT 백엔드 개발 및 구현 사례 : 윤석찬 (AWS 테크에반젤리스트)서버리스 IoT 백엔드 개발 및 구현 사례 : 윤석찬 (AWS 테크에반젤리스트)
서버리스 IoT 백엔드 개발 및 구현 사례 : 윤석찬 (AWS 테크에반젤리스트)
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
 
2013 05-openstack-israel-heat
2013 05-openstack-israel-heat2013 05-openstack-israel-heat
2013 05-openstack-israel-heat
 
Deep Dive on AWS IoT
Deep Dive on AWS IoTDeep Dive on AWS IoT
Deep Dive on AWS IoT
 
AWS October Webinar Series - Getting Started with AWS IoT
AWS October Webinar Series - Getting Started with AWS IoTAWS October Webinar Series - Getting Started with AWS IoT
AWS October Webinar Series - Getting Started with AWS IoT
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
AWS Cloud Kata 2014 | Jakarta - Startup Best Practices
AWS Cloud Kata 2014 | Jakarta - Startup Best PracticesAWS Cloud Kata 2014 | Jakarta - Startup Best Practices
AWS Cloud Kata 2014 | Jakarta - Startup Best Practices
 
Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014
 
IOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoTIOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoT
 
Getting Started with AWS IoT - IOT203 - re:Invent 2017
Getting Started with AWS IoT - IOT203 - re:Invent 2017Getting Started with AWS IoT - IOT203 - re:Invent 2017
Getting Started with AWS IoT - IOT203 - re:Invent 2017
 
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
 
Startup Best Practices on AWS
Startup Best Practices on AWSStartup Best Practices on AWS
Startup Best Practices on AWS
 
Getting Started with AWS IoT - September 2016 Webinar Series
Getting Started with AWS IoT - September 2016 Webinar SeriesGetting Started with AWS IoT - September 2016 Webinar Series
Getting Started with AWS IoT - September 2016 Webinar Series
 
CloudFork
CloudForkCloudFork
CloudFork
 
AWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and Docker
 
2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up
 

Mehr von Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Programming the Physical World with Device Shadows and Rules Engine

  • 1. AWS Cloud Kata for Start-Ups and Developers Hong Kong Programming the Physical World with Device Shadows and Rules Engine Dickson Yue Solutions Architect, AWS
  • 2. AWS Cloud Kata for Start-Ups and Developers Outline • Shadows • Rules • Sample code • Demo
  • 3. AWS Cloud Kata for Start-Ups and Developers AWS IoT
  • 4. AWS Cloud Kata for Start-Ups and Developers AWS IoT
  • 5. AWS Cloud Kata for Start-Ups and Developers Interact with with unreliable connections thing Device Shadow
  • 6. AWS Cloud Kata for Start-Ups and Developers AWS IoT Device Shadows flow Shadow Thing SDK 1. Device publishes current state 2. Persist JSON data store 3. App requests device’s current state 4. App requests change the state 5. Device Shadow syncs updated state 6. Device publishes current state 7. Device Shadow confirms state change report {light: off} get {light : off} desire {light : on} delta {light : on} report {light : on} reported {turbine: off} desired{turbine: on} reported {turbine: on}
  • 7. AWS Cloud Kata for Start-Ups and Developers AWS IoT Device Shadow - Simple Yet { "state" : { “desired" : { "light": “on” }, "reported" : { "light" : “off” }, "delta" : { "light" : “on” } }, "version" : 10 } Device Report its current state to one or multiple shadows Retrieve its desired state from shadow Mobile App Set the desired state of a device Get the last reported state of the device Delete the shadow Shadow Shadow reports delta, desired and reported states along with metadata and version
  • 8. AWS Cloud Kata for Start-Ups and Developers DEMO
  • 9. AWS Cloud Kata for Start-Ups and Developers
  • 10. AWS Cloud Kata for Start-Ups and Developers http://bit.ly/iot-plb
  • 11. AWS Cloud Kata for Start-Ups and Developers http://bit.ly/iot-plb2
  • 12. AWS Cloud Kata for Start-Ups and Developers AWS IoT Device gateway reported: {temp:27, humidity: 80%} Light Amazon Alexa Service AWS Lambda Sensor Tag Light Bulb Shadow 4. Update shadow desired: {light: off} Environment Monitor 2. Update shadow Switch 1. Sensors update MQTT MQTT over the WebSocket HTTP Alexa + Lambda $$ charged by Prices are based on the number of messages published to AWS IoT (Publishing Cost), and the number of messages delivered by AWS IoT to devices or applications (Delivery Cost). 6. Update shadow reported: {light: off}
  • 13. AWS Cloud Kata for Start-Ups and Developers Create a thing AWSREGION='us-east-1’ THINGSNAME="lightbulb02” POLICYNAME='smarthome-devices’ aws iot create-thing --thing-name $THINGSNAME --region $AWSREGION >things/thing-$THINGSNAME.json CERTARN=$(aws iot create-keys-and-certificate --set-as-active --certificate-pem-outfile ./certs/$THINGSNAME-cert.pem --public-key-outfile ./certs/$THINGSNAME-publicKey.pem --private-key- outfile ./certs/$THINGSNAME-privateKey.pem --output text --query 'certificateArn' --region $AWSREGION) aws iot attach-thing-principal --thing-name $THINGSNAME --principal $CERTARN --region $AWSREGION aws iot attach-principal-policy --principal $CERTARN --policy-name $POLICYNAME --region $AWSREGION aws iot list-thing-principals --thing-name $THINGSNAME --region $AWSREGION
  • 14. AWS Cloud Kata for Start-Ups and Developers Load cert and private key certfile="../../certs/grove-cert.pem", keyfile="../../certs/grove-privateKey.pem", rootCA="../../certs/root.pem",
  • 15. AWS Cloud Kata for Start-Ups and Developers Connect through MQTT libary import paho.mqtt.client as mqtt def init(): global client try: client = mqtt.Client() client.on_connect = on_connect client.on_message = on_message client.clientid = clientid client.tls_set( "../../certs/root.pem", certfile="../../certs/grove-cert.pem", keyfile="../../certs/grove-privateKey.pem", tls_version=ssl.PROTOCOL_TLSv1_2, ciphers=None ) client.connect("data.iot.us-east-1.amazonaws.com", 8883, 10) client.loop_forever() except: print "Mqtt Unexpected error:", sys.exc_info()[0]
  • 16. AWS Cloud Kata for Start-Ups and Developers Connect through Python SDK from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient def init(): global client try: client = AWSIoTMQTTClient(clientid) client.configureEndpoint(host, 8883) client.configureCredentials(rootCAPath, privateKeyPath, certificatePath) client.configureAutoReconnectBackoffTime(1, 32, 20) client.configureDrainingFrequency(2) # Draining: 2 Hz client.configureConnectDisconnectTimeout(10) # 10 sec client.configureMQTTOperationTimeout(5) # 5 sec client.connect() thingLightbulb = client.createShadowHandlerWithName(thingLightbulbName, True) thingLightbulb.shadowRegisterDeltaCallback(lightbulbShadowCallback_Delta) except: print "Unexpected error at init:", sys.exc_info()[0]
  • 17. AWS Cloud Kata for Start-Ups and Developers Read sensor data from Grove try: [ temp,hum ] = dht(dht_sensor_port,dht_sensor_type) ppm = grovepi.analogRead(air_sensor) aq = getairquality(ppm) loudness = grovepi.analogRead(loudness_sensor) light = grovepi.analogRead(light_sensor) state = { "temp" : temp, "humidity" : hum, "lightsensorvalue" : light, "lightsensorresistance" : resistance, "ppm" : ppm, "airquality" : aq, "loudness" : loudness, "createdat" : nowstr }
  • 18. AWS Cloud Kata for Start-Ups and Developers Update shadow through MQTT state = { "temp" : temp, "humidity" : hum, "lightsensorvalue" : light, "lightsensorresistance" : resistance, "ppm" : ppm, "airquality" : aq, "loudness" : loudness, "createdat" : nowstr } msg = { "state":{ "reported": state } } topicshadow = "$aws/things/grove/shadow/update" client.publish(topicshadow,json.dumps(msg),1)
  • 19. AWS Cloud Kata for Start-Ups and DevelopersAWS Cloud Kata for Start-Ups and Developers Connect through JavaScript
  • 20. AWS Cloud Kata for Start-Ups and Developers Connect through JavaScript var region = c.AWS.region; //'ap-northeast-1' var iotEndpoint = c.AWS.iotEndpoint; var identityPoolId = c.AWS.identityPoolId; AWS.config.region = region; AWS.config.credentials = new AWS.CognitoIdentityCredentials({ IdentityPoolId: identityPoolId }); AWS.config.credentials.get(function(){ var signedUrl = getSignedUrl(); initClient(signedUrl); }); var requestUrl = 'wss://' + host + canonicalUri + '?' + canonicalQuerystring;
  • 21. AWS Cloud Kata for Start-Ups and Developers Connect through JavaScript function initClient(requestUrl) { var clientId = String(Math.random()).replace('.', ''); var client = new Paho.MQTT.Client(requestUrl, clientId); mqttClient = client; var connectOptions = { onSuccess: function() { client.subscribe(topiclightbulb); client.subscribe(topicgrove); }, useSSL: true, timeout: 3, mqttVersion: 4, onFailure: function() { console.error('connect failed'); } }; client.connect(connectOptions); client.onConnectionLost = onConnectionLost; client.onMessageArrived = onMessageArrived; }
  • 22. AWS Cloud Kata for Start-Ups and Developers Update shadow through MQTT function updateLightShadow(state) { lightstate = state; msg = "{"state": {"desired" : { "light":"" + lightstate + "" }}}"; topicshadow = topiclightbulbUpdate; console.log(msg); mqttClient.send(topicshadow, msg); }
  • 23. AWS Cloud Kata for Start-Ups and Developers Button Control Voice Control
  • 24. AWS Cloud Kata for Start-Ups and Developers Update shadow through Lambda var AWS = require('aws-sdk'); var config = {iotendpoint: 'A1OMFFL4UASE1E.iot.us-east-1.amazonaws.com'}; var iotdata = new AWS.IotData({endpoint:config.iotendpoint}); var newstate = reported.light === "on"? "off" : "on"; var state = { "state" : { "desired" :{ "light" : newstate } } } var params = { payload: JSON.stringify(state), thingName: thingName }; iotdata.updateThingShadow(params, function(err, data) { callback(data); });
  • 25. AWS Cloud Kata for Start-Ups and Developers Update shadow through Alexa if ("AskLightControlIntent" === intentName) { handleLightControlIntent(intent, session, callback); } function handleLightControlIntent(intent, session, callback) { var switchSlot = intent.slots.Switch; var sw = ""; if(switchSlot) sw = switchSlot.value; speechOutput = "The light is now " + sw +"."; var data = sw=="on" ? LightblubShadow.on : LightblubShadow.off; var next = function(){ callback(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession)); } updateShadow("lightbulb",JSON.stringify(data),next);
  • 26. AWS Cloud Kata for Start-Ups and Developers Rules engine
  • 27. AWS Cloud Kata for Start-Ups and Developers Extracting the value from messages • Filter messages with certain criteria • Move messages to other topics • Move messages to other systems • Transform the payload of messages • Predict messages based on trends • React based on messages
  • 28. AWS Cloud Kata for Start-Ups and Developers But how? instance database ?
  • 29. AWS Cloud Kata for Start-Ups and Developers But how? Highly available? Scalable? Easy to operate? Easy to change? Easy to implement? instance database
  • 30. AWS Cloud Kata for Start-Ups and Developers Rules Engine
  • 31. AWS Cloud Kata for Start-Ups and Developers AWS IoT rules engine predict, republish Amazon Machine Learning index archive, analyze Amazon DynamoDB AWS Lambda Amazon Redshift process
  • 32. AWS Cloud Kata for Start-Ups and Developers AWS IoT - SQL Reference SELECT DATA FROM TOPIC WHERE FILTER • Like scanning a database table • Default source is an MQTT topic EXAMPLES: • FROM mqtt(‘my/topic’) • FROM mqtt(‘my/wildcard/+/topic’) • FROM (‘my/topic’)
  • 33. AWS Cloud Kata for Start-Ups and Developers Rules Engine • Familiar SQL syntax • SELECT * FROM topic WHERE filter • Functions • String manipulation (regex support) • Mathematical operations • Context based helper functions • Crypto support • UUID, timestamp, rand, etc. • Execute Simultaneous Actions
  • 34. AWS Cloud Kata for Start-Ups and Developers Quick example SELECT reading, timestamp() as time FROM example-topic/input WHERE reading > 0 Republish to example-topic/output
  • 35. AWS Cloud Kata for Start-Ups and Developers Quick example Publish a message Receive the re-published, transformed message
  • 36. AWS Cloud Kata for Start-Ups and Developers Secure Pub/Sub broker Rules Log {1,2,3,4} Monitoring DB {1,2,3,4} Alarm {4} blue/1 {temp:15} blue/2 {temp:16} blue/3 {temp:12} blue/4 {temp:40} temp = * temp = select temp, lux temp > 30 temp = * Search {1,2,3,4}
  • 37. AWS Cloud Kata for Start-Ups and Developers new: Elasticsearch Integration
  • 38. AWS Cloud Kata for Start-Ups and Developers new: Predict Function
  • 39. AWS Cloud Kata for Start-Ups and Developers DEMO
  • 40. AWS Cloud Kata for Start-Ups and Developers ES Index PUT awsiot-grove{ "mappings": { "grove": { "properties": { "temp": { "type": "double" }, "humidity": { "type": "double“ }, "lightsensorvalue": { "type": "double“ }, "lightsensorresistance": { "type": "double“ }, "createdat": { "type": "date","format" : "yyyy-MM-dd HH:mm:ss" }, "time": { "type": "date" }, "timestamp": { "type": "date" } } } } }
  • 41. AWS Cloud Kata for Start-Ups and Developers Get Started with AWS IoT Device SDK C-SDK (Ideal for embedded OS) JavaScript-SDK (Ideal for Embedded Linux Platforms) Arduino Library (Arduino Yun) Mobile SDK (Android and iOS) Java-SDKPython
  • 42. AWS Cloud Kata for Start-Ups and Developers Summary • Shadows • Nodejs, Python, JavaScript code • Rules • Elasticsearch integration