When the robot uses two or more USB serial devices, the corresponding relationship between the device name and the device is not fixed, but is assigned in sequence according to the order in which the devices are connected to the system.
Inserting one device first and then another device can determine the relationship between the device and the device name, but it is very troublesome to plug and unplug the device every time the system starts. The serial port can be mapped to a fixed device name. Regardless of the insertion order, the device will be mapped to a new device name. We only need to use the new device name to read and write the device.
Note: If you use the virtual machine provided by Yahboom, the following steps can be omitted
View camera device parameters
Input the following command in the terminal to view the corresponding relationship between the camera's pixel size and frame rate.
v4l2-ctl --list-formats-ext
Input the following command to view the device ID
xxxxxxxxxx
lsusb
As can be seen from the figure below, each device has a corresponding ID number.
Input the following command to view the device number.
xxxxxxxxxx
ll /dev/
You can see the USB device information corresponding to the dofbot control board through lsusb (the device ID information we are mainly concerned about is 1a86:7523)
xxxxxxxxxx
Bus 003 Device 007: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Edit myserial.rules file
xxxxxxxxxx
sudo gedit /etc/udev/rules.d/myserial.rules
The dofbot control board serial device ID information 1a86:7523 is required here. The following is the content of the myserial.rules file.
xxxxxxxxxx
KERNEL=="ttyUSB*", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0777",SYMLINK+="myserial"
Note: Some people often fail to bind in this step.
It is recommended to directly open the .md file we provide and copy it. Do not directly copy the content of the pdf file, otherwise the binding may not be successful.
Save the file and exit, then enter the following command to give myserial.rules execution permissions.
xsudo chmod a+x /etc/udev/rules.d/myserial.rules
Enter the following three commands to replug the micro usb device.
xxxxxxxxxx
sudo udevadm trigger
sudo service udev reload
sudo service udev restart
Enter the following command to check whether the device number is successfully bound.
xxxxxxxxxx
ll /dev/myserial
When the picture shown below appears, it is considered to be successfully bound.