-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some data are not reported to Orion when updating a device #1660
Comments
@fgalan I ask you if @GuillaumeOd can provide the PR that fixes this issue. We need it to fix our use case. |
Could you please provide equivalent json sent to Orion in 4.6.0 for the same example? A test case about his POC could added to functional tests: https://github.com/telefonicaid/iotagent-node-lib/blob/master/test/functional/testCases.js |
PRs with fixes are always welcome! :) Anyway, take into account the feedback provided by @AlvaroVega in previous comment. |
The primary difference between the two payloads is the absence of the "value" attribute in version 4.6.0. 4.6.0 JSON Structure{
"json": {
"id": "urn:ngsild:TemperatureSensor:CypressDeviceA1A",
"type": "TemperatureSensor",
"project": {
"type": "Text",
"value": "97e3b48e-3cf3-477a-a784-b958ce35cf9c",
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2024-11-05T13:27:08.039Z"
}
}
},
"model": {
"type": "Text",
"value": "TemperatureSensor",
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2024-11-05T13:27:08.039Z"
}
}
},
"provider": {
"type": "Text",
"value": "...",
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2024-11-05T13:27:08.039Z"
}
}
},
"isPhysical": {
"type": "Boolean",
"value": true,
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2024-11-05T13:27:08.039Z"
}
}
},
"TimeInstant": {
"type": "DateTime",
"value": "2024-11-05T13:27:08.039Z"
}
}
} The following logs detail the data structure when updating the device, captured via function sendUpdateValue(entityName, attributes, typeInformation, token, callback). Device Update Log
|
I got the problem with |
|
IoT Agent Node Lib version the issue has been seen with
4.6.0
Bound or port used (API interaction)
Southbound (Devices data API)
NGSI version
NGSIv2
Are you running a container?
Yes, I am using a contaner (Docker, Kubernetes...)
Image type
normal
Expected behaviour you didn't see
When upgrading iot-agent-node-lib from 3.3.4 to 4.6.0
It should correctly updating a device attribute when using
iotAgentLib.update(device.name, device.type, "", [ { name: 'value', type: 'number', value: '10' }], device)
iot-agent-node-lib 3.3.4 is still working perfectly
Unexpected behaviour you saw
The payload request made to Orion is perfectly sent but does not contain de requested change on the device attribute
Here's what is sent to Orion in 3.3.4 :
In 4.6.0 the payload is exactly the same but the "value" attribute in the request has disappeared, so the request is sent to Orion but without the updated value on the device. End to end, this leads to having the exact same device in orion as the upsert request did not sent the attribute to update.
I believe this comes from
sendUpdateValueNgsi2()
inentities-NGSI-v2.js
as this function changed a lot between 3.3.4 and 4.6.0.After some debugging and analysis, it's coming from the line
measures = measures.filter((item) => item.name !== currentAttr.object_id && item.name !== currentAttr.name);
that removes the measuresvalue
. The second part of the filteritem.name !== currentAttr.name
is going to filter all attributes names that are present inpreprocessedAttr
but it containstypeInformation.active
fromoriginTypeInformation
which contains thevalue
attribute...Steps to reproduce the problem
No response
Configs
iot-agent-node-lib config
Log output
No response
The text was updated successfully, but these errors were encountered: