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

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

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

Postby DiBosco » Feb 19th, '15, 11:37

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 :)
DiBosco
 
Posts: 331
Joined: Aug 31st, '11, 10:22

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

Postby pete910 » Feb 23rd, '15, 21:51

If its for the Arduino make sure you are a member of the "lock" group
User avatar
pete910
 
Posts: 357
Joined: Jan 8th, '12, 18:53

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

Postby DiBosco » Sep 2nd, '15, 16:00

Anyone else any suggestions please? It's not arduino and being a member of lock made no difference.

Thanks!
DiBosco
 
Posts: 331
Joined: Aug 31st, '11, 10:22

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

Postby doktor5000 » Sep 2nd, '15, 20:02

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
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

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

Postby DiBosco » Sep 2nd, '15, 20:27

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/
DiBosco
 
Posts: 331
Joined: Aug 31st, '11, 10:22

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

Postby doktor5000 » Sep 2nd, '15, 20:34

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 :)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest