TCP-IP Python API robot feedback is not working properly


#1

I am currently trying to use TCP-IP-4Axis-Python to get information about the current pose of the end effector by querying “tool_vector_actual”. However, I find that the information I get from calling the feedback socket is delayed and is not the current pose. Is this a bug?

I’m using firmware 1.5.7 and the latest api from https://github.com/Dobot-Arm/TCP-IP-4Axis-Python


#2

I have the same problem. I move robot arm and new coordinates are delayed about 3 seconds…


#3

This is probably because python is too slow for the communication rate.
In fact, a really long message is sent form the robot to the pc every 8ms.
My interpretation is: since it use a tcp communication probably a buffer is filled from which the feedback values are taken, one after the other, starting with the oldest. I managed to fix this problem by changing the communication port from 30004 to 30005. I can try to lead you into fix this problem:

  1. file: ui.py
    line: 80
    form: feed_port = IntVar(self.root, value=30004)
    to: feed_port = IntVar(self.root, value=30005)

  2. file: dobot_api.py
    line: 125
    from: if self.port == 29999 or self.port == 30003 or self.port == 30004:
    to: if self.port == 29999 or self.port == 30003 or self.port == 30004 or self.port == 30005:

Make sure to save and now you can run the main.py without the lag.
Now the feedback is a 200ms rate (much slower, but works properly)
I can suggest changing pc if you want to use the 8ms port, or change programming language (to C, for example)

Make sure to like the comment and visit www.roboware.it :wink:


#4

Ok, need a little assistance! Have never done anything with TCP/IP, so trying use the example TCP-IP-4Axis-Python-main. I can get the gui open with the correct IP address, not 192.168.1.6, and I get an error "Connection error:(Unable to set socket connection use port 29999 !’, <class OSError’>). I changed both lines as shown above, but error still exists. Any suggestions to fix and connect to the MG400? Thanks.


#5

Hi apinkos
glad to see u here
Immediately after connecting the feedback ports at the 30004, 30005 etc. you need to open a thread to refresh the data at a frequency equal to or slightly greater than the feedback frequency, otherwise you will get a blockage reading the previous data.
best wishes


#6

Thanks for the reply. However, I do not know how to implement your suggestion as I have not written any code for TCP/IP connections. Can you update your code in Git and release it? How do you get the TCP-IP-4Axis-Python-main code to work? is there something else I need to do? I’ve gone to Settings > Remote Control and changed the mode to TCP/IP Secondary development and even left it in Online mode, but keep getting the “Unable to set socket connection use port 29999…”. Thanks.


#7

dear apinkos32
You can find information on this in the link below.



Best wishes


#8

Thanks for your response! It corrected itself when I updated the MG400 firmware to 1.5.7.0.


#9

Hi! I am encountering the same problem with the feedback ports. The above 30004_demo.zip doesn’t work for me. It says connection failed in Chinese.

Where can I download MG400 firmware 1.5.7. It doesn’t show up in my Dobot Studio Update section nor on the official download pages. Can you give me the link?

Thank you


#10

Search for it in this forum. There is a thread with the link. 1.5.8 is the latest