I'm using Python to develop an OPC client with the
freeopcua package. To test it, I'm using Prosys OPC Simulation Server. This program lets you host a server on your computer that simulates data to see if you can successfully read and write from your client.
However, I'm having trouble with which I believe is a networking issue. The connection address of the simulated server is
opc.tcp://DESKTOP-EPETSMR:53530/OPCUA/SimulationServer. Thus, when I write these lines in the Python script, I can successfully connect to it:
client = Client("opc.tcp://DESKTOP-EPETSMR:53530/OPCUA/SimulationServer/") client.connect()
The first line can be replaced with any of the following two, and it will work as well:
client = Client("opc.tcp://localhost:53530/OPCUA/SimulationServer/")
client = Client("opc.tcp://127.0.0.1:53530/OPCUA/SimulationServer/")
Now I want to access the server from another computer (i.e. a different computer from the one that is hosting the server) that is connected to the same WiFi network. I thought that replacing the loopback IP
127.0.0.1 with the IP of the computer would be enough. So I ran
ipconfig from Windows' command prompt and got:
Wireless LAN adapter Wi-Fi: IPv4 Address. . . . . . . . . . . : 192.168.1.5 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1
But when I run the previous two lines replacing the loopback IP address with
192.168.1.5, the client cannot connect to the server.
So I tried to perform a ping in both ways (from one PC to another) and both worked okay, so it appears that the issue is not the communication between both hosts.
Any idea of how could this be fixed?