SlideShare a Scribd company logo
IOT and System Platform
From Concepts to Code
Andy Robinson
Avid Solutions
Introductions
1/10/2016 2
Introductions
• Andy Robinson​
• Information Solutions Consultant with Avid
Solutions in Raleigh
• 2 years as Principal at Phase 2 Automation​ in
Taiwan
• 10 years with Avid Solutions
• 5 years with Monsanto/Solutia in Decatur, AL
and Houston, TX​
• ​Co-Founder of aaOpenSource
• The Archestranaut
1/10/2016 3
Overview
1/10/2016 4
Overview/One-Eyed People
I am NOT an expert
In the land of the blind
…the one eyed man is king
1/10/2016 5
Overview/My Definition of IOT
What would/could you do differently if the cost to send data to/from
your system approached $0?
1/10/2016 6
Sensor Transmitter
I/O
Channel
Complex
Machine
Gateway
Data
Server
Visualization
Alarming
Storage
Overview/Parts and Pieces
• Many Moving Pieces
Clients
Data
Transmission/
Receipt
Servers
Storage
Visualization
Analytics
Notifications
1/10/2016 7
Overview/Data Transmission
• Two Core Pieces
• Transport
• TCP – connection oriented, packets are confirmed and retransmitted if failed
• UDP - connectionless , fire and forget
• Protocol
• HTTP
• XMPP
• CoAP
• AMQP
• MQTT
1/10/2016 8
Overview/Data Transmission/HTTP
• Same core protocol as web page delivery
• Uses a RESTful pattern (GET/POST)
• Client-Server with Request/Response
1/10/2016 9
Overview/Data Transmission/HTTP
• Benefits
• Easy path through firewalls (HTTP/80, HTTPS/443)
• Out of the box transport security with SSL/TLS
• Very well known so easy to get started
1/10/2016 10
Overview/Data Transmission/HTTP
• Drawbacks
• Huge overhead from headers 700-800 bytes1 (should be better with HTTP/2)
• RESTful patterns are inherently slow and require polling
(1) http://dev.chromium.org/spdy/spdy-whitepaper
1/10/2016 11
Overview/Data Transmission/XMPP
• eXtensible Messaging and Presence Protocol
• XML over TCP
• Originally started as a chat protocol to support contact lists and
presence
• Ask Eliot Landrum anything
https://en.wikipedia.org/wiki/XMPP
1/10/2016 12
Overview/Data Transmission/XMPP
• Benefits
• Open standard
• Flexible
• Very mature (originated in 1999)
https://en.wikipedia.org/wiki/XMPP
1/10/2016 13
Overview/Data Transmission/XMPP
• Drawbacks
• No QOS inherent at the protocol layer
• Higher network overhead due to XML being text based
https://en.wikipedia.org/wiki/XMPP
1/10/2016 14
Overview/Data Transmission/CoAP
• Constrained Object Access Protocol
• UDP but similar to HTTP with RESTful functions
(GET/PUT/POST/DELETE)
• Asynchronous communications model
• Client-Server
http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117
http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
1/10/2016 15
Overview/Data Transmission/CoAP
• Benefits
• Ultra small header (4 bytes) leads to ultra small packet sizes
• DTLS for security
• Combined with LWM2M for robust device management
• Discovery methods built into protocol
• Great for ultra low power, ultra low bandwidth
• Datagram packet model can work over non IP transports like SMS
• IETF Standard
1/10/2016 16
http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117
http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
Overview/Data Transmission/CoAP
• Drawbacks
• Core protocol is client-server with server initiated communications 
requires inbound packets to client device  security concerns
• As single client to single server there is no built-in concept of data broadcast
1/10/2016 17
http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117
http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
Overview/Data Transmission/AMQP
• Advanced Message Queue Protocol
• Originally developed by big financial orgs for middleware messaging
• Message oriented binary protocol typically over TCP
• OASIS Standard
https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol
1/10/2016 18
Overview/Data Transmission/AMQP
• Benefits
• Built for resiliency and scaling
• Load balancing patterns
• Messages can contain payload and metadata
• Powerful routing patterns
• Security based on SSL/TLS
1/10/2016 19
Overview/Data Transmission/AMQP
• Drawbacks
• Not lightweight – built with servers and fat networks in mind (60 byte
minimum packet size)
• Can be complex to implement client – thanks Paolo for SBLite
1/10/2016 20
Overview/Data Transmission/MQTT
• Message Queue Telemetry Transport
• Created by IBM to support oil pipeline telemetry data over slow,
unreliable networks
• TCP Transport
• Publish-Subscribe with Broker Model
1/10/2016 21
http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117
http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
Overview/Data Transmission/MQTT
• Benefits
• Very small header (7 bytes) leads to very small packet sizes
• TLS for security
• Great for low power, low bandwidth
• No incoming connection to client  much more secure
• 3 levels of QOS
• OASIS Standard
1/10/2016 22
http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117
http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
Overview/Data Transmission/MQTT
• Benefits - Small size and low overhead
1/10/2016 23
https://mobilebit.wordpress.com/2013/05/03/rest-is-for-sleeping-mqtt-is-for-mobile/
Overview/Data Transmission/MQTT
• Drawbacks
• TCP is connection oriented so more complex to put device to sleep (MQTT-S
supports UDP)
• No standard model for metadata and discoverability
• No standard method for device management
http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117
http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
1/10/2016 24
Overview/Data Transmission/Winner
• And the best protocol is…the one that matches your requirements and
capabilities
• One of many comparisons
• www.slideshare.net/paolopat/mqtt-iot-protocols-comparison
• Would also love to talk about DDS (ultra high performance, data-centric)
• ….. but let’s talk about MQTT
1/10/2016 25
MQTT – The Details
1/10/2016 26
MQTT/Details/Transport
• Utilizes single, duplex, persistent TCP connection for transport
• Client connects to broker and broker sends data back down the
connection
• Broker NEVER connects directly to client. Security Win!
• Client can use SSL/TLS to connect to Broker. Security Win!
• Many brokers support authentication and ACL
Client
Broker
(Server)
1/10/2016 27
MQTT/Details/Communication Model
• Pub/Sub with Central Broker
• Conceptually similar to Mxaccess in System Platform
http://www.codeproject.com/KB/IP/PubSubUsingWCF/pubsub.png
1/10/2016 28
MQTT/Details/Broker
• Broker is meeting point for publishers and subscribers
• Many different brokers available
• Run locally or in the cloud
1/10/2016 29
MQTT/Details/Broker
• Local
• mosquitto – The old man of the brokers, full featured, easy, single exe
• GnatMQ – written in C#, open source
• HiveMQ – extra features, commercial, extensible
• Mosca – node.js, open source
• Verne.MQ – written in Erlang, scalable and resilient, open source
1/10/2016 30
MQTT/Details/Broker
• Cloud
• CloudMQTT – uses mosquitto
• Verne.MQ - extensible, highly available
• Public testers – test.mosquito.org, broker.mqtt-dashboard.com, …
1/10/2016 31
MQTT/Details/Topics
• Mailboxes organized into folders
• “/” separates the folders
• Wildcards
• Single Level  “+”
• home/+/temp
home/1/temp
home/2/temp
• Multi-Level  “#”
• /home/#
home/1/temp
home/2/temp
home/1/rh
home/2/rh1/10/2016 32
MQTT/Details/Topics vs Queues
Feature Topics Queues
Big Idea Real Time Asynchronous FIFO/Stack
Dropped Data Can Be OK (but QOS) Never Ok
Pub/Sub Yes Partial (only one client)
Applications Sensor Data
Alarms
Alarms
Events
Value History
“Client”
Broker
Topics
Queue
Value
Alarms
Events
HMI
Historical Values,
Alarms, Events
HMI
HMI
HMI
Publish Subscribe
Timestamped Values
Alarms
Events
1/10/2016 33
MQTT – The Code
1/10/2016 34
MQTT/Code/Client Library
• You only need a client library to pub and sub .. unless you want to run
a broker too
• Client libraries for almost every language
• Best C# library is M2MQTT from Paolo Patierno
• Open Source
• Full Featured
• Nuget Package Available
1/10/2016 35
MQTT/Code/Pseudocode
Create Client
Set Options (ClientID, SSL/TLS?, QOS, Credentials)
Connect to Single Broker by Name or IP Address
…..
Subscribe to Topic(s)  Receive Callback for Subscribed Topic
….
Publish UTF-8 encoded binary data to Topic(s)
1/10/2016 36
MQTT/Code/System Platform/Publish
… Declarations….
configHost = "localhost";
configclientID = Me.Tagname;
MQTTClient = new uPLibrary.Networking.M2Mqtt.MqttClient(configHost);
MQTTClient.Connect(configclientID);
if (MQTTClient.IsConnected) then
Topic = "data/" + Me.Tagname + "/value";
MQTTClient.Publish(Topic,System.Text.Encoding.UTF8.GetBytes(Me.Value));
endif;
1/10/2016 37
MQTT/Code/System Platform/Subscribe
• Not possible due to requirement for callback registration
• But you can use the AOT – been there done that.. mostly
_mqttClient.MqttMsgPublishReceived += _mqttClient_MqttMsgPublishReceived;
_mqttclient.subscribe(Topic)
…
void _mqttClient_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e)
{
Process new message e
}
1/10/2016 38
MQTT – The Demos
1/10/2016 39
MQTT/Demo
• Demo 1 – Publishing simple data from System Platform
1/10/2016 40
MQTT/Demo
• Demo 2 – Publishing complex data from System Platform
1/10/2016 41
MQTT/Demo
• Demo 3 – Subscribing to Data “in” System Platform
1/10/2016 42
MQTT/Demo
• Demo 4 – MQTT  Wonderware Historian (no System Platform)
1/10/2016 43
MQTT/Demo
• Demo 5 – MQTT  Node-Red  ??
• MQTTWarn
1/10/2016 44
amqp
apns
asterisk
carbon
dbus
dnsupdate
emoncms
file
freeswitch
gss
http
instapush
irccat
linuxnotify
log
mqtt
mqttpub
mysql
mysql_dynamic
mythtv
nma
nntp
nsca
osxnotify
osxsay
pastebinpub
pipe
prowl
pushalot
pushbullet
pushover
redispub
rrdtool
slack
sqlite
smtp
syslog
twilio
twitter
xbmc
xmpp
xively
zabbix
MQTT – Resources
1/10/2016 45
MQTT/Resources
• MQTT.org
• Paolo! - m2mqtt.wordpress.com/
• Eclipse paho- www.eclipse.org/paho/
• AMQP on Microsoft Azure - github.com/ppatierno/azuresblite
• Talk to Alvaro Martinez about the new OI Server for MQTT!
• aaOpenSource Github Repo
github.com/aaOpenSource/aaMQTT
1/10/2016 46
Wrap-Up
1/10/2016 47
Wrap-Up/Takeaways
• Just a seed
• No solutions, just ideas
• Take these concepts and scale up
• Consuming public MQTT data – weather? Energy prices?
• Disconnected warehouse with no VPN – real situation with current customer
• We are all now composers, not luthiers
1/10/2016 48
Wrap-Up/Upcoming Talks
• October 8 – Avid Solutions, Atlanta
• IOT – similar talk
• Basic of good security hygiene
• October 20 – All Things Open – Raleigh
• Dear Open Source: Please help. Love, Manufacturing
1/10/2016 49
Wrap-Up/Contact
• Andy Robinson
arobinson@avidsolutionsinc.com
@archestranaut
@aaOpenSource
github.com/aaopensource
1/10/2016 50

More Related Content

What's hot (20)

PDF
Sync IT Presentation 3.16
Marcus Grimaldo
 
PDF
Tutorial: IPv6-only transition with demo
APNIC
 
PPTX
Ceph Day Amsterdam 2015 - Deploying flash storage for Ceph without compromisi...
Ceph Community
 
PDF
Routing security - Budapest 2011
Wardner Maia
 
PDF
Scaling FreeSWITCH Performance
Moises Silva
 
PDF
Bandwidth control approach - Cisco vs Mikrotik on Multitenancy
Olaf Reitmaier Veracierta
 
PDF
Building Local-loop Services for Customers
GLC Networks
 
PDF
Software Defined Datacenter with Proxmox
GLC Networks
 
PDF
Mikrotik Fastpath vs Fasttrack
GLC Networks
 
PDF
BGP on mikrotik
Achmad Mardiansyah
 
PDF
A new perspective on Network Visibility - RISK 2015
Network Performance Channel GmbH
 
PDF
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
nvirters
 
PPTX
WebRTC Standards Q&A Live Session 1 by Dan Burnett & Amir Zmora
Amir Zmora
 
PDF
IXLeeds 2 Technical Update
Thomas Mangin
 
PDF
IPv6 New RFCs
APNIC
 
PDF
Network Simulation - Prague 2015
Wardner Maia
 
PDF
MTCNA : Intro to RouterOS - Part 1
GLC Networks
 
PDF
Osdc2014 openstack networking yves_fauser
yfauser
 
PDF
BGP Anomaly Detection
University of Kufa
 
PPTX
Picking a message queue
Vladislav Kirshtein
 
Sync IT Presentation 3.16
Marcus Grimaldo
 
Tutorial: IPv6-only transition with demo
APNIC
 
Ceph Day Amsterdam 2015 - Deploying flash storage for Ceph without compromisi...
Ceph Community
 
Routing security - Budapest 2011
Wardner Maia
 
Scaling FreeSWITCH Performance
Moises Silva
 
Bandwidth control approach - Cisco vs Mikrotik on Multitenancy
Olaf Reitmaier Veracierta
 
Building Local-loop Services for Customers
GLC Networks
 
Software Defined Datacenter with Proxmox
GLC Networks
 
Mikrotik Fastpath vs Fasttrack
GLC Networks
 
BGP on mikrotik
Achmad Mardiansyah
 
A new perspective on Network Visibility - RISK 2015
Network Performance Channel GmbH
 
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
nvirters
 
WebRTC Standards Q&A Live Session 1 by Dan Burnett & Amir Zmora
Amir Zmora
 
IXLeeds 2 Technical Update
Thomas Mangin
 
IPv6 New RFCs
APNIC
 
Network Simulation - Prague 2015
Wardner Maia
 
MTCNA : Intro to RouterOS - Part 1
GLC Networks
 
Osdc2014 openstack networking yves_fauser
yfauser
 
BGP Anomaly Detection
University of Kufa
 
Picking a message queue
Vladislav Kirshtein
 

Viewers also liked (20)

DOCX
FacebookProject_Team6_FinalReport
Wendy Lally
 
PPTX
16.09.2014 (2)
tolgacelebi
 
PDF
What Can I Do with My Degree?
Nicole DelVicario
 
PDF
Pushback: Information literacy does not mean what you think it means
si641
 
PPTX
літературно мистецький червень2015
Юлия Тер-Давлатян
 
PPTX
літературно мистецький серпень2015
Юлия Тер-Давлатян
 
PDF
Championship Title Boxing
Lola Montelongo
 
PPTX
літературно мистецький жовтень2015
Юлия Тер-Давлатян
 
PDF
Bai 1 lam quen voi sql 2008
Phương Nhung
 
PPTX
тренінг
blondik1289
 
PPT
Урок математики
blondik1289
 
PPSX
School management Software
Globalcampus
 
DOCX
Adriana Pieterse (2)
Adriana Ferreira
 
PDF
PBAlignment
Eunice Ava Lapuz
 
PPTX
E learning proposal for a marketing company
Ruwan Weerasinghe
 
PPTX
Real Estate in Ecommerce age
Krushit Shah
 
DOC
Swapnil Bhavsar - Resume
swapnil bhavsar
 
PPTX
информация по тренингу
blondik1289
 
PPT
Обдаровані діти
blondik1289
 
PDF
Trends in APN practice engage in the change
Deena Nardi
 
FacebookProject_Team6_FinalReport
Wendy Lally
 
16.09.2014 (2)
tolgacelebi
 
What Can I Do with My Degree?
Nicole DelVicario
 
Pushback: Information literacy does not mean what you think it means
si641
 
літературно мистецький червень2015
Юлия Тер-Давлатян
 
літературно мистецький серпень2015
Юлия Тер-Давлатян
 
Championship Title Boxing
Lola Montelongo
 
літературно мистецький жовтень2015
Юлия Тер-Давлатян
 
Bai 1 lam quen voi sql 2008
Phương Nhung
 
тренінг
blondik1289
 
Урок математики
blondik1289
 
School management Software
Globalcampus
 
Adriana Pieterse (2)
Adriana Ferreira
 
PBAlignment
Eunice Ava Lapuz
 
E learning proposal for a marketing company
Ruwan Weerasinghe
 
Real Estate in Ecommerce age
Krushit Shah
 
Swapnil Bhavsar - Resume
swapnil bhavsar
 
информация по тренингу
blondik1289
 
Обдаровані діти
blondik1289
 
Trends in APN practice engage in the change
Deena Nardi
 
Ad

Similar to IOT and System Platform From Concepts to Code (20)

PDF
Protocols for IoT
Aravindhan G K
 
PDF
IoT - Understanding internet of things
veerababu penugonda(Mr-IoT)
 
PPTX
AndroidThing (Internet of things)
Mayur Solanki
 
PDF
Application Layer Protocols for the IoT
Damien Magoni
 
PPTX
iot-application-layer-protocols-v1-200125143512.pptx
ssuser0b643d
 
PPTX
Internet of things(iot)
Rakesh Gupta
 
PPTX
Protocols for internet of things
Charles Gibbons
 
PPTX
Protocols for internet of things
Charles Gibbons
 
PPTX
Internet of Things: Protocols for M2M
Charles Gibbons
 
PPTX
Protocols for internet of things
Charles Gibbons
 
PPTX
Protocols for internet of things
Charles Gibbons
 
PPTX
Protocols for internet of things
Charles Gibbons
 
PDF
Arduino basics
Eueung Mulyana
 
PDF
mqttvsrest_v4.pdf
RaghuKiran29
 
PPTX
InduSoft Web Studio and MQTT for Internet of Things Applications
AVEVA
 
PDF
Building the Internet of Things with Eclipse IoT - IoTBE meetup
Benjamin Cabé
 
PDF
MQTT – protocol for yours IoT
Miroslav Resetar
 
PDF
MQTT: A lightweight messaging platform for IoT
Alejandro Martín Clemente
 
PDF
MQTT - A practical protocol for the Internet of Things
Bryan Boyd
 
PDF
MQTT_v2 protocol for IOT based applications
hassam37
 
Protocols for IoT
Aravindhan G K
 
IoT - Understanding internet of things
veerababu penugonda(Mr-IoT)
 
AndroidThing (Internet of things)
Mayur Solanki
 
Application Layer Protocols for the IoT
Damien Magoni
 
iot-application-layer-protocols-v1-200125143512.pptx
ssuser0b643d
 
Internet of things(iot)
Rakesh Gupta
 
Protocols for internet of things
Charles Gibbons
 
Protocols for internet of things
Charles Gibbons
 
Internet of Things: Protocols for M2M
Charles Gibbons
 
Protocols for internet of things
Charles Gibbons
 
Protocols for internet of things
Charles Gibbons
 
Protocols for internet of things
Charles Gibbons
 
Arduino basics
Eueung Mulyana
 
mqttvsrest_v4.pdf
RaghuKiran29
 
InduSoft Web Studio and MQTT for Internet of Things Applications
AVEVA
 
Building the Internet of Things with Eclipse IoT - IoTBE meetup
Benjamin Cabé
 
MQTT – protocol for yours IoT
Miroslav Resetar
 
MQTT: A lightweight messaging platform for IoT
Alejandro Martín Clemente
 
MQTT - A practical protocol for the Internet of Things
Bryan Boyd
 
MQTT_v2 protocol for IOT based applications
hassam37
 
Ad

Recently uploaded (20)

PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
Water Resources Engineering (CVE 728)--Slide 3.pptx
mohammedado3
 
PPT
Testing and final inspection of a solar PV system
MuhammadSanni2
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPTX
MODULE 04 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
PDF
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
PPTX
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PDF
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PDF
mbse_An_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PPTX
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PDF
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PPTX
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PDF
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
Water Resources Engineering (CVE 728)--Slide 3.pptx
mohammedado3
 
Testing and final inspection of a solar PV system
MuhammadSanni2
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
MODULE 04 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
mbse_An_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 

