如何配置上下文代理接受来自远程传感器的发布请求? [英] How do I configure context broker accept post requests from my remote sensor?

查看:61
本文介绍了如何配置上下文代理接受来自远程传感器的发布请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在气象站上安装了不同的传感器.到目前为止,我的做法是将传感器数据发送到网址.但是,既然我已经在具有IP地址的服务器上设置了CentOS 6.6,所以现在我想将传感器数据直接发送到安装了Orion上下文代理的机器上.

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.

所以我的问题是,我如何配置Orion上下文代理以接受这些(来自气象站传感器的)发给CentOS机器的发帖请求?

推荐答案

将帖子请求发送到运行Orion Context Broker的CentOS计算机上应该没有任何问题.实际上,这是运行Orion的受支持操作系统.

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.

只需确保您打开了Orion将在其侦听的端口(默认为1026),并且帖子中的有效载荷是可以接受的.

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.

例如,要发送一个值,您可以对<host>:<port>/v1/contextEntities/mySensor/attributes进行POST,并输入有效载荷,例如

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"
  }
  ]
}

通过执行GET:1026/version来开始工作,以查看其是否有效并处理更高级的查询(请参见

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 :)

这篇关于如何配置上下文代理接受来自远程传感器的发布请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