SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
IoT	
  Toolkit	
  and	
  the	
  Smart	
  Object	
  API	
  
Architecture	
  For	
  Interoperability	
  
Michael	
  J	
  Koster	
  
michaeljohnkoster@gmail.com	
  
IoT	
  Toolkit	
  Goals	
  
•  Interoperability	
  –	
  Any	
  ApplicaDon,	
  any	
  connected	
  
object,	
  using	
  any	
  M2M	
  protocol	
  
•  Simple	
  API	
  arDculated	
  through	
  data	
  models	
  and	
  
high	
  level	
  informaDon	
  models	
  
•  PlaIorm-­‐as-­‐a-­‐Service	
  and	
  gateway	
  enabled	
  
•  Open	
  Source,	
  IPR-­‐free	
  	
  
•  Distributed,	
  event-­‐driven	
  applicaDon	
  soNware	
  
runs	
  anywhere	
  in	
  the	
  network	
  
•  Web	
  standard	
  protocols	
  and	
  best	
  pracDces	
  
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	
  wriWen	
  to	
  a	
  
custom	
  API	
  
•  Diverse	
  M2M	
  is	
  someDmes	
  
required	
  but	
  can	
  inhibit	
  
interoperability	
  
•  SoNware,	
  User	
  data,	
  and	
  
Things	
  are	
  trapped	
  in	
  Silos	
  
•  Difficult	
  to	
  connect	
  new	
  
types	
  of	
  things	
  and	
  deploy	
  
new	
  plaIorms	
  
•  Very	
  difficult	
  to	
  share	
  
resources	
  or	
  connect	
  across	
  
plaIorms	
  
•  Apps	
  are	
  not	
  network-­‐
effect	
  enabled	
  
Connected	
  Things,	
  Sensors,	
  Actuators,	
  Data	
  Sources	
  
IoT	
  2.0	
  –	
  Interoperability	
  
M2M	
  
CoAP	
   M2M	
  
MQTT	
  
M2M	
  
XMPP	
  
M2M	
  
HTTP	
  
Smart	
  Object	
  API	
  
IoT	
  Toolkit	
  
Discovery	
  
ApplicaDons	
  
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	
  
applicaDons	
  using	
  data	
  
models	
  
•  Write	
  once,	
  run	
  
anywhere	
  soNware	
  
•  Any	
  app	
  to	
  any	
  thing	
  
via	
  any	
  M2M,	
  use-­‐
case	
  appropriate	
  M2M	
  	
  
•  Network	
  effect	
  
enabled	
   Machine	
  
Models	
  
Graph-­‐Structured,	
  Event-­‐Driven,	
  	
  
Real	
  Time	
  Distributed	
  ApplicaDons	
  
SO	
  
SO	
  
SO	
  
Gateways	
   Server	
  
Cloud	
  
Endpoints	
  
•  Sensors	
  
•  Devices	
  
ApplicaDon	
  	
  
Components	
  	
  
And	
  	
  
Resources	
  
Databases	
  
Registry	
  -­‐	
  Instances	
  
Repository	
  -­‐	
  Models	
  
Models	
  
• Discovery	
  
• Persistence	
  
• ReplicaDon	
  
• Resource	
  Access	
  
• Data	
  Models	
  	
  
• Sensor	
  Models	
  
• Machine	
  Models	
  
• Templates	
  
HTTP	
  
MQTT	
  
CoAP	
  
XMPP	
  
HTTP	
  
CoAP	
  
MQTT	
  
Smart	
  	
  
Objects	
  
What	
  Is	
  The	
  Smart	
  Object	
  API?	
  
•  Virtual	
  RepresentaDon	
  of	
  a	
  physical	
  Smart	
  Object	
  
•  Object	
  Model	
  –	
  Web	
  Object	
  EncapsulaDon	
  of	
  
properDes	
  
•  REST	
  API	
  using	
  JSON,	
  XML,	
  RDF,	
  core-­‐link-­‐format	
  
representaDons	
  
•  Data	
  Models	
  –	
  Linked	
  Data	
  descripDons,	
  
Resource	
  Discovery	
  and	
  Linkage	
  
•  Event	
  Model	
  –	
  Asynchronous	
  M2M	
  and	
  
applicaDon	
  soNware	
  event	
  handlers	
  
Object	
  Model	
  
Web	
  Object	
  EncapsulaDon	
  	
  
Smart	
  Object	
  
Web	
  protocol	
  interfaces,	
  also	
  M2M	
  e.g.	
  MQTT,	
  XMPP,	
  …	
  
Event	
  Model	
  
Links	
  data	
  with	
  acDons	
  
Pub-­‐Sub	
  and	
  event	
  handlers	
  
Encapsulates	
  local	
  soNware	
  	
  
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	
  
API	
  –	
  DescripDon	
  	
  
(Data	
  Model)	
  
•  Contains	
  graphs	
  describing	
  the	
  resource	
  data	
  
model	
  	
  
•  RDF	
  triples	
  in	
  many	
  popular	
  representaDons	
  
– create	
  (POST)	
  loads	
  a	
  graph	
  into	
  the	
  descripDon	
  
delete	
  (DELETE)	
  removes	
  a	
  graph	
  or	
  subgraph	
  from	
  
the	
  descripDon	
  
– set	
  (PUT)	
  updates	
  a	
  graph	
  or	
  subgraph	
  
– get	
  (GET)	
  returns	
  a	
  graph	
  or	
  subgraph	
  
•  SemanDc	
  Proxy	
  for	
  core-­‐link-­‐format	
  
compaDbility	
  
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	
  ObservaDon	
  Value	
  or	
  data	
  feed	
  
– get	
  (GET)	
  returns	
  the	
  current	
  ObservaDon	
  Value	
  
•  Formats	
  for	
  embedded	
  Dme	
  +	
  locaDon	
  data	
  
API	
  –	
  Agent	
  
•  Container	
  for	
  Event	
  Handlers,	
  soNware	
  
