[ https://jira.fiware.org/browse/HELP-19576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fernando Lopez reassigned HELP-19576: ------------------------------------- Assignee: Gabriele De Luca > [fiware-stackoverflow] Adding device to OPC-UA IoT Agent trough REST API call > ----------------------------------------------------------------------------- > > Key: HELP-19576 > URL: https://jira.fiware.org/browse/HELP-19576 > Project: Help-Desk > Issue Type: Monitor > Components: FIWARE-TECH-HELP > Reporter: Backlog Manager > Assignee: Gabriele De Luca > Labels: fiware, node.js, opc, opc-ua, rest > > Created question in FIWARE Q/A platform on 13-05-2022 at 13:05 > {color: red}Please, ANSWER this question AT{color} 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. -- This message was sent by Atlassian JIRA (v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy