stlehmann / pyads

Python wrapper for TwinCAT ADS
MIT License
247 stars 93 forks source link

Connecting Pyads to Beckhoff over internet #362

Closed rudy93 closed 9 months ago

rudy93 commented 9 months ago

Dear all,

I am struggling with connecting to a Beckhoff PLC over the internet. In a local environment, everything is working ok. But now I want to communicate to a Beckhoff PLC over the internet and can't make a route. What I have done is the following:

Server-side:

Remote-side:

I checked the outgoing packages with Wire Shark and Wire Shark gave me the error "162 Destination unreachable (Port unreachable). Wire Shark is telling me that my script is trying to make a new route with the UDP protocol on port 37497 but this port is always different. So, I won't be able to forward another port because I don't know which port will be used. Is there a workaround for or any how to, to fix this issue?

Thanks for your reply.

chrisbeardy commented 9 months ago

hello, thank you for your question.

Have you created a route between the two PCs using the standard TwinCat route dialog? If you are struggling to do this, then this is not an issue with pyads but rather with the network configuration, I would contact Beckhoff support for this, my first thing would be to check the firewall etc.

If a route has been established then pyads should just be able to use the AMSNetId in the connection.

May I ask that the issue tracker is reserved for issues on pyads and that questions are diverted to stackoverflow.

Please can you close this issue and if still required ask a question on stack overflow, tag it with twincat or twincat-ads and I will assist you.

Thanks.

rudy93 commented 9 months ago

Thank you for your reply Chris. I have created an OpenVPN connection to resolve the port forwarding issues, but I am still struggling with how to configure the route. I will close this issue and will create an issue on stack overflow.