By: Michael Linnen
Twitter: @mlinnen
Blog: www.protosystem.net
DISCLAIMER!



This is NOT a real security system!
  *This is for education purposes ONLY*

Do NOT use this as your Home Security
               System!
THE BIG PICTURE                                                            Talk to me!
                                                            Message
                                                             Broker

                                                                 Worker                              Web


                                                                                Azure
Bedroom 1     Master           Bedroom 2
             Bedroom


                                                         Front    Side   Back    Master   Bedroom   Bedroom   1st Floor
                                                                                Bedroom      1         2
                                              Doors



                                              Locked



                                              Windows



                                              Motion



                                              Doorbell
                       Front
                       door                              Sleep   Away
                                              Alarm




      Back                                 Side
      door                                 door
NETDUINO PLUS
        Digital i/o Features
 All 20 digital and analog pins:
  GPIO
 Digital pins 0-1: UART 1 RX, TX
 Digital pins 2-3: UART 2 RX, TX
 Digital pins 5-6: PWM, PWM
 Digital pins 7-8: UART 2 RTS,
  CTS
 Digital pins 9-10: PWM, PWM
 Digital pins 11-13: SPI MOSI,
  MISO, SPCK
 Analog pins 4-5: I2C SDA, SCL
WINDOWS AZURE
 Unlimited resources
      Service Bus (Messaging)
      Storage
      Computation                            Internet Of Things Enabler
      Identity
      Networking (VPN)
                                                 o Projecting 50 billion devices in
      Web sites (10 free)                          2020
      Virtual Machines (Linux or Windows)
      Mobile Services
      Media Services
      Database Services
      Reporting Services
      Cache
      CDN
      Store
DEMO
ARCHITECTURE
MQTT
“MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol”

             • Features
                 – Lightweight
                 – Publish/Subscribe
                 – Open published protocol
             • How long?
                 – Invented in 1999
                 – Dr Andy Standford-Clark
                 – Arlen Nipper
             • Used By
                 – Facebook (messenger)
                 – Github
                 – COSM (formerly Pachube)
                 – RabbitMQ (MQTT Adapter)
                 – Websphere MQ
MESSAGES - DOORBELL
Home                       Azure               Remote




 External         Broker            Hub        Browser
  Door

                  MQTT             SignalR    Dashboard




 Doorbell
                                 Master
                              Control Panel
MESSAGES - DOORBELL
Home                           Azure                  Remote




 External         Broker                      Hub     Browser
  Door

                  MQTT                  SignalR      Dashboard


                         Subscribe Doorbell

 Doorbell
                                        Master
                                     Control Panel
MESSAGES - DOORBELL
Home                       Azure               Remote




 External         Broker            Hub        Browser
  Door

                  MQTT             SignalR    Dashboard




 Doorbell
                                 Master
                              Control Panel
MESSAGES - DOORBELL
Home                         Azure                   Remote
                                                    Remote




 External         Broker                 Hub        Browser
  Door
                     Publish Doorbell pushed

                  MQTT                 SignalR     Dashboard




 Doorbell
                                      Master
                                   Control Panel
MESSAGES - DOORBELL
 Home
Home                       Azure
                            Azure                           Remote
                                                           Remote




 External         Broker             Hub                   Browser
  Door
                                              Update UI
                  MQTT              SignalR               Dashboard




 Doorbell                         Master
                               Control Panel
MESSAGES – UNLOCK DOOR

Home                       Azure
                            Azure                Remote
                                                Remote




 External         Broker             Hub        Browser
  Door

                   MQTT             SignalR    Dashboard




 Doorbell
                                  Master
                               Control Panel
MESSAGES – UNLOCK DOOR

Home                         Azure
                              Azure                     Remote
                                                       Remote




 External         Broker                     Hub       Browser
  Door
                           Subscribe lock
                   MQTT                     SignalR   Dashboard




 Doorbell
                                        Master
                                     Control Panel
MESSAGES – UNLOCK DOOR

Home                       Azure                Remote
                                               Remote




 External         Broker            Hub        Browser
  Door

                   MQTT            SignalR    Dashboard




 Doorbell
                                 Master
                              Control Panel
MESSAGES – UNLOCK DOOR

 Home
Home                       Azure
                            Azure                Remote
                                                Remote




 External         Broker             Hub        Browser
  Door

                   MQTT             SignalR    Dashboard




 Doorbell
                                  Master
                               Control Panel
MESSAGES – UNLOCK DOOR

 Home
Home                       Azure
                            Azure                Remote
                                                Remote




 External         Broker             Hub        Browser
  Door

                   MQTT             SignalR    Dashboard




 Doorbell
                                  Master
                               Control Panel
MESSAGES – UNLOCK DOOR

 Home
Home                       Azure
                            Azure                Remote
                                                Remote




 External         Broker             Hub        Browser
  Door

                   MQTT             SignalR    Dashboard




 Doorbell
                                  Master
                               Control Panel
