Building the Internet of Things with Thingsquare and Contiki - day 1, part 2

46,436 views

Published on

How to build the Internet of Things - what is an Internet of things device and how do we connect it? This is the second Thingsquare IoT workshop slide deck.

Published in: Technology

Building the Internet of Things with Thingsquare and Contiki - day 1, part 2

  1. 1. Lab 1: Big Red Internet Button
  2. 2. + = IoT!
  3. 3. 1. Press the button 2. Post something to the Internet
  4. 4. The Big Red Button • Two connectors – Ground – Signal • 12 v built-in LED
  5. 5. The Thingsquare kit • CC2538 System-on-a-Chip board – The heart of it all – Runs Contiki • Display board – LCD screen – JTAG debugger • Ethernet router
  6. 6. The Thingsquare cloud
  7. 7. The Thingsquare cloud • Connect your devices • Program your devices from your browser • Inspect the output
  8. 8. What we’ll do • Connect the button • Upload a program that does: – Reads the button – Does an HTTP POST to http://requestb.in/ • Inspect the output
  9. 9. Set up your device • Register the device with the Thingsquare cloud • Give it a name • Blink it
  10. 10. Set up the program • Create a new app – call it something unique – Like adam-button.c • Copy the contents of big-red-button.c – Don’t worry about the contents for now – we’ll go through all that
  11. 11. Set up a requestb.in • Go to http://requestb.in/ and create a RequestBin
  12. 12. RequestBin URL • Copy the RequestBin URL into the program: #define URL "http://requestb.in/abcdefghij" • • • • Run the program Press the button Reload the requestb.in page See the result
  13. 13. What we just did • Did an HTTP POST directly from the chip • Posted data via a webhook to a cloud service
  14. 14. Connecting a device to the IoT
  15. 15. The device
  16. 16. The Internet
  17. 17. More Internet The Internet
  18. 18. IPv4
  19. 19. IPv6 IPv4
  20. 20. IPv6/IPv4 router
  21. 21. The App
  22. 22. Cloud
  23. 23. Cloud Websocket
  24. 24. Cloud API
  25. 25. IPv6 to IPv4 translation: NAT64 • Translate IPv4 addresses to IPv6 addresses – 192.168.1.1 becomes ::fffff:192.168.1.1 – Remember the port numbers
  26. 26. DNS64 • Translate DNS names to IPv6-mapped IPv4 address
  27. 27. api.example.com?
  28. 28. 198.51.100.28
  29. 29. 198.51.100.28 64:ff9b::c633:641c
  30. 30. ws://api.example.com/
  31. 31. The IPv6 mesh
  32. 32. IPv6 primer • Addresses are really long – 128 bits • Example – fe80::1234:abcd:5678:ef01 • A device has several IPv6 addresses
  33. 33. The IPv6 mesh • Contiki automatically forms a wireless IPv6 network – Routing protocol called RPL • The Ethernet router is the root of the network
  34. 34. A RPL Directed Acyclic Graph
  35. 35. The RPL DAG • Every DAG has a DAG ID – The IPv6 address of the root • Every DAG has a version number
  36. 36. Let’s look at the RPL mesh! • Go to Status -> Mesh on the kit display
  37. 37. The Mesh display • • • • • • • • • The DAG ID The parent IPv6 address The DAG version RPL rank Number of neighbors Number of routes Estimated number of hops ETX: RPL link quality indicator RSSI: Received Signal Strength Indicator
  38. 38. Hands-on experimentation • • • • Cusp your hand over the antenna Watch the ETX go up Might choose another parent Hop count will then increase
  39. 39. This is what happened
  40. 40. Our hand stopped the radio signals
  41. 41. A better route was found
  42. 42. Eventually the network recovers
  43. 43. More like this http://thingsquare.com

×