Hello there,
i’m new to UR and i’m testing my connection to a UR10. I have setup a program THAT WORKS from which i can send script and commands to the UR via socket (IP of my UR is static on a ethernet network, port is 30002, entry point is my machine). I have a script which tries to connect to a another process i have setup to listen the UR request. The code for openning the socket is something like this:
$ 1 "port≔12345"
global port=21
$ 2 "ip_addr≔'169.254.150.55'"
global ip_addr="169.254.150.55"
$ 3 "socket≔socket_open(ip_addr,port,'conn')"
global socket=socket_open(ip_addr,port,"conn")
$ 4 "Loop socket≟ False "
while (socket == False ):
$ 5 "socket≔socket_open(ip_addr,port,'conn')"
global socket=socket_open(ip_addr,port,"conn")
end
And the python listener goes like this:
import socket
import time
HOST = "localhost"
PORT = 21
print("Starting Program")
count = 0
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT)) # Bind to the port
s.listen(5) # Now wait for client connection.
c, addr = s.accept() # Establish connection with client.
print(f"Connection from: {addr}")
There is more code but this all that is needed. I tried changing the HOST to 127.0.0.1 and the IP on the ethernet interface . Any idea why is giving me a timeout connection? Also i have a wireshark set up and this is what it shows me:
UR IP: 169.254.177.55
Machine IP: 169.254.150.55
Listener Port: 21
NOTE: the script that runs the program on the UR that tries to establish a connection i tried it from running it from the teach pendant directly and from sending through my tool that works (so the UR is on Remote mode).
Thx in advance