FIWARE-IDAS:注册设备出现问题
我和IDAS探员有问题。使用MQTT Ultralight代理,取决于我注册设备的方式,当代理收到读取iotagent服务崩溃且上下文代理中的相关实体未更新时 正确的行为是下一个。如果要创建服务:FIWARE-IDAS:注册设备出现问题,fiware,agent,fiware-orion,Fiware,Agent,Fiware Orion,我和IDAS探员有问题。使用MQTT Ultralight代理,取决于我注册设备的方式,当代理收到读取iotagent服务崩溃且上下文代理中的相关实体未更新时 正确的行为是下一个。如果要创建服务: curl -X POST 172.21.0.23:8090/iot/services \ -i \ -H "Content-Type: application/json" \ -H "Fiware-Service: red_entrada _1" \ -H "Fiware-ServicePath:
curl -X POST 172.21.0.23:8090/iot/services \
-i \
-H "Content-Type: application/json" \
-H "Fiware-Service: red_entrada _1" \
-H "Fiware-ServicePath: /Prueba" \
-d '{
"services": [
{
"apikey": "pass_1",
"cbroker": "http://172.21.0.23:1026",
"entity_type": "disp_entrada_1",
"resource": "/iot/mqtt"
}]}'
。。。以及设备,用于建立传入属性和每个属性的名称:
curl -X POST 172.21.0.23:8090/iot/devices \
-i \
-H "Content-Type: application/json" \
-H "Fiware-Service: red_entrada _1" \
-H "Fiware-ServicePath: /Prueba" \
-d '{
"devices":[
{
"device_id": "AC_2",
"entity_name":"disp_entrada_1:AC_2",
"protocol":"PDI-IoTA-MQTT-UltraLight",
"entity_type": "disp_entrada_1",
"timezone": "Europe/Madrid",
"attributes": [
{
"object_id": "LUX",
"name": "LUX_1",
"type": "string"
},
{
"object_id": "LUM",
"name": "LUM_1",
"type": "string" },
{
"object_id": "HUMB",
"name": "HUMB_1",
"type": "string"
},
{
"object_id": "TCB",
"name": "TCB_1",
"type": "string"
},
{
"object_id": "IN_TEMP",
"name": "IN_TEMP_1",
"type": "string" },
{
"object_id": "BAT",
"name": "BAT_1",
"type": "string"
}
]}]}'
因此,将在上下文代理中创建一个新实体,当读数到达代理时,该实体将更新:
{
"_id" : {
"id" : "disp_entrada_1:AC_2",
"type" : "disp_entrada_1",
"servicePath" : "/Prueba"
},
"attrNames" : [
"TimeInstant",
"LUX_1",
"LUM_1",
"HUMB_1",
"TCB_1",
"IN_TEMP_1",
"BAT_1"
],
"attrs" : {
"TimeInstant" : {
"value" : "2016-03-14T08:11:49.810465Z",
"type" : "ISO8601",
"creDate" : 1457943015,
"modDate" : 1457943109
},
"LUX_1" : {
"value" : "464.000",
"type" : "string",
"md" : [
{
"name" : "TimeInstant",
"type" : "ISO8601",
"value" : "2016-03-14T08:11:49.687585Z"
}
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"LUM_1" : {
"value" : "2.694",
"type" : "string",
"md" : [
{
"name" : "TimeInstant",
"type" : "ISO8601",
"value" : "2016-03-14T08:11:49.718131Z"
}
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"HUMB_1" : {
"value" : "38.7",
"type" : "string",
"md" : [
{
"name" : "TimeInstant",
"type" : "ISO8601",
"value" : "2016-03-14T08:11:49.748719Z"
}
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"TCB_1" : {
"value" : "21.31",
"type" : "string",
"md" : [
{
"name" : "TimeInstant",
"type" : "ISO8601",
"value" : "2016-03-14T08:11:49.779327Z"
}
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"IN_TEMP_1" : {
"value" : "21.00",
"type" : "string",
"md" : [
{
"name" : "TimeInstant",
"type" : "ISO8601",
"value" : "2016-03-14T08:11:49.810465Z"
}
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"BAT_1" : {
"value" : "97",
"type" : "string",
"md" : [
{
"name" : "TimeInstant",
"type" : "ISO8601",
"value" : "2016-03-14T08:11:49.230590Z"
}
],
"creDate" : 1457943103,
"modDate" : 1457943109
}
},
"creDate" : 1457943015,
"modDate" : 1457943109
}
当我注册一个新设备,并使用“object_id”的相同值(传入MQTT数据中的属性名称)作为属性名称时,问题就出现了。在这种情况下,当然不需要注册设备)。例如:
curl -X POST 172.21.0.23:8090/iot/devices \
-i \
-H "Content-Type: application/json" \
-H "Fiware-Service: red_entrada_2" \
-H "Fiware-ServicePath: /Prueba" \
-d '{
"devices":[
{
"device_id": "AC_2",
"entity_name":"disp_entrada_1:AC_2",
"protocol":"PDI-IoTA-MQTT-UltraLight",
"entity_type": "disp_entrada_1",
"timezone": "Europe/Madrid",
"attributes": [
{
"object_id": "LUX",
"name": "LUX",
"type": "string"
},
{
"object_id": "LUM",
"name": "LUM",
"type": "string"
},
{
"object_id": "HUMB",
"name": "HUMB",
"type": "string"
},
{
"object_id": "TCB",
"name": "TCB",
"type": "string"
},
{
"object_id": "IN_TEMP",
"name": "IN_TEMP",
"type": "string"
},
{
"object_id": "BAT",
"name": "BAT",
"type": "string"
}
]}] }'
在这种情况下,也会在上下文代理中创建一个新实体,但当读取数据到达时,实体不会更新,IoAgent服务崩溃。实体状态:
{
"_id" : {
"id" : " disp_entrada_1:AC_2",
"type" : " disp_entrada_1",
"servicePath" : "/Prueba"
},
"attrNames" : [
"TimeInstant"
],
"attrs" : {
"TimeInstant" : {
"type" : "ISO8601",
"creDate" : 1457948167,
"modDate" : 1457948167,
"value" : "2016-03-14T09:36:07.432814Z"
}
},
"creDate" : 1457948167,
"modDate" : 1457948167
}
我看不出这种行为有什么逻辑。如果我没有事先注册设备,实体将自动创建,属性将以“object_id”字段的值作为名称(这是我在第二个示例中尝试做的)
?这可能是由于代理或管理器安装上的问题吗?实际上这是一个错误,当您将要转换为相同(“t”)的参数“t”关联起来时,它会导致无限循环 最好的解决办法是不要求任何翻译,然后将其保留为原文(“t”) 在下一个版本中,此错误将被修复 感谢您使用IDAS,很抱歉我们的回复太晚