the connected home: managing and innovating with offline devices
TRANSCRIPT
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Markku Lepistö - Principal Technology Evangelist
The Connected Home
Managing and Innovating with Offline Devices
AWS IoT
Any device can connect securelyAnyone can connect a device Getting started is easy
“Securely connect one or one-billion devices to AWS,
so they can interact with applications and other devices”
Security – IoT Requirements
Strong Authentication
Fine Grained Authorization
Secure Communication
Security – IoT Requirements
Strong Authentication
Secure Communication
Security – IoT Requirements
Strong Authentication
Secure Communication
Security – IoT Requirements
Strong Authentication
Secure Communication
Protect your Keys
Security – IoT Requirements
Strong Authentication
Secure Communication
Security – Secure Device
SDKs make it easy to be secure
TLS Mutual Authentication
We package a TLS software library with embedded C
Protocols / Interaction
Device Shadow
Protocols – MQTT
MQTTS vs HTTPS:
• 93x faster throughput
• 11.89x less battery to send
• 170.9x less battery to receive
• 50% less power to keep connected
• 8x less network overhead
Source:
http://stephendnicholas.com/archives/1217
• OASIS standard protocol (v3.1.1)
• Lightweight, pub-sub, transport protocol
that is useful for connected devices
• MQTT is used on oil rigs, connected
trucks, and many more sensitive and
resource-sensitive scenarios.
• Customers have needed to build,
maintain and scale a broker to use
MQTT with cloud applications
Protocols – MQTT – Use Cases
mydevices/#
mydevices/1
mydevices/2
mydevices/3
Protocols – MQTT – Use Cases
mydevices/4
mydevices/4
Protocols – MQTT – Use Cases
mydevices/4
mydevices/4
Protocols – MQTT – Use Cases
mydevices/to_all
mydevices/to_all
Protocols – MQTT – QoS 0
1
2
3
4
5
61,2,3,5,6
Protocols – MQTT – QoS 1
1
2
3
4
5
41,2,3,4,5,6
6
Protocols – MQTT – Keep Alive
PINGREQ
PINGRESP
Although TCP/IP in theory notifies you when a socket breaks, in practice, particularly on
things like mobile and satellite links, which often “fake” TCP over the air and put
headers back on at each end, it’s quite possible for a TCP session to “black hole”, i.e. it
appears to be open still, but in fact is just dumping anything you write to it onto the floor.
Andy Stanford-Clark on the topic “Why is the keep-alive needed?“ *
* https://groups.google.com/forum/#!msg/mqtt/zRqd8JbY4oM/XrMwlQ5TU0EJ
Protocols – AWS IoT Shadow
{
"state" : {
“desired" : {
"lights": { "color": "RED" },
"engine" : "ON"
},
"reported" : {
"lights" : { "color": "GREEN" },
"engine" : "ON"
},
"delta" : {
"lights" : { "color": "RED" }
} },
"version" : 10
}
Thing
Report its current state to one or multiple shadow
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
Protocols – AWS IoT Shadow Topics (MQTT)
$aws/things/{thing}/shadow/…
Publish
…/get: to get the latest shadow state
…/update: to update the shadow state
…/delete: to remove the shadow state
Subscribe
…/accepted: shadow accepted message
…/rejected: shadow rejected message
…/delta: differences between desired and reported
DEVICE SHADOWPersistent thing state
during intermittent
connections
Protocols – AWS IoT Shadow Use Case{
"state" : {
“desired" : {
"engine" : "ON”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"reported" : {
"engine" : ”OFF”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"version" : 10
}
Protocols – AWS IoT Shadow Use Case{
"state" : {
“desired" : {
"engine" : "ON”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"reported" : {
"engine" : ”OFF”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"delta" : {
”engine" : “ON”
} },
"version" : 10
}
"engine" : ”ON”
Protocols – AWS IoT Shadow Use Case{
"state" : {
“desired" : {
"engine" : "ON”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"reported" : {
"engine" : ”OFF”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"delta" : {
”engine" : “ON”
} },
"version" : 10
}
"engine" : ”OFF”
Protocols – AWS IoT Shadow Use Case{
"state" : {
“desired" : {
"engine" : "ON”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"reported" : {
"engine" : ”OFF”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"delta" : {
”engine" : “ON”
} },
"version" : 10
}
"engine" : "ON”
Protocols – AWS IoT Shadow Use Case{
"state" : {
“desired" : {
"engine" : "ON”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"reported" : {
"engine" : ”OFF”,
“tires”: {
“LF”:40,
“RF”:38,
“LR”:37,
“RR”:39
},
“CCD”: {
“A”:0,
“B”:8,
“C”:7,
“D”:9
}
},
"version" : 10
}
"engine" : "ON”
Getting Started with AWS IoT
How do I get started?
AWS IoT SDKs IoT Starter Kits
Getting Started – SDKs
Arduino (Arduino Yún)
Node.js (Ideal for Embedded Linux)
C – Embedded (Ideal for embedded OS)
Getting Started – Arduino Yún SDK
Arduino IDE
Libraries
Hardware Ecosystem
Getting Started – Arduino Yún SDK
Getting Started – Node.js SDK
Easy install with NPM
Supports Embedded
Linux Boards
High level, but easy
access to hardware
Getting Started – Node.js SDK
Getting Started – Embedded C SDK
Deeply embedded
Port to your platform
Delivered as source
w/ POSIX port
Getting Started – Porting Story
Board Manufacturers
TLS + MQTT
Shadow
Pub/Sub - 8kb code, 4k RAM
Shadow – 11kb code, 6k RAM
(MQTT and SDK, no TLS, TCP/IP)
Official IoT Starter Kits, Powered by AWS
Official IoT Starter Kits on Variety of Platforms
Broadcom WICED
BCM4343W
On Threadx/Netx
Marvell
EZConnect
MW302
On FreeRTOS
Renasas RX63N
On Micrium OS
TI CC3200
On TI-RTOSMicrochip WCM
PIC32 Platform
Intel Edison
on Yocto Linux
Mediatek
LinkOne
on Linkit OS
Dragonboard
410c on
Ubuntu
Seeeduino
Arduino on
openWRT
Beaglebone
Green on
Debian
Demo
Connected Home Telemetry Control
Temperature & Humidity Telemetry
AWS IoT
Intel
Edison
Shadow
Temp & Humi
Sensor
Demo
Controlling the Lights
Chip
AWS IoT
Intel
EdisonLambda
RelayState: True
Shadow
Publish
Rules
SNS
Demo
Voice Control
Chip
AWS IoT
Intel
EdisonLambda Function
Implements
Alexa Skill: Edison
Utterances: switch the
light on/off
RelayState: True
Shadow
Voice command: ‘Alexa – tell Edison to switch the light on’
Alexa SDK
Success response:
Say: ‘I switched the
light for you’
Call Skill
AWS IoT
Any device can connect securelyAnyone can connect a device Getting started is easy