SlideShare une entreprise Scribd logo
1  sur  69
Télécharger pour lire hors ligne
@matteocollina
   matteocollina.com




 Making things
 that work with us!

Codemotion Venezia 2012/11/17
Smartphones are
changing the world
How many people will own
a smartphone by 2014



       1.000.000.000
Did you see
it coming




   http://www.flickr.com/photos/12738000@N00/360231193/
Steve
did.
        http://www.flickr.com/photos/noppyfoto/6216399465/
Thanks.

          http://www.flickr.com/photos/noppyfoto/6216399465/
They didn’t!



    ...
What's next
              (hint: it's a big number)




    50.000.000.000
50.000.000.000




1.000.000.000
"Things"
http://www.flickr.com/photos/adactio/2337914481




                             50.000.000.000
                                                  interconnected


                                            "things"
                                                       by

                                                    2020
Social Web Of
Things Video
http://www.youtube.com/watch?v=i5AuzQXBsG4
Let's experiment
http://www.flickr.com/photos/jurvetson/2798315677
Goal:


   Monitor my
   house
   temperature
I want to
chat with
my house
>: hi house
hi matteo

>: what's the
temperature?
36
>: 4 8 15 16 23 42


 If you don’t
 understand
 this, you are
 not a geek!
Enter Hubot




              Hubot © 2012 GitHub Inc. All rights
A programmable robot
that is controlled through
chat



                      Hubot © 2012 GitHub Inc. All rights
We can supercharge our house with hubot
We can supercharge our house with hubot


                  How
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)
In order to ask our temp
to hubot, we need to:

 1. sense the temp
 2. get the temp on the web
 3. build a web API
From Hubot, I want to do
the equivalent of:
       >: curl http://mchouse.it/temp




 What about JSON
We are building an API




      In Italy,
     “API” means
        “bees”
                   http://www.flickr.com/photos/theseanster93/4056815767
What do we need to
sense my house
temperature
Arduino is an open
source microcontroller,
that you can use to
hack things



                  http://www.flickr.com/photos/mattrichardson/5029708468/
We add a sensor to an Arduino



                    TMP
                     36




                                TMP
                                 36
We add an ethernet shield to
  connect to the Internet

                                                          TMP
                                                           36




                   http://www.flickr.com/photos/snootlab/6052465980/
What protocol do we use
to push our temperature
      to our API?


   HTTP POST
HTTP is slow and safe




               http://www.flickr.com/photos/clearlyambiguous/48185613/
We need a
fast, binary
protocol




               http://www.flickr.com/photos/grrphoto/305649629
likes binary
What if we
need to
interconnect
our things?
To build a
social web of
things we
need to react
to events.
We need a
publish/subscribe
pattern.
HTTP
Devices need:
• binary protocol

• publish/subscribe
Binary vs REST
M2M protocols are     “Things” should
ad-hoc, and           interact with our
researchers and       lives, and all the
businesses focus on   technology should
low level problems.   be built to make
                      them easy to use.
• “things” exposed       • “things” exposed
  with binary protocol     to the web

• publish/subscribe      • request/response

• topics as the naming   • URIs as the
  system                   naming system
MQTT is the
state of art
protocol for the
Internet of
Things
Mosquitto

 Really Small
Message Broker
• the base element of the protocol is a topic

• devices and other systems can publish or
  subscribe to topics
How to use

 on
Step 1: download
PubSubClient, the
      library for
on Arduino: Setup



String server = String("qest.me");

PubSubClient client =
  PubSubClient(server,
               1883,
               callback);
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: publishing


if (!client.connected()) {
  client.connect("arduino");
}
client.loop();
      This is called a topic,
    and it is where we publish
chars[10]; MQTT.
         things on

itoa(get_temperature(), s, 10);
client.publish("temp", s);
speaks



, Hubot speak HTTP
speaks
Communication

, Hubot speak HTTP
Discover


QEST
qest.me
QEST
                         HTTP Clients           MQTT Clients
• MQTT broker

• REST interface
                      REST Server          MQTT Server
• HTTP semantics                        QEST

• no QoS                           Data Layer

• built in node.js

• crafted by me                         Redis
QEST : MQTT to REST
• retains every message received

                client.publish("temp", "30");


• every topic has its own URI: /topics/<NAME>


                curl -H "Accept: txt" 
                  http://qest.me/topics/temp
QEST : REST to MQTT
• transform every HTTP PUT received to a
  MQTT message
          curl -X PUT -d '{ "housetemp": 42 }' 
          -H "Content-Type: application/json" 
          http://qest.me/topics/temp

• devices can listen directly to MQTT topics

          void callback(char* topic, byte*
                        payload, int length) {
            ...
          }
          PubSubClient(server, 1883, callback);
          client.subscribe("temp");
state-of-art                                                              QEST-based
              approach to IoT apps                                                      solution to IoT apps



  Web App                                                       Web App

                                                    Bridge

                                                                                                               QEST

                                                   IoT
                                                                                                               Device
                                                                    3 2 1 0 9 8    7 6 5 4 3 2 1 0




                                                              GND
                                                              SCL

                                                             AREF
                                                              SDA
                                                                    1 1 1 1   DIGITAL




                                                                                                       RX
                                                                                                       TX
                                                                          PWM
                                                                          PWM
                                                                          PWM




                                                                                          PWM
                                                                                          PWM

                                                                                                 PWM
                                                                     L

                                                                     TX
                                                                          Arduino UNO                  ON




                                                  Broker
                                                                     RX




                                                                                                        1
                                                                                                        ICSP




                                                                                www.arduino.cc




                                                                     RESET
                                                                     IOREF
                                                                               POWER         ANALOG IN




                                                                     3V3
                                                                             5V Gnd Vin     0 1 2 3 4 5




                                                  Device
       3 2 1 0 9 8    7 6 5 4 3 2 1 0
 GND
 SCL

AREF
 SDA




       1 1 1 1   DIGITAL
                                          RX
                                          TX
             PWM
             PWM
             PWM




                             PWM
                             PWM

                                    PWM




        L

        TX
        RX
             Arduino UNO                  ON
                                           1




                                           ICSP




                   www.arduino.cc
        RESET
        IOREF




                  POWER         ANALOG IN
        3V3




                5V Gnd Vin     0 1 2 3 4 5
QEST : Scalability
                        HTTP/MQTT Clients

                          Load Balancer




   REST Server   MQTT Server           REST Server   MQTT Server

           QEST
           Data Layer
                               ...             QEST
                                               Data Layer




                               Redis
Do you like
Spaghetti
Code?
JavaScript Apps are
often a mess

We mix logic with
presentation with
persistance.

Is QEST different?
                      http://www.flickr.com/photos/mpirotta/4944504834
QEST:
Built BDD-style, with
Cucumber-js and mocha

Continuous Integration
based on Travis-CI

Written in CoffeeScript

Patches are welcome!




                          http://www.flickr.com/photos/mpirotta/4944504834
Let’s ask something
    to my house!




              http://www.flickr.com/photos/oneaustin/1261907803
Hubot Integration
module.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)
    else
      msg.send "No topic specified"




                                              Hubot © 2012 GitHub Inc. All rights
Security Issues
• What devices can a user monitor?

• What devices can 'listen' to the
  state of other devices?

• Who can access the devices state?

• Is the communication secure?
We need to
interconnect Users
Social profiles to
the Devices!
We need OAuth
 for Devices!

      I’m
   working on
      it!!
try


QEST
qest.me
TL;DR
• The Internet of Things
  will be big

• Devices need binary
  and pub/sub protocols

• Devs need HTTP API

• QEST does both
Matteo Collina

                 Software Engineer @
                 Mavigex

                 Ph.D. Student @
                 University of Bologna


@matteocollina   matteocollina.com
Credits
• Font Awesome for the
  Icons.

• Flickr for LOTS of CC
  images :).

• Balsamiq Mockup for
  the iPhone Mockup
@matteocollina




Thank You!
 Matteo Collina (matteo.collina2@unibo.it)




                                                http://www.flickr.com/photos/axel-d/479627824/
Any Questions?




            http://www.flickr.com/photos/alexindigo/1606826416

Contenu connexe

En vedette

Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)Matteo Collina
 
E così vuoi sviluppare un'app
E così vuoi sviluppare un'appE così vuoi sviluppare un'app
E così vuoi sviluppare un'appMatteo Collina
 
The usability of open data
The usability of open dataThe usability of open data
The usability of open dataMatteo Collina
 
No. la sottile arte di trovare il tempo dove non esite.
No. la sottile arte di trovare il tempo dove non esite.No. la sottile arte di trovare il tempo dove non esite.
No. la sottile arte di trovare il tempo dove non esite.Matteo Collina
 
Crea il TUO database con LevelDB e Node.js
Crea il TUO database con LevelDB e Node.jsCrea il TUO database con LevelDB e Node.js
Crea il TUO database con LevelDB e Node.jsMatteo Collina
 