IOT and System Platform From Concepts to Code

  • 1. IOT and System Platform From Concepts to Code Andy Robinson Avid Solutions
  • 3. Introductions • Andy Robinson​ • Information Solutions Consultant with Avid Solutions in Raleigh • 2 years as Principal at Phase 2 Automation​ in Taiwan • 10 years with Avid Solutions • 5 years with Monsanto/Solutia in Decatur, AL and Houston, TX​ • ​Co-Founder of aaOpenSource • The Archestranaut 1/10/2016 3
  • 5. Overview/One-Eyed People I am NOT an expert In the land of the blind …the one eyed man is king 1/10/2016 5
  • 6. Overview/My Definition of IOT What would/could you do differently if the cost to send data to/from your system approached $0? 1/10/2016 6 Sensor Transmitter I/O Channel Complex Machine Gateway Data Server Visualization Alarming Storage
  • 7. Overview/Parts and Pieces • Many Moving Pieces Clients Data Transmission/ Receipt Servers Storage Visualization Analytics Notifications 1/10/2016 7
  • 8. Overview/Data Transmission • Two Core Pieces • Transport • TCP – connection oriented, packets are confirmed and retransmitted if failed • UDP - connectionless , fire and forget • Protocol • HTTP • XMPP • CoAP • AMQP • MQTT 1/10/2016 8
  • 9. Overview/Data Transmission/HTTP • Same core protocol as web page delivery • Uses a RESTful pattern (GET/POST) • Client-Server with Request/Response 1/10/2016 9
  • 10. Overview/Data Transmission/HTTP • Benefits • Easy path through firewalls (HTTP/80, HTTPS/443) • Out of the box transport security with SSL/TLS • Very well known so easy to get started 1/10/2016 10
  • 11. Overview/Data Transmission/HTTP • Drawbacks • Huge overhead from headers 700-800 bytes1 (should be better with HTTP/2) • RESTful patterns are inherently slow and require polling (1) http://dev.chromium.org/spdy/spdy-whitepaper 1/10/2016 11
  • 12. Overview/Data Transmission/XMPP • eXtensible Messaging and Presence Protocol • XML over TCP • Originally started as a chat protocol to support contact lists and presence • Ask Eliot Landrum anything https://en.wikipedia.org/wiki/XMPP 1/10/2016 12
  • 13. Overview/Data Transmission/XMPP • Benefits • Open standard • Flexible • Very mature (originated in 1999) https://en.wikipedia.org/wiki/XMPP 1/10/2016 13
  • 14. Overview/Data Transmission/XMPP • Drawbacks • No QOS inherent at the protocol layer • Higher network overhead due to XML being text based https://en.wikipedia.org/wiki/XMPP 1/10/2016 14
  • 15. Overview/Data Transmission/CoAP • Constrained Object Access Protocol • UDP but similar to HTTP with RESTful functions (GET/PUT/POST/DELETE) • Asynchronous communications model • Client-Server http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117 http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm 1/10/2016 15
  • 16. Overview/Data Transmission/CoAP • Benefits • Ultra small header (4 bytes) leads to ultra small packet sizes • DTLS for security • Combined with LWM2M for robust device management • Discovery methods built into protocol • Great for ultra low power, ultra low bandwidth • Datagram packet model can work over non IP transports like SMS • IETF Standard 1/10/2016 16 http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117 http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
  • 17. Overview/Data Transmission/CoAP • Drawbacks • Core protocol is client-server with server initiated communications  requires inbound packets to client device  security concerns • As single client to single server there is no built-in concept of data broadcast 1/10/2016 17 http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117 http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
  • 18. Overview/Data Transmission/AMQP • Advanced Message Queue Protocol • Originally developed by big financial orgs for middleware messaging • Message oriented binary protocol typically over TCP • OASIS Standard https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol 1/10/2016 18
  • 19. Overview/Data Transmission/AMQP • Benefits • Built for resiliency and scaling • Load balancing patterns • Messages can contain payload and metadata • Powerful routing patterns • Security based on SSL/TLS 1/10/2016 19
  • 20. Overview/Data Transmission/AMQP • Drawbacks • Not lightweight – built with servers and fat networks in mind (60 byte minimum packet size) • Can be complex to implement client – thanks Paolo for SBLite 1/10/2016 20
  • 21. Overview/Data Transmission/MQTT • Message Queue Telemetry Transport • Created by IBM to support oil pipeline telemetry data over slow, unreliable networks • TCP Transport • Publish-Subscribe with Broker Model 1/10/2016 21 http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117 http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
  • 22. Overview/Data Transmission/MQTT • Benefits • Very small header (7 bytes) leads to very small packet sizes • TLS for security • Great for low power, low bandwidth • No incoming connection to client  much more secure • 3 levels of QOS • OASIS Standard 1/10/2016 22 http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117 http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm
  • 23. Overview/Data Transmission/MQTT • Benefits - Small size and low overhead 1/10/2016 23 https://mobilebit.wordpress.com/2013/05/03/rest-is-for-sleeping-mqtt-is-for-mobile/
  • 24. Overview/Data Transmission/MQTT • Drawbacks • TCP is connection oriented so more complex to put device to sleep (MQTT-S supports UDP) • No standard model for metadata and discoverability • No standard method for device management http://www.slideshare.net/rickgaribay/from-the-internet-of-things-to-intelligent-systems-a-developers-primer-garibay-final-34875117 http://www.realtimecommunicationsworld.com/topics/realtimecommunicationsworld/articles/408622-pros-cons-the-major-iot-communications-protocols.htm 1/10/2016 24
  • 25. Overview/Data Transmission/Winner • And the best protocol is…the one that matches your requirements and capabilities • One of many comparisons • www.slideshare.net/paolopat/mqtt-iot-protocols-comparison • Would also love to talk about DDS (ultra high performance, data-centric) • ….. but let’s talk about MQTT 1/10/2016 25
  • 26. MQTT – The Details 1/10/2016 26
  • 27. MQTT/Details/Transport • Utilizes single, duplex, persistent TCP connection for transport • Client connects to broker and broker sends data back down the connection • Broker NEVER connects directly to client. Security Win! • Client can use SSL/TLS to connect to Broker. Security Win! • Many brokers support authentication and ACL Client Broker (Server) 1/10/2016 27
  • 28. MQTT/Details/Communication Model • Pub/Sub with Central Broker • Conceptually similar to Mxaccess in System Platform http://www.codeproject.com/KB/IP/PubSubUsingWCF/pubsub.png 1/10/2016 28
  • 29. MQTT/Details/Broker • Broker is meeting point for publishers and subscribers • Many different brokers available • Run locally or in the cloud 1/10/2016 29
  • 30. MQTT/Details/Broker • Local • mosquitto – The old man of the brokers, full featured, easy, single exe • GnatMQ – written in C#, open source • HiveMQ – extra features, commercial, extensible • Mosca – node.js, open source • Verne.MQ – written in Erlang, scalable and resilient, open source 1/10/2016 30
  • 31. MQTT/Details/Broker • Cloud • CloudMQTT – uses mosquitto • Verne.MQ - extensible, highly available • Public testers – test.mosquito.org, broker.mqtt-dashboard.com, … 1/10/2016 31
  • 32. MQTT/Details/Topics • Mailboxes organized into folders • “/” separates the folders • Wildcards • Single Level  “+” • home/+/temp home/1/temp home/2/temp • Multi-Level  “#” • /home/# home/1/temp home/2/temp home/1/rh home/2/rh1/10/2016 32
  • 33. MQTT/Details/Topics vs Queues Feature Topics Queues Big Idea Real Time Asynchronous FIFO/Stack Dropped Data Can Be OK (but QOS) Never Ok Pub/Sub Yes Partial (only one client) Applications Sensor Data Alarms Alarms Events Value History “Client” Broker Topics Queue Value Alarms Events HMI Historical Values, Alarms, Events HMI HMI HMI Publish Subscribe Timestamped Values Alarms Events 1/10/2016 33
  • 34. MQTT – The Code 1/10/2016 34
  • 35. MQTT/Code/Client Library • You only need a client library to pub and sub .. unless you want to run a broker too • Client libraries for almost every language • Best C# library is M2MQTT from Paolo Patierno • Open Source • Full Featured • Nuget Package Available 1/10/2016 35
  • 36. MQTT/Code/Pseudocode Create Client Set Options (ClientID, SSL/TLS?, QOS, Credentials) Connect to Single Broker by Name or IP Address ….. Subscribe to Topic(s)  Receive Callback for Subscribed Topic …. Publish UTF-8 encoded binary data to Topic(s) 1/10/2016 36
  • 37. MQTT/Code/System Platform/Publish … Declarations…. configHost = "localhost"; configclientID = Me.Tagname; MQTTClient = new uPLibrary.Networking.M2Mqtt.MqttClient(configHost); MQTTClient.Connect(configclientID); if (MQTTClient.IsConnected) then Topic = "data/" + Me.Tagname + "/value"; MQTTClient.Publish(Topic,System.Text.Encoding.UTF8.GetBytes(Me.Value)); endif; 1/10/2016 37
  • 38. MQTT/Code/System Platform/Subscribe • Not possible due to requirement for callback registration • But you can use the AOT – been there done that.. mostly _mqttClient.MqttMsgPublishReceived += _mqttClient_MqttMsgPublishReceived; _mqttclient.subscribe(Topic) … void _mqttClient_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e) { Process new message e } 1/10/2016 38
  • 39. MQTT – The Demos 1/10/2016 39
  • 40. MQTT/Demo • Demo 1 – Publishing simple data from System Platform 1/10/2016 40
  • 41. MQTT/Demo • Demo 2 – Publishing complex data from System Platform 1/10/2016 41
  • 42. MQTT/Demo • Demo 3 – Subscribing to Data “in” System Platform 1/10/2016 42
  • 43. MQTT/Demo • Demo 4 – MQTT  Wonderware Historian (no System Platform) 1/10/2016 43
  • 44. MQTT/Demo • Demo 5 – MQTT  Node-Red  ?? • MQTTWarn 1/10/2016 44 amqp apns asterisk carbon dbus dnsupdate emoncms file freeswitch gss http instapush irccat linuxnotify log mqtt mqttpub mysql mysql_dynamic mythtv nma nntp nsca osxnotify osxsay pastebinpub pipe prowl pushalot pushbullet pushover redispub rrdtool slack sqlite smtp syslog twilio twitter xbmc xmpp xively zabbix
  • 46. MQTT/Resources • MQTT.org • Paolo! - m2mqtt.wordpress.com/ • Eclipse paho- www.eclipse.org/paho/ • AMQP on Microsoft Azure - github.com/ppatierno/azuresblite • Talk to Alvaro Martinez about the new OI Server for MQTT! • aaOpenSource Github Repo github.com/aaOpenSource/aaMQTT 1/10/2016 46
  • 48. Wrap-Up/Takeaways • Just a seed • No solutions, just ideas • Take these concepts and scale up • Consuming public MQTT data – weather? Energy prices? • Disconnected warehouse with no VPN – real situation with current customer • We are all now composers, not luthiers 1/10/2016 48
  • 49. Wrap-Up/Upcoming Talks • October 8 – Avid Solutions, Atlanta • IOT – similar talk • Basic of good security hygiene • October 20 – All Things Open – Raleigh • Dear Open Source: Please help. Love, Manufacturing 1/10/2016 49

