How to get arduino to always be connected as /dev/ttyUSB0 and with chmod 0777? I've got Debian 10 as OS and for a Project, I need my arduino to always be connected as /dev/ttyUSB0, not any other ttyUSB-number, and I need it to be connected with the 0777 rights for a script to work.
I've read some things about udev, but nothing I tried yet worked.
I tried creating
/etc/udev/rules.d/51-my_usb_device
with the content
SUBSYSTEM==&quot;tty&quot;, MODE=&quot;0777&quot;, KERNELS==&quot;ttyUSB0&quot;
but it does not work, even after reboot (like nothing changed). I must admit though that I do not really understand udev.
How to do this?
Have you considered not trying to force ttyUSB0 but instead creating a symlink to whatever tty is assigned? Your software then just uses the symlink.
A problem with forcing a particular tty is what if you boot without the Arduino but another device is attached? You then need to convince the other device to skip ttyUSB0.
If you would consider a symlink then something like:
ACTION==&quot;add&quot;, KERNEL==&quot;ttyUSB*&quot;, ATTRS{idVendor}==&quot;1a86&quot;, ATTRS{idProduct}==&quot;7523&quot;, SYMLINK+=&quot;arduino&quot;

might get you started. Check the VID and PID using lsusb or similar. To set permissions as well you can use e.g. MODE=&quot;0777&quot; as you already have.
There is an example at https://wiki.debian.org/udev that might give more background.