Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Connecting NEST via MQTT to Internet of Things

4,042 views

Published on

MQTT its the protocol of the Internet of Things (IoT) - so I went on a quest to understand n how MQTT works with devices, sensors and the Internet of Things cloud. To do this, I built a scenario to see if I could get some of my devices to communicate with the IBM IoT Foundation and visualized the sensor data in a graph using a local application on my Notebook. 1st couple of slides show how to connect nest than i wend on to connect my Android Phone and Google Glass.

Published in: Internet
  • Be the first to comment

Connecting NEST via MQTT to Internet of Things

  1. 1. How MQTT can connect devices to the IoT Markus van Kempen E: mvk@ca.ibm.com T: @markusvankempen
  2. 2. How MQTT protocol can connect devices to the Internet of Things (#IoT) - What is MQTT? -MQTT is a lightweight messaging protocol that supports publish/subscribe - http://mqtt.org/ - How can it be used to talk to devices? - How does MQTT work with IoT? - Other scenarios -Connecting Android Device to the IoT Cloud -Connecting GOOGLE GLASS to the IoT Cloud
  3. 3. Choice of Sensors and devices
  4. 4. Internet Scenario overview using MQTT Publish Hosts messages Proxy MQTT Client IoT Cloud / MQTT Broker Topic: iot-2/type/laptoplan/id/Deviceid/evt/+/fmt/json
  5. 5. 1) Get Data from a Sensor e.g Nest Pull I am using node (js) and the unofficial nest api
  6. 6. 2) Sign up or use a IoT broker You can use Ibm IoT Cloud https://internetofthings.ibmcloud.com/#/ Or open source broker like Mosquitto See mqtt.org for more infos
  7. 7. 3) Publish/Send Data via mqtt from you device sensor to IOT cloud / mqtt broker Publish client.publish('iot-2/evt/MVK/fmt/json', JSON.stringify(data), function() {}); d": { "myName": "Markus Infos", “targettemp" : 72, currenttem 70 } };
  8. 8. 4) Use a mqtt client to subscribe or publish to the broker There is lots of Mqtt client out there like mqtt.js or a eclipse paho Subscribe iot-2/type/mvk-laptoplan/id/00-21-CC-C8-6F-1B/evt/+/fmt/json
  9. 9. 5) Subscribe to broker (IoT Cloud) with a mqtt client to visualize the data Subscribe iot-2/type/mvk-laptoplan/id/00-21-CC-C8-6F-1B/evt/+/fmt/json {"d": {"myName":"Nest Data", "deviceName":"Bedroom“, "currentTemp":20.93,“ targetTemp":20}}
  10. 10. 6) Implement a command which the device reacts to { "d": { "myName": "Paho client", "TargetTemp": 72 } } iot-2/type/mvk-laptoplan/id/00-21-CC-C8-6F-1B/cmd/MVK/fmt/json Publish
  11. 11. Full Scenario overview using mqtt Data Publish Subscribe/ Notify of evt & cmd CMDPublish Nest / Proxy #1 Mqtt Client #2 Mqtt Client Visual Display Distributes Messages to subscribers
  12. 12. MQTT Client and IoT Cloud Publish Distributes Messages to subscribers Subscribe/ Notify of event & cmd {"d": {"myName":”Data", “clientName":“paho“, “Data":”Hello” ….}} Publish / Subscribe to Topic iot-2/type/laptoplan/id/Deviceid/evt/+/fmt/json
  13. 13. References MQTT http://mqtt.org/ http://Mosquitto.org Github https://github.com/markusvankempen/SendNestDatatoIBMIoTCloud IBM IoT Cloud https://internetofthings.ibmcloud.com/ Quickstarter https://developers.google.com/+/quickstart/android Youtube: https://www.youtube.com/watch?v=jm2oCSilIvU My blog http://markusvankempen.tumblr.com/
  14. 14. Markus van Kempen – EA Architect Innovating with People and Technology email: mvk@ca.ibm.com Twitter: @markusvankempen Hashtag: #MVK
  15. 15. How MQTT can connect ANDIORD to the IoT Markus van Kempen E: mvk@ca.ibm.com T: @markusvankempen
  16. 16. https://github.com/ibm-messaging/iot-starter-for-android
  17. 17. Internet Publish Hosts messages IoT Cloud / MQTT Broker Topic: iot-2/evt/accel/fmt/json Android Visualization On Laptop Scenario overview using Android App with MQTT and IBM IoT json Message { "d": {"myName":"MVK Nexus Accelerometer", "acceleration_x":0.0, ,,,,,,} }
  18. 18. MQTT Client and IoT Cloud Publish Distributes Messages to subscribers {"d": {"myName":”Data", “text":“Hello Phone “, ….}} Publish to device iot-2/type/MYNEXUS/id/8c705ae36b0c/cmd/alert/fmt/json Subscribe/ Notifyofevent&cmd
  19. 19. References Code: https://github.com/markusvankempen/IBMIotForAndriod YouTube: https://www.youtube.com/watch?v=PvFtxS8pO0Y https://github.com/ibm-messaging/iot-starter-for-android
  20. 20. How MQTT can connect GLASS to the IoT Markus van Kempen E: mvk@ca.ibm.com T: @markusvankempen
  21. 21. Internet Publish Hosts messages IoT Cloud / MQTT Broker Topic: iot-2/evt/status/fmt/json Google GLASS QuickStart Visualization Scenario overview using GLASS MQTT and IBM IoT json Message { "d": { "myName": “MVK GLASS", “direction”: “Left”, "x": 1000, “y": 1000, “z": 1000 } }
  22. 22. MQTT Client and IoT Cloud Publish Distributes Messages to subscribers Subscribe/ Notify of event & cmd {"d": {"myName":”Data", “clientName":“paho“, “Data":”Hello” ….}} Publish / Subscribe to Topic iot-2/type/Name/id/Deviceid/evt/+/fmt/json
  23. 23. References YouTube: https://www.youtube.com/watch?v=pzUetPjTfCk Code: https://github.com/markusvankempen/GoogleGlass-LiveCard-Mqtt-to-IBMIot
  24. 24. Markus van Kempen – EA Architect Innovating with People and Technology email: mvk@ca.ibm.com Twitter: @markusvankempen Hashtag: #MVK

×