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

[fiware-stackoverflow] Orion CB saves device with 'entity_name' value in 'id' field

    Details

      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': [

      { 'name': 't', 'type': 'celsius' }

      ],
      'lazy': [

      { 'name': 'b', 'type': 'mybits' }

      ]
      }]

      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": [

      { "isPattern": "false", "id": myid, "type": entity_type }

      ,
      "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.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-21 12:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-21 12:05|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-22 18:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-22 18:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-22 21:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-22 21:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-02-02 21:05|UPDATED status: transition Finish| # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2018-02-02 21:05|UPDATED status: transition Finish| # answers= 2, accepted answer= True

          People

          • Assignee:
            josegato Jose Gato Luis
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: