Page 1 of 1

Can't open /dev/ttyACM0. I *am* member of dialout

PostPosted: Feb 19th, '15, 11:37
by DiBosco
I've got a weird thing where I can only open the virtual com port /dev/ttyACM0 as root.

I am a member of dialout and I can open /dev/ttyUSB0 - which is also a virtual com port - as a user.

Code: Select all
[robertw@desktop ~]$ll /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Feb 19 09:34 /dev/ttyUSB0
[robertw@desktop ~]$ ll /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Feb 19 08:36 /dev/ttyACM0


Code: Select all
[robertw@desktop ~]$ groups robertw
robertw : robertw dialout wireshark vboxusers



Can anyone think of a reason why this would be?

Thanks :)

Re: Can't open /dev/ttyACM0. I *am* member of dialout

PostPosted: Feb 23rd, '15, 21:51
by pete910
If its for the Arduino make sure you are a member of the "lock" group

Re: Can't open /dev/ttyACM0. I *am* member of dialout

PostPosted: Sep 2nd, '15, 16:00
by DiBosco
Anyone else any suggestions please? It's not arduino and being a member of lock made no difference.

Thanks!

Re: Can't open /dev/ttyACM0. I *am* member of dialout

PostPosted: Sep 2nd, '15, 20:02
by doktor5000
ACLs? Check
Code: Select all
getfacl /dev/ttyACM0
output.
Also, how exactly do you open that port, meaning with what program or command? And what's the error message?
Can you cat /dev/ttyACM0 ? Is there any lock file under /var/lock for any tty device?

And please show the output as root of
Code: Select all
journalctl -ab | grep -iE "ttyacm|ttyusb"


edit doktor5000: error message might even come from Arduino. There seem to be issues
when connected via hub or usb3.0, see http://forum.arduino.cc/index.php?topic=129647.0
Or it might be an issue with lockdev: https://bugs.archlinux.org/task/31586

Re: Can't open /dev/ttyACM0. I *am* member of dialout

PostPosted: Sep 2nd, '15, 20:27
by DiBosco
I'm using either a program I've written using Qt or Cutecom.

I just get the error message, cannot open port /dev/ttyACM0. Remember that if I run either program as root is works fine.

I don't think it's a lock issue for the reason above. I'm not using USB3. This isn't an Arduino board I must stress. :)

This problem did not exist going back to Mageia 3 and earlier days. As long as I was a member of dialout it was fine. 4 and 5 both have issues.

Code: Select all
getfacl /dev/ttyACM0
getfacl: Removing leading '/' from absolute path names
# file: dev/ttyACM0
# owner: root
# group: dialout
user::rw-
group::rw-
other::---



Code: Select all
journalctl -ab | grep -iE "ttyacm|ttyusb"
Sep 02 18:42:06 localhost kernel: cdc_acm 2-1.2.7.1:1.0: ttyACM0: USB ACM device
Sep 02 18:42:27 localhost ModemManager[1320]: <warn>  Could not grab port (tty/ttyACM0): 'Cannot add port 'tty/ttyACM0', unhandled serial type'
Sep 02 18:55:40 localhost ModemManager[1320]: <info>  (tty/ttyACM0): released by modem /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.7/2-1.2.7.1
Sep 02 18:55:44 localhost kernel: cdc_acm 2-1.2.7.1:1.0: ttyACM0: USB ACM device
Sep 02 18:56:23 localhost ModemManager[1320]: <warn>  Could not grab port (tty/ttyACM0): 'Cannot add port 'tty/ttyACM0', unhandled serial type



Code: Select all
ll /var/lock
lrwxrwxrwx 1 root root 11 Jul 16 17:48 /var/lock -> ../run/lock/

Re: Can't open /dev/ttyACM0. I *am* member of dialout

PostPosted: Sep 2nd, '15, 20:34
by doktor5000
Could still be a lock issue. If the device file is ok permission-wise, but the lockfile isn't, it would still work as root but not as user.
See the arch bugreport linked above which is also not about arduino. Can you show the output as root of
Code: Select all
find /run/lock -ls


Apart from that, any change if you disable modemmanager?
Code: Select all
systemctl stop ModemManager.service; systemctl mask ModemManager.service


You might need to run your application under strace
Code: Select all
strace -f -e open cutecom

if the program you usually run is "cutecom".
Maybe even
Code: Select all
strace -f -e file cutecom
if the former doesn't provide enough information :)