Introduction to the Internet Of Things ... using the MeshThing hardware running Contiki mesh-networking software for IPv6 / 6LoWPAN. Also, Daryl Wilding McBride (@darylwmcb) covers building a quadcopter for the Outback Joe competition.
1. Hands-on with the IoT
Daryl Wilding-McBride (DiUS)
Andy Gelme (geekscape.org, m9design.co)
2. The point(s) of this talk
1. Physical integration through open standards
is the next big thing
2. We should turn our minds to this new class
of application
3. It’s really easy to get started now
3.
4.
5. “It’s only the Internet of Things while it
doesn’t work.
As soon as it works, it’s a thermostat.”
Chris Anderson, 3DRobotics
6. “Q: What is the Internet Of Things, Mr
Salesman ?
A: Whatever matches my product range.”
Dick Selwood, EE Journal
So what is the Internet of Things... really?
9. Software
● Open source
● Ease of use
e.g. Arduino IDE
● Big Data platforms,
tools, technologies
Hardware
● Open source
● Innovation in cost /
power usage /
sophistication
● Maker movement
● 3D printing
● Fabrication services
(e.g. Shapeways)
● Easy-to-use building
blocks (e.g. Arduino)
Culture
● Drive for greater
efficiency / knowledge
/ safety
● Making decisions on
evidence
The confluence enables new classes of
applications to be built
10. “The best minds of my generation are
thinking about how to make people
click ads.
That sucks.”
Jeff Hammerbacher, Facebook’s first data scientist
11. From a technology perspective, good web
software delivery is a solved problem
12. From a technology perspective, good web
software delivery is a solved problem
IoT has lots of unsolved, worthwhile problems
that are very challenging
13. From a technology perspective, good web
software delivery is a solved problem
IoT has lots of unsolved, worthwhile problems
that are very challenging
We need to get good at solving them
14. Granularity of IoT building blocks
Generic building blocks …
● Arduino, sensors, actuators
Function specific building blocks
● Quadcopter with autopilot
Complete solutions
● Search & rescue UAVs
16. Sensors, actuators and controllers
Turning a collection of transducers into a single unit
Designed by John Spencer for the Caravan Of Terror
● ATtiny84 MCU < $1.50
● Linear potentiometer
○ Motorized slider
○ Capacitive touch
● LED display
● RGB LED string
● Multiple units controlled by I2CATtiny84 8-bit MCU
17. Turning multiple units into a subsystem
Designed by John Spencer for the Caravan Of Terror
18. Having reached this point the question becomes …
“How do we connect all the subsystems together ?”
and / or
“How do we connect these things to the Internet ?”
19. Connecting devices
Whenever you can … use cables
○ More bandwidth
○ Less latency
○ More reliable
○ More secure (assume no physical access)
○ Cheaper (for given bandwidth requirement)
○ Ethernet, e.g Freetronics EtherTen
20. Connecting devices
However, cables not possible in many situations
○ Devices are far apart
○ Devices that move around
○ Uneconomic, e.g retrofit building automation
21. Wireless networking choices
We are now spoilt with choice
○ 4G modems
○ WiFi, e.g SparkCore
○ Bluetooth Classic / Low Energy
○ Near Field Communication
○ nRF24 (Nordic Semiconductor)
○ 433 MHz e.g garage door opener
○ Mesh network: 802.15.4 + 6LoWPAN
22. Network design decisions
Driven by requirements
○ Development environment
○ Bandwidth and latency
○ Power consumption
○ Reliability
○ Security
○ Range
○ Cost
23. Likely outcome
Solution includes variety of different hardware
devices, networking and software stacks
There is no one magic silver bullet
Certainly not mesh networks … so, always read the fine print !
24. Why IPv6 / 6LoWPAN mesh networks ?
WiFi and Bluetooth LE are often good solutions
What if we require ?
● IP packets end-to-end (no protocol gateways)
● Peer-to-peer transmission (no access points)
● Very low energy consumption (milliWatts)
○ Minimal resources, deep sleep
● Simple discovery, routing, name resolution,
services
○ IETF open standards (RFC)
25. Some personal criteria
● Open-source hardware and software
● Low cost < $40
● Prototype: Off-the-shelf
● Production: Custom hardware
● Replace existing options, e.g Zigbee
○ Isn’t really open
○ Wasn’t IP based
○ Compatibility over time / between vendors
26. Network diagram
MeshThing #1
RPL Border Gateway
fd00:0:0:10::1
MeshThing #2
fd00:0:0:10::2
MeshThing #3
fd00:0:0:10::3
MeshThing #4
fd00:0:0:10::4
Raspberry Pi or OpenWRT
IPv6 Router
fd00:0:0:1::1/64 eth0
fd00:0:0:2::1/64 wlan0
fd00:0:0:10::1/64 tun0
SLIPDesktop / Laptop
IPv6 Node
fd00:0:0:1::2/64 eth0
LAN
Mobile device
IPv6 Node
fd00:0:0:2::2/64
WiFi
Everything is an IPv6 connected device
TCP, UDP and ICMP (ping) messages all work between any devices
27. Mesh network stack
● Message: MQTT or CoAP
● Service discovery: DNS-SD
● Name resolution: mDNS
● Transport: IETF ICMP / UDP / TCP
● Network: IETF IPv6 with 6LoWPAN, RPL (routing)
● Data link: IEEE 802.15.4 MAC (sicslowmac)
● Physical: IEEE 802.15.4 PHY (radio)
28. MeshThing hardware
● MeshThing
○ ATmega2564RFR2: SoC +
radio
○ XBee header layout
○ 16 I/O pins
○ Contiki OS
● MeshUSB
○ USB serial
○ LiPo battery / charging
○ Micro-SD card slot
○ Solar panel input
● MeshProto (stackable board)
31. ● Compile using avr-gcc (C programming)
● Build Contiki on Linux, MacOS or Windows
○ Raspberry Pi for development and gateway
● MeshThing runs STK500 bootloader (Arduino)
○ Use “avrdude” to download firmware
MeshThing programming
32. ● One host acting as mesh network router
● Enable IPv6 forwarding
● Acquire IPv6 Unique Local Address (ULA)
○ Address prefix fdxx:xxxx:xxxx/48
● IPv6 route advertisement for each interface
○ Run “radv” daemon (Linux)
○ Run “rtadv” daemon (Mac OS X)
● Clients run IPv6 route solicitation damon
Network configuration
StateLess Address Auto Configuration (SLAAC)
33. ● Get mDNS and DNS-SD working
● Port MQTT C client
○ Integration with NodeRed
● Port Firmata for NodeBots
○ Improvements for multiple nodes
● Support Arduino IDE
○ Arduino sketch as a loadable module
Work in progress
63. Choose a goal / project
Build your own sensor network (home / office)
Connect to Xively, ThingSpeak, SkyNet.IM … or D.I.Y
Build your own robot
NodeBots Days: http://nodebots.io
Build your own quadcopter
http://copter.ardupilot.com/wiki/build-your-own-multicopter
64. Typical process
● Understand the “problem” … multiple iterations
● Get a microcontroller, e.g Arduino
○ Connect sensors / actuators
○ Connect to LAN / WAN
● Get a Single Board Computer, e.g Raspberry Pi
○ Install MQTT (publish / subscribe message server)
○ Real-time monitor and control
○ Background data aggregation and presentation
● Think about power, networking, packaging
○ Prototyping => Fit For Purpose => Production
● Perfect the “user experience” … multiple iterations
65. Gadgets #1
https://www.temboo.
com/arduino
● Atheros AR9331, 400 MHz
○ 16 Mb Flash, 64 Mb RAM
○ Running OpenWRT (Linino)
○ Ethernet, WiFi, USB A
○ Micro-SD
● ATmega32u4
○ Arduino Leonardo
○ Serial connection to AR9331
74. Hopefully, we’ve convinced you ...
1. Physical integration through open standards
is the next big thing
2. We should turn our minds to this new class
of applications
3. It’s really easy and fun to get started now
75. Yow! Connect conference
● September 2014
● Internet of Things stream
● Mobile: Android and iOS streams
● Keynotes: Local and international luminaries
● Tentative dates …
○ Call For Papers
○ Open: 31st March, Closes: 30th May
○ Submitters notified: 23rd June
76. Staying in touch
Daryl Wilding-McBride
dwm@dius.com.au @DarylWMcB
http://dius.com.au
Andy Gelme
andyg@geekscape.org @geekscape
http://geekscape.org http://m9design.co