MESSAGES – UNLOCK DOOR

 Home
Home                       Azure
                            Azure                Remote
                                                Remote




 External         Broker             Hub        Browser
  Door

                   MQTT             SignalR    Dashboard




 Doorbell
                                  Master
                               Control Panel
MESSAGES – UNLOCK DOOR

 Home
Home                       Azure
                            Azure                Remote
                                                Remote




 External         Broker             Hub        Browser
  Door

                   MQTT             SignalR    Dashboard




 Doorbell
                                  Master
                               Control Panel
MESSAGES – UNLOCK DOOR

Home                        Azure
                             Azure                    Remote
                                                     Remote




 External         Broker                  Hub        Browser
  Door

                   MQTT                 SignalR     Dashboard

                      Publish lock unlocked



 Doorbell
                                       Master
                                    Control Panel
MESSAGES – UNLOCK DOOR

Home                       Azure
                            Azure                           Remote
                                                           Remote




 External         Broker             Hub                   Browser
  Door

                   MQTT             SignalR               Dashboard
                                              Update UI



 Doorbell
                                  Master
                               Control Panel
HARDWARE
Ground Bus – Exposes more connections
LED’s – Indicators or simulates actuators
Switches – Keyboard,
 Window/Door/Motion sensors, Alarm mode
Ground Bus


Connect to LEDs or Switches




                              Connect to Netduino GND
LED’S


     Connect to Ground Bus


   Connect to Netduino Digital
   Pin (or 3.3 volt pin to test)
Switches


      Connect to Ground Bus



    Connect to Netduino
    Digital Pin
Netduino 3.3 V
                 Netduino GND
LET’S GET STARTED
Pick a device to build
      o Doorbell (easiest)
      o Alarm (a little harder)
      o External Door (hardest)
      o Alarm Panel (hardest)
Fill out the signup sheet
      o Unique Client ID (use your initials)
Get your parts
Code the solution
   * Reference: HTTP://www.CloudHomeSecurity.com
 VPN
 Restricted IP’s
 HTTPS and a gateway
  broker
GATEWAY BROKER
Home                         Azure                    Remote




                                         Hub          Browser

       MQTT     HTTPs   MQTT
       Broker           Broker         SignalR       Dashboard




                                        Master
                                     Control Panel
MISSION CRITICAL
Home                          Azure              Remote




                                       Hub       Browser

       MQTT      HTTPs   MQTT
       Broker            Broker       SignalR   Dashboard




   Master
Control Panel
Messaging Patterns



       MQTT          Message
       Broker         Router
Messaging Patterns


                Subscribe DI/0

       MQTT                      Message
       Broker                     Router
Messaging Patterns



       MQTT          Message
       Broker         Router
Messaging Patterns


                Publish DI/0 true

       MQTT                         Message
       Broker                        Router
Messaging Patterns


                Publish DI/0 true

       MQTT                         Message
       Broker                        Router
Messaging Patterns


                Publish DI/0 true

       MQTT                         Message
       Broker   Publish DO/0 true    Router
Messaging Patterns


                Publish DI/0 true

       MQTT                         Message
       Broker   Publish DO/0 true    Router

