2
votes

I have the following configuration for an active lightweightm2m-iotagent attribute (a temperature sensor value). Fiware's IoT agent turns IPSO objects into lazy attributes but I add a mapping to make it an active attribute as in the documentation:

  types: {
    'Type': {
        service: 'service',
        subservice: '/service',
        commands: [],
        lazy: [],
        active: [
          {
            "name": "t",
            "type": "number"
          }
        ],
        lwm2mResourceMapping: {
          "t": {
            "objectType": 3303,
            "objectInstance": 0,
            "objectResource": 5700
          }
        }
    },

According to the documentation for the iotagent-node-lib:

NGSI queries to the context broker will be resolved in the Broker database.

However, when I query my active attribute in Orion, Orion also queries the lightweightm2m-iotagent, requesting a bogus /3303/0/0 path which doesn't even exist in the IPSO definition.

curl -H "Fiware-service: service" -H "Fiware-servicepath: /service" http://172.17.0.1:1026/v2/entities/entity1:Type/attrs/t/value

How can I set up the configuration to get the behavior stated in the documentation, resolving a query for an active attribute in the broker database and avoiding these bogus queries?

1

1 Answers

0
votes

Maybe the IoTAgent is not recognizing the active attribute as such, and it may be related to the static configuration of the types via "config.js"; this kind of configuration is not commonly used and may contain some errors (as probably the one you have found). Please, try provisioning the device through the API, as explained in: https://github.com/telefonicaid/lightweightm2m-iotagent/blob/master/docs/deviceProvisioning.md. If it works then, maybe we should flag the static attribute configuration as a buggy.