Q&A
This chapter lists common problems in using myBlockly to control the robot arm for reference.
Q1: myBlockly reports an error ModuleNotFoundError: No module named 'pymycobot'
when running
A: This is because the pymycobot library is not installed when setting up the Python environment. To install the pymycobot library, open the terminal (Win key + R key), enter: pip install pymycobot --upgrade --user
, and press Enter to display Successfully installed pymycobot.
Q2: The robot arm is unresponsive due to the lack of a sleep
method module
A: The program that operates the robot arm movement takes time to complete, so a sleep
module needs to be connected after an action to give the robot arm time to move before the next movement (the required time depends on the situation, and the robot arm is set by default to run myBlockly with a minimum sleep time of no less than 0.5s), otherwise the robot arm will not be able to achieve the desired movement.
Q3: The Run
button in the upper right corner cannot be clicked, and it is gray-green.
A: The new version of myBlockly has added the function of detecting the serial communication of the robot arm. If the robot arm is currently connected to the computer, you need to check:
(1) Is there a background program occupying the robot arm's serial port?
(2) Is the toolbar under the red arrow on the right closed? If it is open, you need to manually close it.
Q4: Why do I get a lot of errors after running the program?
A: Before running the program, you need to confirm a few points:
(1) Please make sure that your robot arm's serial port number and baud rate are correct.
How to check the serial port number:
- In Windows, find the device manager and check the port.
If the port (COM and LPT) shows USB-Enhanced-SERIAL CH9102, it is a CP34X chip.
If the port (COM and LPT) shows Silicon Labs CP210x USB to UART Bridge, it is a CP210X chip. The ports with these two names are the serial port numbers of your robot arm.
- In Linux, open the terminal and enter ls/dev/tty* and press Enter. The serial port number of the robot arm is displayed. AMA0 or USB0 is the serial port number of your robot arm.
- Open the terminal on Mac, enter cd /dev/ and press Enter, then ls -al tty to find it, for example /dev/tty.usbserial-10.
(2) Please make sure the baud rate is correct. The baud rates of M5, myCobot 320 Pi-2020, myCobot 320 Pi-2022, myCobot 280 Jetson nano, and myCobot 280 Arudino are all 115200. The baud rates of myCobot 280 Pi, myPalletizer 260 Pi, mecahrm 270 Pi, myBuddy 280, Pro 600, etc. are all 1000000.
(3) Please make sure that the model, serial port number, and baud rate in the blue box are consistent with those in the small toolbar on the right, and match the robot arm.
Q5: Error MyCobot.int() takes 2 positional arguments but 3 were given.
A: This error will appear in the old version of myBlockly because the versions of myBlockly and pymycobot do not match. Just update the versions of myBlockly and pymycobot driver library.
Q6: The result of running the program shows child process exited with code 1 A: This is not an error. All programs have finished running and returned the binary number 1. It means that everything has been successfully completed.