首页 文章

通过IDAS注册设备时,Orion CB实体上缺少属性

提问于
浏览
3

我有一些麻烦从http://www.slideshare.net/FI-WARE/io-t-basicexercisesdevelopersweek获得预期的结果

注册新设备时没有问题,它的实体也在Orion CB上成功创建,但在查询创建的实体时,不显示设备属性 . Created Entity只有TimeInstant属性 .

我在发送观察时得到200响应代码,但由于缺少CB上的实体属性,它显然没有效果 .

Registering device

  • URL:/ iot / devices

  • 方法:POST

  • 有效载荷:

JSON

{
 "devices": [
    {
        "device_id": "14:da:e9",
        "entity_name": "Thing12",
        "entity_type": "Thing12Type",
        "protocol": "PDI-IoTA-UltraLight",
        "timezone": "Europe/Madrid",
        "attributes": [
            {
                "name": "weight",
                "type": "double",
                "object_id": "weight"
            },
            {
                "name": "valid",
                "type": "boolean",
                "object_id": "valid"
            }
        ]
    }
 ]
}

Listing devices

  • URL:/ iot / devices / 14:da:e9

  • 方法:GET

JSON

{
"device_id": "14:da:e9",
"entity_name": "Thing12",
"entity_type": "Thing12Type",
"protocol": "PDI-IoTA-UltraLight",
"timezone": "Europe/Madrid",
"attributes": [
    {
        "name": "weight",
        "type": "double",
        "object_id": "weight"
    },
    {
        "name": "valid",
        "type": "boolean",
        "object_id": "valid"
    }
],
"service": "openiot",
"service_path": "/"
}

Querying CB

  • URL:/ ngsi10 / contextEntities / Thing12

  • 方法:GET

JSON

{
"contextElement": {
    "type": "Thing12Type",
    "isPattern": "false",
    "id": "Thing12",
    "attributes": [
        {
            "name": "TimeInstant",
            "type": "ISO8601",
            "value": "2015-06-25T13:07:18.354970Z"
        }
    ]
},
"statusCode": {
    "code": "200",
    "reasonPhrase": "OK"
}
}

2 回答

  • 0

    问题似乎出现在图像orion-psb-image-R4.2上 . 启动新实例(CentOS-6.3init)并手动安装每个组件后,问题似乎已解决 . 可能是之前实例中版本之间的冲突 .

  • 1

    只要发送与这些属性相关的观察结果,就会在ContextBroker中创建属性 . 只是尝试发送“权重”和“有效”的观察结果,您应该能够在ContextBroker相关实体上看到这些属性 .

    如果这对您有用,请告诉我们 .

    您为非创建设备观察到的行为是故意设计的,因此设备注册可能是可选的(尽管我们不建议这样做) .

    感谢您使用IDAS!

相关问题