components	
  invoked	
  within	
  the	
  local	
  context	
  of	
  a	
  
Smart	
  Object	
  
•  Observer	
  class	
  invokes	
  Event	
  Handler	
  code	
  in	
  the	
  
Agent	
  
•  Reference	
  ImplementaDon	
  
–  create	
  (POST)	
  make	
  a	
  new	
  code	
  object	
  instance	
  
•  handler	
  or	
  daemon	
  
–  delete	
  (DELETE)	
  remove	
  	
  code	
  instance	
  
–  set	
  (PUT)	
  updates	
  sefng	
  of	
  a	
  code	
  instance	
  
–  get	
  (GET)	
  returns	
  sefng	
  of	
  a	
  code	
  instance	
  
API	
  –	
  Observers	
  
•  Contains	
  graphs	
  which	
  define	
  the	
  nodes	
  and	
  
endpoints	
  of	
  event	
  driven	
  processing	
  
•  Publish,	
  Subscribe,	
  and	
  Event	
  Handler	
  paWerns	
  
•  Reference	
  ImplementaDon	
  
– create	
  (POST)	
  make	
  a	
  new	
  Observer	
  	
  
– set	
  (PUT)	
  update	
  an	
  Observer’s	
  sefngs	
  
– get	
  (GET)	
  return	
  an	
  Observer’s	
  sefngs	
  
– delete	
  (DELETE)	
  remove	
  an	
  Observer	
  
Smart	
  Object	
  Structure	
  –	
  Object	
  Model	
  
Smart	
  Object	
  
DescripDon	
  
ObservableProperty	
  
ObservableProperty…	
  
Agent	
  
Publisher	
  
Subscriber	
  
Handler	
  
PropertyOfInterest	
  
DescripDon	
  
Observers	
  
Handler	
  Instance	
  
Daemon	
  
Default	
  Property	
  
REST	
  API	
  
•  Python	
  API	
  –	
  Local	
  SoNware,	
  Agents	
  and	
  Handlers	
  
–  Resources	
  (objects)	
  are	
  hierarchical	
  properDes	
  of	
  other	
  
resources	
  
–  self.indoorTempValue = sensors.weather.indoor_temp.get()!
•  Web	
  API	
  –	
  HWp	
  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	
  DescripDon;	
  GET	
  of	
  
Observable	
  Property	
  returns	
  it’s	
  ObservaDon	
  Value	
  
Protocol	
  Bridge	
  Examples	
  
•  MQTT	
  Endpoints	
  and	
  Bridge	
  using	
  Observer	
  
•  CoAP	
  Server	
  Endpoint	
  and	
  link-­‐data	
  Proxy	
  
MQTT	
  Observer	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqWObserver	
  
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	
  
MQTT	
  Observer	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqWObserver	
  
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	
  
MQTT	
  Observer	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqWObserver	
  
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	
  
MQTT	
  Observer	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqWObserver	
  
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	
  direcDons	
  
MQTT	
  Bridge	
  to	
  mulDple	
  REST	
  endpoints	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqWObserver	
  
PUT	
   GET	
  
Publish	
  from	
  
data	
  producer	
  
Publish	
  to	
  Other	
  
Subscribers	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqWObserver	
  
PUT	
   GET	
  
CoAP	
  Server	
  Endpoint	
  
Smart	
  Object	
  
JSON	
  
JSON	
  
JSON	
  
RDF	
  
SemanDc	
  
Proxy	
  
RDF	
  
link-­‐format	
  
•  CompaDble	
  Object	
  
Models	
  
•  Observer	
  paWern	
  
•  Standard	
  JSON	
  
Resources	
  
•  SemanDc	
  Proxy	
  
exposes	
  stored	
  RDF	
  
via	
  core-­‐link-­‐format	
  
GET/POST	
  operaDons	
  
IoT	
  Toolkit	
  Protocol	
  Interoperability	
  
CoAP	
  
MQTT	
  
MQTT	
  
HTTP	
  
smartobjectservice.com	
  
ec2-­‐54-­‐200-­‐106-­‐25.us-­‐
west-­‐2.compute.amazonaws.com	
  
IoT	
  Toolkit	
  
•  IoT	
  Toolkit	
  is	
  a	
  reference	
  implementaDon	
  of	
  
the	
  Smart	
  Object	
  API	
  and	
  related	
  tools	
  
•  REST	
  API	
  with	
  real-­‐Dme	
  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	
  
IoT	
  Toolkit	
  Project	
  Status	
  
•  Smart	
  Object	
  API	
  is	
  complete	
  and	
  stable	
  
•  IoT	
  Toolkit	
  Demo	
  	
  
•  M2M	
  interoperability:	
  MQTT,	
  CoAP,	
  HTTP	
  interfaces	
  	
  
•  Development	
  Roadmap	
  Examples	
  
–  Object	
  model,	
  Data	
  model	
  namespaces	
  and	
  ontologies	
  
–  Programming	
  model	
  UI:	
  Node	
  Red	
  integraDon	
  
–  Graph-­‐based	
  resource	
  access	
  control	
  
–  Harden	
  code,	
  excepDon	
  handling,	
  API	
  Tests	
  
–  Scalable	
  server,	
  mulD-­‐tenancy	
  
–  XMPP	
  endpoint	
  and	
  proxy	
  for	
  XEP-­‐0060,	
  XEP-­‐0323,	
  
XEP-­‐0325	
  
–  Web	
  UI	
  for	
  debug	
  and	
  demo,	
  applicaDons	
  
•  Navigator,	
  Dashboard,	
  AnalyDcs,	
  Graphs	
  and	
  Charts	
  
Code	
  Examples	
  
•  Arduino	
  Sketch	
  that	
  updates	
  SmartObject	
  in	
  
the	
  gateway	
  
•  Server	
  startup	
  code	
  	
  
•  Example	
  Resources	
  
•  Event	
  Model	
  Examples	
  –	
  Observers	
  
