Comments (10)
Not sure if is a corner case or what should be the right behaviour. At the second step device named Sensor01 with an entityType and entityName is already found and then used.
If your add an static attribute to each group then the resulting entity has both static attributes.
Maybe the bug is that at second step Sensor01 device should be updated with new provided entityName and entityType?
from iotagent-node-lib.
entity_name and entity_type are fields of device to link a device with a CB entity (which has id ant type), but are not a key in Devices model and typically are inhered from Group (as apikey) when autoprovision.
from iotagent-node-lib.
Maybe (or not) before second step (send second measure) you can update provisioned device to ensure entityName and entityType are updated on Sensor01 device and then send the measure.
from iotagent-node-lib.
Hi Alvaro, thank you for your reply.
According to the documentation about service groups:
They are identified by an apikey and a resource and mapped to a particular entity type. [...]
For every config group, the pair (resource, apikey) must be unique (as it is used to identify which group to assign to which device).
From my point of view, once a measurement is 'identified' with a specific apikey and resource, it cannot be mapped to a different entity that belongs to a different group. Probably the main problem is that the agent seems to ignore the entity type, which is instead important when talking to the context broker.
There are probably two solutions:
- take the entity type into account when defining a device uniquely
- return an error when a device with the same ID is 'found outside' the service group.
The second solution, however, seems to me to contradict what is written in the documentation.
from iotagent-node-lib.
Currently is not possible provision two devices in the same service/subservice with the same id but different apikey. And apikey at device level is mandatory since not along ago
from iotagent-node-lib.
Perhaps this should be made clearer in the documentation, because at present it seems to describe a different behaviour (at least in my interpretation of the text).
The problem I see is that the definition of uniqueness within the agent and the CB is different. This causes confusion as there is a 1:1 logical mapping between the device in the iot agent and the CB.
Do you think it makes sense to also include the device type in the uniqueness definition to standardise the behaviour with the CB?
Regardless of these considerations in the roadmap, given the current definition of uniqueness, I think the current behaviour may not be correct and the second measurement should be rejected.
from iotagent-node-lib.
Perhaps this should be made clearer in the documentation, because at present it seems to describe a different behaviour (at least in my interpretation of the text).
Maybe you could do a pull request with a proposal of change to the documentation to make things clearer, based in your experience with this issue, please? Thanks in advance!
from iotagent-node-lib.
Do you think it makes sense to also include the device type in the uniqueness definition to standardise the behaviour with the CB?
As far as I understand "type" is a concept used in CB associated to entities but it doesn't have an equivalent at device level at IOTA. In sum:
- At CB level we have: entity id and entity type
- At IOTA level we have: device id
The mapping between both worlds (entity_id+entity_type <-> device_id) is done by IOTA, either by explicit provision or by autoprovision.
Please @AlvaroVega provide feedback if I'm wrong.
from iotagent-node-lib.
PR #1592 should fix this issue, allowing several devices with same device_id in the same service and subservice (as long as they are using different apikeys).
@tudamp could you test again, please? You can get the latest iotagent-json docker container from dockerhub at telefonicaiot/iotagent-json:latest
. Thanks in advance!
from iotagent-node-lib.
Release 4.4.0 including this fix has been released today, so we are going to close this issue.
@tudamp of course it can reopened if needed, if you provided feedback at the end.
from iotagent-node-lib.
Related Issues (20)
- allow define transport in device group HOT 1
- NGSI-LD observedAt is ignoring timezone from service or device for multivariable sensor HOT 3
- FIWARE ServicePath wildcard not working when listing devices HOT 3
- Timeinstant as attribute case (not measure) HOT 5
- No CMD attributes added when sending push commands (using `endpoint`) HOT 8
- Change type from string to Text HOT 3
- NGSI entity is missing attributes with manual device provisioning through Rest API HOT 10
- create mongodb index over Device collection HOT 3
- add new API to delete high number of devices HOT 3
- More flexible functional test (to cover northbound-only interactions)
- Remove dependency on deprecated domain module HOT 1
- active attributes are stored in Device model (mongo) as "active" but are stored in Group Model as "attributes" HOT 3
- ENTITY_GENERIC_ERROR is logging so much info HOT 2
- Allow use a different TimesInstant wording for metadata HOT 3
- allow use measures with metadatas it will be constants HOT 1
- allow to define metadatas in device attributes HOT 1
- Add `timestamp` tests HOT 1
- Problems with explicitAttrs and TimeInstan #1605 HOT 4
- sort multimeasures by an attribute (by TimeInstant ) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iotagent-node-lib.