SlideShare a Scribd company logo
1 of 70
Download to read offline
@matteocollina
   matteocollina.com




 Making things
 that work with us!

Better Software - Florence 2012/09/26
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.
• binary protocol     • devices exposed
                        to the web
• publish/subscribe
                      • REST architecture
• topics as the
  naming system       • URIs as the
                        naming system
• royalty free
                      • syndication
• open source
  implementations
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

                 Ph.D. Student




@matteocollina   matteocollina.com
www.mavigex.com
   www.wemobi.it
Credits
• Font Awesome for the
  Icons.

• Flickr for LOTS of CC
  images :).

• Balsamiq Mockup for
  the iPhone Mockup
Thank You!
Any Questions?




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

More Related Content

Viewers also liked

E così vuoi sviluppare un'app (ci servono le APi!)
E così vuoi sviluppare un'app (ci servono le APi!)E così vuoi sviluppare un'app (ci servono le APi!)
E così vuoi sviluppare un'app (ci servono le APi!)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
 
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
 
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
 
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
 
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
 
Making your washing machine talk with a power plant
Making your washing machine talk with a power plantMaking your washing machine talk with a power plant
Making your washing machine talk with a power plantMatteo Collina
 

Viewers also liked (14)

E così vuoi sviluppare un'app (ci servono le APi!)
E così vuoi sviluppare un'app (ci servono le APi!)E così vuoi sviluppare un'app (ci servono le APi!)
E così vuoi sviluppare un'app (ci servono le APi!)
 
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
 
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
 
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...
 
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
 
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
 
Making your washing machine talk with a power plant
Making your washing machine talk with a power plantMaking your washing machine talk with a power plant
Making your washing machine talk with a power plant
 

Similar to Making things that works with us

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é
 
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
 
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é
 
MQTT and SensorThings API MQTT Extension
MQTT and SensorThings API MQTT ExtensionMQTT and SensorThings API MQTT Extension
MQTT and SensorThings API MQTT ExtensionSensorUp
 
Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Future Insights
 
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
 
MQTT enabling the smallest things
MQTT enabling the smallest thingsMQTT enabling the smallest things
MQTT enabling the smallest thingsIan Craggs
 
IoT: Internet of Things with Python
IoT: Internet of Things with PythonIoT: Internet of Things with Python
IoT: Internet of Things with PythonLelio Campanile
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturersKeatonParker2
 
How to build own IoT Platform
How to build own IoT PlatformHow to build own IoT Platform
How to build own IoT PlatformPatryk Omiotek
 
ICS/SCADA/PLC Google/Shodanhq Cheat Sheet
ICS/SCADA/PLC Google/Shodanhq Cheat SheetICS/SCADA/PLC Google/Shodanhq Cheat Sheet
ICS/SCADA/PLC Google/Shodanhq Cheat Sheetqqlan
 
Swift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSwift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSally Shepard
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection systemAashiq Ahamed N
 
Government Poly Arvi.
Government Poly Arvi.Government Poly Arvi.
Government Poly Arvi.Sarthak Kadav
 

Similar to Making things that works with us (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
 
Kamery, światło, akcja!
Kamery, światło, akcja!Kamery, światło, akcja!
Kamery, światło, akcja!
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
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
 
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
 
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
 
MQTT and SensorThings API MQTT Extension
MQTT and SensorThings API MQTT ExtensionMQTT and SensorThings API MQTT Extension
MQTT and SensorThings API MQTT Extension
 
Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)
 
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
 
Arduino tutorial A to Z
Arduino tutorial A to ZArduino tutorial A to Z
Arduino tutorial A to Z
 
MQTT enabling the smallest things
MQTT enabling the smallest thingsMQTT enabling the smallest things
MQTT enabling the smallest things
 
IoT: Internet of Things with Python
IoT: Internet of Things with PythonIoT: Internet of Things with Python
IoT: Internet of Things with Python
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturers
 
How to build own IoT Platform
How to build own IoT PlatformHow to build own IoT Platform
How to build own IoT Platform
 
ICS/SCADA/PLC Google/Shodanhq Cheat Sheet
ICS/SCADA/PLC Google/Shodanhq Cheat SheetICS/SCADA/PLC Google/Shodanhq Cheat Sheet
ICS/SCADA/PLC Google/Shodanhq Cheat Sheet
 
Swift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSwift hardware hacking @ try! Swift
Swift hardware hacking @ try! Swift
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection system
 
Government Poly Arvi.
Government Poly Arvi.Government Poly Arvi.
Government Poly Arvi.
 

Recently uploaded

Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 

Recently uploaded (20)

Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 

Making things that works with us

  • 1. @matteocollina matteocollina.com Making things that work with us! Better Software - Florence 2012/09/26
  • 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. • binary protocol • devices exposed to the web • publish/subscribe • REST architecture • topics as the naming system • URIs as the naming system • royalty free • syndication • open source implementations
  • 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 Ph.D. Student @matteocollina matteocollina.com
  • 67. www.mavigex.com www.wemobi.it
  • 68. Credits • Font Awesome for the Icons. • Flickr for LOTS of CC images :). • Balsamiq Mockup for the iPhone Mockup
  • 70. Any Questions? http://www.flickr.com/photos/alexindigo/1606826416