Connecting Netduinos to a Windows Azure Service

40
Hands on Hacknight Connecting Netduino's to an Azure cloud By: Michael Linnen Twitter: @mlinnen Blog: www.protosystem.net

description

This deck is for a alt.net presentation on connecting netduinos to an Windows Azure cloud service. http://www.meetup.com/CharlotteAltNet/events/88586792/

Transcript of Connecting Netduinos to a Windows Azure Service

Page 1: Connecting Netduinos to a Windows Azure Service

Hands on Hacknight Connecting

Netduino's to an Azure cloud

service

By: Michael LinnenTwitter: @mlinnenBlog: www.protosystem.net

Page 2: Connecting Netduinos to a Windows Azure Service

SPONSORS

Page 3: Connecting Netduinos to a Windows Azure Service

This is NOT a real security system!

DISCLAIMER!

*This is for education purposes ONLY*

Do NOT use this as your Home Security System!

Page 4: Connecting Netduinos to a Windows Azure Service

THE BIG PICTURE

Front

Side Back

Master Bedroom

Bedroom 1

Bedroom 2

1st Floor

Doors

Locked

Windows

Motion

Doorbell

AlarmSleep

Away

Bedroom 1

Bedroom 2

Master Bedroo

m

Back door

Front door

Side door

Talk to me!

Message Broker

Azure

Worker

Master Control Panel

Web

Master Control Panel Dashboard

Page 5: Connecting Netduinos to a Windows Azure Service

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

Processor and Memory Atmel 32-bit microcontroller Speed: 48MHz, ARM7 Code Storage: 64 KB

• without networking: 128 KB RAM: 42 KB

• without networking: 60 KB

Page 6: Connecting Netduinos to a Windows Azure Service

Unlimited resources Service Bus (Messaging) Storage Computation Identity Networking (VPN) Web sites (10 free) Virtual Machines (Linux or

Windows) Mobile Services Media Services Database Services Reporting Services Cache CDN Store

WINDOWS AZURE

Internet Of Things Enablero Projecting 50 billion

devices in 2020

Page 7: Connecting Netduinos to a Windows Azure Service

DEMO

Page 8: Connecting Netduinos to a Windows Azure Service

ARCHITECTURE

Page 9: Connecting Netduinos to a Windows Azure Service

• 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

MQTT“MQTT is a machine-to-machine (M2M)/"Internet of Things"

connectivity protocol”

Page 10: Connecting Netduinos to a Windows Azure Service

External Door

Doorbell

Broker Hub Browser

MQTT SignalR Dashboard

Master Control Panel

MESSAGES - DOORBELL

Home Azure Remote

Page 11: Connecting Netduinos to a Windows Azure Service

MESSAGES - DOORBELL

Doorbell

Broker Hub Browser

Home

MQTT SignalR Dashboard

Subscribe Doorbell

Subscribe Doorbell

Master Control Panel

External Door

Azure Remote

Page 12: Connecting Netduinos to a Windows Azure Service

MESSAGES - DOORBELL

Doorbell

Broker Hub Browser

Azure Remote

MQTT SignalR Dashboard

Publish Doorbell pushed

Master Control Panel

External Door

Home

Page 13: Connecting Netduinos to a Windows Azure Service

Doorbell

Broker Hub Browser

Remote

MQTT SignalR Dashboard

Publish Doorbell pushed

Master Control Panel

Publish Doorbell pushed

Azure Remote

External Door

Home

MESSAGES - DOORBELL

Page 14: Connecting Netduinos to a Windows Azure Service

Doorbell

Broker Hub Browser

Home Azure Remote

MQTT SignalR Dashboard

Update UI

Master Control Panel

Azure Remote

External Door

Home

MESSAGES - DOORBELL

Page 15: Connecting Netduinos to a Windows Azure Service

Doorbell

Hub Browser

Azure Remote

MQTT SignalR Dashboard

Master Control Panel

Home Azure Remote

BrokerExternal Door

MESSAGES – UNLOCK DOOR

Page 16: Connecting Netduinos to a Windows Azure Service

MESSAGES – UNLOCK DOOR

External Door

Doorbell

Broker Hub Browser

Azure Remote

MQTT SignalR Dashboard

Master Control Panel

Subscribe code

Subscribe setlock

Subscribe lock

Azure RemoteHome

Page 17: Connecting Netduinos to a Windows Azure Service

MESSAGES – UNLOCK DOOR

Doorbell

Broker Hub Browser

Remote

MQTT SignalR Dashboard

Master Control Panel

Publish code 01

Azure Remote

External Door

Home

Page 18: Connecting Netduinos to a Windows Azure Service

Doorbell

Broker Hub Browser

Home Azure Remote

MQTT SignalR Dashboard

