pyads: ADSError: ROUTERERR_PORTALREADYINUSE (1286)
Hi,
Thanks for your work on this. Do you have an insight on to why I’d be getting error 1286? My code is as follows:
pyads.open_port()
remote_ip = '192.168.1.38'
adr = pyads.AmsAddr('5.59.211.2.1.1',851)
pyads.add_route(adr,remote_ip)
plc = pyads.Connection('5.59.211.2.1.1',851)
plc.open()
In my case, 192.168.1.38 is the remote machine, with NetID 5.59.211.2.1.1.
The ‘add_route’ method returns “connected to 192.168.1.38”, but then plc.open() gives the port in use error.
I noticed the route is not in the routing table of the remote PLC… does it work on remote machines instead of 127.0.0.1.1.1? I don’t see a method for adding the password, so I’m not sure how it would work. To work around that, like I’ve done with node-ads in the past, I created a static local route to my machine from the PLC side, but I’m not able to connect, given the error above.
I’m on ubuntu with a win7 TC3 PLC.
Thanks!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 27 (2 by maintainers)
Bon appétit
This seems to work with my setup.
Version details:
I just got it to work two minutes ago! What did the trick for me was altering the add_route_to_plc command. The documentation says something like:
pyads.ads.add_route_to_plc(sending_net_id, adding_host_name, ip_address, username, password, route_name=None, added_net_id=None)I filled out all the fields and switched Hostname and Routename, resulting in: