Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Developing Connected Applications with Amazon Web Services IoT

830 views

Published on


Amazon Web Services IoT is a managed cloud service that enables Internet-connected things to easily and securely interact with each other and cloud resources. We dive into demo applications that tie together physical IoT devices, web browsers and identity providers to create smart, connected applications using Amazon Web Services.
Speaker: Adam Larter, Solutions Architect, Amazon Web Services

Published in: Technology

Developing Connected Applications with Amazon Web Services IoT

  1. 1. ©  2016,  Amazon  Web  Services,  Inc.  or  its  Affiliates.  All  rights  reserved. Adam  Larter  – Principal  Solutions  Architect September  2016 Developing  Connected  Applications   with  AWS  IoT
  2. 2. 25Billion  “Things”  by  2020
  3. 3. What  is  a  ‘Thing’? • iPad’s  and  Mobile  Phones  are  “things” • Laptops  can  be  “things” • Biochips  are  definitely  “things” • Maker  devices  – Arduinos,  Raspberry  Pis,  Edisons -­ are  “things” • M2M  devices  are  a  common  “thing” • If  it’s  using  MQTT,  has  a  certificate,  and  an  IP  address  then  it’s  a   Thing
  4. 4. AWS  IoT DEVICE  SDK Set  of  client  libraries  to   connect,  authenticate  and   exchange  messages DEVICE  GATEWAY Communicate  with  devices  via   MQTT  and  HTTP AUTHENTICATION AUTHORISATION Secure  with  mutual   authentication  and  encryption RULES  ENGINE Transform  messages   based  on  rules  and   route  to  AWS  Services AWS  Services -­ -­ -­ -­ -­ 3P  Services DEVICE  SHADOW Persistent  thing  state   during  intermittent   connections APPLICATIONS AWS   IoT API DEVICE  REGISTRY Identity  and  management  of   your  things
  5. 5. Example: Connected  City
  6. 6. bit.ly/aws-­lightbulb
  7. 7. Light  Bulb  Moment Amazon   CloudFront Amazon   S3  Bucket AWS  IoT IoT shadow Amazon Cognito Amazon Cognito
  8. 8. Light  Bulb  Moment AWS  IoT Amazon Cognito IoT shadow
  9. 9. AWS  IoT DEVICE  SDK Set  of  client  libraries  to   connect,  authenticate  and   exchange  messages DEVICE  GATEWAY Communicate  with  devices  via   MQTT  and  HTTP AUTHENTICATION AUTHORISATION Secure  with  mutual   authentication  and  encryption RULES  ENGINE Transform  messages   based  on  rules  and   route  to  AWS  Services AWS  Services -­ -­ -­ -­ -­ 3P  Services DEVICE  SHADOW Persistent  thing  state   during  intermittent   connections APPLICATIONS AWS   IoT API DEVICE  REGISTRY Identity  and  management  of   your  things
  10. 10. Device  Shadow Plan  for  devices  to  lose  connectivity • Device  may  need  to  shut  down  when  idle  to  conserve  battery.   • Device  may  be  stable,  but  the  network  could  be  unreliable. Send  devices  commands  through  Shadows • Instead  of  wrangling  custom  topics  and  keeping  state  yourself,  use  the   Device  Shadow  to  abstract  away  the  topics  and  connectivity  issues. Query  device  state  through  Shadows • The  Device  Shadow  is  always  available,  even  if  the  device  is  not.
  11. 11. Thing reported   state desired   state MQTT AWS  Lambda The  device  itself  is  the   source  of  truth  for  the   ‘reported’  state.   Interested  parties  set   the  ‘desired’  state  to   request  a  change  to  the   state  of  the  device. Device  Shadow
  12. 12. ‘Desired’  State Used  to  request  a  change  to  device  state • Interested  parties  request  device  state  change  through  the  JSON  payload. Difference  between  ‘reported’  and  ‘desired’   triggers  a  ‘delta’  message  to  the  device • The  AWS  IoT device  shadow  compares  the  ‘reported’  state  with  the  ‘desired’   state,  and  any  properties  of  ‘desired’  not  present  or  different  in  the  ‘reported’   state  are  notified  via  a  ‘delta’  message.
  13. 13. $aws/things/myThingName/shadow/update Reserved  topic  structure   addresses  the  device   shadow  for  a  thing Device  Shadow  Topics
  14. 14. Security  is  Job  Zero
  15. 15. IoT certificate  and   private  key IoT policyAWS  IoT IoT ‘Thing’ LightBulb + MQTT  topics AWS  IoT – Securing  Device  Connections Certificate  provisioned   by  device  manufacturer AWS  IoT has  the  public  key  to   confirm  the  authenticity  of  the   certificate  and  the  connection   between  the  Thing  and  the   AWS  IoT service  is  encrypted Based  on  the  certificate  presented   by  the  Thing,  the  associated  IoT Policy  is  applied  to  allow/deny   actions  to  resources  (such  as   publishing  to  certain  MQTT  topics)
  16. 16. AWS  IoT DEVICE  SDK Set  of  client  libraries  to   connect,  authenticate  and   exchange  messages DEVICE  GATEWAY Communicate  with  devices  via   MQTT  and  HTTP AUTHENTICATION AUTHORISATION Secure  with  mutual   authentication  and  encryption RULES  ENGINE Transform  messages   based  on  rules  and   route  to  AWS  Services AWS  Services -­ -­ -­ -­ -­ 3P  Services DEVICE  SHADOW Persistent  thing  state   during  intermittent   connections APPLICATIONS AWS   IoT API DEVICE  REGISTRY Identity  and  management  of   your  things
  17. 17. Example  IoT Rule SELECT state.reported.info as info FROM '$aws/things/sensorBox/shadow/update' WHERE state.reported.target="LightBulb" Just  the  ‘info’  property  in  the   reported  state  message Only  messages  that  have  a   ‘target’  value  set  to  ‘LightBulb’
  18. 18. AWS  Lambda Zero  Administration • Focus  on  business  logic,  not  infrastructure • Upload  your  code  &  Lambda  handles  everything  else Auto  Scaling • Lambda  scales  the  infrastructure  as  needed  to  match  the  event  rate   and  pay  as  you  go Bring  Your  Own  Code • Python,  NodeJS &  Java  supported  now  with  other  languages  coming • Create  threads  and  processes,  run  batch  scripts  or  other  exe’s
  19. 19. AWS  SDKs
  20. 20. AWS  IoT SDKs Supported  languages  /  environments • Python • Embedded  C • iOS • Android • Javascript • NodeJS • Java • Arduino  Yun Support  device  shadow  and  custom  topics • Built  on  top  of  Paho MQTT  client  library,  the  SDK  abstracts  the   device  shadow  but  allows  direct  pub/sub Fully  documented • Rich  documentation  with  examples  on  GitHub
  21. 21. This  call  initialises the   thing  shadow,  passing  in   the  X.509  certificate  and   key  needed  to  secure  the   connection. AWS  IoT SDK  Abstraction
  22. 22. Listen  for  callbacks  – standard  event-­driven   model  in  NodeJS. AWS  IoT SDK  Abstraction
  23. 23. AWS  IoT SDK  Abstraction $aws/things/myThingName/shadow/update
  24. 24. Amazon   CloudFront Amazon   S3  Bucket AWS  IoT Amazon Cognito Amazon Cognito IoT shadow AWS Lambda Light  Bulb  Moment
  25. 25. Amazon   CloudFront Amazon   S3  Bucket Amazon Cognito Amazon Cognito IoT shadow AWS Lambda AWS  IoT Light  bulb  moment
  26. 26. Using  IoT Rules  to  Republish  Telemetry AWS  IoT IoT shadowSensors IoT Rule IoT shadow
  27. 27. bit.ly/awsiotcolour
  28. 28. Amazzon Kinesis   Stream Shard  /  Partition Lambda functions as adapters Serverless Event  Bus  – Event-­driven Amazon   API   Gateway AWS Lambda AWS  IoT message  broker External  data   provider Page  submits  request and  then  subscribes  to   a  topic  over  which  it receives  notification  events when  data  is  ready
  29. 29. Connecting  the  Disconnected • What  happens  when  the  world  can  access   connected  devices  that  cost  less  than  $5? Or  $3? • What  will  we  learn  when  we  have  access  to  more   information  about  the  world  around  us  in  real-­time? • What  if  you  could  interact  with  and  change  the  world   around  you  at  massive  scale? What  Will  You Build?
  30. 30. Thank  You!

×