Master Control Panel

Publish code 01

Azure Remote

External Door

Home

MESSAGES – UNLOCK DOOR

Page 19: Connecting Netduinos to a Windows Azure Service

Doorbell

Broker Hub Browser

Home Azure Remote

MQTT SignalR Dashboard

Master Control Panel

Publish code 01

Azure Remote

External Door

Home

MESSAGES – UNLOCK DOOR

Page 20: Connecting Netduinos to a Windows Azure Service

Doorbell

Broker Hub Browser

Home Azure Remote

MQTT SignalR Dashboard

Master Control Panel

Publish setlock unlock

Azure Remote

External Door

Home

MESSAGES – UNLOCK DOOR

Page 21: Connecting Netduinos to a Windows Azure Service

Doorbell

Broker Hub Browser

Home Azure Remote

MQTT SignalR Dashboard

Master Control Panel

Publish setlock unlock

Azure Remote

External Door

Home

MESSAGES – UNLOCK DOOR

Page 22: Connecting Netduinos to a Windows Azure Service

Doorbell

Broker Hub Browser

Home Azure Remote

MQTT SignalR Dashboard

Master Control Panel

Publish lock unlocked

Azure Remote

External Door

Home

MESSAGES – UNLOCK DOOR

Page 23: Connecting Netduinos to a Windows Azure Service

Doorbell

Broker Hub Browser

Azure Remote

MQTT SignalR Dashboard

Master Control Panel

Publish lock unlocked

Azure Remote

External Door

Home

MESSAGES – UNLOCK DOOR

Page 24: Connecting Netduinos to a Windows Azure Service

Doorbell

Broker Hub Browser

Azure Remote

MQTT SignalR Dashboard

Master Control Panel

Update UI

Azure Remote

External Door

Home

MESSAGES – UNLOCK DOOR

Page 25: Connecting Netduinos to a Windows Azure Service

HARDWARE

Ground Bus – Exposes more connections

LED’s – Indicators or simulates actuators

Switches – Keyboard, Window/Door/Motion sensors, Alarm mode

Page 26: Connecting Netduinos to a Windows Azure Service

Ground Bus

Connect to LEDs or Switches

Connect to Netduino GND

Page 27: Connecting Netduinos to a Windows Azure Service

LED’S

Connect to Ground Bus

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

Page 28: Connecting Netduinos to a Windows Azure Service

Switches

Connect to Ground Bus

Connect to Netduino Digital Pin

Page 29: Connecting Netduinos to a Windows Azure Service

Netduino GND

Netduino 3.3 V

Page 30: Connecting Netduinos to a Windows Azure Service

Pick a device to buildoDoorbell (easiest)oAlarm (a little harder)oExternal Door (hardest)oAlarm Panel (hardest)

Fill out the signup sheetoUnique Client ID (use your initials)

Get your partsCode the solution

* Reference: HTTP://www.CloudHomeSecurity.com

LET’S GET STARTED

Page 31: Connecting Netduinos to a Windows Azure Service

SECURING MESSAGES

VPN Restricted IP’s HTTPS and a gateway

broker

Page 32: Connecting Netduinos to a Windows Azure Service

MQTTBroker

MQTTBroker

Hub Browser

SignalR Dashboard

Master Control Panel

Home Azure Remote

GATEWAY BROKER

HTTPs

Page 33: Connecting Netduinos to a Windows Azure Service

MQTTBroker

MQTTBroker

Hub Browser

SignalR Dashboard

Master Control Panel

Home Azure Remote

MISSION CRITICAL

HTTPs

Page 34: Connecting Netduinos to a Windows Azure Service

Messaging Patterns

MQTTBroker

MessageRouter

Page 35: Connecting Netduinos to a Windows Azure Service

Messaging Patterns

MQTTBroker

MessageRouter

Subscribe DO/0

Subscribe DI/0

Page 36: Connecting Netduinos to a Windows Azure Service

Messaging Patterns

MQTTBroker

MessageRouter

Publish DI/0 true

Page 37: Connecting Netduinos to a Windows Azure Service

Messaging Patterns

MQTTBroker

MessageRouter

Publish DI/0 true Publish DI/0 true

Page 38: Connecting Netduinos to a Windows Azure Service

Messaging Patterns

MQTTBroker

MessageRouter

Publish DI/0 true Publish DI/0 true

Page 39: Connecting Netduinos to a Windows Azure Service

Messaging Patterns

MQTTBroker

MessageRouter

Publish DI/0 true Publish DI/0 true

Publish DO/0 true

Page 40: Connecting Netduinos to a Windows Azure Service

Messaging Patterns

MQTTBroker

MessageRouter

Publish DO/0 true

Publish DI/0 true Publish DI/0 true

Publish DO/0 true