Controlling the robot arm using TCP/IP

The user can connect the robot arm through the IP address of the robot arm, so as to achieve the effect of remote operation of the robot arm without connecting the USB port

Note: Currently only Python3 uses the robot arm in this way, provided there is a server and it has been enabled.

Action before connecting

Get Robot IP and Port

1 Get the latest Basic and Atom firmware,Burn method

2 Get Robot IP and Port

M5 version:

The display at the bottom of the robot arm selects the third Transponder--and then selects the second WLAN Server


As shown in the picture, the IP and port number of the robotic arm have been displayed


PI version:

wireless network

Click the WIFI icon, connect to WIFI, and enter the WIFI password, click the Connection Information option 7.6-2

wired network Network cable to connect to the network port of the robotic arm


Click Connection Information to view the current IP


Note: The robotic arm needs to be under the same network segment as the control terminal, that is, under the same WIFI

3 Download the server file through GitHub and run it on the robotic arm system7.6-2

4 Open a command terminal 7.6-2

5 Enter the following code to run the script:


The operation is successful as shown in the figure: 7.6-2

socket control

connect(serialport, baudrate, timeout)

  • function: Connect the robotic arm via serial port and baud rate(For PI version)
  • parameter
    • serialport: ( str) default/dev/ttyAMA0
    • baudrate: Baud rate default 1000000
    • timeout: default0.1


from pymycobot import MyCobotSocket
# Use port 9000 by default
# Where "" is the IP of the robot arm
mc = MyCobotSocket("","9000")

#The Raspberry Pi version needs to enter the connect function, the default value is ("/dev/ttyAMA0", "1000000"):
#Not required when the machine model is M5 version

#After the connections is normal, the robot arm can be controlled.
res = mc.get_angles()

results matching ""

    No results matching ""