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

[fiware-stackoverflow] adding nested OPC-UA Variable results in "String cannot be coerced to a nodeId"

    Details

      Description

      Created question in FIWARE Q/A platform on 16-02-2021 at 10:02
      Please, ANSWER this question AT https://stackoverflow.com/questions/66221917/adding-nested-opc-ua-variable-results-in-string-cannot-be-coerced-to-a-nodeid

      Question:
      adding nested OPC-UA Variable results in "String cannot be coerced to a nodeId"

      Description:
      Error: String cannot be coerced to a nodeId
      Hi,
      I was busy setting up a connection between the Orion Broker and an PLC with OPC-UA Server using the opcua iotagent agent.
      I managed to setup all parts and I am able to receive (test) data, but I am unable to follow the tutorial with regards to adding an entity to the Orion-Broker using a json file:
      curl http://localhost:4001/iot/devices -H "fiware-service: plcservice" -H "fiware-servicepath: /demo" -H "Content-Type: application/json" -d @add_device.json

      The expected result would be an added entity to the OrionBroker with the supplied data, but this only results in a error message:

      {"name":"Error","message":"String cannot be coerced to a nodeId : ns*4:s*MAIN.mainVar"}

      suspected Error
      Is it possible that the iotagent does not work nicely with nested Variables?
      steps taken

      doublechecked availability of OPC Data:

      OPC data changes every second, can be seen in Broker log

      reduced complexity of setup to only include Broker and IOT-agent

      additional information:
      add_device.json file:
      {
      "devices": [
      {
      "device_id": "plc1",
      "entity_name": "PLC1",
      "entity_type": "plc",
      "attributes": [

      { "object_id": "ns*4:s*MAIN.mainVar", "name": "main", "type": "Number" }

      ],
      "lazy": [
      ],
      "commands" : []
      }
      ]

      }

      config of IOT-agent (from localhost:4081/config):
      {
      "config": {
      "logLevel": "DEBUG",
      "contextBroker":

      { "host": "orion", "port": 1026 }

      ,
      "server":

      { "port": 4001, "baseRoot": "/" }

      ,
      "deviceRegistry":

      { "type": "memory" }

      ,
      "mongodb":

      { "host": "iotmongo", "port": "27017", "db": "iotagent", "retries": 5, "retryTime": 5 }

      ,
      "types": {
      "plc": {
      "service": "plcservice",
      "subservice": "/demo",
      "active": [

      { "name": "main", "type": "Int16" }

      ,

      { "name": "test1", "type": "Int16" }

      ,

      { "name": "test2", "type": "Int16" }

      ],
      "lazy": [],
      "commands": []
      }
      },
      "browseServerOptions": null,
      "service": "plc",
      "subservice": "/demo",
      "providerUrl": "http://iotage:4001",
      "pollingExpiration": "200000",
      "pollingDaemonFrequency": "20000",
      "deviceRegistrationDuration": "P1M",
      "defaultType": null,
      "contexts": [
      {
      "id": "plc_1",
      "type": "plc",
      "service": "plcservice",
      "subservice": "/demo",
      "polling": false,
      "mappings": [

      { "ocb_id": "test1", "opcua_id": "ns=4;s=test.TestVar.test1", "object_id": null, "inputArguments": [] }

      ,

      { "ocb_id": "test2", "opcua_id": "ns=4;s=test.TestVar.test2", "object_id": null, "inputArguments": [] }

      ,

      { "ocb_id": "main", "opcua_id": "ns=4;s=MAIN.mainVar", "object_id": null, "inputArguments": [] }

      ]
      }
      ]
      }
      }

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2021-02-17 09:06|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2021-02-17 09:06|CREATED monitor | # answers= 0, accepted answer= False

          People

          • Assignee:
            gabriele Gabriele De Luca
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: