internet of things: hands on: yow! night

76
Hands-on with the IoT Daryl Wilding-McBride (DiUS) Andy Gelme (geekscape.org, m9design.co)

Upload: andy-gelme

Post on 07-Sep-2014

462 views

Category:

Technology


4 download

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

Page 1: Internet Of Things: Hands on: YOW! night

Hands-on with the IoT

Daryl Wilding-McBride (DiUS)

Andy Gelme (geekscape.org, m9design.co)

Page 2: Internet Of Things: Hands on: YOW! night

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

Page 3: Internet Of Things: Hands on: YOW! night
Page 4: Internet Of Things: Hands on: YOW! night
Page 5: Internet Of Things: Hands on: YOW! night

“It’s only the Internet of Things while it doesn’t work.

As soon as it works, it’s a thermostat.”

Chris Anderson, 3DRobotics

Page 6: Internet Of Things: Hands on: YOW! night

“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?

Page 7: Internet Of Things: Hands on: YOW! night
Page 8: Internet Of Things: Hands on: YOW! night

Why now ?

What has changed?

Page 9: Internet Of Things: Hands on: YOW! night

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

Page 10: Internet Of Things: Hands on: YOW! night

“The best minds of my generation are thinking about how to make people

click ads.

That sucks.”

Jeff Hammerbacher, Facebook’s first data scientist

Page 11: Internet Of Things: Hands on: YOW! night

From a technology perspective, good web software delivery is a solved problem

Page 12: Internet Of Things: Hands on: YOW! night

From a technology perspective, good web software delivery is a solved problem

IoT has lots of unsolved, worthwhile problems that are very challenging

Page 13: Internet Of Things: Hands on: YOW! night

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

Page 14: Internet Of Things: Hands on: YOW! night

Granularity of IoT building blocksGeneric building blocks …● Arduino, sensors, actuators

Function specific building blocks● Quadcopter with autopilot

Complete solutions● Search & rescue UAVs

Page 15: Internet Of Things: Hands on: YOW! night

Generic building block: MeshThing

Page 16: Internet Of Things: Hands on: YOW! night

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

Page 17: Internet Of Things: Hands on: YOW! night

Turning multiple units into a subsystemDesigned by John Spencer for the Caravan Of Terror

Page 18: Internet Of Things: Hands on: YOW! night

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 ?”

Page 19: Internet Of Things: Hands on: YOW! night

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

Page 20: Internet Of Things: Hands on: YOW! night

Connecting devices

However, cables not possible in many situations

○ Devices are far apart○ Devices that move around○ Uneconomic, e.g retrofit building automation

Page 21: Internet Of Things: Hands on: YOW! night

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

Page 22: Internet Of Things: Hands on: YOW! night

Network design decisions

Driven by requirements

○ Development environment○ Bandwidth and latency○ Power consumption○ Reliability○ Security○ Range○ Cost

Page 23: Internet Of Things: Hands on: YOW! night

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 !

Page 24: Internet Of Things: Hands on: YOW! night

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)

Page 25: Internet Of Things: Hands on: YOW! night

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

Page 26: Internet Of Things: Hands on: YOW! night

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

Page 27: Internet Of Things: Hands on: YOW! night

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)

Page 28: Internet Of Things: Hands on: YOW! night

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)

Page 29: Internet Of Things: Hands on: YOW! night

MeshThing Input / Output

Page 30: Internet Of Things: Hands on: YOW! night

● 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

Page 31: Internet Of Things: Hands on: YOW! night

● 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

Page 32: Internet Of Things: Hands on: YOW! night

● 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)

Page 33: Internet Of Things: Hands on: YOW! night

● 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

Page 34: Internet Of Things: Hands on: YOW! night

Solution : Search & Rescue UAV

Page 35: Internet Of Things: Hands on: YOW! night

About the UAV Outback Challenge

Page 36: Internet Of Things: Hands on: YOW! night
Page 37: Internet Of Things: Hands on: YOW! night
Page 38: Internet Of Things: Hands on: YOW! night
Page 39: Internet Of Things: Hands on: YOW! night
Page 40: Internet Of Things: Hands on: YOW! night

4.5 kms

Page 41: Internet Of Things: Hands on: YOW! night

2.3 kms

Page 42: Internet Of Things: Hands on: YOW! night

1.2 kms

Page 43: Internet Of Things: Hands on: YOW! night
Page 44: Internet Of Things: Hands on: YOW! night

About the H20-to-Joe Team

Page 45: Internet Of Things: Hands on: YOW! night
Page 46: Internet Of Things: Hands on: YOW! night
Page 47: Internet Of Things: Hands on: YOW! night
Page 48: Internet Of Things: Hands on: YOW! night
Page 49: Internet Of Things: Hands on: YOW! night
Page 50: Internet Of Things: Hands on: YOW! night
Page 51: Internet Of Things: Hands on: YOW! night
Page 52: Internet Of Things: Hands on: YOW! night
Page 53: Internet Of Things: Hands on: YOW! night
Page 54: Internet Of Things: Hands on: YOW! night
Page 55: Internet Of Things: Hands on: YOW! night
Page 56: Internet Of Things: Hands on: YOW! night

PX4 Demo

Page 57: Internet Of Things: Hands on: YOW! night
Page 58: Internet Of Things: Hands on: YOW! night

What we’ve learned so far

Page 59: Internet Of Things: Hands on: YOW! night

Sophistication of open-source hardware & software

What we’ve learned so far

Page 60: Internet Of Things: Hands on: YOW! night

Sophistication of open-source hardware & software

Prototyping with a 3D printer

What we’ve learned so far

Page 61: Internet Of Things: Hands on: YOW! night

Sophistication of open-source hardware & software

Prototyping with a 3D printer

Embedded computing is a lot of fun

What we’ve learned so far

Page 62: Internet Of Things: Hands on: YOW! night

Getting started

Page 63: Internet Of Things: Hands on: YOW! night

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

Page 64: Internet Of Things: Hands on: YOW! night

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

Page 65: Internet Of Things: Hands on: YOW! night

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

Page 66: Internet Of Things: Hands on: YOW! night

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)

Page 67: Internet Of Things: Hands on: YOW! night

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 ?

Page 68: Internet Of Things: Hands on: YOW! night

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

Page 69: Internet Of Things: Hands on: YOW! night

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

Page 70: Internet Of Things: Hands on: YOW! night

Space and tools with people who share skills / collaborate

HackerSpaces

Page 71: Internet Of Things: Hands on: YOW! night

Electronics prototyping, diagnosis, manufacturing

HackerSpaces

Page 72: Internet Of Things: Hands on: YOW! night

3D printers, laser-cutter, lathe, CNC mill, ...

HackerSpaces

Page 73: Internet Of Things: Hands on: YOW! night

Making a broad variety of things

HackerSpaces

Page 74: Internet Of Things: Hands on: YOW! night

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

Page 75: Internet Of Things: Hands on: YOW! night

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

Page 76: Internet Of Things: Hands on: YOW! night

Staying in touchDaryl [email protected] @DarylWMcBhttp://dius.com.au

Andy [email protected] @geekscapehttp://geekscape.org http://m9design.co