Why Making Things People Want beats Making People Want Things - Ad:tech 2013
Making things that work with us - Distill
-
Upload
matteo-collina -
Category
Technology
-
view
11.304 -
download
1
Transcript of Making things that work with us - Distill
![Page 1: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/1.jpg)
http://500px.com/photo/20389019
We #code
@matteocollina
![Page 2: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/2.jpg)
http://500px.com/photo/32597639
We are no Jedi
![Page 3: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/3.jpg)
http://500px.com/photo/20388963
We #code apps
![Page 4: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/4.jpg)
Did you see it coming
http://www.flickr.com/photos/12738000@N00/360231193/
![Page 5: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/5.jpg)
Thanks.
http://www.flickr.com/photos/noppyfoto/6216399465/
![Page 6: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/6.jpg)
They didn’t!
...
![Page 7: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/7.jpg)
7:11 PMiPad
How do we #code an App?
![Page 8: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/8.jpg)
7:11 PMiPad
We #code a response to some kind of user action
![Page 9: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/9.jpg)
Pop-up Dialog
OK
This message comefrom the server!
Cancel
Web ServerTap
We #code a remote web server
![Page 10: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/10.jpg)
Web and Mobile apps are based on
HTTP
REST
![Page 11: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/11.jpg)
REpresentationalState Tranfer = REST
![Page 12: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/12.jpg)
What's next(hint: it's a big number)
X0.000.000.000
![Page 13: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/13.jpg)
X0.000.000.000
Number of connected“things” by 2020:
![Page 14: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/14.jpg)
X0.000.000.000
Number of connected“things” by 2020:
1.000.000.000
Number of smartphones users in 2012
![Page 15: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/15.jpg)
10X
![Page 16: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/16.jpg)
http://500px.com/photo/4766384
In the future, this chain will be connected to the Internet
![Page 17: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/17.jpg)
http://500px.com/photo/20591939
Things are different
![Page 18: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/18.jpg)
http://500px.com/photo/26425201
We want to #code the real world.
![Page 19: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/19.jpg)
Arduino is an open source microcontroller that you can use to hack things
http://www.flickr.com/photos/mattrichardson/5029708468/
![Page 20: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/20.jpg)
http://www.flickr.com/photos/jurvetson/2798315677
![Page 21: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/21.jpg)
Control my house from GTalk or Twitter
Goal:
![Page 22: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/22.jpg)
I want to chat with my house
![Page 23: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/23.jpg)
>: hi househi matteo
>: what's the temperature?36
>: turn airconditioning onconsider it done!
![Page 24: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/24.jpg)
>: 4 8 15 16 23 42
![Page 25: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/25.jpg)
Hubot © 2012 GitHub Inc. All rights
Enter Hubot
![Page 26: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/26.jpg)
Hubot © 2012 GitHub Inc. All rights
A programmable robotthat can receive commands through chat
![Page 27: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/27.jpg)
We can supercharge my house with hubot
![Page 28: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/28.jpg)
We can supercharge my house with hubot
My house needs to:
1. publish sensed data to the web
2. receive commands from the web
![Page 29: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/29.jpg)
Our controlroom is in the
Cloud How can we send and receive the updates
![Page 30: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/30.jpg)
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
![Page 31: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/31.jpg)
The world is event
based, too!
![Page 32: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/32.jpg)
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
![Page 33: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/33.jpg)
Pidgeons are not a communication protocol
See RFC1149http://500px.com/photo/32895129
![Page 34: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/34.jpg)
http://www.flickr.com/photos/clearlyambiguous/48185613/
HTTP is slow and safe
![Page 35: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/35.jpg)
We need a fast, binary protocol
http://www.flickr.com/photos/grrphoto/305649629
![Page 36: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/36.jpg)
![Page 37: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/37.jpg)
• Binary
• Publish/Subscribe
• Free
• Standard (in a few months)
• Offline/Disconnected mode
![Page 38: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/38.jpg)
• 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/
![Page 39: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/39.jpg)
How to use
on
![Page 40: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/40.jpg)
Download PubSubClient, the library for
![Page 41: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/41.jpg)
on Arduino: Setup
String server = String("qest.me");
PubSubClient client = PubSubClient(server, 1883, callback);
![Page 42: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/42.jpg)
if (!client.connected()) { client.connect("arduino");}client.loop();
char s[10];itoa(get_temperature(), s, 10);client.publish("temp", s);
on Arduino: publishing
![Page 43: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/43.jpg)
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
![Page 44: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/44.jpg)
Your “thing” speaks MQTT.Your App speaks HTTP.
http://500px.com/photo/35382862
![Page 45: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/45.jpg)
Your App cannot serve two masters.
http://500px.com/photo/35382862
![Page 46: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/46.jpg)
http://500px.com/photo/31083423
We need a Bridge between the Web and the
“Things” world
![Page 47: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/47.jpg)
(bridge in Italian)http://eclipse.org/proposals/technology.ponte/
http://github.com/mcollina/ponte
A M2M/IoT bridge for REST developers
![Page 48: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/48.jpg)
• MQTT broker
• REST interface
• can be deployed on top of a lot pub/sub systems and databases
• built in node.js
ponte
![Page 49: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/49.jpg)
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
![Page 50: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/50.jpg)
http://www.flickr.com/photos/oneaustin/1261907803
DEMO!
![Page 51: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/51.jpg)
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
![Page 52: Making things that work with us - Distill](https://reader033.fdocuments.in/reader033/viewer/2022052509/55d4da2cbb61eba17b8b4697/html5/thumbnails/52.jpg)
Matteo Collina ([email protected])
Thank You!
@matteocollina
http://www.flickr.com/photos/axel-d/479627824/