Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenOPC.open_client: ConnectionRefusedError + remote machine running OpenOPC Gateway Service #26

Open
jamesbraza opened this issue Jan 17, 2023 · 1 comment

Comments

@jamesbraza
Copy link

I have the following set up:

  • On remote machine (10.4.8.71): both MatrikonOPC Simulation Server and the OpenOPC Gateway Service running
  • On local machine: run the below snippet
  • On both machines: Windows OS, Windows Firewall disabled, ran regsvr32 /s \path\to\openopc\lib\gbda_aut.dll
import OpenOPC

opc = OpenOPC.open_client(host="10.4.8.71")

The last line throws the following Pyro4.errors.CommunicationError:

Traceback (most recent call last):
  File "C:\path\to\venv\lib\site-packages\Pyro4\core.py", line 511, in connect_and_handshake
    sock = socketutil.createSocket(connect=connect_location,
  File "C:\path\to\venv\lib\site-packages\Pyro4\socketutil.py", line 307, in createSocket
    sock.connect(connect)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  ...
  File "C:\path\to\scripts\opc.py", line 25, in matrikon_simulation_main
    opc = OpenOPC.open_client("10.4.8.71")
  File "C:\path\to\venv\lib\site-packages\OpenOPC.py", line 131, in open_client
    return server_obj.create_client()
  File "C:\path\to\venv\lib\site-packages\Pyro4\core.py", line 275, in __getattr__
    self._pyroGetMetadata()
  File "C:\path\to\venv\lib\site-packages\Pyro4\core.py", line 615, in _pyroGetMetadata
    self.__pyroCreateConnection()
  File "C:\path\to\venv\lib\site-packages\Pyro4\core.py", line 596, in __pyroCreateConnection
    connect_and_handshake(conn)
  File "C:\path\to\venv\lib\site-packages\Pyro4\core.py", line 549, in connect_and_handshake
    raise ce
Pyro4.errors.CommunicationError: cannot connect to ('10.4.8.71', 7766): [WinError 10061] No connection could be made because the target machine actively refused it

I am not sure if:

  • I am missing a software entity in the communication pipeline
  • If multi-machine systems doesn't work with OpenOPC
  • If I have an incorrect OS configuration on one or both machines

What can I do to fix this?

@jamesbraza
Copy link
Author

@ya-mouse thank you for answering my questions today in #24, it helped me realize I was running the OpenOPC Gateway Service on the wrong machine. Any ideas on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant