6

I have a home-made device and I wrote a program for data acquisition from it. But each time I plug-in the device I have to change the permissions for /dev/ttyACM0, so that the port can be used for data transfer. How can I make this device to have read/write permissions by default. The lsusb output for this device is:

Bus 003 Device 005: ID ffff:0005

2 Answers2

5

If you are a member of the dialout group you can access serial devices, including ttySx, ttyUSBx, and ttyACMx devices, without changing permissions.

$ sudo adduser myusername dialout

Alternatively, you could create a udev rule to set the permissions as the device is attached. See https://askubuntu.com/a/112573/471836

1

I will add an answer to my own question for anyone that will need this in the future. I followed an answer from @Adam Lussier and have created /etc/udev/rules.d/50-ttyusb.rules file with this content (proposed by @Sneetsher):

ACTION=="add", KERNEL=="ttyACM[0-9]*", ATTRS{idVendor}=="ffff", ATTRS{idProduct}=="0005", MODE="0666"

Like this only this specific device is given the read/write permissions. Reference for anyone wanting to know more about writing rules file.