Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-16770

[fiware-stackoverflow] Not supporting NGSIv2 metadata in device provisioned attributes

    Details

    • Type: Monitor
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2021
    • Component/s: FIWARE-TECH-HELP
    • Labels:

      Description

      Created question in FIWARE Q/A platform on 25-05-2020 at 12:05
      Please, ANSWER this question AT https://stackoverflow.com/questions/62001030/not-supporting-ngsiv2-metadata-in-device-provisioned-attributes

      Question:
      Not supporting NGSIv2 metadata in device provisioned attributes

      Description:
      We have used IoT agent -1.14.0 version from docker hub.
      We have given the service and servicepath as follows
      fiware-service:testiotagent
      fiware-servicepath:/

      Device registration payload :

      { "devices": [ { "device_id":"Motion-10", "entity_name":"urn:ngsi-ld:SENSOR:Motion-10", "entity_type":"SENSOR", "transport": "MQTT", "attributes": [ {"object_id": "s", "name": "state", "type":"Text"}

      ,
      {"object_id": "l", "name": "luminosity", "type":"Integer",
      "metadata":{ "unitCode":

      {"type": "Text", "value" :"CAL"}

      }
      }
      ]
      }
      ]
      }

      As per iotagent node lib version 2.12.0 ,IoT agent json -1.14.0 version should support the metadata in device provisioned attributes. But still facing issue.
      When we try to provision the above device we are getting the below error:

      {
      "name": "WRONG_SYNTAX",
      "message": "Wrong syntax in request: Errors found validating request."
      }

      I found that iotagent-node-lib have the schema to validate against device registration payload

      https://github.com/telefonicaid/iotagent-node-lib/blob/master/lib/templates/createDevice.json

      In this json schema there is no metadata schema mentioned in attributes.

      I have followed the below steps for metadata in Entity level:

      I have removed the metadata in IoT agent
      Updated the entity 'urn:ngsi-ld:SENSOR:Motion-10' as below

      {
      "id":"urn:ngsi-ld:SENSOR:Motion-10",
      "type":"SENSOR",
      "luminosity":{
      "type":"Integer",
      "value":"0",
      "metadata":{ "unitCode":

      {"type": "Text", "value" :"CAL"}

      }
      }

      Tried to send measurement and metadata got overriden and got the empty metadata

      {
      "id":"urn:ngsi-ld:SENSOR:Motion-10",
      "type":"SENSOR",
      "luminosity":{
      "type":"Integer",
      "value":"15",
      "metadata":{}
      }
      }

      Is it due to the fix given for issue 1788 in fiware-orion ,https://github.com/telefonicaid/fiware-orion/issues?q=1788.
      Need some qucik confirmation and help from Fiware experts to overcome this issue, it is very much appreciated.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2020-06-05 00:05|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2020-06-05 00:05|CREATED monitor | # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2020-06-05 03:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2020-06-05 03:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2020-06-05 06:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2020-06-05 06:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            Unassigned
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: