![Page 1: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/1.jpg)
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
![Page 2: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/2.jpg)
sensorup.com@sensorup
Agenda• Recap: OGC SensorThings Data Model and URL Patterns
• CREATE, UPDATE and DELETE entities
• Deep Insert
• Arduino and SensorThings
• Many Examples
![Page 3: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/3.jpg)
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)
![Page 4: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/4.jpg)
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
![Page 5: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/5.jpg)
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/
![Page 6: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/6.jpg)
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.
![Page 7: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/7.jpg)
sensorup.com@sensorup
We will be back to DC area in March. Would love to meet! Beers on us!
![Page 8: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/8.jpg)
8
Data Model
![Page 9: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/9.jpg)
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/
![Page 10: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/10.jpg)
HTTP Verbs• POST
• create a new entity
• PATCH
• update partial resources
• DELETE
• remove an entity
![Page 11: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/11.jpg)
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
![Page 12: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/12.jpg)
Demo and GIST
• https://gist.github.com/liangsteve/9bbc095c9e417af63a6e
![Page 13: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/13.jpg)
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
![Page 14: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/14.jpg)
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.
![Page 15: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/15.jpg)
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
![Page 16: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/16.jpg)
Integrity Constraints
![Page 17: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/17.jpg)
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.
![Page 18: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/18.jpg)
Connect Your Arduino
• Instruction and Source Code:
• https://sensorup.atlassian.net/wiki/display/SPS/2015/12/02/SensorThings+API+-+Arduino+101
![Page 19: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/19.jpg)
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
![Page 20: SensorThings API webinar-#4-Connect Your Sensor](https://reader033.vdocument.in/reader033/viewer/2022042605/58715c8b1a28ab8e5b8b6981/html5/thumbnails/20.jpg)
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