How to retrieve real-time readings from SensorUp SensorThings?

Objective

This is a short tutorial explaining how to retrieve the metadata datastreams of a live video camera.  The static information can be retrieved with OGC SensorThings API via HTTP.  The dynamic information can be retrieved with OGC SensorThings API MQTT.

Background

OGC SensorThings has the following key concepts:

  • Thing
    • a Thing can be a sensor system or a person who wear multiple sensors. A Thing can have multiple Datastreams, such as speed, heart rate, live video, bearing, etc.
  • Datastream
    • Datastream groups multiple Observations. You can get the metadata of Observations from here.
  • Observation
    • where you can find the "readings", and we call it result.

There are more details, but I guess these are enough for now.

A Video Cam System as a Thing

  • A Garmin XE Virb is a Thing, and it can have multiple Datastreams, such as live video feed, bearing, speed, body temperature, etc.
  • As a result, in order to retrieve the "metadata", in fact you are retrieving Observations from another Datastream.

Retrieve Readings (Observations) via SensorThings API

Pushing and streaming new reading whenever they are available (Observations) via SensorThings API MQTT

  • SensorUp PS-Cloud has the MQTT feature, and it can push readings to you in real-time.
  • Simply use the same URL path described above, you can received new readings via MQTT.
  • e.g., the URL for the speed Observations is v1.0/Datastreams(78731)/Observations
    • note: as the camera is not moving most of the time, most likely you will not receive new speed readings.
  • But let's use a different Datastream, we do have a live sensor uploading data every 10 seconds.

Summary

This is a very brief tutorial of how to get the live data stream from "metadata". In fact, these metadata are also Observations. SensorUp is the editor of the OGC SensorThings API and provides the most complete and comprehensive OGC SensorThings API solution.  Please feel free to contact us if you need to learn more about our offerings.