object models for interoperability
DESCRIPTION
TRANSCRIPT
![Page 1: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/1.jpg)
M2M Protocol Interoperability MQTT CoAP HTTP REST Bridge Using IoT Toolkit and the Smart Object API
Michael J Koster [email protected]
![Page 2: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/2.jpg)
IoT Toolkit Goals • Interoperability – Any ApplicaJon, any connected object, using any M2M protocol
• Simple API arJculated through data models and high level informaJon models
• PlaOorm-‐as-‐a-‐Service and gateway enabled • Open Source, IPR-‐free • Distributed, event-‐driven applicaJon soSware runs anywhere in the network
• Web standard protocols and best pracJces
![Page 3: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/3.jpg)
API
IoT 1.0 – Things Connected to Apps
M2M CoAP
M2M MQ
M2M XMPP
M2M HTTP
App
API
App
API
App
API
App
• App runs on single service – Single Points Of Failure
• Each app wriYen to a custom API
• Diverse M2M is someJmes required but can inhibit interoperability
• SoSware, User data, and Things are trapped in Silos
• Difficult to connect new types of things and deploy new plaOorms
• Very difficult to share resources or connect across plaOorms
• Apps are not network-‐effect enabled
Connected Things, Sensors, Actuators, Data Sources
![Page 4: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/4.jpg)
IoT 2.0 – Interoperability
M2M CoAP M2M
MQTT M2M XMPP
M2M HTTP
Smart Object API IoT Toolkit
Discovery
ApplicaJons
Data Models
• Object Model • REST + Event Model • M2M Abstrac9ons
IoT Toolkit
Connected Things, Sensors, Actuators, Data Sources
Model Database
• Easy to deploy new things and applicaJons using data models
• Write once, run anywhere soSware
• Any app to any thing via any M2M, use-‐case appropriate M2M
• Network effect enabled Machine
Models
![Page 5: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/5.jpg)
Graph-‐Structured, Event-‐Driven, Real Time Distributed ApplicaJons
SO
SO
SO
Gateways Server Cloud Endpoints
• Sensors • Devices
ApplicaJon Components
And Resources
Databases
Registry -‐ Instances
Repository -‐ Models
Models
• Discovery • Persistence • ReplicaJon • Resource Access
• Data Models • Sensor Models • Machine Models • Templates
HTTP
MQTT
CoAP
XMPP HTTP
CoAP
MQTT
Smart Objects
![Page 6: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/6.jpg)
What Is The Smart Object API? • Virtual RepresentaJon of a physical Smart Object • Object Model – Web Object EncapsulaJon of properJes
• REST API using JSON, XML, RDF, core-‐link-‐format representaJons
• Data Models – Linked Data descripJons, Resource Discovery and Linkage
• Event Model – Asynchronous M2M and applicaJon soSware event handlers
![Page 7: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/7.jpg)
Object Model Web Object EncapsulaJon
Smart Object
Web protocol interfaces, also M2M e.g. MQTT, XMPP, …
Event Model Links data with acJons Pub-‐Sub and event handlers
Encapsulates local soSware components and handlers
Self-‐describing data model For Resource Discovery
and Linkage, RDF and core-‐link-‐format
Sensor or other data JSON, XML, data feeds
![Page 8: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/8.jpg)
API – DescripJon (Data Model)
• Contains graphs describing the resource data model
• RDF triples in many popular representaJons – create (POST) loads a graph into the descripJon delete (DELETE) removes a graph or subgraph from the descripJon
– set (PUT) updates a graph or subgraph – get (GET) returns a graph or subgraph
• SemanJc Proxy for core-‐link-‐format compaJbility
![Page 9: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/9.jpg)
API – Observable Property
• Represents sensor data or a data feed • Can be JSON, xml, text, or other content type – create (POST): make new observable property – delete (DELETE) remove observable property – set (PUT) update ObservaJon Value or data feed – get (GET) returns the current ObservaJon Value
• Formats for embedded Jme + locaJon data
![Page 10: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/10.jpg)
API – Agent
• Container for Event Handlers, soSware components invoked within the local context of a Smart Object
• Observer class invokes Event Handler code in the Agent
• Reference ImplementaJon – create (POST) make a new code object instance
• handler or daemon – delete (DELETE) remove code instance – set (PUT) updates segng of a code instance – get (GET) returns segng of a code instance
![Page 11: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/11.jpg)
API – Observers
• Contains graphs which define the nodes and endpoints of event driven processing
• Publish, Subscribe, and Event Handler paYerns • Reference ImplementaJon – create (POST) make a new Observer – set (PUT) update an Observer’s segngs – get (GET) return an Observer’s segngs – delete (DELETE) remove an Observer
![Page 12: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/12.jpg)
Smart Object Structure – Object Model
Smart Object
DescripJon
ObservableProperty
ObservableProperty…
Agent
Publisher Subscriber Handler
PropertyOfInterest
DescripJon
Observers
Handler Instance Daemon
Default Property
![Page 13: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/13.jpg)
REST API • Python API – Local SoSware, Agents and Handlers – Resources (objects) are hierarchical properJes of other resources
– self.indoorTempValue = sensors.weather.indoor_temp.get()!
• Web API – HYp and CoAP REST Client access, MQTT topics – Resources are organized in hierarchical path – GET http:my_server:8000/sensors/weather/indoor_temp!– GET coap:my_server:5683/sensors/weather/indoor_temp!– MQTT subscribe my_server:1883 /sensors/weather/indoor_temp!
• Default Property – Returns a resource associated with a higher level resource – GET of Smart Object returns it’s DescripJon; GET of Observable Property returns it’s ObservaJon Value
![Page 14: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/14.jpg)
Protocol Bridge Examples
• MQTT Endpoints and Bridge using Observer • CoAP Server Endpoint and link-‐data Proxy
![Page 15: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/15.jpg)
MQTT Observer
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish From REST API
Publish to Other Subscribers
SUB Publish to REST API
Connects REST Resource to MQTT Topic Publish and Subscribe
![Page 16: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/16.jpg)
MQTT Observer
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish From REST API
Publish to Other Subscribers
SUB Publish to REST API
Publisher Publishes REST Resource updates to the broker
![Page 17: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/17.jpg)
MQTT Observer
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish From REST API
Publish to Other Subscribers
SUB Publish to REST API
Subscriber Makes last published data available at the REST endpoint
![Page 18: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/18.jpg)
MQTT Observer
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish From REST API
Publish to Other Subscribers
SUB Publish to REST API
Pub+Sub Repeats data updates in both direcJons
![Page 19: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/19.jpg)
MQTT Bridge to mulJple REST endpoints
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish to Other Subscribers
REST Endpoint ObservableProperty
mqYObserver
PUT GET
![Page 20: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/20.jpg)
CoAP Server Endpoint
Smart Object
JSON
JSON
JSON
RDF
SemanJc Proxy
RDF
link-‐format
• CompaJble Object Models
• Observer paYern • Standard JSON Resources
• SemanJc Proxy exposes stored RDF via core-‐link-‐format GET/POST operaJons
![Page 21: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/21.jpg)
IoT Toolkit Protocol Interoperability
CoAP
MQTT
MQTT HTTP
smartobjectservice.com
ec2-‐54-‐200-‐106-‐25.us-‐west-‐2.compute.amazonaws.com
![Page 22: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/22.jpg)
IoT Toolkit
• IoT Toolkit is a reference implementaJon of the Smart Object API and related tools
• REST API with real-‐Jme event model for the Internet of Things
• Lightweight server that can run on small computers e.g. Raspberry Pi, ARM/Linux PC, AWS t1.micro
• M2M using HTTP, MQTT, and CoAP, others
![Page 23: Object models for interoperability](https://reader033.vdocuments.us/reader033/viewer/2022051514/54b7513a4a795967588b466f/html5/thumbnails/23.jpg)
IoT Toolkit Project Status • Smart Object API is complete and stable • IoT Toolkit Demo • M2M interoperability: MQTT, CoAP, HTTP interfaces • Development Roadmap Examples – Harden code, excepJon handling, API Tests – Scalable server, mulJ-‐tenancy, persistence models – Graph-‐based resource access control – Data model API for resource discovery and linkage – XMPP endpoint and proxy for XEP-‐0060, XEP-‐0323, XEP-‐0325
– Programming model UI e.g. Node Red – Web UI for debug and demo, applicaJons
• Navigator, Dashboard, AnalyJcs, Graphs and Charts