•  Based	
  on	
  the	
  Weather	
  Sensor	
  Demo	
  	
  
Weather	
  sensor	
  example	
  
Sensor	
  
(Arduino)	
  
Gateway	
  
(Rpi)	
  
Sensor	
  Hardware	
  
•  Wind	
  Speed	
  
•  Wind	
  DirecDon	
  
•  Rainfall	
  
•  Temperature	
  
•  Humidity	
  
•  Barometer	
  
Reads	
  sensor	
  elements	
  and	
  creates	
  sensor	
  output	
  	
  
values	
  to	
  update	
  Smart	
  Object	
  in	
  the	
  Gateway	
  	
  
using	
  a	
  simple	
  hWp	
  client	
  
Gateway	
  runs	
  Smart	
  Object	
  API	
  and	
  exposes	
  HTTP	
  
	
  interface,	
  adds	
  descripDonand	
  other	
  resources,	
  	
  
Observers	
  send	
  updates	
  to	
  cloud	
  server	
  
Local	
  
Ethernet	
  
Cloud	
  Server	
  acts	
  as	
  Gateway-­‐as-­‐a-­‐Service	
  for	
  Xively	
  
Receives	
  updates	
  from	
  the	
  gateway,	
  Observers	
  	
  
Send	
  periodic	
  updates	
  to	
  Xively	
  feed	
  
Cloud	
  	
  
Server	
  
Internet	
  
Client	
  
(Xively)	
  
Internet	
  
Xively	
  acts	
  as	
  client	
  applicaDon	
  and	
  receives	
  	
  
updates	
  from	
  the	
  cloud	
  service	
  acDng	
  as	
  GaaS	
  
Arduino	
  Sketch	
  
	
  	
  	
  PString jsonObject(objectBuffer, sizeof(objectBuffer));!
!
   if(nextPushPoint==0) {!
     nextPushPoint=1;!
/* use Pstring.print to format JSON string from integer */!
     jsonObject.println(daily_rain,1); !
/* PUT update to Smart Object server property using JSON */!
     client.print("PUT ");!
     client.print(serverPath);!
     client.print(”daily_rain");!
     client.println(" HTTP/1.1");!
     client.println("Content-Type: application/json");!
     client.print("Content-Length: ");!
     client.println(jsonObject.length()-2);!
     client.println("Connection: close");!
     client.println();!
     client.println(jsonObject);!
   }!
Demo	
  Code	
  for	
  Weather	
  Sensor	
  –	
  
Smart	
  Object	
  and	
  Service	
  CreaDon	
  
	
  	
  baseObject	
  =	
  SmartObject()	
  #	
  create	
  a	
  Smart	
  Object	
  to	
  serve	
  as	
  the	
  base	
  container	
  
for	
  other	
  Smart	
  Objects	
  and	
  resources	
  
	
  	
  	
  	
  server	
  =	
  SmartObjectService(baseObject)	
  #	
  make	
  an	
  instance	
  of	
  the	
  service,	
  
baseObject	
  is	
  the	
  object	
  root	
  
	
  	
  	
  	
  server.start(8000)	
  #	
  forks	
  a	
  server	
  thread	
  to	
  listen	
  on	
  port	
  8000	
  
	
  	
  	
  	
  print	
  'hCpd	
  started	
  at',	
  baseObject.Proper9es.get('hCpService’)	
  
	
  
#	
  top	
  level	
  object	
  container	
  for	
  sensors,	
  class	
  is	
  SmartObject	
  
sensors	
  =	
  baseObject.create({'resourceName':	
  'sensors',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
  	
  	
  	
  	
  	
  	
  'resourceClass':	
  'SmartObject'})	
  
	
  
#weather	
  sensor	
  Smart	
  Object	
  under	
  sensors	
  for	
  the	
  weather	
  sensor	
  	
  	
  	
  	
  
	
  	
  	
  	
  weather	
  =	
  sensors.create({'resourceName':	
  'rhvWeather-­‐01',	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
   	
  	
  	
  	
  	
  'resourceClass':	
  'SmartObject’}!
Data	
  Model	
  –	
  DescripDon	
  	
  
for	
  object	
  discovery	
  and	
  linkage	
  
	
  	
  	
  #	
  make	
  a	
  reference	
  to	
  the	
  weather	
  sensor	
  object	
  DescripDon	
  and	
  build	
  an	
  example	
  
graph	
  (could	
  use	
  the	
  built-­‐in	
  reference	
  as	
  well)	
  
	
  	
  	
  	
  weather.descripDon	
  =	
  weather.Resources.get('Descrip9on')	
  
	
  
	
  	
  	
  	
  weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/outdoor_temperature'),	
  
RDFS.Resource,	
  Literal('sensor')))	
  
	
  	
  	
  	
  weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/outdoor_temperature'),	
  
RDF.type,	
  Literal('temperature')))	
  
	
  	
  	
  	
  weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/outdoor_humidity'),	
  
RDFS.Resource,	
  Literal('sensor')))	
  
	
  	
  	
  	
  weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/outdoor_humidity'),	
  
RDF.type,	
  Literal('humidity')))	
  
	
  	
  	
  	
  weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/sealevel_pressure'),	
  
RDFS.Resource,	
  Literal('sensor')))	
  
	
  	
  	
  	
  weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/sealevel_pressure'),	
  
RDF.type,	
  Literal('pressure')))!
EncapsulaDon:	
  Observable	
  Property,	
  
