internet of things: hands on: yow! night
DESCRIPTION
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.TRANSCRIPT
Hands-on with the IoT
Daryl Wilding-McBride (DiUS)
Andy Gelme (geekscape.org, m9design.co)
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
“It’s only the Internet of Things while it doesn’t work.
As soon as it works, it’s a thermostat.”
Chris Anderson, 3DRobotics
“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?
Why now ?
What has changed?
Software● Open source
● Ease of usee.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
“The best minds of my generation are thinking about how to make people
click ads.
That sucks.”
Jeff Hammerbacher, Facebook’s first data scientist
From a technology perspective, good web software delivery is a solved problem
From a technology perspective, good web software delivery is a solved problem
IoT has lots of unsolved, worthwhile problems that are very challenging
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
Granularity of IoT building blocksGeneric building blocks …● Arduino, sensors, actuators
Function specific building blocks● Quadcopter with autopilot
Complete solutions● Search & rescue UAVs
Generic building block: MeshThing
Sensors, actuators and controllers
Turning a collection of transducers into a single unitDesigned 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
Turning multiple units into a subsystemDesigned by John Spencer for the Caravan Of Terror
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 ?”
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
Connecting devices
However, cables not possible in many situations
○ Devices are far apart○ Devices that move around○ Uneconomic, e.g retrofit building automation
Wireless networking choicesWe 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
Network design decisions
Driven by requirements
○ Development environment○ Bandwidth and latency○ Power consumption○ Reliability○ Security○ Range○ Cost
Likely outcome
Solution includes variety of different hardware devices, networking and software stacks
There is no one magic silver bulletCertainly not mesh networks … so, always read the fine print !
Why IPv6 / 6LoWPAN mesh networks ?WiFi and Bluetooth LE are often good solutionsWhat 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)
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
Network diagram
MeshThing #1RPL Border Gatewayfd00:0:0:10::1
MeshThing #2fd00:0:0:10::2
MeshThing #3fd00:0:0:10::3
MeshThing #4fd00:0:0:10::4
Raspberry Pi or OpenWRTIPv6 Routerfd00:0:0:1::1/64 eth0fd00:0:0:2::1/64 wlan0fd00:0:0:10::1/64 tun0
SLIPDesktop / LaptopIPv6 Nodefd00:0:0:1::2/64 eth0
LAN
Mobile deviceIPv6 Nodefd00:0:0:2::2/64
WiFi
Everything is an IPv6 connected deviceTCP, UDP and ICMP (ping) messages all work between any devices
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)
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)
MeshThing Input / Output
● For highly constrained devices …○ 8-bit MPU, 8 MHz, 40 kB Flash, 8 Kb RAM
● Cisco contributed the uIPv6 stack● 6LoWPAN header compression, adaption layer● RPL routing protocol● Non-premptive tasks● Cross platform support● Many contributed examples● Cooja network simulator
Contiki Operating System
● 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
● 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 configurationStateLess Address Auto Configuration (SLAAC)
● 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
Solution : Search & Rescue UAV
About the UAV Outback Challenge
4.5 kms
2.3 kms
1.2 kms
About the H20-to-Joe Team
PX4 Demo
What we’ve learned so far
Sophistication of open-source hardware & software
What we’ve learned so far
Sophistication of open-source hardware & software
Prototyping with a 3D printer
What we’ve learned so far
Sophistication of open-source hardware & software
Prototyping with a 3D printer
Embedded computing is a lot of fun
What we’ve learned so far
Getting started
Choose a goal / projectBuild your own sensor network (home / office)Connect to Xively, ThingSpeak, SkyNet.IM … or D.I.Y
Build your own robotNodeBots Days: http://nodebots.io
Build your own quadcopterhttp://copter.ardupilot.com/wiki/build-your-own-multicopter
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
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
Gadgets #2● Open-source hardware and software● 168 MHz Cortex M4F CPU● 2 MB Flash, 256 KB RAM● 3-axis accelerometer / gyroscope /
magnetometer● Barometer● Backup, override, failsafe processor● Running NuttX RTOS (Posix)
Hang-out with like-minded people● Meetup.com: IoT groups
○ http://www.meetup.com/Internet-of-Human-Things-Melbourne○ http://www.meetup.com/IoT-Melbourne
● HackerSpaces.org …○ http://hackerspaces.org/wiki/Australia○ CCHS Hawthorn: http://hackmelbourne.org○ OpenLab: http://www.medialabmelbourne.com.au/openlab○ Make-Create Brunswick: http://www.meetup.com/Make-Create
○ Ballarat HackerSpace, Mill Park Library MakerSpace○ Geelong HackerSpace, East Gippsland HackerSpace○ Footscray MakerLab ? Northern Suburbs ?
Hang-out with like-minded people● Meetup.com: IoT groups
○ http://www.meetup.com/Internet-of-Things-Sydney
● HackerSpaces.org …○ http://hackerspaces.org/wiki/Australia○ Robots and Dinosaurs: http://robodino.org○ RoboDojo: https://groups.google.com/forum/#!forum/robodojo○ OzBerryPi: http://www.ozberrypi.org (nomadic)○ NewCastle MakerSpace: http://newcastlemakerspace.org/wiki○ Visit CCHS Melbourne: http://hackmelbourne.org
Hang-out with like-minded people● Meetup.com: IoT groups
○ http://www.meetup.com/Hack-the-Evening
● HackerSpaces.org …○ http://hackerspaces.org/wiki/Australia○ Brisbane HackerSpace: HSBNE○ Gold Coast TechSpace: http://gctechspace.org○ Caboolture HackerSpace, Townsville HackerSpace○ Hack This Coop (Toowoomba)○ Visit CCHS Melbourne: http://hackmelbourne.org
Space and tools with people who share skills / collaborate
HackerSpaces
Electronics prototyping, diagnosis, manufacturing
HackerSpaces
3D printers, laser-cutter, lathe, CNC mill, ...
HackerSpaces
Making a broad variety of things
HackerSpaces
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
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
Staying in touchDaryl [email protected] @DarylWMcBhttp://dius.com.au
Andy [email protected] @geekscapehttp://geekscape.org http://m9design.co