Enter the app era with ruby on rails
Enter the app era with ruby on railsEnter the app era with ruby on rails
Enter the app era with ruby on railsMatteo Collina
 
The internet of things - Rails Girls Galway
The internet of things - Rails Girls GalwayThe internet of things - Rails Girls Galway
The internet of things - Rails Girls GalwayMatteo Collina
 
Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Matteo Collina
 
Building a multi protocol broker for the internet of things using nodejs
Building a multi protocol broker for the internet of things using nodejsBuilding a multi protocol broker for the internet of things using nodejs
Building a multi protocol broker for the internet of things using nodejsMatteo Collina
 
Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Matteo Collina
 
L'universo dietro alle App
L'universo dietro alle AppL'universo dietro alle App
L'universo dietro alle AppMatteo Collina
 
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015Matteo Collina
 
Operational transformation
Operational transformationOperational transformation
Operational transformationMatteo Collina
 
Exposing M2M to the REST of us
Exposing M2M to the REST of usExposing M2M to the REST of us
Exposing M2M to the REST of usMatteo Collina
 

En vedette (14)

Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)
 
E così vuoi sviluppare un'app
E così vuoi sviluppare un'appE così vuoi sviluppare un'app
E così vuoi sviluppare un'app
 
The usability of open data
The usability of open dataThe usability of open data
The usability of open data
 
No. la sottile arte di trovare il tempo dove non esite.
No. la sottile arte di trovare il tempo dove non esite.No. la sottile arte di trovare il tempo dove non esite.
No. la sottile arte di trovare il tempo dove non esite.
 
Crea il TUO database con LevelDB e Node.js
Crea il TUO database con LevelDB e Node.jsCrea il TUO database con LevelDB e Node.js
Crea il TUO database con LevelDB e Node.js
 
Enter the app era with ruby on rails
Enter the app era with ruby on railsEnter the app era with ruby on rails
Enter the app era with ruby on rails
 
The internet of things - Rails Girls Galway
The internet of things - Rails Girls GalwayThe internet of things - Rails Girls Galway
The internet of things - Rails Girls Galway
 
Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...
 
Building a multi protocol broker for the internet of things using nodejs
Building a multi protocol broker for the internet of things using nodejsBuilding a multi protocol broker for the internet of things using nodejs
Building a multi protocol broker for the internet of things using nodejs
 
Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...
 
L'universo dietro alle App
L'universo dietro alle AppL'universo dietro alle App
L'universo dietro alle App
 
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
 
Operational transformation
Operational transformationOperational transformation
Operational transformation
 
Exposing M2M to the REST of us
Exposing M2M to the REST of usExposing M2M to the REST of us
Exposing M2M to the REST of us
 

Similaire à Making things that works with us codemotion

Home automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technologyHome automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technologyratthaslip ranokphanuwat
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BJingfeng Liu
 
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialPowering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialBenjamin Cabé
 
Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Future Insights
 
MQTT and SensorThings API MQTT Extension
MQTT and SensorThings API MQTT ExtensionMQTT and SensorThings API MQTT Extension
MQTT and SensorThings API MQTT ExtensionSensorUp
 
IoT: Internet of Things with Python
IoT: Internet of Things with PythonIoT: Internet of Things with Python
IoT: Internet of Things with PythonLelio Campanile
 
Messaging for the Internet of Awesome Things
Messaging for the Internet of Awesome ThingsMessaging for the Internet of Awesome Things
Messaging for the Internet of Awesome ThingsAndy Piper
 
Contiki Operating system tutorial
Contiki Operating system tutorialContiki Operating system tutorial
Contiki Operating system tutorialSalah Amean
 
Swift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSwift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSally Shepard
 
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationWebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationDan Jenkins
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturersKeatonParker2
 
How To make your own Robot And control it using labview
How To make your own Robot And control it using labviewHow To make your own Robot And control it using labview
How To make your own Robot And control it using labviewAymen Lachkhem
 
Leveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2MLeveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2MBenjamin Cabé
 
IoT support for .NET Core - IoT Saturday 2020
IoT support for .NET Core - IoT Saturday 2020IoT support for .NET Core - IoT Saturday 2020
IoT support for .NET Core - IoT Saturday 2020Mirco Vanini
 
The internet of (lego) trains
The internet of (lego) trainsThe internet of (lego) trains
The internet of (lego) trainsGrzegorz Duda
 
