Deep Dive on AWS IoT
-
Upload
amazon-web-services -
Category
Technology
-
view
3.410 -
download
0
Transcript of Deep Dive on AWS IoT
![Page 1: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/1.jpg)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Vadim Jelezniakov | Dev Manager, AWS IoT
19 April 2016
IoT on AWS
Deep Dive
![Page 2: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/2.jpg)
Goal: Answer these questions
1. How do I extract value from my device data?
Using IoT rules engine to process your data
2. How do I visualize my device data?
Connecting the rules engine to Elasticsearch/Kibana
3. How do I generate predictions?
Using Amazon Machine Learning predict function in
your IoT rules
![Page 3: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/3.jpg)
AWS IoT
![Page 4: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/4.jpg)
Back to the questions
1. How do I extract value from my device data?
Using IoT rules engine to process messages
2. How do I visualize my device data?
Connecting the rules engine to Elasticsearch/Kibana
3. How do I generate predictions ?
Using Amazon Machine Learning predict function in
your IoT rules
![Page 5: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/5.jpg)
Rules Engine
![Page 6: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/6.jpg)
Rules engine: Extracting value from messages
• Filter messages with certain criteria
• Transform the payload of messages
• React based on messages
• Move messages to other topics
• Move messages to other systems
• Predict changes based on trends
![Page 7: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/7.jpg)
What is a rule?
ruleArn: arn:aws:iot:<region>:<account_id>:rule/<uniq_rule_name>
rule:
• ruleName: human-readable name
• description: human-readable description
• ruleDisabled: true/false
• sql: e.g. SELECT * FROM ‘pm/topic’
• actions:
• action 1:
• action 2:
![Page 8: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/8.jpg)
What is a rule?
• ruleName: human-readable name
• description: human-readable description
• ruleDisabled: true/false
• sql: e.g. SELECT * FROM ‘pm/topic’
• actions:
• action 1:
• action 2:
![Page 9: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/9.jpg)
What is a rule?
• ruleName: human-readable name
• description: human-readable description
• ruleDisabled: true/false
• sql: e.g. SELECT * FROM ‘pm/topic’
• actions:
• action 1:
• action 2:
![Page 10: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/10.jpg)
Rules engine: Filter and transform
• Filter messages with certain criteria
• Transform the payload of messages
• React based on messages
• Move messages to other topics
• Move messages to other systems
• Predict changes based on trends
![Page 11: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/11.jpg)
Rules engine: Filter and transform
• SQL
• SELECT * FROM topic WHERE condition
• SELECT status.space_id AS room_id FROM
'iot/tempSensors/#' WHERE temp > 50
• Functions (in SELECT or WHERE)
• String manipulation (regex support)
• Mathematical operations
• Context-based helper functions
• Crypto support
• UUID, timestamp, rand, etc.
![Page 12: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/12.jpg)
Rules engine: React and move
• Filter messages with certain criteria
• Transform the payload of messages
• React based on messages
• Move messages to other topics
• Move messages to other systems
• Predict changes based on trends
![Page 13: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/13.jpg)
Rules engine: React (and move)
"rule": {
"ruleName": "republishPredictions”,
"ruleDisabled": false,
"sql": "SELECT no AS id, cycle AS c_number FROM 'pm/topic' WHERE failure = 1",
"description": "Republish ids of engines that are predicted to fail within 30 cycles",
"actions": [
{
"republish": {
"topic": "pm/failures",
"roleArn": "arn:aws:iam::012345678901:role/iot-actions-role”
}
}
],
}
![Page 14: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/14.jpg)
Rules engine: React (and move)
"rule": {
"ruleName": "republishPredictions”,
"ruleDisabled": false,
"sql": "SELECT no AS id, cycle AS c_number FROM 'pm/topic' WHERE failure = 1",
"description": "Republish ids of engines that are predicted to fail within 30 cycles",
"actions": [
{
"republish": {
"topic": "pm/failures",
"roleArn": "arn:aws:iam::012345678901:role/iot-actions-role”
}
}
],
}
![Page 15: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/15.jpg)
Rules engine: Move messages to other systems
• Filter messages with certain criteria
• Transform the payload of messages
• React based on messages
• Move messages to other topics
• Move messages to other systems
• Predict changes based on trends
![Page 16: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/16.jpg)
Rules engine: Move messages to other
systems
Invoke a Lambda function
Put object in an S3 bucket
Insert, update a
DynamoDB table
Publish to an SNS topic
or endpoint
Publish to a Kinesis stream
Publish to Firehose
Republish to AWS IoT
Publish to Elasticsearch
Capture a CloudWatch
metric or change an alarm
Write to SQS queue
![Page 17: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/17.jpg)
1. How do I extract value from my device data?
Using IoT rules engine to process messages
2. How do I visualize my device data?
Connecting the rules engine to Elasticsearch/Kibana
3. How do I generate predictions?
Using Amazon Machine Learning predict function in
your IoT rules
![Page 18: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/18.jpg)
1. How do I extract value from my device data ?
Using IoT Rules Engine to process messages
2. How do I visualize my device data?
Connecting the rules engine to Elasticsearch/Kibana
3. How do I generate predictions ?
Using Amazon Machine Learning (AML) predict
function in your IoT Rules
![Page 19: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/19.jpg)
ElasticSearch Integration - New
![Page 20: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/20.jpg)
Basic flow for using Elasticsearch
1. Configure your Elasticsearch domain
2. Use an IoT rule to send device data to the
Elasticsearch domain you configured
3. Use Kibana to visualize your device data
![Page 21: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/21.jpg)
![Page 22: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/22.jpg)
AWS IoT Elasticsearch demo
![Page 23: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/23.jpg)
1. How do I extract value from my device data?
Using IoT rules engine to process messages
2. How do I visualize my device data?
Connecting the rules engine to Elasticsearch/Kibana
3. How do I generate predictions?
Using Amazon Machine Learning predict function in
your IoT rules
![Page 24: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/24.jpg)
1. How do I extract value from my device data ?
Using IoT Rules Engine to process messages
2. How do I visualize my device data ?
Connecting the Rules Engine to ElasticSearch / Kibana
3. How do I generate predictions?
Using Amazon Machine Learning predict function in
your IoT rules
![Page 25: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/25.jpg)
Failures are often hard to predict
![Page 26: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/26.jpg)
Importance of the good predictions
Right balance depends on risk/cost ratio:
1. Predict a failure too soon = replacing a part
that doesn’t need repair yet – loss
2. No prediction = risk of sustaining a bigger loss
![Page 27: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/27.jpg)
Amazon ML Predict Function
![Page 28: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/28.jpg)
Basic flow for using predictions
1. Use an IoT rule to forward device data to S3
2. Train your Amazon ML model using the data from
S3
3. Use an IoT rule to:
• Obtain predicted value from real-time prediction
endpoint in Amazon ML
• Emit a CloudWatch metric (or trigger an alarm)
4. Use an IoT rule to emit details of a predicted failure
![Page 29: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/29.jpg)
AWS IoT predict function for Amazon ML
machinelearning_predict(
'ml-XXXXXX',
'arn:aws:iam::<account_id>:role/<role>',
*).predictedLabel
ml-XXXXXX – Amazon ML predictor you trained
account_id – your account ID
role – a role in your account that:
• Has access to Amazon ML
• Part of a trust relationship b/w your account and IoT
![Page 30: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/30.jpg)
AWS IoT predict demo
![Page 31: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/31.jpg)
More fun with WebSockets:
predict.vadimj.io
![Page 32: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/32.jpg)
Summary
• Extract value from device data: rules engine
• Visualize your data: rules engine with
Elasticsearch/Kibana integration
• Using predictions: machinelearning_predict()
![Page 33: Deep Dive on AWS IoT](https://reader034.fdocuments.in/reader034/viewer/2022042723/587125711a28abe4448b601d/html5/thumbnails/33.jpg)
Thank You!@vadimj