Nick Alexis
Nick Alexis

Reputation: 39

API to read multiple sensor measurements via Orion+keyrock or connect Sth-comet+keyrock?

I am a hardware developer and I have multiple sensors communicating with the framework. I also have deployed the system until cygnus and keyrock components. Currently I have also developed a client that mines time series data straight from connecting on the mongo database. I know this is a crude way of doing things and if I want to play with roles and permissions I have to do it through Orion. The only way you provide for us to read sensor data via Orion is reading the last measurement with this command:

curl -G -X GET \ 'http://localhost:1026/v2/entities/urn:ngsi-ld:Motion:001' \ -d 'type=Motion' \ -H 'fiware-service: openiot' \ -H 'fiware-servicepath: /'

Is there a way to mine time series data between dates (or N measurements back from now) via orion so i can secure time series data mining and assign it to a role with permission?

I know there is STH-Comet to read time series data but from reading the tutorials I understand that cannot connect sth-comet with keyrock via a proxy. Is this possible?

Upvotes: 1

Views: 66

Answers (1)

fgalan
fgalan

Reputation: 12294

As you said, STH is the component you should use for time series information. Basically:

  • You send your sensor data to Orion Context Broker (where the last value is accessible using the NGSIv2 interface, e.g. using a GET operation like the one you show)
  • Orion Context Broker sends the data to STH using a notification (based in a pre-existing subscription you need to create in Orion Context Broker using the NGSIv2 interface).
    • For high load scenarios the recommended setup is Orion->Cygnus->STH (Cygnus configured with NGSISTHSink and NGSIMongoSink) as it performs better that STH to do aggregations.
  • You can use the STH raw API or aggregated API to get time series information.

What I don't understand from your question is "I understand that cannot connect sth-comet with keyrock via a proxy". Could your edit your question post to elaborate a little bit on it, please?

Upvotes: 0

Related Questions