AWS IoT is a managed cloud platform that allows connected IoT devices to easily and securely interact with cloud applications and other devices. In this session, we will discuss how constrained devices can leverage the AWS IoT service to send data to the cloud and receive commands back to the device using the protocol of their choice. We will discuss how devices can connect securely using MQTT and HTTP protocols, and how developers and businesses can leverage the AWS IoT Rules Engine, Thing Shadows, and accelerate prototype development using AWS IoT Device SDKs. Finally, we will cover new features released since the launch of AWS IoT including integration with Amazon Machine Learning and Amazon ElasticSearch Service.
2. What is so special about IoT?
• We are connecting the physical world
• Energy, scale, security
• Communication isn’t always stable
• Software on things
• Changing is hard, risky
• Where is the logic?
3. Goals:
1. The system of things
2. The life of a thing
3. The community of things
4. The wisdom of things
32. Goals:
1. The system of things
2. The life of a thing
3. The community of things
4. The wisdom of things
33. How can things interact?
• A thing can listen to a thing
• MQTT / WebSocket
• A thing can command others
• Querying/updating a shadow’s state
• Things can create a group discussion
• Listen and discuss a topic
• Things׳ autocracy
• Rules engine
• Application logic
• Distributed
39. App receiving telemetry
// Subscribe to messages on the turbine-1 topic
device.subscribe('turbine-1/data');
// Register a callback whenever we receive a message
device.on('message', function(topic, payload) {
// Print out the data we received
console.log('Got a message: ', topic, payload.toString());
});
42. AWS IoT device shadow - Simple yet powerful
{
"state" : {
"desired" : {
"lamp": "ON",
"fan" : "ON"
},
"reported" : {
"lamp": "OFF",
"fan" : "ON"
},
"delta" : {
"lamp": "ON",
} },
"version" : 10
}
Thing
Reports its current state to one or multiple shadows
Retrieves its desired state from shadow
Your application
Sets the desired state of a device
Gets the last reported state of the device
Shadow
Shadow reports delta, desired, and reported
states along with metadata and a version
49. 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
50. 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 an Amazon Kinesis
stream (and to EMR and Spark)
Publish to Firehose
Republish to AWS IoT
Publish to Amazon ES
Capture a CloudWatch
metric or change an alarm
Write to SQS queue
51. Rules engine: Move messages to other systems
Publish to Amazon Elasticsearch
Service
Write to SQS queue
Publish to an SNS topic
or endpoint
52. A rule in AWS IoT
aws iot create-topic-rule --rule-name WindFarmData --topic-rule-payload
{
"sql": "SELECT datapoint_id, current, rotation_speed, location,
topic(2) as turbine_id, timestamp() as time,
FROM 'wind-farm/+/data'",
"description": "Save data from wind turbines into Elasticsearch",
"actions": [
{
"elasticsearch": {
"roleArn": "arn:aws:iam::123456789012:role/aws_iot_windfarm",
"endpoint": "https://my-es-endpoint.us-west-2.es.amazonaws.com",
"index": "turbine-data",
"type": "measurement",
"id": "${CONCAT(datapoint_id, '_', turbine_id)}"
}}]}
RouteFilter, transform