Connecting Netduinos to a Windows Azure Service

  • 1.
    By: Michael Linnen Twitter:@mlinnen Blog: www.protosystem.net
  • 3.
    DISCLAIMER! This is NOTa real security system! *This is for education purposes ONLY* Do NOT use this as your Home Security System!
  • 4.
    THE BIG PICTURE Talk to me! Message Broker Worker Web Azure Bedroom 1 Master Bedroom 2 Bedroom Front Side Back Master Bedroom Bedroom 1st Floor Bedroom 1 2 Doors Locked Windows Motion Doorbell Front door Sleep Away Alarm Back Side door door
  • 5.
    NETDUINO PLUS Digital i/o Features  All 20 digital and analog pins: GPIO  Digital pins 0-1: UART 1 RX, TX  Digital pins 2-3: UART 2 RX, TX  Digital pins 5-6: PWM, PWM  Digital pins 7-8: UART 2 RTS, CTS  Digital pins 9-10: PWM, PWM  Digital pins 11-13: SPI MOSI, MISO, SPCK  Analog pins 4-5: I2C SDA, SCL
  • 6.
    WINDOWS AZURE  Unlimitedresources  Service Bus (Messaging)  Storage  Computation  Internet Of Things Enabler  Identity  Networking (VPN) o Projecting 50 billion devices in  Web sites (10 free) 2020  Virtual Machines (Linux or Windows)  Mobile Services  Media Services  Database Services  Reporting Services  Cache  CDN  Store
  • 7.
  • 8.
  • 9.
    MQTT “MQTT is amachine-to-machine (M2M)/"Internet of Things" connectivity protocol” • Features – Lightweight – Publish/Subscribe – Open published protocol • How long? – Invented in 1999 – Dr Andy Standford-Clark – Arlen Nipper • Used By – Facebook (messenger) – Github – COSM (formerly Pachube) – RabbitMQ (MQTT Adapter) – Websphere MQ
  • 10.
    MESSAGES - DOORBELL Home Azure Remote External Broker Hub Browser Door MQTT SignalR Dashboard Doorbell Master Control Panel
  • 11.
    MESSAGES - DOORBELL Home Azure Remote External Broker Hub Browser Door MQTT SignalR Dashboard Subscribe Doorbell Doorbell Master Control Panel
  • 12.
    MESSAGES - DOORBELL Home Azure Remote External Broker Hub Browser Door MQTT SignalR Dashboard Doorbell Master Control Panel
  • 13.
    MESSAGES - DOORBELL Home Azure Remote Remote External Broker Hub Browser Door Publish Doorbell pushed MQTT SignalR Dashboard Doorbell Master Control Panel
  • 14.
    MESSAGES - DOORBELL Home Home Azure Azure Remote Remote External Broker Hub Browser Door Update UI MQTT SignalR Dashboard Doorbell Master Control Panel
  • 15.
    MESSAGES – UNLOCKDOOR Home Azure Azure Remote Remote External Broker Hub Browser Door MQTT SignalR Dashboard Doorbell Master Control Panel
  • 16.
    MESSAGES – UNLOCKDOOR Home Azure Azure Remote Remote External Broker Hub Browser Door Subscribe lock MQTT SignalR Dashboard Doorbell Master Control Panel
  • 17.
    MESSAGES – UNLOCKDOOR Home Azure Remote Remote External Broker Hub Browser Door MQTT SignalR Dashboard Doorbell Master Control Panel
  • 18.
    MESSAGES – UNLOCKDOOR Home Home Azure Azure Remote Remote External Broker Hub Browser Door MQTT SignalR Dashboard Doorbell Master Control Panel
  • 19.
    MESSAGES – UNLOCKDOOR Home Home Azure Azure Remote Remote External Broker Hub Browser Door MQTT SignalR Dashboard Doorbell Master Control Panel
  • 20.
    MESSAGES – UNLOCKDOOR Home Home Azure Azure Remote Remote External Broker Hub Browser Door MQTT SignalR Dashboard Doorbell Master Control Panel
  • 21.
    MESSAGES – UNLOCKDOOR Home Home Azure Azure Remote Remote External Broker Hub Browser Door MQTT SignalR Dashboard Doorbell Master Control Panel
  • 22.
    MESSAGES – UNLOCKDOOR Home Home Azure Azure Remote Remote External Broker Hub Browser Door MQTT SignalR Dashboard Doorbell Master Control Panel
  • 23.
    MESSAGES – UNLOCKDOOR Home Azure Azure Remote Remote External Broker Hub Browser Door MQTT SignalR Dashboard Publish lock unlocked Doorbell Master Control Panel
  • 24.
    MESSAGES – UNLOCKDOOR Home Azure Azure Remote Remote External Broker Hub Browser Door MQTT SignalR Dashboard Update UI Doorbell Master Control Panel
  • 25.
    HARDWARE Ground Bus –Exposes more connections LED’s – Indicators or simulates actuators Switches – Keyboard, Window/Door/Motion sensors, Alarm mode
  • 26.
    Ground Bus Connect toLEDs or Switches Connect to Netduino GND
  • 27.
    LED’S Connect to Ground Bus Connect to Netduino Digital Pin (or 3.3 volt pin to test)
  • 28.
    Switches Connect to Ground Bus Connect to Netduino Digital Pin
  • 29.
    Netduino 3.3 V Netduino GND
  • 30.
    LET’S GET STARTED Picka device to build o Doorbell (easiest) o Alarm (a little harder) o External Door (hardest) o Alarm Panel (hardest) Fill out the signup sheet o Unique Client ID (use your initials) Get your parts Code the solution * Reference: HTTP://www.CloudHomeSecurity.com
  • 31.
     VPN  RestrictedIP’s  HTTPS and a gateway broker
  • 32.
    GATEWAY BROKER Home Azure Remote Hub Browser MQTT HTTPs MQTT Broker Broker SignalR Dashboard Master Control Panel
  • 33.
    MISSION CRITICAL Home Azure Remote Hub Browser MQTT HTTPs MQTT Broker Broker SignalR Dashboard Master Control Panel
  • 34.
    Messaging Patterns MQTT Message Broker Router
  • 35.
    Messaging Patterns Subscribe DI/0 MQTT Message Broker Router
  • 36.
    Messaging Patterns MQTT Message Broker Router
  • 37.
    Messaging Patterns Publish DI/0 true MQTT Message Broker Router
  • 38.
    Messaging Patterns Publish DI/0 true MQTT Message Broker Router
  • 39.
    Messaging Patterns Publish DI/0 true MQTT Message Broker Publish DO/0 true Router
  • 40.
    Messaging Patterns Publish DI/0 true MQTT Message Broker Publish DO/0 true Router