Observer,	
  and	
  Subscriber	
  
	
  sealevel_pressure	
  =	
  weather.create({'resourceName':	
  'sealevel_pressure',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
   	
   	
  	
  	
  	
  	
  	
  	
  'resourceClass':	
  'ObservableProperty'})	
  
	
  	
  	
  	
  	
  
	
  	
  sealevel_pressure.Observers.create({'resourceName':'demoServiceObserver',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
   	
  'resourceClass':	
  'hCpPublisher',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
   	
  'targetURI':	
  'hCp://smartobjectservice.com:
	
   	
   	
   	
   	
   	
   	
  8000/sensors/rhvWeather-­‐01/sealevel_pressure'})	
  
	
  
	
  #	
  make	
  a	
  named	
  subscriber	
  resource	
  
	
  	
  	
  	
  outdoor_humidity.Observers.create({'resourceName':	
  'humiditySubscriber',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'resourceClass':	
  'hCpSubscriber',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'observerURI':	
  'hCp://localhost:8000/sensors/rhvWeather-­‐01/
	
   	
   	
   	
   	
   	
   	
   	
   	
   	
   	
   	
   	
  indoor_humidity',	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'observerName':	
  'humiditySubObserver'	
  })	
  
Event	
  Model:	
  MQTT	
  Observer	
  
•  Publish,	
  Subscribe,	
  or	
  Pub+Sub	
  using	
  the	
  
mqWObserver	
  resource	
  class	
  
•  Prototype	
  opens	
  a	
  connecDon	
  to	
  a	
  specified	
  
broker	
  for	
  each	
  endpoint	
  
	
  
Observers.create({'resourceName': 'mqttTestObserver',!
! ! ! ! ! 'resourceClass': 'mqttObserver',!
'connection': 'smartobjectservice.com',!
'pubTopic': ’sealevel_pressure',!
'subTopic': None,!
'QoS': 0,!
'keepAlive': 60 })!
Event	
  Model	
  –	
  
Xively	
  Publisher	
  -­‐	
  Observer	
  
sealevel_pressure.Observers.create({'resourceName':	
  'xivelyObserver',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
   	
  	
  'resourceClass':	
  'xivelyPublisher',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
   	
  	
  'apiBase':	
  'hCps://api.xively.com/v2/feeds',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
   	
  	
  'feedID':	
  '2141862995',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
   	
  	
  'streamID':	
  'sealevel_pressure’,	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
   	
   	
   	
   	
   	
   	
  	
  'apiKey’:'QYourApiKeyGoesHEresjhgrjgo56',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
   	
   	
  	
  'updateInterval':	
  pushInterval	
  })	
  
	
  
Event	
  Model	
  –	
  
Handler	
  and	
  Callback	
  NoDfier	
  
	
  	
  #addHandler	
  class	
  adds	
  2	
  properDes	
  values	
  together	
  and	
  stores	
  in	
  a	
  third	
  
	
  	
  	
  	
  weather.Agent.create({'resourceName':	
  'addHandler',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'resourceClass':	
  'addHandler',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'addendLink1':'sensors/rhvWeather-­‐01/indoor_temperature',	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'addendLink2':	
  'sensors/rhvWeather-­‐01/indoor_temperature',	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'sumOutLink':	
  'sensors/rhvWeather-­‐01/outdoor_humidity'})	
  
	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  #	
  now	
  create	
  a	
  callback	
  observer	
  endpoint	
  	
  
	
  	
  	
  	
  indoor_temperature.Observers.create({'resourceName':	
  'callbackTempObserver',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'resourceClass':	
  'callbackNo9fier',	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'handlerURI':	
  'callback:///sensors/rhvWeather-­‐01/Agent/
	
   	
   	
   	
   	
   	
   	
   	
   	
   	
   	
   	
   	
   	
  addHandler'})	
  

Contenu connexe

Tendances

Hypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of ThingsHypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of ThingsMichael Koster
 
A Modular Open Source Platform for IoT
A Modular Open Source Platform for IoTA Modular Open Source Platform for IoT
A Modular Open Source Platform for IoTMichael Koster
 
OMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
OMA LwM2M Workshop - Michael Koster, IPSO Alliance ObjectsOMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
OMA LwM2M Workshop - Michael Koster, IPSO Alliance ObjectsOpen Mobile Alliance
 
Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)
Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)
Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)Helena Edelson
 
Building Eventing Systems for Microservice Architecture
Building Eventing Systems for Microservice Architecture  Building Eventing Systems for Microservice Architecture
Building Eventing Systems for Microservice Architecture Yaroslav Tkachenko
 
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...Lightbend
 
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache KafkaExploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache KafkaLightbend
 
Why Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For MicroservicesWhy Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For MicroservicesYaroslav Tkachenko
 
Building Stateful Microservices With Akka
Building Stateful Microservices With AkkaBuilding Stateful Microservices With Akka
Building Stateful Microservices With AkkaYaroslav Tkachenko
 
Understanding Virtual Networking in the Cloud - RightScale Compute 2013
Understanding Virtual Networking in the Cloud - RightScale Compute 2013Understanding Virtual Networking in the Cloud - RightScale Compute 2013
Understanding Virtual Networking in the Cloud - RightScale Compute 2013RightScale
 
Enterprise Metadata Integration
Enterprise Metadata IntegrationEnterprise Metadata Integration
Enterprise Metadata IntegrationDr. Mirko Kämpf
 
How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...
How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...
How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...Lightbend
 
Sa introduction to big data pipelining with cassandra & spark west mins...
Sa introduction to big data pipelining with cassandra & spark   west mins...Sa introduction to big data pipelining with cassandra & spark   west mins...
Sa introduction to big data pipelining with cassandra & spark west mins...Simon Ambridge
 
Lightbend Fast Data Platform
Lightbend Fast Data PlatformLightbend Fast Data Platform
Lightbend Fast Data PlatformLightbend
 
Moving from Big Data to Fast Data? Here's How To Pick The Right Streaming Engine
Moving from Big Data to Fast Data? Here's How To Pick The Right Streaming EngineMoving from Big Data to Fast Data? Here's How To Pick The Right Streaming Engine
Moving from Big Data to Fast Data? Here's How To Pick The Right Streaming EngineLightbend
 
Akka Streams And Kafka Streams: Where Microservices Meet Fast Data
Akka Streams And Kafka Streams: Where Microservices Meet Fast DataAkka Streams And Kafka Streams: Where Microservices Meet Fast Data
Akka Streams And Kafka Streams: Where Microservices Meet Fast DataLightbend
 

Tendances (17)

Hypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of ThingsHypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of Things
 
Embedded to connected
Embedded to connectedEmbedded to connected
Embedded to connected
 
A Modular Open Source Platform for IoT
A Modular Open Source Platform for IoTA Modular Open Source Platform for IoT
A Modular Open Source Platform for IoT
 
OMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
OMA LwM2M Workshop - Michael Koster, IPSO Alliance ObjectsOMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
OMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
 
Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)
Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)
Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)
 
Building Eventing Systems for Microservice Architecture
Building Eventing Systems for Microservice Architecture  Building Eventing Systems for Microservice Architecture
Building Eventing Systems for Microservice Architecture
 
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
 
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache KafkaExploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
 
Why Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For MicroservicesWhy Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For Microservices
 
Building Stateful Microservices With Akka
Building Stateful Microservices With AkkaBuilding Stateful Microservices With Akka
Building Stateful Microservices With Akka
 
Understanding Virtual Networking in the Cloud - RightScale Compute 2013
Understanding Virtual Networking in the Cloud - RightScale Compute 2013Understanding Virtual Networking in the Cloud - RightScale Compute 2013
Understanding Virtual Networking in the Cloud - RightScale Compute 2013
 
Enterprise Metadata Integration
Enterprise Metadata IntegrationEnterprise Metadata Integration
Enterprise Metadata Integration
 
How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...
How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...
How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...
 
Sa introduction to big data pipelining with cassandra & spark west mins...
Sa introduction to big data pipelining with cassandra & spark   west mins...Sa introduction to big data pipelining with cassandra & spark   west mins...
Sa introduction to big data pipelining with cassandra & spark west mins...
 
Lightbend Fast Data Platform
Lightbend Fast Data PlatformLightbend Fast Data Platform
Lightbend Fast Data Platform
 
Moving from Big Data to Fast Data? Here's How To Pick The Right Streaming Engine
Moving from Big Data to Fast Data? Here's How To Pick The Right Streaming EngineMoving from Big Data to Fast Data? Here's How To Pick The Right Streaming Engine
Moving from Big Data to Fast Data? Here's How To Pick The Right Streaming Engine
 
Akka Streams And Kafka Streams: Where Microservices Meet Fast Data
Akka Streams And Kafka Streams: Where Microservices Meet Fast DataAkka Streams And Kafka Streams: Where Microservices Meet Fast Data
Akka Streams And Kafka Streams: Where Microservices Meet Fast Data
 

Similaire à IoT Toolkit and the Smart Object API - Architecture for Interoperability

M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitMichael Koster
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitMichael Koster
 
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...Michael Koster
 
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013Michael Koster
 
IoT Toolkit and Smart Object API Tutorial Introduction
IoT Toolkit and Smart Object API Tutorial IntroductionIoT Toolkit and Smart Object API Tutorial Introduction
IoT Toolkit and Smart Object API Tutorial IntroductionMichael Koster
 
CCNA-Open-Platform-IoT
CCNA-Open-Platform-IoTCCNA-Open-Platform-IoT
CCNA-Open-Platform-IoTMichael Koster
 
A Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityA Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityMichael Koster
 
A Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityA Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityMichael Koster
 
MQTT-REST Bridge using the Smart Object API
MQTT-REST Bridge using the Smart Object APIMQTT-REST Bridge using the Smart Object API
MQTT-REST Bridge using the Smart Object APIMichael Koster
 
MQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMichael Koster
 
MQTT REST Bridge using the Smart Object API
MQTT REST Bridge using the Smart Object APIMQTT REST Bridge using the Smart Object API
MQTT REST Bridge using the Smart Object APIMichael Koster
 
Hypermedia for Machine APIs
Hypermedia for Machine APIsHypermedia for Machine APIs
Hypermedia for Machine APIsMichael Koster
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoMichael Koster
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoMichael Koster
 
Web of Things to the edge
Web of Things to the edgeWeb of Things to the edge
Web of Things to the edgeMichael Koster
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoMichael Koster
 

Similaire à IoT Toolkit and the Smart Object API - Architecture for Interoperability (20)

M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT Toolkit
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT Toolkit
 
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
 
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
 
IoT Toolkit and Smart Object API Tutorial Introduction
IoT Toolkit and Smart Object API Tutorial IntroductionIoT Toolkit and Smart Object API Tutorial Introduction
IoT Toolkit and Smart Object API Tutorial Introduction
 
CCNA-Open-Platform-IoT
CCNA-Open-Platform-IoTCCNA-Open-Platform-IoT
CCNA-Open-Platform-IoT
 
A Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityA Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT Interoperability
 
A Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityA Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT Interoperability
 
MQTT-REST Bridge using the Smart Object API
MQTT-REST Bridge using the Smart Object APIMQTT-REST Bridge using the Smart Object API
MQTT-REST Bridge using the Smart Object API
 
MQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object API
 
MQTT REST Bridge using the Smart Object API
MQTT REST Bridge using the Smart Object APIMQTT REST Bridge using the Smart Object API
MQTT REST Bridge using the Smart Object API
 
Hypermedia for Machine APIs
Hypermedia for Machine APIsHypermedia for Machine APIs
Hypermedia for Machine APIs
 
Design patternsforiot
Design patternsforiotDesign patternsforiot
Design patternsforiot
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipso
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipso
 
Web of Things to the edge
Web of Things to the edgeWeb of Things to the edge
Web of Things to the edge
 
Windows 8 Metro apps and the outside world
Windows 8 Metro apps and the outside worldWindows 8 Metro apps and the outside world
Windows 8 Metro apps and the outside world
 
Ipso eclipse-summary
Ipso eclipse-summaryIpso eclipse-summary
Ipso eclipse-summary
 
AWS IoT Deep Dive
AWS IoT Deep DiveAWS IoT Deep Dive
AWS IoT Deep Dive
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipso
 

Plus de Michael Koster

Hypermedia design for machine apis
Hypermedia design for machine apisHypermedia design for machine apis
Hypermedia design for machine apisMichael Koster
 
Ipso smart objects for iot
Ipso smart objects for iotIpso smart objects for iot
Ipso smart objects for iotMichael Koster
 
Ipso application templates
Ipso application templatesIpso application templates
Ipso application templatesMichael Koster
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoTMichael Koster
 
REST APIs for an Internet of Things
REST APIs for an Internet of ThingsREST APIs for an Internet of Things
REST APIs for an Internet of ThingsMichael Koster
 
The Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
The Network Effect - Open Source and the Internet Of Things - Helsinki KeynoteThe Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
The Network Effect - Open Source and the Internet Of Things - Helsinki KeynoteMichael Koster
 
Tools for the Open Source Internet of Things
Tools for the Open Source Internet of ThingsTools for the Open Source Internet of Things
Tools for the Open Source Internet of ThingsMichael Koster
 
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013Michael Koster
 
Personal Agency on the IoT
Personal Agency on the IoTPersonal Agency on the IoT
Personal Agency on the IoTMichael Koster
 
Friend Of A Thing and IoT Resource access control #OSIOT
Friend Of A Thing and IoT Resource access control #OSIOTFriend Of A Thing and IoT Resource access control #OSIOT
Friend Of A Thing and IoT Resource access control #OSIOTMichael Koster
 

Plus de Michael Koster (11)

Hypermedia design for machine apis
Hypermedia design for machine apisHypermedia design for machine apis
Hypermedia design for machine apis
 
Osiot13 IoT buildout
Osiot13 IoT buildoutOsiot13 IoT buildout
Osiot13 IoT buildout
 
Ipso smart objects for iot
Ipso smart objects for iotIpso smart objects for iot
Ipso smart objects for iot
 
Ipso application templates
Ipso application templatesIpso application templates
Ipso application templates
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoT
 
REST APIs for an Internet of Things
REST APIs for an Internet of ThingsREST APIs for an Internet of Things
REST APIs for an Internet of Things
 
The Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
The Network Effect - Open Source and the Internet Of Things - Helsinki KeynoteThe Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
The Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
 
Tools for the Open Source Internet of Things
Tools for the Open Source Internet of ThingsTools for the Open Source Internet of Things
Tools for the Open Source Internet of Things
 
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
 
Personal Agency on the IoT
Personal Agency on the IoTPersonal Agency on the IoT
Personal Agency on the IoT
 
Friend Of A Thing and IoT Resource access control #OSIOT
Friend Of A Thing and IoT Resource access control #OSIOTFriend Of A Thing and IoT Resource access control #OSIOT
Friend Of A Thing and IoT Resource access control #OSIOT
 

Dernier

ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxNIMMANAGANTI RAMAKRISHNA
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxmibuzondetrabajo
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxAndrieCagasanAkio
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119APNIC
 
Cybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best PracticesCybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best PracticesLumiverse Solutions Pvt Ltd
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxMario
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 

Dernier (9)

ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptx
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptx
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptx
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119
 
Cybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best PracticesCybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best Practices
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptx
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 

IoT Toolkit and the Smart Object API - Architecture for Interoperability

  • 1. IoT  Toolkit  and  the  Smart  Object  API   Architecture  For  Interoperability   Michael  J  Koster   michaeljohnkoster@gmail.com  
  • 2. IoT  Toolkit  Goals   •  Interoperability  –  Any  ApplicaDon,  any  connected   object,  using  any  M2M  protocol   •  Simple  API  arDculated  through  data  models  and   high  level  informaDon  models   •  PlaIorm-­‐as-­‐a-­‐Service  and  gateway  enabled   •  Open  Source,  IPR-­‐free     •  Distributed,  event-­‐driven  applicaDon  soNware   runs  anywhere  in  the  network   •  Web  standard  protocols  and  best  pracDces  
  • 3. 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  wriWen  to  a   custom  API   •  Diverse  M2M  is  someDmes   required  but  can  inhibit   interoperability   •  SoNware,  User  data,  and   Things  are  trapped  in  Silos   •  Difficult  to  connect  new   types  of  things  and  deploy   new  plaIorms   •  Very  difficult  to  share   resources  or  connect  across   plaIorms   •  Apps  are  not  network-­‐ effect  enabled   Connected  Things,  Sensors,  Actuators,  Data  Sources  
  • 4. IoT  2.0  –  Interoperability   M2M   CoAP   M2M   MQTT   M2M   XMPP   M2M   HTTP   Smart  Object  API   IoT  Toolkit   Discovery   ApplicaDons   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   applicaDons  using  data   models   •  Write  once,  run   anywhere  soNware   •  Any  app  to  any  thing   via  any  M2M,  use-­‐ case  appropriate  M2M     •  Network  effect   enabled   Machine   Models  
  • 5. Graph-­‐Structured,  Event-­‐Driven,     Real  Time  Distributed  ApplicaDons   SO   SO   SO   Gateways   Server   Cloud   Endpoints   •  Sensors   •  Devices   ApplicaDon     Components     And     Resources   Databases   Registry  -­‐  Instances   Repository  -­‐  Models   Models   • Discovery   • Persistence   • ReplicaDon   • Resource  Access   • Data  Models     • Sensor  Models   • Machine  Models   • Templates   HTTP   MQTT   CoAP   XMPP   HTTP   CoAP   MQTT   Smart     Objects  
  • 6. What  Is  The  Smart  Object  API?   •  Virtual  RepresentaDon  of  a  physical  Smart  Object   •  Object  Model  –  Web  Object  EncapsulaDon  of   properDes   •  REST  API  using  JSON,  XML,  RDF,  core-­‐link-­‐format   representaDons   •  Data  Models  –  Linked  Data  descripDons,   Resource  Discovery  and  Linkage   •  Event  Model  –  Asynchronous  M2M  and   applicaDon  soNware  event  handlers  
  • 7. Object  Model   Web  Object  EncapsulaDon     Smart  Object   Web  protocol  interfaces,  also  M2M  e.g.  MQTT,  XMPP,  …   Event  Model   Links  data  with  acDons   Pub-­‐Sub  and  event  handlers   Encapsulates  local  soNware     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  
  • 8. API  –  DescripDon     (Data  Model)   •  Contains  graphs  describing  the  resource  data   model     •  RDF  triples  in  many  popular  representaDons   – create  (POST)  loads  a  graph  into  the  descripDon   delete  (DELETE)  removes  a  graph  or  subgraph  from   the  descripDon   – set  (PUT)  updates  a  graph  or  subgraph   – get  (GET)  returns  a  graph  or  subgraph   •  SemanDc  Proxy  for  core-­‐link-­‐format   compaDbility  
  • 9. 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  ObservaDon  Value  or  data  feed   – get  (GET)  returns  the  current  ObservaDon  Value   •  Formats  for  embedded  Dme  +  locaDon  data  
  • 10. API  –  Agent   •  Container  for  Event  Handlers,  soNware   components  invoked  within  the  local  context  of  a   Smart  Object   •  Observer  class  invokes  Event  Handler  code  in  the   Agent   •  Reference  ImplementaDon   –  create  (POST)  make  a  new  code  object  instance   •  handler  or  daemon   –  delete  (DELETE)  remove    code  instance   –  set  (PUT)  updates  sefng  of  a  code  instance   –  get  (GET)  returns  sefng  of  a  code  instance  
  • 11. API  –  Observers   •  Contains  graphs  which  define  the  nodes  and   endpoints  of  event  driven  processing   •  Publish,  Subscribe,  and  Event  Handler  paWerns   •  Reference  ImplementaDon   – create  (POST)  make  a  new  Observer     – set  (PUT)  update  an  Observer’s  sefngs   – get  (GET)  return  an  Observer’s  sefngs   – delete  (DELETE)  remove  an  Observer  
  • 12. Smart  Object  Structure  –  Object  Model   Smart  Object   DescripDon   ObservableProperty   ObservableProperty…   Agent   Publisher   Subscriber   Handler   PropertyOfInterest   DescripDon   Observers   Handler  Instance   Daemon   Default  Property  
  • 13. REST  API   •  Python  API  –  Local  SoNware,  Agents  and  Handlers   –  Resources  (objects)  are  hierarchical  properDes  of  other   resources   –  self.indoorTempValue = sensors.weather.indoor_temp.get()! •  Web  API  –  HWp  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  DescripDon;  GET  of   Observable  Property  returns  it’s  ObservaDon  Value  
  • 14. Protocol  Bridge  Examples   •  MQTT  Endpoints  and  Bridge  using  Observer   •  CoAP  Server  Endpoint  and  link-­‐data  Proxy  
  • 15. MQTT  Observer   MQTT  Broker   REST  Endpoint   ObservableProperty   mqWObserver   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  
  • 16. MQTT  Observer   MQTT  Broker   REST  Endpoint   ObservableProperty   mqWObserver   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  
  • 17. MQTT  Observer   MQTT  Broker   REST  Endpoint   ObservableProperty   mqWObserver   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  
  • 18. MQTT  Observer   MQTT  Broker   REST  Endpoint   ObservableProperty   mqWObserver   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  direcDons  
  • 19. MQTT  Bridge  to  mulDple  REST  endpoints   MQTT  Broker   REST  Endpoint   ObservableProperty   mqWObserver   PUT   GET   Publish  from   data  producer   Publish  to  Other   Subscribers   REST  Endpoint   ObservableProperty   mqWObserver   PUT   GET  
  • 20. CoAP  Server  Endpoint   Smart  Object   JSON   JSON   JSON   RDF   SemanDc   Proxy   RDF   link-­‐format   •  CompaDble  Object   Models   •  Observer  paWern   •  Standard  JSON   Resources   •  SemanDc  Proxy   exposes  stored  RDF   via  core-­‐link-­‐format   GET/POST  operaDons  
  • 21. IoT  Toolkit  Protocol  Interoperability   CoAP   MQTT   MQTT   HTTP   smartobjectservice.com   ec2-­‐54-­‐200-­‐106-­‐25.us-­‐ west-­‐2.compute.amazonaws.com  
  • 22. IoT  Toolkit   •  IoT  Toolkit  is  a  reference  implementaDon  of   the  Smart  Object  API  and  related  tools   •  REST  API  with  real-­‐Dme  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  
  • 23. IoT  Toolkit  Project  Status   •  Smart  Object  API  is  complete  and  stable   •  IoT  Toolkit  Demo     •  M2M  interoperability:  MQTT,  CoAP,  HTTP  interfaces     •  Development  Roadmap  Examples   –  Object  model,  Data  model  namespaces  and  ontologies   –  Programming  model  UI:  Node  Red  integraDon   –  Graph-­‐based  resource  access  control   –  Harden  code,  excepDon  handling,  API  Tests   –  Scalable  server,  mulD-­‐tenancy   –  XMPP  endpoint  and  proxy  for  XEP-­‐0060,  XEP-­‐0323,   XEP-­‐0325   –  Web  UI  for  debug  and  demo,  applicaDons   •  Navigator,  Dashboard,  AnalyDcs,  Graphs  and  Charts  
  • 24. Code  Examples   •  Arduino  Sketch  that  updates  SmartObject  in   the  gateway   •  Server  startup  code     •  Example  Resources   •  Event  Model  Examples  –  Observers   •  Based  on  the  Weather  Sensor  Demo    
  • 25. Weather  sensor  example   Sensor   (Arduino)   Gateway   (Rpi)   Sensor  Hardware   •  Wind  Speed   •  Wind  DirecDon   •  Rainfall   •  Temperature   •  Humidity   •  Barometer   Reads  sensor  elements  and  creates  sensor  output     values  to  update  Smart  Object  in  the  Gateway     using  a  simple  hWp  client   Gateway  runs  Smart  Object  API  and  exposes  HTTP    interface,  adds  descripDonand  other  resources,     Observers  send  updates  to  cloud  server   Local   Ethernet   Cloud  Server  acts  as  Gateway-­‐as-­‐a-­‐Service  for  Xively   Receives  updates  from  the  gateway,  Observers     Send  periodic  updates  to  Xively  feed   Cloud     Server   Internet   Client   (Xively)   Internet   Xively  acts  as  client  applicaDon  and  receives     updates  from  the  cloud  service  acDng  as  GaaS  
  • 26. Arduino  Sketch        PString jsonObject(objectBuffer, sizeof(objectBuffer));! !    if(nextPushPoint==0) {!      nextPushPoint=1;! /* use Pstring.print to format JSON string from integer */!      jsonObject.println(daily_rain,1); ! /* PUT update to Smart Object server property using JSON */!      client.print("PUT ");!      client.print(serverPath);!      client.print(”daily_rain");!      client.println(" HTTP/1.1");!      client.println("Content-Type: application/json");!      client.print("Content-Length: ");!      client.println(jsonObject.length()-2);!      client.println("Connection: close");!      client.println();!      client.println(jsonObject);!    }!
  • 27. Demo  Code  for  Weather  Sensor  –   Smart  Object  and  Service  CreaDon      baseObject  =  SmartObject()  #  create  a  Smart  Object  to  serve  as  the  base  container   for  other  Smart  Objects  and  resources          server  =  SmartObjectService(baseObject)  #  make  an  instance  of  the  service,   baseObject  is  the  object  root          server.start(8000)  #  forks  a  server  thread  to  listen  on  port  8000          print  'hCpd  started  at',  baseObject.Proper9es.get('hCpService’)     #  top  level  object  container  for  sensors,  class  is  SmartObject   sensors  =  baseObject.create({'resourceName':  'sensors',                                                                                  'resourceClass':  'SmartObject'})     #weather  sensor  Smart  Object  under  sensors  for  the  weather  sensor                  weather  =  sensors.create({'resourceName':  'rhvWeather-­‐01',                                                                          'resourceClass':  'SmartObject’}!
  • 28. Data  Model  –  DescripDon     for  object  discovery  and  linkage        #  make  a  reference  to  the  weather  sensor  object  DescripDon  and  build  an  example   graph  (could  use  the  built-­‐in  reference  as  well)          weather.descripDon  =  weather.Resources.get('Descrip9on')            weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/outdoor_temperature'),   RDFS.Resource,  Literal('sensor')))          weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/outdoor_temperature'),   RDF.type,  Literal('temperature')))          weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/outdoor_humidity'),   RDFS.Resource,  Literal('sensor')))          weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/outdoor_humidity'),   RDF.type,  Literal('humidity')))          weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/sealevel_pressure'),   RDFS.Resource,  Literal('sensor')))          weather.descripDon.set((URIRef('sensors/rhvWeather-­‐01/sealevel_pressure'),   RDF.type,  Literal('pressure')))!
  • 29. EncapsulaDon:  Observable  Property,   Observer,  and  Subscriber    sealevel_pressure  =  weather.create({'resourceName':  'sealevel_pressure',                                                                                      'resourceClass':  'ObservableProperty'})                sealevel_pressure.Observers.create({'resourceName':'demoServiceObserver',                                                                                          'resourceClass':  'hCpPublisher',                                                                                          'targetURI':  'hCp://smartobjectservice.com:              8000/sensors/rhvWeather-­‐01/sealevel_pressure'})      #  make  a  named  subscriber  resource          outdoor_humidity.Observers.create({'resourceName':  'humiditySubscriber',                                                                                  'resourceClass':  'hCpSubscriber',                                                                                  'observerURI':  'hCp://localhost:8000/sensors/rhvWeather-­‐01/                          indoor_humidity',                                                                                    'observerName':  'humiditySubObserver'  })  
  • 30. Event  Model:  MQTT  Observer   •  Publish,  Subscribe,  or  Pub+Sub  using  the   mqWObserver  resource  class   •  Prototype  opens  a  connecDon  to  a  specified   broker  for  each  endpoint     Observers.create({'resourceName': 'mqttTestObserver',! ! ! ! ! ! 'resourceClass': 'mqttObserver',! 'connection': 'smartobjectservice.com',! 'pubTopic': ’sealevel_pressure',! 'subTopic': None,! 'QoS': 0,! 'keepAlive': 60 })!
  • 31. Event  Model  –   Xively  Publisher  -­‐  Observer   sealevel_pressure.Observers.create({'resourceName':  'xivelyObserver',                                                                                        'resourceClass':  'xivelyPublisher',                                                                                        'apiBase':  'hCps://api.xively.com/v2/feeds',                                                                                        'feedID':  '2141862995',                                                                                        'streamID':  'sealevel_pressure’,                                                                                      'apiKey’:'QYourApiKeyGoesHEresjhgrjgo56',                                                                                        'updateInterval':  pushInterval  })    
  • 32. Event  Model  –   Handler  and  Callback  NoDfier      #addHandler  class  adds  2  properDes  values  together  and  stores  in  a  third          weather.Agent.create({'resourceName':  'addHandler',                                                    'resourceClass':  'addHandler',                                                    'addendLink1':'sensors/rhvWeather-­‐01/indoor_temperature',                                                      'addendLink2':  'sensors/rhvWeather-­‐01/indoor_temperature',                                                      'sumOutLink':  'sensors/rhvWeather-­‐01/outdoor_humidity'})                        #  now  create  a  callback  observer  endpoint            indoor_temperature.Observers.create({'resourceName':  'callbackTempObserver',                                                                                    'resourceClass':  'callbackNo9fier',                                                                                    'handlerURI':  'callback:///sensors/rhvWeather-­‐01/Agent/                            addHandler'})