TCP/IP Socket Robot to PC

I have been working on a vision project, incorporating a ur3e.
I was hoping to be able to send a request over socket using python to receive coordinates from a PC program.
Ive looked at several tutorials where the PC is controlling the arm remotely, however for my purposes i would not like all the moves to be done remotely.

Every time i call socket_open i get false as the return.
I was wondering if perhaps there is a firewall blocking this or something i am unaware of was looking to see if anyone may know.

Eh funny, just replied to someone else about this:

It’s the same guy, that’s why it seems familiar to ya :laughing:

You have two safety settings that can block you :

  • As @terryc says, check or temporarily disable your PC’s firewall
  • On your robot, you also have security restrictions here :

Florent
https://underautomation.com

“Every time i call socket_open i get false as the return.”

This is going to be hard to figure out with the little information there is on your post. The issue can vary from a small detail, some beginner slip or a more advanced issue going on underneath, but I’ll give you a list of things you can check to figure it out. So, first things first: you have two separate devices that try to communicate with each other, so it can be that one is doing something wrong, maybe it’s the other one, or maybe it’s both of them.

Some stuff you can try from the PC side (server):

  • That is binded to a reachable IP address from the same network (e.g. 192.168.0.230, never use 127.0.0.1).
  • The ports number match in both sides.
  • You start up the server always before than the client.
  • The server is reachable by another processes (e.g. try to run a small script that connects to your Server and can retrieves info from it).
  • The server can reach the robot (open the command prompt from Windows and try to ping the robot IP address). In Windows there is a tricky thing that when a computer is connected to more than one network, it tends to “have a preference” for the one with Internet access, so if you cannot reach the robot, disable the Wi-Fi and other LANs and try again.
  • Disable Windows Firewall to ensure that remote connections can reach your server. If that was the issue but you don’t want to keep the Firewall completely off in the long run, look up how to add exceptions and include your server in the exception list.

Some stuff you can try from the robot side (client):

  • The IP address and port are correct. Remember that UR controllers reserved ports for special processes, so make sure that your program is not trying to connect to port numbers like 3002, 3003,… or any other ports that are used by URCaps. Most of the examples from UR use port numbers like 50000 or 50002. If you are trying to use a reserved port, change it to an available port nr. on both the server and on the UR program.
  • The UR controller is within the same network than the PC (so the mask does not necessarily have to match as well, but I’d give it a try to this too). If you do changes on the IP address - mask settings, you might need to restart the controller because some OS internal settings only apply changes after a restart.
  • The server is reachable from the UR side. To try this, you’ll need to connect a keyboard to the controller, open a terminal and ping to the PC.
  • Give it a try to the suggestion of @androidflorent to see if you have any restrictions from Polyscope.

One last idea is to try first TCP-IP before XML-RPC. If it is only a connection issue, connecting server-client through TCP will be fine after fixing it. If you have different XML versions on the server and client side, you will have a connection error message when actually the connection is fine but the XML differences messes it up. Here you have an XML-RPC example using Python.

Thank you all for the quick responses.
I have programmed URs before this is my first time trying to do some more advanced features.

in response to @cgs

PC side

  • I believe it is binded to an IP reachable, I do have a direct lan between my PC and UR

  • The Port Numbers match

  • I do start the server first.

  • I did run a test client script on the same pc and it was able to retrieve

  • I am able to ping the robot successfully, should i be disconnecting other connections to online?

*I did create an inbound rule for the pot i am using

Robot Side

  • The IP and port are correct i believe

  • Has been changed to correct and restarted

  • How does one go about opening command prompt on the UR

  • I reached out to my rep for the UR admin password so will try this next

Connect a keyboard to the UR, and use CTRL-ALT-F1 to open one of the virtual terminals (You can use F1-F6, F7 is the Linux X server where polyscope runs)

username: root
pw: easybot

Windows blocks ICMP ping requests sometimes. Another thing to try would be making sure “Network discovery” is turned on in windows for that network. Might also need to make the LAN connection Private so it has full permissions.

sorry another rookie question how do i get back out of the terminal screen

CTRL-ALT-F7 I think. Either that or F9

Okay thanks i think it may be having an issue cause the network is public like @terryc
mentioned i may have to get our IT to configure this for me

As in the computer and the robot are both plugged into a big company network? Or you’ve run RJ45 between computer and robot?

If the latter, you shouldn’t need to get IT involved, just select the LAN connection and toggle to private

The latter however I don’t have options to toggle on a company laptop

Hello there, I am pretty new to this area. How can I find the port number of UR5 . Thanks in advance

Here you have all the ports in use by a UR: Overview of client interfaces - 21744

Use in your program any other port nr >= 50007