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:Orion
Description
Created question in FIWARE Q/A platform on 21-01-2018 at 10:01
Please, ANSWER this question AT https://stackoverflow.com/questions/48365467/orion-cb-saves-device-with-entity-name-value-in-id-field
Question:
Orion CB saves device with 'entity_name' value in 'id' field
Description:
I'm trying to develop IoTA with lazy attributes. And found that Context Broker saves device 'entity_name' field in 'id', so when CB makes request for lazy attributes, IoTA can't found device with such id.
With purpose to create device entity I make this request to IoTA:
'devices': [{
'device_id': 'idSensor14',
'entity_name': 'nameSensor14',
'entity_type': 'anysensor',
'attributes': [
],
'lazy': [
]
}]
Then if we request entitites list in CB ('v2/entities/') we discover:
{ "id":"nameSensor15",
"type":"anysensor",
"t":{"type":"celsius","value":"","metadata":{}}}
It seems that CB saves device with wrong id. This is request for lazy attributes:
data = {
"entities": [
,
"attributes": ["b"]
]}
And this is error in IoA log:
op=IoTAgentNGSI.ContextServer | srv=myhome | subsrv=/sensors | msg=Query error [DEVICE_NOT_FOUND] handling request: No device was found with id:nameSensor15
If delete entity_name from registration request, then CB will use device id = 'anysensors:idSensor14'. My Orion version is 1.7.0, and iotagent-node-lib version is 2.5.1.
2018-01-21 12:05|CREATED monitor | # answers= 0, accepted answer= False