-
Notifications
You must be signed in to change notification settings - Fork 197
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
Run ADS Client on WSL through localhost #190
Comments
TwinCAT doesn't expect TCP connections from localhost. Especially, when you use the same AMS NetId as Target and Sender address. So at least you have to use different AMS NetIds for the TwinCAT server (in outside Windows) and your ADS Client (inside WSL). Then it depends on WSL networking, which I have no clue about. If on the TwiNCAT side the connections looks like a normal remote host, then it should work as soon as you configured the AMS route correctly. If TwinCAT receives a TCP connection attempt from an IP it is listening itself I doubt it will work. |
No luck with different AMS NetId... WSL networking has it's own considerations. I think WSL1 gives you a localhost network only. WSL2 gives you a virtual network that you can configure but needs Hyper-V which is not compatible with TwinCAT in run-mode. I did not try changing my TwinCAT Local NetId to localhost... Maybe that would work. It works through VirtualBox and remotly, so really not a big issue for me. |
I think the author of a nodejs ADS client figured out what's necessary for localhost communication - reservation of a port on the router. This has since been at least partially propagated to the rust client ads-rs (though I'm not sure if it cleared the reserved port after use). It should work for WSL1 with localhost networking, though WSL2 is a different story as you've noted. Since this is technically possible over ADS, I wonder if it's something that might be accepted for Beckhoff's open source library here. Even some official acknowledgment/documentation of the underlying mechanism would be nice, too. Links:
|
Is it possible to run the ADS Client on a windows subsystem linux (WSL) which communicates through the localhost ? FYI it works when installing the client on a remote PC using the same linux distribution as the WSL (Ubuntu 20.04).
Maybe related to #93 and #141.
ADS Route
Client Config
Running the Client Example
Wireshark Debug (loopback adapter)
wireshark-capture.zip
The text was updated successfully, but these errors were encountered: