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

**URL:** <https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955>\
**Category:** General\
**Created:** [19 December 2018 09:57 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955 "2018-12-19T09:57:02Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [19 December 2018 09:57 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/1 "2018-12-19T09:57:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RoganFPS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/roganfps/32/3208_2.png) [@RoganFPS](https://discourse.nodered.org/u/RoganFPS)\
**Post date:** [19 December 2018 18:19 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/2 "2018-12-19T18:19:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [20 December 2018 07:48 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/3 "2018-12-20T07:48:59Z")

</div>

Thank you, can you guide me in detail ?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [20 December 2018 08:23 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/4 "2018-12-20T08:23:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [20 December 2018 09:14 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/5 "2018-12-20T09:14:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [20 December 2018 09:21 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/6 "2018-12-20T09:21:05Z")

</div>

ohh, thank you very much

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [20 December 2018 09:26 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/7 "2018-12-20T09:26:15Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![RoganFPS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/roganfps/32/3208_2.png) [@RoganFPS](https://discourse.nodered.org/u/RoganFPS)\
**Post date:** [20 December 2018 14:23 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/8 "2018-12-20T14:23:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [20 December 2018 14:53 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/9 "2018-12-20T14:53:41Z")

</div>

![kep](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/21aa335f3a1029d446909ddea6f13ac9033c3fda.png)  
I config like image, in node red i also config

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [20 December 2018 15:40 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/10 "2018-12-20T15:40:04Z")

</div>

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...

---

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [20 December 2018 15:46 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/11 "2018-12-20T15:46:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [20 December 2018 15:49 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/12 "2018-12-20T15:49:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [20 December 2018 15:59 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/13 "2018-12-20T15:59:15Z")

</div>

![opc](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/ce94f046aa2313d7c9601c0f96f9741ae35f9788.png)

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"}]

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [20 December 2018 17:01 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/14 "2018-12-20T17:01:38Z")

</div>

> [@gaara7271](#):
>
> opc kepware

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

---

<div class="post-metadata">

**Author:** ![johanon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/johanon/32/3335_2.png) [@johanon](https://discourse.nodered.org/u/johanon)\
**Post date:** [20 December 2018 18:57 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/15 "2018-12-20T18:57:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [21 December 2018 02:08 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/17 "2018-12-21T02:08:50Z")

</div>

oh yeah, i'm ok

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [21 December 2018 09:22 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/18 "2018-12-21T09:22:40Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [22 December 2018 13:34 UTC](https://discourse.nodered.org/t/connect-node-red-on-raspberry-to-opc-server-on-other-pc-same-network/5955/19 "2018-12-22T13:34:44Z")

</div>

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

> **[dedynobre/comunicacao-opc-com-node-red](https://github.com/dedynobre/comunicacao-opc-com-node-red)**
>
> Demonstração de como comunicar o NodeRed com OPC Server - dedynobre/comunicacao-opc-com-node-red
