The Internet of Things -...

64
The Internet of Things Justin Mclean IoT Sydney Email: [email protected] Twitter: @justinmclean

Transcript of The Internet of Things -...

Page 1: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

The Internet of ThingsJustin Mclean

IoT Sydney Email: [email protected]

Twitter: @justinmclean

Page 2: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Who am I?• Freelance developer

• Programming for 25+ years

• Apache Flex PMC, Incubator PMC, Apache member

• Run IoT meetup group in Sydney Australia

• Been tinkering with Arduino and open source hardware for 5+ years

Page 3: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Internet of Things?• Small mostly dumb, low cost, low power computers

• Sense the environment around them

• Collate and push data up to somewhere to be analysed

• Enable something be controlled in some way

Page 4: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Rapid Growth• Rapid growth over the last few years

• Estimated 9 billion connected things

• 25-100 billion connected things by 2020

• 1-20 trillion industry by 2020

Page 5: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

What’s Changed• Long tail of Moore’s Law

• Small cheap fast electronics

• Easy to program chips

• Rapid prototyping

• Low cost and low volume manufacture

Page 6: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Pebble

Page 7: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Pebble Prototype

Page 8: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Clyde

Page 9: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Inside Clyde

Page 10: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Brad the Toaster

Page 11: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Problems• Power

• Reliable bandwidth / communication

• Standards - everyone has their own

• Security

• Who owns the data?

• Licensing

Page 12: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

A message you can Hug™

Page 13: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

WeVibe

• remote control vibrator

• $3.75 million settlement for tracking users use

• matched data to users email addresses

Page 14: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

What could go wrong?

Page 15: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Open Source Hardware• Same as Open Source software right?

• Copyright and licensing

• Physical things require manufacture

• Costs to consider

• Distribution issues

• Some assembly required

Page 16: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Is it really Open Source?• Where do you draw the line?

• Can it easily be made?

• Is all software available?

• Can you easily modify it?

Page 17: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

OSHWA• Open Source Hardware Association

http://www.oshwa.org

• Came up with a definition of OSHW

• Checklist and guidelines

• Must be documented!

• Clarifies issue such as dual licensing (you can’t), royalties (no) + other issues

• Certification logo and process

Page 18: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Licensing

Page 19: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Licensing• Software licenses generally deal with copyright as copyright gives instant

protection

• Open source hardware consists of many pieces; bill of materials, pcb design, wire net, silk screen

• Copyright may not apply to all these things

Page 20: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Best (Educated) Guess• Schematic layout - most likely

• Net list - no (it’s a fact)

• Component layout - automated may mean no copyright (what about creative/original layout?)

• Gerber files - quite likely

• PCB - aesthetic parts yes but layout and board probably not

• Source code - yes

• license may not be legal binding or enforceable

Page 21: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

OSHW Licenses• CERN and TAPR (copyleft style)

http://www.ohwr.org/projects/cernohl/wiki http://www.tapr.org/ohl.html

• Solder Pad (Apache style)http://solderpad.org/licenses/

• Creative Commons

Page 22: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard
Page 23: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

It Scales!

Page 24: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Arduino Platform • Open source hardware and software platform

• Easy to program in a high level language

• Hardware is flexible, fast, consumes very little power and is cheap

• Easy to get up to speed with little programming or electronics knowledge

• Libraries to control or use LEDs, LCDs, GPS, ethernet and much more

Page 25: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Why Arduino?• Mature platform

• Large community

• Low cost / low power

• Easy to program

• Easy to Prototype

• Open source hardware

• Many form factors

Page 26: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Arduino Board • General purpose I/O pins

• Analogue Inputs

• USB for power and uploading software

• CPU (16Mzh but 16 MIPS!)

• Memory (only 32K)

• Great for prototyping

Page 27: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Arduino

Page 28: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Arduino Mini

Page 29: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Flora

Page 30: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Arduino 101

Page 31: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Industrino

Page 32: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

ESP8266

Page 33: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Particle Electron

Page 34: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

LoRa One

Page 35: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

The Things Network• The Things Network

https://www.thethingsnetwork.org

• Community based internet of things global network

• 100’s of communities all over the world

• Use LoRaWAN not WiFi or 3G - no ongoing costs

• Requires gateways, but a few gateways can cover a small city

Page 36: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Software• Arduino - IDE and hardware

http://arduino.cc/

• Fritzing - drop and drag circuit board designerhttp://fritzing.org/

• Commercial + OS Cloud platforms e.g. Open Sensors, Xively, etc

• Messaging platforms e.g. RabbitMQ or mosquitto

• More platforms Watson, AWS, Azure, ThingWorx, etc

Page 37: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Arduino

Page 38: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

DIY Protocols• Firmata - lightweight extensible binary protocol

• HTTP - XML or REST familiar and easy to code

