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

FIWARE.Question.Tech.Adding device to OPC-UA IoT Agent trough REST API call.

    Details

      Description

      Created question in FIWARE Q/A platform on 13-05-2022 at 13:05
      Please, ANSWER this question AT https://stackoverflow.com/questions/72230070/adding-device-to-opc-ua-iot-agent-trough-rest-api-call

      Question:
      Adding device to OPC-UA IoT Agent trough REST API call

      Description:
      I'm struggling trying to add a device via API call.
      If I start the docker container with the docker-compse.yml, I'm able to load a device to the local OPC-UA server, with the following REST API call.

      curl http://localhost:4001/iot/devices -H "fiware-service: opcua_car" -H "fiware-servicepath: /demo" -H "Content-Type: application/json" -d @testCommands/add_device_NGSIv2.json

      But, if I start the docker container with the docker-compse-external-server.yml, which instead of the iotagent4fiware/iotagent-opcua:latest uses the iotagent4fiware/iotagent-opcua:1.3.4, and I use the same API call, I get the following error:

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

      From the Docker log:
      "op":"IoTAgentNGSI.RestUtils","time":"2022-05-12T19:47:59.467Z","lvl":"DEBUG","msg":"Errors found validating request: {
      "valid":false,"errors": [

      {"attribute":"pattern","property":"devices.0.commands.1.object_id","expected":"^([^<>();'="]+)+$","actual":"ns=3;s=Accelerate","message":"invalid input"}

      ,

      {"attribute":"pattern","property":"devices.0.commands.0.object_id","expected":"^([^<>();'="]+)+$","actual":"ns=3;s=Stop","message":"invalid input"}

      ,

      {"attribute":"pattern","property":"devices.0.attributes.4.object_id","expected":"^([^<>();'="]+)+$","actual":"ns=3;s=Oxigen","message":"invalid input"}

      ,

      {"attribute":"pattern","property":"devices.0.attributes.3.object_id","expected":"^([^<>();'="]+)+$","actual":"ns=3;s=Temperature","message":"invalid input"}

      ,

      {"attribute":"pattern","property":"devices.0.attributes.2.object_id","expected":"^([^<>();'="]+)+$","actual":"ns=3;s=EngineStopped","message":"invalid input"}

      ,

      {"attribute":"pattern","property":"devices.0.attributes.1.object_id","expected":"^([^<>();'="]+)+$","actual":"ns=3;s=Acceleration","message":"invalid input"}

      ,

      {"attribute":"pattern","property":"devices.0.attributes.0.object_id","expected":"^([^<>();'="]+)+$","actual":"ns=3;s=EngineBrake","message":"invalid input"}

      ,

      {"attribute":"pattern","property":"devices.0.lazy.0.object_id","expected":"^([^<>();'="]+)+$","actual":"ns=3;s=Speed","message":"invalid input"}

      ]
      }

      Then, If I run the Agent in Node.js, I get the same error:

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

      If I try to use iotagent4fiware/iotagent-opcua:latest, which should be the same of running the cloned repository in Node.js, it seems to ignore the endpointUrl present in the configuration.properties file, and it try to connect always to opc.tcp://iotcarsrv:5001/UA/CarServer.
      Of course, connection fails...
      I'm pretty confused from that behaviors, and I can't add anything to the IoTAgent.

        Activity

        backlogmanager Backlog Manager created issue -
        Hide
        backlogmanager Backlog Manager added a comment -

        2022-05-14 05:31|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2022-05-14 05:31|CREATED monitor | # answers= 0, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager made changes -
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        fla Fernando Lopez made changes -
        Assignee Gabriele De Luca [ gabriele ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2022-05-21 05:31|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2022-05-21 05:31|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2022-05-22 05:31|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2022-05-22 05:31|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        gabriele Gabriele De Luca made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        Hide
        gabriele Gabriele De Luca added a comment -

        The docker image will be aligned with the master branch and updated soon

        Show
        gabriele Gabriele De Luca added a comment - The docker image will be aligned with the master branch and updated soon
        backlogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] Adding device to OPC-UA IoT Agent trough REST API call FIWARE.Question.Tech.Adding device to OPC-UA IoT Agent trough REST API call.
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        7d 1 Backlog Manager 21/May/22 7:31 AM
        In Progress In Progress Answered Answered
        23h 59m 1 Backlog Manager 22/May/22 7:31 AM
        Answered Answered Closed Closed
        2d 7h 18m 1 Gabriele De Luca 24/May/22 2:50 PM

          People

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

            Dates

            • Created:
              Updated:
              Resolved: