Vrankela
Vrankela

Reputation: 1202

How do I configure context broker accept post requests from my remote sensor?

I have set my weather station with different sensors attached. My practice until now was to send the sensor data to a web address. But now that I have set up a CentOS 6.6 on a server with its IP address so now I want to send the sensor data directly to that machine that has orion context broker installed.

So my question is, how do I configure orion context broker to accept these post requests (from the weather station sensors) that are being sent to the CentOS machine?

Upvotes: 2

Views: 146

Answers (1)

LeandroGuillen
LeandroGuillen

Reputation: 518

You shouldn't have any problem sending post requests to a CentOS machine that is running Orion Context Broker. In fact, that is the supported OS for running Orion.

Just make sure you have the port open that Orion will be listening at (by default it's 1026), and that the payload in the post is acceptable.

For example, to send a value you could do a POST to <host>:<port>/v1/contextEntities/mySensor/attributes and a payload such as

{
  "attributes" : [
  {
    "name" : "temperature",
    "type" : "float",
    "value" : "26.5"
  },
  {
    "name" : "pressure",
    "type" : "integer",
    "value" : "763"
  }
  ]
}

Start out simple by doing a GET :1026/version to see if it works and work up to more advanced queries (see the documentation for more good stuff :)

Upvotes: 1

Related Questions