Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Enabler:IDAS
Description
Created question in FIWARE Q/A platform on 14-03-2016 at 15:03
Please, ANSWER this question AT https://stackoverflow.com/questions/35989887/fiware-idas-issue-with-registered-device
Question:
FIWARE - IDAS: Issue with registered device
Description:
I’m having problems with the IDAS Iotagent. Using the MQTT Ultralight agent, depending on how I register a device, when the agent receives a reading the iotagent service crashes and the related entity into the context broker is not updated.
The correct behaviour is the next one. If create a service:
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": [
]}'
... and a device, establishing the incoming attributes and a name for each one of them:
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": "BAT", "name": "BAT_1", "type": "string" }]}]}'
As a result, a new entity is created into the context broker, and as the readings arrive to the agent, this entity is updated:
{
"_id" :
,
"attrNames" : [
"TimeInstant",
"LUX_1",
"LUM_1",
"HUMB_1",
"TCB_1",
"IN_TEMP_1",
"BAT_1"
],
"attrs" : {
"TimeInstant" :
,
"LUX_1" : {
"value" : "464.000",
"type" : "string",
"md" : [
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"LUM_1" : {
"value" : "2.694",
"type" : "string",
"md" : [
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"HUMB_1" : {
"value" : "38.7",
"type" : "string",
"md" : [
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"TCB_1" : {
"value" : "21.31",
"type" : "string",
"md" : [
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"IN_TEMP_1" : {
"value" : "21.00",
"type" : "string",
"md" : [
],
"creDate" : 1457943103,
"modDate" : 1457943109
},
"BAT_1" : {
"value" : "97",
"type" : "string",
"md" : [
],
"creDate" : 1457943103,
"modDate" : 1457943109
}
},
"creDate" : 1457943015,
"modDate" : 1457943109
}
The problem arises when I register a new DEVICE and I use as the name for the attributes the same value of the "object_id" (name of the attribute into the incoming MQTT data. Surely on this scenario it's not necessary to register a DEVICE). For example:
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": "BAT", "name": "BAT", "type": "string" }]}] }'
On that case a new entity is created into the context broker too, but when the readings arrive the entity is not updated and the IoTAgent service crashes. Entity status:
{
"_id" :
,
"attrNames" : [
"TimeInstant"
],
"attrs" : {
"TimeInstant" :
},
"creDate" : 1457948167,
"modDate" : 1457948167
}
I can’t see any logic on this behaviour. If I don't register beforehand the device, the entity will be created automatically and the attributes will have as the name the value of the "object_id" field (that was what I was attempting to do on the second example).
¿Can it be due to an issue on the agent or manager installation?
2017-05-22 21:10|UPDATED status: transition Finish| # answers= 1, accepted answer= True