Connect node-red on raspberry to OPC server on other PC same network

#1

Hi everyone,
i connected node-red to OPC server same machine PC windown, but i can't connect node-red on raspberry to OPC on PC same network.
Can i help you ? what should i do ?
Thank you

0 Likes

#2

You need to connect to the OPC servers URI. There are lots of details you are missing though.

1 Like

#3

Thank you, can you guide me in detail ?

0 Likes

#4

You state you can already connect, so you have the details you need.
So what happens when you configure the node with the URI of your OPC server?

Is there an error message? Is there anything in the logs?

On the machine that works
What version of Node-RED, nodejs are you using?
What node and version are you using to connect to your OPC server?

On the machine that does not work
What version of Node-RED, nodejs are you using?
What node and version are you using to connect to your OPC server?

0 Likes

#5

Regarding OPC, if I remember correctly, was originally developed for Windows (later also for Linux) and had dependencies of COM and DCOM.

Since the topic author wrote it worked fine in Windows where COM and DCOM is present, there should be no surprise it worked locally in Windows

Now when trying to connect over the network, DCOM is required unless the OPC server is developed "later" so to say, i.e. is an OPC UA server

When connecting from Node-RED running on Debian in a RPi, DCOM is not available and if the OPC server is not developed recently, it will not work

It is a while back since I worked with OPC clients and servers and it was only in Windows. But I would look for a tool for Linux that is capable to find & list OPC servers on the network and see if that is able to connect and browse the server for tags and items. If this fails, I think the OPC server is a pure Windows DA implementation

1 Like

#6

ohh, thank you very much

0 Likes

#7

First check I would do is to try to run a small python program on your RPi trying OpenOPC
http://openopc.sourceforge.net/

If you are able to find and connect to your OPC server, that is a good starting point

0 Likes

#8

Have you setup OPCUA discovery in the OPC side bud? If so you should have a URI to communicate with this is what should be in your node red app

0 Likes

#9

kep
I config like image, in node red i also config

0 Likes

#10

You stated that you already had it working on one machine with Node-RED.

So what did you use there? You also haven't said what contrib-node you are using...

0 Likes

#11

i used node-red-contrib-iiot-opcua. i connected node red on PC window to opc kepware server on same PC, but i can't connect node red on raspberry to opc server on PC same network

0 Likes

#12

so what did you configure within node-red-contrib-iiot-opcua within node-red that worked?

0 Likes

#13

i configure like image

[{"id":"abc0b483.7a6558","type":"OPCUA-IIoT-Read","z":"873f820a.ceb8a","attributeId":"13","maxAge":1,"depth":1,"connector":"cd03c874.d47a18","name":"","justValue":true,"showStatusActivities":false,"showErrors":false,"parseStrings":false,"historyDays":1,"x":330,"y":244,"wires":[["ee58f1d9.7264d"]]},{"id":"cd03c874.d47a18","type":"OPCUA-IIoT-Connector","z":"","discoveryUrl":"","endpoint":"opc.tcp://192.168.1.101:49320/KEPServerEX","keepSessionAlive":true,"loginEnabled":false,"securityPolicy":"None","securityMode":"NONE","name":"LOCAL SERVER","showErrors":false,"individualCerts":false,"publicCertificateFile":"","privateKeyFile":"","defaultSecureTokenLifetime":"60000","endpointMustExist":false,"autoSelectRightEndpoint":false,"strategyMaxRetry":"","strategyInitialDelay":"","strategyMaxDelay":"","strategyRandomisationFactor":"","requestedSessionTimeout":"","connectionStartDelay":"","reconnectDelay":"","maxBadSessionRequests":"10"}]

0 Likes

#14

So what about the FW in Windows? Did you define a rule for incoming connection?

1 Like

#15

First check the firewall. I keep forgetting this myself from time to time. Go Windows firewall, advanced settings, incoming rule, TCP, port 49320. In Kepserver doc named UA endpoint.

1 Like

#17

oh yeah, i'm ok

0 Likes

#18

When you say you are ok, did you manage to make it work Node-RED RPi <---> OPC Server Windows ???

Since you are on OPC UA and managed to make it work locally in Windows, I think the problems with remote access over the network are related to user access rights and/or Windows firewall

I have seen that the OPC UA nodes published as "node-red-contrib-opcua" does give some good & useful debug info. I could actually see that access was denied when I tried Node-RED RPi <---> Kepware OPC Server Windows

(I did also not manage to even connect locally in the same Windows machine, for me this is not critical anyway, I'm not using OPC in any production system)

0 Likes

#19

My example configuration, reading and writing using the OPC node can be found in this example if it helps:

2 Likes