mikakaraila / node-red-contrib-opcua

A Node-RED node to communicate OPC UA. Uses node-opcua library.
Other
212 stars 196 forks source link

Error Using OpcUa Server node #582

Open n90n opened 1 year ago

n90n commented 1 year ago

Hi, I have been trying to create an OpcUa server in node-red which I can connect to using UaExpert. I also want to be able to write to my variables from node-red and see it change in UaExpert.

I keep getting this error in node-red which i feel affects every other thing i try doing.

image

My OpcUa server configuration is shown below image

The result in UaExpert is shown below image

Is there anything that I am missing out that is causing the cannot find suitable endpoints in available endpoint error?

mikakaraila commented 1 year ago

Do you have DNS / hosts that will contain NOK-SYSTEMS IP address?

n90n commented 1 year ago

NOK-SYSTEMS is the hostname of my system. Even when I change the NOK-SYSTEMS to 127.0.0.1 or localhost, I get the same result. Find attached the screenshot.

image

mikakaraila commented 1 year ago

Error comes from the node-opcua. Check if you should add resource path after the port into the endpoint url!

What is UaExpert showing as endpoint? In your screenshot endpoint is opc.tcp://NOK-SYSTEMS:53880/

Code that produces error: image

n90n commented 1 year ago

how do I add resource path after the port into the endpoint url? please enlighten me.

the uaExpert is same as what i have in the server. find screenshot attached image

image

thank you for your support.

mikakaraila commented 1 year ago

I expect UaExpert will add it automatically.

In client node, see: ResourcePath use just / instead of tip: Ua/SimpleNodeRedServer

image

mikakaraila commented 1 year ago

NOTE: You should use OPC UA Client node instead of server node!

UaExpert is OPC UA Client that will connect to your NOK-SYSTEMS.

Use OPC UA Client node with the given endpoint url. Now you have introduced another server with the same endpoint.

Here: image

n90n commented 1 year ago

Dear Mikakaraila,

I am confused, if I use an OPC UA Client, I still get an invalid endpoint error message. image

Recall that what I want to achieve is to create a functional opc ua server and then use opc ua clients node (using the subscribe or write action) to write to my custom nodes which I have defined in the .xml nodeset directory.

the opcua server will show running in nodered but will in the command prompt, it will be showing cannot find suitable endpoints like I have already highlighted above.

Please, I need your help as I have been stuck here for more than 2 weeks

mikakaraila commented 1 year ago

Aah, now you explain this.

It is better to start to build simple server address space with addVariable commands like in this example: image

mikakaraila commented 1 year ago

Here is another more simple example how to add variable and set variable value:

image

mikakaraila commented 1 year ago

Here is flow file: OPCUA-VARIABLE.txt

mikakaraila commented 1 year ago

And you can see variables & values with UaExpert: image

mikakaraila commented 1 year ago

Please test with v0.2.311