Editor's Notes

  • #7: Not going to try to one up what’s been said by many people smarter than me have defined IOT in terms of the technology and the promise for hundreds of trillions of dollars in savings. Instead when I think of IOT I think about a mindset. That mindset being “what would you…”
  • #8: So when you dive a little deeper you find a lot of moving parts when it comes to tx/rx of IOT data. In this talk I’m going to focus almost exclusively on the data transmission and receipt part. So… let’s get started because I’ve got about 50 slides to get through.. With demos…
  • #9: Any time you send/receive data over a network you have to consider both the transport and the protocol. For transport you’ve got two primary options, TCP and UDP. The simplistic difference between the two is that TCP confirms receipt of a packet, allowing for retransmission if it doesn’t make it while UDP does not. This makes UDP a lot lighter weight and easier to wake up and send data but you have to deal with a lot of issues yourself. The next part is the protocol. And that’s what I’m about to spend a lot of time talking about. The protocol is how the two ends of the conversation know how to interpret the packets flying back and forth.
  • #10: So first up, HTTP. This is your old school method for delivering web pages but with a new twist, a RESTFUL pattern. Without getting too far into it, RESTful patterns are a way you can use existing HTTP verbs like GET/POST, etc. and specially formulated URL’s to get data and send data to the server. But fundamentally this is a request/response pattern where every time you want data it’s a new independent transaction as well as sending data.