Your SlideShare is downloading. ×
0
@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").hea...
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 prot...
• “things” exposedwith binary protocol• publish/subscribe• topics as the namingsystem• “things” exposedto the web• request...
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.publis...
if (!client.connected()) {client.connect("arduino");}client.loop();char s[10];itoa(get_temperature(), s, 10);client.publis...
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.QES...
QEST• retains every message received: MQTT to RESTcurl -H "Accept: txt" http://qest.me/topics/tempclient.publish("temp", "...
QEST• transform every HTTP PUT received into aMQTT message: REST to MQTTvoid callback(char* topic, byte*payload, int lengt...
Web AppDeviceSCLSDAAREFGNDIOREFRESET3V3PWMPWMPWMLTXRXONICSPPWMPWMPWMTXRX312111019 8DIGITAL7 6 5 4 3 2 1 015V GndPOWERwww.a...
Hubot © 2012 GitHub Inc. All rightsHubot Integrationmodule.exports = (robot) ->robot.respond /qest check ([a-z0-9A-Z]+)/i,...
• What devices can a user monitor?• What devices can listen to thestate of other devices?• Who can access the devices stat...
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?
Upcoming SlideShare
Loading in...5
×

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

3,798

Published on

Published in: Technology, Sports
1 Comment
6 Likes
Statistics
Notes
No Downloads
Views
Total Views
3,798
On Slideshare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
29
Comments
1
Likes
6
Embeds 0
No embeds

No notes for slide

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

  1. 1. @matteocollinamatteocollina.comIoT Day Trento 2013/04/09Making thingsthat work with us!
  2. 2. Smartphones arechanging the world
  3. 3. How many people will owna smartphone by 20141.000.000.000
  4. 4. Did you seeit cominghttp://www.flickr.com/photos/12738000@N00/360231193/
  5. 5. Stevedid.http://www.flickr.com/photos/noppyfoto/6216399465/
  6. 6. Thanks.http://www.flickr.com/photos/noppyfoto/6216399465/
  7. 7. They didn’t!...
  8. 8. Whats next(hint: its a big number)50.000.000.000
  9. 9. 1.000.000.00050.000.000.000
  10. 10. 50.000.000.000interconnected"things"by2020
  11. 11. http://www.flickr.com/photos/jurvetson/2798315677
  12. 12. Monitor myhousetemperatureGoal:
  13. 13. I want tochat withmy house
  14. 14. >: hi househi matteo>: whats thetemperature?19
  15. 15. >: 4 8 15 16 23 42
  16. 16. Hubot © 2012-2013 GitHub Inc. All rights reserved.Enter Hubot
  17. 17. A programmable robotthat is controlled throughchatHubot © 2012-2013 GitHub Inc. All rights reserved.
  18. 18. We can supercharge our house with hubot
  19. 19. 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
  20. 20. In order to ask our tempto hubot, we need to:1. sense the temp2. get the temp on the web3. build a web API
  21. 21. From Hubot, I want to dothe equivalent of:>: curl http://mchouse.it/tempWhat about JSON
  22. 22. What protocol do we useto push our temperatureto our API?HTTP POST
  23. 23. http://www.flickr.com/photos/clearlyambiguous/48185613/HTTP is slow and safe
  24. 24. We need afast, binaryprotocolhttp://www.flickr.com/photos/grrphoto/305649629
  25. 25. likes binary
  26. 26. To build asocial web ofthings weneed to reactto events.
  27. 27. We need apublish/subscribepattern.
  28. 28. HTTP
  29. 29. Devices need:• binary protocol• publish/subscribe
  30. 30. 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.
  31. 31. • “things” exposedwith binary protocol• publish/subscribe• topics as the namingsystem• “things” exposedto the web• request/response• URIs as thenaming system
  32. 32. MQTT is the state ofart protocol for theInternet of ThingsMosquittoReally SmallMessage Broker
  33. 33. • the base element of the protocol is a topic• devices and other systems can publish orsubscribe to topics
  34. 34. How to useon
  35. 35. Step 1: downloadPubSubClient, thelibrary for
  36. 36. on Arduino: SetupString server = String("qest.me");PubSubClient client =PubSubClient(server,1883,callback);
  37. 37. if (!client.connected()) {client.connect("arduino");}client.loop();char s[10];itoa(get_temperature(), s, 10);client.publish("temp", s);on Arduino: publishing
  38. 38. 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.
  39. 39. speaks, Hubot speak HTTP
  40. 40. speaks, Hubot speak HTTPCommunication
  41. 41. QESTDiscoverqest.me
  42. 42. • 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
  43. 43. 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>
  44. 44. 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
  45. 45. 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
  46. 46. 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"
  47. 47. • 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
  48. 48. We need OAuthfor Devices!I’mworking onit!!
  49. 49. TL;DR• The Internet of Thingswill be big• Devices need binaryand pub/sub protocols• Devs need HTTP API• QEST does both
  50. 50. Matteo CollinaPh.D. Student @University of Bologna@matteocollina matteocollina.com
  51. 51. Credits• Font-Awesome for theIcons.• Flickr for the CCimages.• Balsamiq Mockup forthe iPhone Mockup.• Unibo for my Ph.D.
  52. 52. Matteo Collina (matteo.collina2@unibo.it)Thank You!@matteocollinahttp://www.flickr.com/photos/axel-d/479627824/
  53. 53. http://www.flickr.com/photos/alexindigo/1606826416Any Questions?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×