Making things that work with us - Distill

  • 7,368 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
7,368
On Slideshare
0
From Embeds
0
Number of Embeds
12

Actions

Shares
Downloads
24
Comments
0
Likes
4

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. http://500px.com/photo/20389019 We #code @matteocollina
  • 2. http://500px.com/photo/32597639 We are no Jedi
  • 3. http://500px.com/photo/20388963 We #code apps
  • 4. Did you see it coming http://www.flickr.com/photos/12738000@N00/360231193/
  • 5. Thanks. http://www.flickr.com/photos/noppyfoto/6216399465/
  • 6. They didn’t! ...
  • 7. 7:11 PMiPad How do we #code an App?
  • 8. 7:11 PMiPad We #code a response to some kind of user action
  • 9. Pop-up Dialog OK This message come from the server! Cancel Web ServerTap We #code a remote web server
  • 10. Web and Mobile apps are based on HTTP REST
  • 11. REpresentational State Tranfer = REST
  • 12. What's next (hint: it's a big number) X0.000.000.000
  • 13. X0.000.000.000 Number of connected “things” by 2020:
  • 14. X0.000.000.000 Number of connected “things” by 2020: 1.000.000.000 Number of smartphones users in 2012
  • 15. 10X
  • 16. http://500px.com/photo/4766384 In the future, this chain will be connected to the Internet
  • 17. http://500px.com/photo/20591939 Things are different
  • 18. http://500px.com/photo/26425201 We want to #code the real world.
  • 19. Arduino is an open source microcontroller that you can use to hack things http://www.flickr.com/photos/mattrichardson/5029708468/
  • 20. http://www.flickr.com/photos/jurvetson/2798315677
  • 21. Control my house from GTalk or Twitter Goal:
  • 22. I want to chat with my house
  • 23. >: hi house hi matteo >: what's the temperature? 36 >: turn airconditioning on consider it done!
  • 24. >: 4 8 15 16 23 42
  • 25. Hubot © 2012 GitHub Inc. All rights Enter Hubot
  • 26. Hubot © 2012 GitHub Inc. All rights A programmable robot that can receive commands through chat
  • 27. We can supercharge my house with hubot
  • 28. We can supercharge my house with hubot My house needs to: 1. publish sensed data to the web 2. receive commands from the web
  • 29. Our control room is in the Cloud  How can we send and receive the updates
  • 30. In order to send commands to Things from the Web, we need to: 1. subscribe the Thing to some event 2. publish the new event
  • 31. The world is event based, too!
  • 32. In order to publish live data, we need to: 1. sense it 2. send it in the cloud 3. build a web API to access it
  • 33. Pidgeons are not a communication protocol See RFC1149 http://500px.com/photo/32895129
  • 34. http://www.flickr.com/photos/clearlyambiguous/48185613/ HTTP is slow and safe
  • 35. We need a fast, binary protocol http://www.flickr.com/photos/grrphoto/305649629
  • 36. • Binary • Publish/Subscribe • Free • Standard (in a few months) • Offline/Disconnected mode
  • 37. • 93x faster throughput • 11.89x less battery to send • 170.9x less battery to receive • 1/2 as much power to keep connection open • 8x less network overhead MQTT vs HTTPS for Mobile Push Notifications Source: http://mobilebit.wordpress.com/2013/05/03/rest-is-for-sleeping-mqtt-is-for-mobile/
  • 38. How to use on
  • 39. Download PubSubClient, the library for
  • 40. on Arduino: Setup String server = String("qest.me"); PubSubClient client = PubSubClient(server, 1883, callback);
  • 41. if (!client.connected()) { client.connect("arduino"); } client.loop(); char s[10]; itoa(get_temperature(), s, 10); client.publish("temp", s); on Arduino: publishing
  • 42. if (!client.connected()) { client.connect("arduino"); } client.loop(); char s[10]; itoa(get_temperature(), s, 10); client.publish("temp", s); This is called a topic, and it is where we publish data on MQTT. on Arduino: publishing
  • 43. Your “thing” speaks MQTT. Your App speaks HTTP. http://500px.com/photo/35382862
  • 44. Your App cannot serve two masters. http://500px.com/photo/35382862
  • 45. http://500px.com/photo/31083423 We need a Bridge between the Web and the “Things” world
  • 46. (bridge in Italian) http://eclipse.org/proposals/technology.ponte/ http://github.com/mcollina/ponte A M2M/IoT bridge for REST developers
  • 47. • MQTT broker • REST interface • can be deployed on top of a lot pub/sub systems and databases • built in node.js ponte
  • 48. ponte’s pillars • Node.js • Ascoltatori, the pub/sub library for node backed for every broker out there! npm.im/ascoltatori • Mosca, the multi-transport MQTT broker for node.js. npm.im/mosca • MQTT.js, the MQTT library for node: npm.im/mqtt
  • 49. http://www.flickr.com/photos/oneaustin/1261907803 DEMO!
  • 50. TL;DR • The Internet of Things will be big • Devices need binary formats and pub/sub protocols • Apps are built on top of REST APIs • Ponte does both
  • 51. Matteo Collina (matteo.collina2@unibo.it) Thank You! @matteocollina http://www.flickr.com/photos/axel-d/479627824/