I have been programming a robotic arm (DOBOT MG400) using Python 3 and a TCP_IP connection to a windows 10 PC through an RJ45 connection. This was working well, and the robotic arm was acknowledging commands and moving, until I ran some windows updates on the PC. Now, when I run the same programs that have run successfully before, I get WinError 10053 An established connection was aborted by the software in your host machine. If I restart the PC, it normally works for a few launches of the program before it starts to get the same errors. Documentation for the DOBOT TCP_IP commands are here if anyone is interested: https://github.com/Dobot-Arm/TCP-IP-Protocol/blob/master/TCP_IP%20Remote%20Control%20Interface%20Guide%20(V3_4axis)_20240112_en.pdf
There are a few questions on here about WinError 10053, but these are all about connecting to internet services (like email servers) and so the answers don't seem relevant to this hardware connection.
Below is the minimum reproducible example of the code:
import socket
try:
TCP_IP = '192.168.1.6'
TCP_PORT = 30003
BUFFER_SIZE = 80
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
print (f"Connected to DOBOT port {TCP_PORT}")
except Exception as doboterror:
print(f"Unable to connect to DOBOT port {TCP_PORT}:\n{doboterror}")
def send(msg):
s.send(msg.encode())
def enable(weight = 0.196):
msg = (f"EnableRobot({weight})")
send(msg)
Calling "enable()" once does nothing (the robotic arm would normally enter an activated state), and upon calling "enable()" again, this error message is produced:
Connected to DOBOT port 30003
>>> enable()
>>> enable()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\New DOBOT files\MRE DOBOT.py", line 20, in enable
send(msg)
File "D:\New DOBOT files\MRE DOBOT.py", line 16, in send
s.send(msg.encode())
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
So I believe that it is an issue of something like a firewall blocking the connection. I have tried running this while disconnected from the internet, and with the firewall turned off, but get the same results. It is worth noting that this is done on a university managed PC.
The robotic arm continues to function as expected on the proprietary software included with the robot, DOBOTStudio. From this I can continue to make the robotic arm move.
I have tried to recover the PC to an earlier version, but I don't think that the restore point was old enough. Is there a way to suppress any hidden antivirus or whitelist the connection? I am very inexperienced with TCP_IP connections.