• Web Sockets - lightweight binary protocol

Page 39: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Firmarta• https://github.com/firmata/protocol

• Midi message format

• Wide range of supported languages

• Arduino standard library

• Good for host computer to arduino

Page 40: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

HTTP• Arduino standard libraries

• Web server (20 lines of code) compiles to about 12K

• HTTP header hack

• Return JSON, XML, CSV or whatever

• Requires ethernet or WiFi shield

Page 41: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Problems with HTTP• Large requests - huge amount of unwanted header information

• Expensive to setup/shutdown requests

• No data push

Page 42: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

WebSockets• Bidirectional real time communication over a single TCP/IP socket

• Fast protocol has low overhead and connections kept open (500:1 vs HTTP)

• Binary and text support

• Multiple versions of the protocol

• Nice simple Javascript API

Page 43: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Browser Support• Limited support for older browsers

• Internet Explorer 9 support via a plugin

• Work on mobile iOS Safari (6+) and Android (4.4)

• Latest version IE10+, Chrome 14+, Firefox 11+, Safari 6+

• “Standards” are such wonderful things

Page 44: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Standards / Protocols• CAN Bus (Controller Area Network)

Lightweight vehicle bus protocol no host

• CoAP (Constrained Application Protocol) HTTP Lite - multicast, low overhead, simple

• MQTT (Message Queue Telemetry Transport) Lightweight pub/sub, many to many, topic matching, QoS, payload can be anything

• XMPP (Extensible Messaging and Presence Protocol) Jabber - decentralised text protocol

Page 45: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

CAN Bus• Been about since 1980s, specification 1991, ISO standard 1993

• Robust

• Automotive industry but has other industrial applications (fieldbus)

• Atmel AVR processors

• Arduino support through hardware

Page 46: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

MQTT• OASIS specification

• Publish / Subscribe requires a broker

• Advanced features include quality of service, last will and testament, bridging

• Payload are blobs

• Arduino and OS software support (mosquitto)

• Run on a wide range of devices / platforms

Page 47: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Yet more standards!

• 6LoWPAN (IP6 over Wireless Personal Networks)

• AMQP (Advanced Message Queueing Protocol)

• STOMP (Simple Text Oriented Messaging Protocol)

• OMA LWM2M (Open Mobile Alliance Lightweight Machine to Machine)

Page 48: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Rapid Prototyping• Manufacture prototypes cheaply

• Can iterate designs quickly

• Easy to use software

• Tools are cheaper than you think or can access via hacker spaces

Page 49: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Breadboard

Page 50: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Prototype

Page 51: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Fritzing• Very easy to use

• Large library of parts

• Easy export of files

• Auto route not very useful

• Breadboard view not compact

Page 52: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Breadboard View

Page 53: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

PCB View

Page 54: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Check Your Design

Page 55: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

PCB ordering services• Hackvana

http://www.hackvana.com

• OSH Parkhttps://oshpark.com

• Seeed Studio Fusion PCBhttp://www.seeedstudio.com

Page 56: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Boards

Page 57: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

It works!

Page 58: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

I can’t wait 2-3 weeks!• Can pay more to quicker turn around

• Can use chemicals to etch boards and use surface mount or drill holes by hand (several hours)

• Can use CNC machine to cut and drill (several hours)

Page 59: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

CNC Machines• Opposite of a 3D printer

• Smaller, cheaper, better software

• Can cut metal, wood, plastic, wax + more

• Can do 3D as well as 2D

• Othermill and Otherplan software (free)

Page 60: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Othermill

Page 61: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

What can Apache Do?• Implement and support standard protocols (eg CoAP, MQTT)

• Look to see how existing projects can be used in this space.Already happening with Apache Cassandra, Apache Storm, Apache Spark, Apache Apex, Apache Kafta, Apache Hadoop and others.

• Look at OSWH licensing and see if it’s comparable with ASF licensing

• Encourage hardware vendors to release code under more permissive licenses. Mynewt has done good work here.

• New protocols?

Page 62: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Apache Mynewt (incubating)• Real time operating system

• Linux for embedded devices that can’t run Linux

• BLE support

• Targets multiple devices

• Simple build and package management

• Simulator

• Should be out of incubation soon

Page 63: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Apache Edgent (incubating)• Edge device operating system

• Run on Java devices and Android (currently)

• Provides real time analytics on streaming data

• Filter and collates data

• Connects into Apache Kafta, Apache Spark and Apache Storm

• Name changed from Quarks

Page 64: The Internet of Things - events17.linuxfoundation.orgevents17.linuxfoundation.org/sites/events/files/slides/IOT_ApacheCon... · What can Apache Do? • Implement and support standard

Questions?Ask now, see me after the session,follow me on twitter @justinmclean

or email me at [email protected].