通过 IDAS 注册设备时 Orion CB 实体缺少属性
Missing attributes on Orion CB Entity when registering device through IDAS
我在 http://www.slideshare.net/FI-WARE/io-t-basicexercisesdevelopersweek
的练习中遇到了一些问题,无法获得预期的结果
注册新设备时没有问题,它的实体也已在 Orion CB 上成功创建,但在查询创建的实体时,未显示任何设备属性。创建的实体只有 TimeInstant 属性。
我在发送观察时收到 200 响应代码,但显然没有效果,因为 CB 上的实体属性丢失。
正在注册设备
- 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"
}
]
}
]
}
列出设备
- URL: /iot/devices/14:da:e9
- 方法:获取
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": "/"
}
查询CB
- URL: /ngsi10/contextEntities/Thing12
- 方法:获取
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"
}
}
一旦您发送与这些属性相关的观察,就会在 ContextBroker 中创建属性。只需尝试发送 "weight" 和 "valid" 的观察结果,您应该能够在 ContextBroker 相关实体中看到这些属性。
让我们知道这是否适合您。
您观察到的非创建设备的行为是有意设计的,因此设备注册可能是可选的(尽管我们不建议这样做)。
感谢使用IDAS!
问题似乎出在图像 orion-psb-image-R4.2 上。在启动新实例 (CentOS-6.3init) 并手动安装每个组件后,问题似乎已解决。可能是之前实例中版本之间的冲突。
我在 http://www.slideshare.net/FI-WARE/io-t-basicexercisesdevelopersweek
的练习中遇到了一些问题,无法获得预期的结果注册新设备时没有问题,它的实体也已在 Orion CB 上成功创建,但在查询创建的实体时,未显示任何设备属性。创建的实体只有 TimeInstant 属性。
我在发送观察时收到 200 响应代码,但显然没有效果,因为 CB 上的实体属性丢失。
正在注册设备
- 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"
}
]
}
]
}
列出设备
- URL: /iot/devices/14:da:e9
- 方法:获取
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": "/"
}
查询CB
- URL: /ngsi10/contextEntities/Thing12
- 方法:获取
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"
}
}
一旦您发送与这些属性相关的观察,就会在 ContextBroker 中创建属性。只需尝试发送 "weight" 和 "valid" 的观察结果,您应该能够在 ContextBroker 相关实体中看到这些属性。
让我们知道这是否适合您。
您观察到的非创建设备的行为是有意设计的,因此设备注册可能是可选的(尽管我们不建议这样做)。
感谢使用IDAS!
问题似乎出在图像 orion-psb-image-R4.2 上。在启动新实例 (CentOS-6.3init) 并手动安装每个组件后,问题似乎已解决。可能是之前实例中版本之间的冲突。