OGC SensorThings API
Tutorial #4 - Connecting Your Sensors
uptime: 242 hours
# of broken lights: 5 RH: 19 % Temp: -22 Celsius
Dr. Steve Liang Chair, OGC SensorThings API Standard Working Group Founder and CEO, SensorUp Inc. Associate Professor, University of Calgary
sensorup.com@sensorup
Agenda• Recap: OGC SensorThings Data Model and URL Patterns
• CREATE, UPDATE and DELETE entities
• Deep Insert
• Arduino and SensorThings
• Many Examples
sensorup.com@sensorup
About Dr. Steve Liang• Associate Professor, Geomatics Engineering, Uni. Calgary
• AITF-Microsoft Industry Chair on Open Sensor Web
• Chair OGC SensorThings API Standard Working Group
• Co-Chair OGC Sensor Web Enablement Domain Working Group
• N.A. Chair, OGC University Domain Working Group
• Rapporteur, ITU-T SG12/11 on Internet of Things Test Specifications
• Founder and CEO, SensorUp Inc, a University of Calgary startup (http://www.sensorup.com)
sensorup.com@sensorup
About SensorUp• We are a world leader in OGC Sensor Web and IoT
• We are leading several international IoT standard development efforts (OGC and ITU-T)
• We developed world’s first OGC SensorThings API implementation
sensorup.com@sensorup
• Topic: Building an IoT Cloud Platform with Open Geospatial Standards
• Presenter: Dr. Steve Liang
• January 27th 2016
• http://www.meetup.com/Virtual-IoT/
sensorup.com@sensorup
We will be in DC area from January 11~13 2016. Would love to meet! Beers on us!
SensorUp will be in DC area January 11~13 ’16.
sensorup.com@sensorup
We will be back to DC area in March. Would love to meet! Beers on us!
8
Data Model
Prerequisites
• Basic knowledge of REST (REpresentational State Transfer)
• https://en.wikipedia.org/wiki/Representational_state_transfer
• Basic knowledge of JSON (JavaScript Object Notation)
• http://www.json.org/
HTTP Verbs• POST
• create a new entity
• PATCH
• update partial resources
• DELETE
• remove an entity
Steps to Connect Your Sensors
Create Contextual Information
(the static data)Upload Readings
(the dynamic data)
1 2
1.Thing2.Location3.ObservedProperty4.Sensor5.Datastream
•Observation
Demo and GIST
• https://gist.github.com/liangsteve/9bbc095c9e417af63a6e
Best Practice #1: Reuse Existing Entities
13
• Reuse existing entities if possible
• If an [ObservedProperty, Sensor] exists, create a link instead of creating a new but redundant entity.
• Benefit
• Faster analysis, better discoverability, improved performance
Best Practice #2
14
• If you know your Sensors, ObservedProperties or even Locations already, create them first.
• Then adding a new Thing just need one POST request.
For example, say you are building an IoT Platform for Wifi Weight Scales
• Thing
• serial number 98312
• ObservedProperty
• Weight, http://dbpedia.org/page/Weight
• Sensor
• Load Sensor, https://www.sparkfun.com/products/13332
Integrity Constraints
Internet of Things Data Exchange Platform
(SensorUp DEP)
Internet of Things DevicesInternet of Things Applications
ISO/OGC Standards and Open Hardware Ecosystem
smart home, connected buildings, networked sensors / cameras,
etc.
Connect Your Arduino
• Instruction and Source Code:
• https://sensorup.atlassian.net/wiki/display/SPS/2015/12/02/SensorThings+API+-+Arduino+101
Useful Resources• SensorThings API Playground
• http://pg.sensorup.com
• API Documentation
• http://www.sensorup.com/docs
• GIST for today’s code
• https://gist.github.com/liangsteve/9bbc095c9e417af63a6e
See you next year!
• Upcoming Webinar Topics:
• SensorThings for real-time applications (MQTT Extension)
• SensorThings API and GIS integration
• SensorThings and Spatial Data Infrastructure
• SensorThings v.s. Sensor Observation Services