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

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

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

  • 3,700 views
Published

 

Published in Technology , Sports
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
3,700
On SlideShare
0
From Embeds
0
Number of Embeds
10

Actions

Shares
Downloads
28
Comments
1
Likes
6

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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