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

OPC DA Client Host Parameter Fixed to Localhost, Unable to Specify Custom IP Address #67

Open
Jbiscode opened this issue Nov 7, 2024 · 0 comments

Comments

@Jbiscode
Copy link
Contributor

Jbiscode commented Nov 7, 2024

Describe the Bug

Hello, I encountered an issue while connecting to OPC DA in a Windows environment. In my setup, the server and client are on different PCs within the same network, so the host needs to be specified with an IP address rather than "localhost".

Currently, the code accepts a host parameter, but within the client creation function, the host appears to be fixed to localhost. Could we modify the code to allow specifying an IP address instead of restricting it to localhost?

To Reproduce

Steps to reproduce the behavior:
1. Use openopc2 on a Windows client and connect to an OPC server on another Windows machine.
2. Test the connection without using a gateway, using COM communication directly.
3. Set OPC_HOST_IP to the external IP of the other machine (ensure that DCOM communication is properly configured).
4. Attempt to connect with localhost without attempting to connect with the set IP.

Expected Behavior

The connection should attempt to use the specified OPC_HOST_IP, but it currently always tries to connect to localhost.

Desktop (please complete the following information):

•	Client PC: Windows 11 Pro (64-bit)
•	OPC Server PC: Windows 10 (64-bit)
•	Python 3.10.5 (32-bit)

P.S. I used your recent update, version 0.1.18, and was able to successfully connect to the OPC server after applying these changes. Thank you for the update!

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