Fiware:通过IDAS UltraLight注册/发送时,猎户座CB中没有观测属性

Fiware:通过IDAS UltraLight注册/发送时,猎户座CB中没有观测属性,fiware,fiware-orion,Fiware,Fiware Orion,这个问题很相似,但没有找到明确的答案 我一直在尝试FiWare通过IDAS将UL2.0传送到在FiWare实验室环境中工作的猎户座CB: 使用最新的GitHub 剧本 特别是在教程之后 我有一个生成了令牌的FI-WARE实验室帐户。修改了config.ini文件: [user] # Please, configure here your username at FIWARE Cloud and a valid Oauth2.0 TOKEN for your user (you can us

这个问题很相似,但没有找到明确的答案

我一直在尝试FiWare通过IDAS将UL2.0传送到在FiWare实验室环境中工作的猎户座CB:

  • 使用最新的GitHub
    剧本
  • 特别是在教程之后
我有一个生成了令牌的FI-WARE实验室帐户。修改了config.ini文件:

[user]
# Please, configure here your username at FIWARE Cloud and a valid Oauth2.0 TOKEN for your user (you can use get_token.py to obtain a valid TOKEN).
username=MY_USERNAME
token=MY_TOKEN

[contextbroker]
host=130.206.80.40
port=1026
OAuth=no
# Here you need to specify the ContextBroker database you are querying.
# Leave it blank if you want the general database or the IDAS service if you are looking for IoT devices connected by you.
# fiware_service=
fiware_service=bus_auto
fiware-service-path=/

[idas]
host=130.206.80.40
adminport=5371
ul20port=5371
OAuth=no
# Here you need to configure the IDAS service your devices will be sending data to.
# By default the OpenIoT service is provided.
# fiware-service=fiwareiot
fiware-service=bus_auto
fiware-service-path=/
#apikey=4jggokgpepnvsb2uv4s40d59ov
apikey=4jggokgpepnvsb2uv4s40d59ov

[local]
#Choose here your System type. Examples: RaspberryPI, MACOSX, Linux, ...
host_type=MACOSX
# Here please add a unique identifier for you. Suggestion: the 3 lower hexa bytes of your Ethernet MAC. E.g. 79:ed:af
# Also you may use your e-mail address.
host_id=a0:11:00
我使用了SENSOR_TEMP模板,添加了“协议”字段(PDI IoTA UltraLight,这是我遇到的第一个问题):

现在我可以注册设备了。像

python RegisterDevice.py SENSOR_TEMP NexusPro Temp-Otterlo
并在设备列表中查看:

python ListDevices.py
我可以像这样发送观察结果

python SendObservation.py Temp-Otterlo 'otemp|17'
但在ContextBroker中,我看到的是实体,而不是度量,例如

python GetEntity.py Temp-Otterlo
给予

我奇怪地得到了TimeInstant属性。我试着像fiware service=fiwareiot一样使用.ini的设置,但没用。我没有主意了。目录上的文件。对于IDAS4 正在讨论将观察结果发送到端口8002并设置“OpenIoT”服务,但也失败了

谢谢你的帮助

应该运行“python SendObservation.py NexusPro'otemp | 17'”而不是“python SendObservation.py Temp Otterlo'otemp | 17'”

原因是您正在南行提供观测,然后应该使用DEV_ID

在收到观察结果之前,实体不包含属性,因此您无法看到它是正常的。一旦你尝试了上面的一个,它应该都能工作


干杯,

您尝试过使用不同的Orion上下文代理吗?(例如,您自己的)。还没有,因为这可能是一个常见问题(请参阅)。例如,OCB版本是否重要?它肯定是重要的。尝试使用最新版本的OCB(从今天起为0.24)。是的,我现在可以在Docker设置中使用最新的OCB+IoAgentCpp图像,使用Docker compose方法,如下所述:也尝试了设备id,但结果相同:通过CB在实体中没有值。
python GetEntity.py Temp-Otterlo
* Asking to http://130.206.80.40:1026/ngsi10/queryContext
* Headers: {'Fiware-Service': 'bus_auto', 'content-type': 'application/json', 'accept': 'application/json', 'X-Auth-Token': 'NULL'}
* Sending PAYLOAD:
{
    "entities": [
        {
            "type": "",
            "id": "Temp-Otterlo",
            "isPattern": "false"
        }
    ],
    "attributes": []
}

...

* Status Code: 200
* Response:
{
  "contextResponses" : [
    {
      "contextElement" : {
        "type" : "thing",
        "isPattern" : "false",
        "id" : "Temp-Otterlo",
        "attributes" : [
          {
            "name" : "TimeInstant",
            "type" : "ISO8601",
            "value" : "2015-10-03T14:04:44.663133Z"
          },
          {
            "name" : "att_name",
            "type" : "string",
            "value" : "value",
            "metadatas" : [
              {
                "name" : "TimeInstant",
                "type" : "ISO8601",
                "value" : "2015-10-03T14:04:44.663500Z"
              }
            ]
          }
        ]
      },
      "statusCode" : {
        "code" : "200",
        "reasonPhrase" : "OK"
      }
    }
  ]
}