ya-mouse / openopc

OpenOPC for Python3.4
Other
48 stars 56 forks source link

Question: how to install OpenOPC Gateway Service on non-Windows OS #24

Closed jamesbraza closed 1 year ago

jamesbraza commented 1 year ago

From https://openopc.sourceforge.net/api.html:

In Open mode a connection is made to the OpenOPC Gateway Service running on the specified node. This mode is available to both Windows and non-Windows clients.

I am trying to build and start the OpenOPC Gateway Service on macOS Monterey version 12.6 using pyinstaller as suggested here. I can actually successfully build the service, but when I go to run it:

> pyinstaller --onefile  --hidden-import=json --hidden-import=win32timezone ./src/OpenOPCService.py
68 INFO: PyInstaller: 5.7.0
68 INFO: Python: 3.10.9
81 INFO: Platform: macOS-12.6-arm64-arm-64bit
...
12129 INFO: Building EXE from EXE-00.toc completed successfully.
> ./dist/OpenOPCService debug
Traceback (most recent call last):
  File "OpenOPCService.py", line 13, in <module>
ModuleNotFoundError: No module named 'win32serviceutil'
[21202] Failed to execute script 'OpenOPCService' due to unhandled exception!

My question is, given the gateway service depends upon Windows packages like win32serviceutil, how can one install the OpenOPC Gateway Service on OS's besides Windows?

ya-mouse commented 1 year ago

I suppose, it's a windows-only service: https://openopc.sourceforge.net/service.html

jamesbraza commented 1 year ago

Okay, and thank you for responding! Perhaps I was misinterpreting this statement:

This mode is available to both Windows and non-Windows clients.

How can one have a non-Windows client if the Gateway service is Windows-only?

ya-mouse commented 1 year ago

From the context in Readme, it's about OPC Client instance, not about running OPC Gateway Service (that acts as a server).

jamesbraza commented 1 year ago

Okay so my answer is (please correct me if there's a misunderstanding):

  1. The OpenOPC Gateway Service:
    • Is a Windows-only service
    • Runs on the Windows machine containing the OPC DA server
  2. OpenOPC client(s) can live on other non-Windows machines
    • These machines don't run the OpenOPC Gateway Service

Closing this out, thank you!