5. Setting up udev rules for a consistent device name on Linux - maxosprojects/open-dobot GitHub Wiki

To create a reliable device name for the dobot, you can create a new file /etc/udev/rules.d/01-open-dobot.rules with this single line as content:

ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0042", SYMLINK+="dobot"

The udev rules are checked each time a device is detected and if the rule applies (in this case the Vendor and Product IDs are checked), a new softlink with the given name is created. As the vendor and product ID in this case belong to the Arduino, other boards will also get this link.

To execute the new rule, run

sudo udevadm trigger

After that (without loggin out or disconnecting the dobot), a new device name /dev/dobot should be visible:

[~] ls -al /dev | grep do

lrwxrwxrwx 1 root root 7 May 7 16:51 dobot -> ttyACM0

The dobot is now always connected with this name so that the connection can be established via

dobot = Dobot('/dev/dobot')