8. 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 sync’s
updated state
6. Device Publishes Current State 7. Device Shadow confirms state change
AWS IoT Device Shadow Flow
9. AWS IoT Device Shadow - Simple Yet Powerful
{
"state" : {
“desired" : {
"lights": { "color": "RED" },
"engine" : "ON"
},
"reported" : {
"lights" : { "color": "GREEN" },
"engine" : "ON"
},
"delta" : {
"lights" : { "color": "RED" }
} },
"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
11. AWS IoT - SQL Reference
• Like scanning a database table
• Default source is an MQTT topic
EXAMPLES:
• FROM mqtt(‘my/topic’)
• FROM mqtt(‘my/wildcard/+/topic’)
• FROM (‘my/topic’)
SELECT DATA FROM TOPIC WHERE FILTER
And we’re about to get into the content, but here is a quick Overview of the IoT service.
Amazon Web Service’s IoT is a managed cloud platform that enables connected devices to easily and securely interact with cloud applications and other devices.
TLS 1.2 (certificate, private key, root CA)
WebSockets with SigV4
As you can see, several pieces in IoT that work together, we’ll use all of these in our workshop.
But what you get out of this is a fully managed, serverless, automatically scaling, pay as you go.