Making things that works with us - First Italian Internet of Things Day
Upcoming SlideShare
Loading in...5
×
 

Making things that works with us - First Italian Internet of Things Day

on

  • 4,079 views

 

Statistics

Views

Total Views
4,079
Views on SlideShare
1,417
Embed Views
2,662

Actions

Likes
5
Downloads
27
Comments
1

10 Embeds 2,662

http://www.matteocollina.com 2493
https://twitter.com 106
http://www.collina.me 19
http://pateng.opencontent.it 15
http://www.investintrentino.it 14
http://hi-tech.leonardo.it 11
http://localhost 1
https://www.matteocollina.com 1
http://www.google.fr 1
http://www.google.it 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Making things that works with us - First Italian Internet of Things Day Making things that works with us - First Italian Internet of Things Day Presentation Transcript

  • @matteocollinamatteocollina.comIoT Day Trento 2013/04/09Making thingsthat work with us!
  • Smartphones arechanging the world
  • How many people will owna smartphone by 20141.000.000.000
  • Did you seeit cominghttp://www.flickr.com/photos/12738000@N00/360231193/
  • Stevedid.http://www.flickr.com/photos/noppyfoto/6216399465/
  • Thanks.http://www.flickr.com/photos/noppyfoto/6216399465/
  • They didn’t!...
  • Whats next(hint: its a big number)50.000.000.000
  • 1.000.000.00050.000.000.000
  • 50.000.000.000interconnected"things"by2020
  • http://www.flickr.com/photos/jurvetson/2798315677
  • Monitor myhousetemperatureGoal:
  • I want tochat withmy house
  • >: hi househi matteo>: whats thetemperature?19
  • >: 4 8 15 16 23 42
  • Hubot © 2012-2013 GitHub Inc. All rights reserved.Enter Hubot
  • A programmable robotthat is controlled throughchatHubot © 2012-2013 GitHub Inc. All rights reserved.
  • We can supercharge our house with hubot
  • module.exports = (robot) ->robot.respond /what’s the temperature?/i, (msg) ->msg.http("http://mchouse.it/temperature").header("Accept", "application/json").get() (err, res, body) ->msg.send JSON.parse(body)We can supercharge our house with hubotHow
  • In order to ask our tempto hubot, we need to:1. sense the temp2. get the temp on the web3. build a web API
  • From Hubot, I want to dothe equivalent of:>: curl http://mchouse.it/tempWhat about JSON
  • What protocol do we useto push our temperatureto our API?HTTP POST
  • http://www.flickr.com/photos/clearlyambiguous/48185613/HTTP is slow and safe
  • We need afast, binaryprotocolhttp://www.flickr.com/photos/grrphoto/305649629
  • likes binary
  • To build asocial web ofthings weneed to reactto events.
  • We need apublish/subscribepattern.
  • HTTP
  • Devices need:• binary protocol• publish/subscribe
  • Binary vs REST“Things” shouldinteract with ourlives, and all thetechnology shouldbe built to makethem easy to use.M2M protocols aread-hoc, andresearchers andbusinesses focus onlow level problems.
  • • “things” exposedwith binary protocol• publish/subscribe• topics as the namingsystem• “things” exposedto the web• request/response• URIs as thenaming system
  • MQTT is the state ofart protocol for theInternet of ThingsMosquittoReally SmallMessage Broker
  • • the base element of the protocol is a topic• devices and other systems can publish orsubscribe to topics
  • How to useon
  • Step 1: downloadPubSubClient, thelibrary for
  • on Arduino: SetupString server = String("qest.me");PubSubClient client =PubSubClient(server,1883,callback);
  • if (!client.connected()) {client.connect("arduino");}client.loop();char s[10];itoa(get_temperature(), s, 10);client.publish("temp", s);on Arduino: publishing
  • if (!client.connected()) {client.connect("arduino");}client.loop();char s[10];itoa(get_temperature(), s, 10);client.publish("temp", s);on Arduino: publishingThis is called a topic,and it is where we publishthings on MQTT.
  • speaks, Hubot speak HTTP
  • speaks, Hubot speak HTTPCommunication
  • QESTDiscoverqest.me
  • • MQTT broker• REST interface• HTTP semantics• no QoS• built in node.js• will support MongoDB,RabbitMQ and many others.QESTREST ServerRedisMQTT ServerQESTData LayerHTTP Clients MQTT Clients
  • QEST• retains every message received: MQTT to RESTcurl -H "Accept: txt" http://qest.me/topics/tempclient.publish("temp", "30");• every topic has its own URI: /topics/<NAME>
  • QEST• transform every HTTP PUT received into aMQTT message: REST to MQTTvoid callback(char* topic, byte*payload, int length) {...}PubSubClient(server, 1883, callback);client.subscribe("temp");curl -X PUT -d { "housetemp": 42 } -H "Content-Type: application/json" http://qest.me/topics/temp• devices can listen directly to MQTT topics
  • Web AppDeviceSCLSDAAREFGNDIOREFRESET3V3PWMPWMPWMLTXRXONICSPPWMPWMPWMTXRX312111019 8DIGITAL7 6 5 4 3 2 1 015V GndPOWERwww.arduino.ccANALOG INVin 0 1 2 3 4 5Arduino UNOIoTBrokerQESTstate-of-artapproach to IoT appsQEST-basedsolution to IoT appsBridgeWeb AppDeviceSCLSDAAREFGNDIOREFRESET3V3PWMPWMPWMLTXRXONICSPPWMPWMPWMTXRX312111019 8DIGITAL7 6 5 4 3 2 1 015V GndPOWERwww.arduino.ccANALOG INVin 0 1 2 3 4 5Arduino UNO
  • Hubot © 2012 GitHub Inc. All rightsHubot Integrationmodule.exports = (robot) ->robot.respond /qest check ([a-z0-9A-Z]+)/i, (msg) ->topic = msg.match[1]if topic?msg.http("http://qest.me/topics/#{topic}").header("Accept", "application/json").get() (err, res, body) ->msg.send JSON.parse(body)elsemsg.send "No topic specified"
  • • What devices can a user monitor?• What devices can listen to thestate of other devices?• Who can access the devices state?• Is the communication secure?Security Issues
  • We need OAuthfor Devices!I’mworking onit!!
  • TL;DR• The Internet of Thingswill be big• Devices need binaryand pub/sub protocols• Devs need HTTP API• QEST does both
  • Matteo CollinaPh.D. Student @University of Bologna@matteocollina matteocollina.com
  • Credits• Font-Awesome for theIcons.• Flickr for the CCimages.• Balsamiq Mockup forthe iPhone Mockup.• Unibo for my Ph.D.
  • Matteo Collina (matteo.collina2@unibo.it)Thank You!@matteocollinahttp://www.flickr.com/photos/axel-d/479627824/
  • http://www.flickr.com/photos/alexindigo/1606826416Any Questions?