The document summarizes a presentation about Internet of Things (IoT) and Machine-to-Machine (M2M) communication given at BarCamp Melbourne on July 29, 2012. It discusses the history of distributed computing from the 1970s to present, challenges with connecting devices over networks, and proposes solutions like using MQTT for messaging and IPv6/802.15.4 networks. The presentation also invites attendees to local hacker spaces and Raspberry Jam events.
1. Internet of Things (IoT)
Machine-to-Machine (M2M)
BarCamp Melbourne - Sunday 29th July 2012
Andy Gelme - @geekscape
http://geekscape.org
Connected Community HackerSpace (Melbourne)
http://hackmelbourne.org
Sunday, 29 July 12
2. The future of IoT / M2M ?
• “Those who cannot remember the past are
condemned to repeat it” - George Santayana
• “I skate to where the puck is going to be, not where
it has been” - Wayne Gretsky (The Great One)
Sunday, 29 July 12
3. 1973
• Carl Hewitt (MIT): Actor model (asynchronous)
• Actors send messages to other Actors
• Actors can create new Actors
• Specific behaviour for each message received
• Guy Steele and Gerry Sussman: Scheme language
• Invented to understand the Actor model !
• Invented Call-By-Continuation
• Erlang created at Ericsson in 1986
Sunday, 29 July 12
4. Mid 1970’s
• Xerox Parc (Palo Alto)
• Home Brew Computer Club (Menlo Park)
• Compare with HackerSpaces (Everywhere)
• Dawn of microprocessors
• Apple I ... now: iStuff
• Tandy TRS-80
• BBC micro ... now: ARM (processor in most phones)
• Compare with Raspberry Pi
Sunday, 29 July 12
5. 8-bit micro processors vs controllers
• 1970s: 4004, SC/MP, 2650, 8080, Z-80, 6800, 6502, 6809 ...
• Clock: 1.0 to 4.0 MHz Memory: 1 Kb to 64 Kb RAM
• Storage: Cassette tape (if you were lucky)
• Networking: None (usually)
• Cost: Expensive Development environment: Challenging
• 2000s: Arduino (ARM ATMega328) ... System On a Chip ...
• Clock: 16.0 MHz Memory: 32 Kb Flash and 2 Kb RAM
• Storage: SD card (if required)
• Networking: USB, Ethernet, WiFi, Bluetooth, Mesh 802.15.4, ...
• Cost: Cheap Development environment: Easy
Sunday, 29 July 12
6. 1980s
• Internet is still quite small (teenage years !)
• WWW / HTTP not for another decade (1990s)
• “The value of a network is proportional to the
square of the number of connected devices / users”
- Robert Metcalfe (Ethernet) and later George
Gilder
• “The network is the computer” - Sun Microsystems
Sunday, 29 July 12
7. 2000-01-01
• The day after Y2K ... post-apocalyptic computing :)
• WiFi for very early adopters
• Mobile phones: Resemble a brick !
• Social networking: Friendstar 2002, MySpace 2003 ...
Sunday, 29 July 12
9. 2007 / 2008
• 2007-04-13
• Powered up my first Arduino NG
• 2008-02-23
• 2nd BarCamp Melbourne 2008 at ThoughtWorks
Sunday, 29 July 12
10. 2012-07-29
• Internet is now very large and diverse in all ways
• WWW / HTTP is the dominant protocol
• Designed for web pages / documents
• Request-Response (synchronous)
• ... not good for embedded devices :(
• Metcalfe’s law applied to ...
• Billions of smart phones are in the mainstream
• Social networking is mainstream
• Open Source Hardware Design !
Sunday, 29 July 12
11. Now what ?
• “The future is here ... it’s just not evenly distributed”
- William Gibson (1993)
Sunday, 29 July 12
12. Connecting the real world
• The networking infrastructure is in place ...
• Except IPv6 :(
• Choice: Ethernet, WiFi, Bluetooth, IR, 433 MHz
• Virtual servers on the WAN (aka “the cloud”)
• Good cheap LAN servers: OpenWRT, Raspberry Pi
• Smart phones and tablets have lots of sensors !
• GPS, accelerometer, compass, light,
• They also make good user interfaces for devices :)
Sunday, 29 July 12
13. 8 fallacies of distributing computing
1. The network is reliable
2. Latency is zero
3. Bandwidth is infinite
4. The network is secure
5. Topology doesn’t change
6. There is one administrator
7. Transport cost is zero
8. The network is homogeneous
- Peter Deutsch (1994) and James Gosling (1997)
Sunday, 29 July 12
14. Issues
• Many different development environments ...
• Arduino: IDE, C / C++, libraries, hardware
• Android: Eclipse, Java, class libraries, UI, networking
• iOS: XCode, Objective-C, libraries, UI, networking
• Web browser UI: HTML5, JavaScript, CSS
• Servers: Too many choices to mention
• Need to solve: Messaging (glue), Configuration, User
Interface, Security, Failure (device or network)
Sunday, 29 July 12
15. Messaging (glue)
• Devices require asynchronous events
• Synchronous request-response is a poor choice
• Can’t wait for something that may never complete
• Consider MQTT http://mqtt.org
• Publish-subscribe and topic based
• Very light-weight, good for embedded devices
• Client libraries available for many languages
Sunday, 29 July 12
16. MQTT example
http://github.com/geekscape/mqtt_lua
mqtt_client = MQTT.client.create(host, port, callback)
mqtt_client:connect(client_id)
mqtt_client:subscribe(‘topic’)
while (true) do
mqtt_client:handler()
mqtt_client:publish(‘topic’, ‘message’)
end
function callback(topic, message)
print(‘topic: ‘ .. topic .. ‘, message: ‘ .. message)
end
Sunday, 29 July 12
17. Configuration
• Managing lots (hundreds, thousands, millions, ...) of
devices without any direct user interface is hard
• Maintain network / device configuration on local
server(s) ... don’t hard code in the source !
• Distribute configuration via MQTT topics
• Self-describing devices discover their configuration
and save to EEPROM
Sunday, 29 July 12
18. User interface
• Having to develop N different user interfaces is
painful
• Having to change all those user interfaces every
time a new device type joins your network is even
more painful
• Make dynamic user interfaces incorporate an MQTT
client and be driven by the same MQTT topics as
the device configuration
Sunday, 29 July 12
19. Security
• Obvious problems ...
• Recent: Onity hotel locks ... completely insecure
• SCADA systems connected to Internet
• How many Arduinos using secure networking ?
• IcedTea (Tiny Encryption Algorithm: 1994)
• Make sure you use XXTEA (1998)
• Vulnerable to chosen-plaintext attack
Sunday, 29 July 12
20. Failure (device or network)
• A most difficult problem ...
• Network partition ... partial failure
• Eventual consistency ...
• Relativity for computing :)
• Never have exactly the same view of the world
• Leasing: Never hold on to resources forever
• Distributed garbage collection
• MQTT defines a “Last will and testament”
Sunday, 29 July 12
21. 802.15.4 mesh network / IPv6
• Device needs to be cheap, sufficient memory and
incorporate the radio
• ATMega128RFA01 ... Arduino compatible, 128K Flash,
built-in 802.15.4 and US$5.40 in volume
• Networking stack: Atmel MAC
• Operating environment ...
• Arduino: Libraries, but no operating system or tasks
• Contiki: Light-weight O.S with proto-threads
Sunday, 29 July 12
22. Invitation
• Melbourne HackerSpace: http://hackmelbourne
• Individual and group projects, workshops, etc
• Scope for running your own group or events
• Please join our email list (see web-site for details)
• Melbourne Raspberry Jam: See http://meetup.com
• Next Saturday from 1:30 pm at the HackerSpace
Sunday, 29 July 12