Physical Computing and IoT
Physical Computing and IoTPhysical Computing and IoT
Physical Computing and IoTEduardo Oliveira
 

Similaire à Making things that works with us codemotion (20)

Home automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technologyHome automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technology
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
Kamery, światło, akcja!
Kamery, światło, akcja!Kamery, światło, akcja!
Kamery, światło, akcja!
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3B
 
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialPowering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
 
Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)
 
MQTT and SensorThings API MQTT Extension
MQTT and SensorThings API MQTT ExtensionMQTT and SensorThings API MQTT Extension
MQTT and SensorThings API MQTT Extension
 
Arduino tutorial A to Z
Arduino tutorial A to ZArduino tutorial A to Z
Arduino tutorial A to Z
 
IoT: Internet of Things with Python
IoT: Internet of Things with PythonIoT: Internet of Things with Python
IoT: Internet of Things with Python
 
Messaging for the Internet of Awesome Things
Messaging for the Internet of Awesome ThingsMessaging for the Internet of Awesome Things
Messaging for the Internet of Awesome Things
 
Contiki Operating system tutorial
Contiki Operating system tutorialContiki Operating system tutorial
Contiki Operating system tutorial
 
Swift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSwift hardware hacking @ try! Swift
Swift hardware hacking @ try! Swift
 
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationWebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC application
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturers
 
How To make your own Robot And control it using labview
How To make your own Robot And control it using labviewHow To make your own Robot And control it using labview
How To make your own Robot And control it using labview
 
Leveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2MLeveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2M
 
IoT support for .NET Core - IoT Saturday 2020
IoT support for .NET Core - IoT Saturday 2020IoT support for .NET Core - IoT Saturday 2020
IoT support for .NET Core - IoT Saturday 2020
 
The internet of (lego) trains
The internet of (lego) trainsThe internet of (lego) trains
The internet of (lego) trains
 
Physical Computing and IoT
Physical Computing and IoTPhysical Computing and IoT
Physical Computing and IoT
 

