jms, websocket, and the internet of things - controlling physical devices on the real time web
TRANSCRIPT
![Page 1: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/1.jpg)
© 2013 Kaazing Corporation. All Rights Reserved. 1
Controlling Physical Devices on the Real Time Web
David Witherspoon Prashant Khanal Sep 25, 2013
![Page 2: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/2.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
About Us
§ Prashant Khanal § Software Engineer – Kaazing § [email protected] § Twitter: @ipras
§ David Witherspoon § Software Engineer – Kaazing § [email protected] § Twitter: @dpwspoon
![Page 3: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/3.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Demo!
![Page 4: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/4.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Agenda
§ Requirements for the IoT
§ Creating a reference architecture for IoT
§ Live Demos, Live Demos, Live Demos
§ Source Code, Source Code, Source Code
§ WoT and IoT
![Page 5: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/5.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Internet of Things
Ubiquitous/Pervasive
Heterogeneous
Highly Interconnected
Event-Driven/Real Time
Identifiable Components
Always On
Scalable
Manageable
![Page 6: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/6.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi
Image source: http://www.oracle.com/technetwork/articles/java/raspberrypi-1704896.html
![Page 7: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/7.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi Resources
§ RaspberryPi.org
§ Wheezy (OS)
§ Oracle JVM
§ Pi4J (Raspberry Pi Java Library)
![Page 8: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/8.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Demo!
![Page 9: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/9.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Demo Setup
![Page 10: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/10.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi Controlling the Light Directly
![Page 11: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/11.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi Controlling the Light Directly
![Page 12: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/12.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi Controlling the Light Directly
![Page 13: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/13.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi Controlling the Light Directly
![Page 14: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/14.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Demo Setup
![Page 15: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/15.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi Reading from a Toggle Switch
![Page 16: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/16.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi Reading from a Toggle Switch
![Page 17: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/17.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi Reading from a Toggle Switch
![Page 18: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/18.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Demo Setup
![Page 19: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/19.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Messaging for the IoT
§ Messaging Style
§ Interconnected / Bidirectional
§ Dynamic States (Could be on or off)
§ Messaging Protocol Requirements
§ Identity
§ Data formats
§ Transactions
§ Acknowledgments
§ And more …
![Page 20: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/20.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Message Systems/Protocols for the IoT
§ Java Message Service (JMS) § Standard messaging API
§ Vendor independent
§ Pub / Sub
§ Loosely Coupled
![Page 21: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/21.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Controlling the Light Remotely Using Pub-Sub
![Page 22: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/22.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Demo!
![Page 23: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/23.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
LightJmsTcpController Using JMS to Control a Light
![Page 24: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/24.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
LightJmsTcpController Using JMS to Control a Light
![Page 25: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/25.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
LightJmsTcpController Using JMS to Control a Light
![Page 26: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/26.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
LightJmsTcpController Using JMS to Control a Light
![Page 27: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/27.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
ToggleJmsTcpListener Using JMS to Send Events
![Page 28: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/28.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
ToggleJmsTcpListener Using JMS to Send Events
![Page 29: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/29.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Controlling the Light Remotely Using Pub-Sub
![Page 30: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/30.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Challenges with TCP
§ Isolated networks
§ Firewalls
§ Ports
§ Web browsers
![Page 31: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/31.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
How to Extend This to the Web
![Page 32: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/32.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Controlling the Light Remotely Using Pub-Sub Over the Web
![Page 33: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/33.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
HTML5 WebSocket: TCP for the Web
§ Standard Protocol (IETF): RFC-6455
§ Standard API:
§ W3C: JavaScript
§ JSR 356: Java EE
§ Single socket, full-duplex
§ Low overhead: <1% of HTTP
§ Low latency: low milliseconds
§ SSL support Full duplex
![Page 34: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/34.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Protocol Layering
TCP
JMS XMPP AMQP B2B FTP VNC mktdata etc
Browsers, Native Applications and IoT Devices
WebSocket Gateway
Internet
WebSocket Gateway
![Page 35: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/35.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Controlling the Light Remotely Using Pub-Sub Over the Web
![Page 36: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/36.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Demo!
![Page 37: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/37.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
WebSocket with Brokers
![Page 38: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/38.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
WebSocket with Brokers
![Page 39: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/39.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
WebSocket with Brokers
![Page 40: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/40.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Internet of Things
![Page 41: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/41.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Internet of Things == Web of Things
![Page 42: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/42.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
The Architecture
![Page 43: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/43.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
The Web of Things
![Page 44: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/44.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
WebSocket Powering the Web of Things
WS
WS
WS WS WS WS
WS
WS
WS
![Page 45: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/45.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Extending Protocols to the Web of Things
MQTT/WS
AMQP/WS
JMS/WS STOMP/WS
XMPP/WS
![Page 46: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/46.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Raspberry Pi Resources
§ RaspberryPi.org
§ http://www.raspberrypi.org/
§ Wheezy (OS)
§ http://www.raspberrypi.org/downloads
§ Oracle JVM on the Pi
§ http://www.oracle.com/technetwork/articles/java/raspberrypi-1704896.html
§ Pi4J (Raspberry Pi Java Library)
§ http://pi4j.com/
![Page 47: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/47.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
Find Out More
§ The Zinger – Blog: § http://blog.kaazing.com
§ HTML5 Developer Conference § October 22-23, 2013, San Francisco, Moscone North
§ JMS WebSocket Tutorial § http://tutorial.kaazing.com
§ More developer content § http://developer.kaazing.com
§ RC Car / Light and Switch Code § https://github.com/dpwspoon/kaazingPi
§ The Definitive Guide to HTML5 WebSocket, (Apress, 2013) § First comprehensive guide on WebSocket
§ Use WSK214 for 40% of the e-book
47
![Page 48: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/48.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
![Page 49: JMS, WebSocket, and the Internet of Things - Controlling Physical Devices on the Real Time Web](https://reader033.vdocuments.site/reader033/viewer/2022052701/55d4f3bcbb61ebe16b8b4685/html5/thumbnails/49.jpg)
© 2013 Kaazing Corporation. All Rights Reserved.
The End