Making things that works with us codemotion

  • 1. @matteocollina matteocollina.com Making things that work with us! Codemotion Venezia 2012/11/17
  • 3. How many people will own a smartphone by 2014 1.000.000.000
  • 4. Did you see it coming http://www.flickr.com/photos/12738000@N00/360231193/
  • 5. Steve did. http://www.flickr.com/photos/noppyfoto/6216399465/
  • 6. Thanks. http://www.flickr.com/photos/noppyfoto/6216399465/
  • 8. What's next (hint: it's a big number) 50.000.000.000
  • 11. http://www.flickr.com/photos/adactio/2337914481 50.000.000.000 interconnected "things" by 2020
  • 12. Social Web Of Things Video http://www.youtube.com/watch?v=i5AuzQXBsG4
  • 15. Goal: Monitor my house temperature
  • 16. I want to chat with my house
  • 17. >: hi house hi matteo >: what's the temperature? 36
  • 18. >: 4 8 15 16 23 42 If you don’t understand this, you are not a geek!
  • 19. Enter Hubot Hubot © 2012 GitHub Inc. All rights
  • 20. A programmable robot that is controlled through chat Hubot © 2012 GitHub Inc. All rights
  • 21. We can supercharge our house with hubot
  • 22. We can supercharge our house with hubot How 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)
  • 23. In order to ask our temp to hubot, we need to: 1. sense the temp 2. get the temp on the web 3. build a web API
  • 24. From Hubot, I want to do the equivalent of: >: curl http://mchouse.it/temp What about JSON
  • 25. We are building an API In Italy, “API” means “bees” http://www.flickr.com/photos/theseanster93/4056815767
  • 26. What do we need to sense my house temperature
  • 27. Arduino is an open source microcontroller, that you can use to hack things http://www.flickr.com/photos/mattrichardson/5029708468/
  • 28. We add a sensor to an Arduino TMP 36 TMP 36
  • 29. We add an ethernet shield to connect to the Internet TMP 36 http://www.flickr.com/photos/snootlab/6052465980/
  • 30. What protocol do we use to push our temperature to our API? HTTP POST
  • 31. HTTP is slow and safe http://www.flickr.com/photos/clearlyambiguous/48185613/
  • 32. We need a fast, binary protocol http://www.flickr.com/photos/grrphoto/305649629
  • 34. What if we need to interconnect our things?
  • 35. To build a social web of things we need to react to events.
  • 37. HTTP
  • 38. Devices need: • binary protocol • publish/subscribe
  • 39. Binary vs REST M2M protocols are “Things” should ad-hoc, and interact with our researchers and lives, and all the businesses focus on technology should low level problems. be built to make them easy to use.
  • 40. • “things” exposed • “things” exposed with binary protocol to the web • publish/subscribe • request/response • topics as the naming • URIs as the system naming system
  • 41. MQTT is the state of art protocol for the Internet of Things
  • 43. • the base element of the protocol is a topic • devices and other systems can publish or subscribe to topics
  • 46. on Arduino: Setup String server = String("qest.me"); PubSubClient client = PubSubClient(server, 1883, callback);
  • 47. on Arduino: publishing if (!client.connected()) { client.connect("arduino"); } client.loop(); char s[10]; itoa(get_temperature(), s, 10); client.publish("temp", s);
  • 48. on Arduino: publishing if (!client.connected()) { client.connect("arduino"); } client.loop(); This is called a topic, and it is where we publish chars[10]; MQTT. things on itoa(get_temperature(), s, 10); client.publish("temp", s);
  • 52. QEST HTTP Clients MQTT Clients • MQTT broker • REST interface REST Server MQTT Server • HTTP semantics QEST • no QoS Data Layer • built in node.js • crafted by me Redis
  • 53. QEST : MQTT to REST • retains every message received client.publish("temp", "30"); • every topic has its own URI: /topics/<NAME> curl -H "Accept: txt" http://qest.me/topics/temp
  • 54. QEST : REST to MQTT • transform every HTTP PUT received to a MQTT message curl -X PUT -d '{ "housetemp": 42 }' -H "Content-Type: application/json" http://qest.me/topics/temp • devices can listen directly to MQTT topics void callback(char* topic, byte* payload, int length) { ... } PubSubClient(server, 1883, callback); client.subscribe("temp");
  • 55. state-of-art QEST-based approach to IoT apps solution to IoT apps Web App Web App Bridge QEST IoT Device 3 2 1 0 9 8 7 6 5 4 3 2 1 0 GND SCL AREF SDA 1 1 1 1 DIGITAL RX TX PWM PWM PWM PWM PWM PWM L TX Arduino UNO ON Broker RX 1 ICSP www.arduino.cc RESET IOREF POWER ANALOG IN 3V3 5V Gnd Vin 0 1 2 3 4 5 Device 3 2 1 0 9 8 7 6 5 4 3 2 1 0 GND SCL AREF SDA 1 1 1 1 DIGITAL RX TX PWM PWM PWM PWM PWM PWM L TX RX Arduino UNO ON 1 ICSP www.arduino.cc RESET IOREF POWER ANALOG IN 3V3 5V Gnd Vin 0 1 2 3 4 5
  • 56. QEST : Scalability HTTP/MQTT Clients Load Balancer REST Server MQTT Server REST Server MQTT Server QEST Data Layer ... QEST Data Layer Redis
  • 57. Do you like Spaghetti Code? JavaScript Apps are often a mess We mix logic with presentation with persistance. Is QEST different? http://www.flickr.com/photos/mpirotta/4944504834
  • 58. QEST: Built BDD-style, with Cucumber-js and mocha Continuous Integration based on Travis-CI Written in CoffeeScript Patches are welcome! http://www.flickr.com/photos/mpirotta/4944504834
  • 59. Let’s ask something to my house! http://www.flickr.com/photos/oneaustin/1261907803
  • 60. Hubot Integration module.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) else msg.send "No topic specified" Hubot © 2012 GitHub Inc. All rights
  • 61. Security Issues • What devices can a user monitor? • What devices can 'listen' to the state of other devices? • Who can access the devices state? • Is the communication secure?
  • 62. We need to interconnect Users Social profiles to the Devices!
  • 63. We need OAuth for Devices! I’m working on it!!
  • 65. TL;DR • The Internet of Things will be big • Devices need binary and pub/sub protocols • Devs need HTTP API • QEST does both
  • 66. Matteo Collina Software Engineer @ Mavigex Ph.D. Student @ University of Bologna @matteocollina matteocollina.com
  • 67. Credits • Font Awesome for the Icons. • Flickr for LOTS of CC images :). • Balsamiq Mockup for the iPhone Mockup
  • 68. @matteocollina Thank You! Matteo Collina (matteo.collina2@unibo.it) http://www.flickr.com/photos/axel-d/479627824/
  • 69. Any Questions? http://www.flickr.com/photos/alexindigo/1606826416