3

I was using Arduino IDE on my Arch Linux laptop without problems, after some time /months I'm not able to upload the sketch because of permissions:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied

I can access and write to the device with minicom without problems, because permissions are good:

crw-rw-rw- 1 root uucp

My user is in the uucp group. But when I start sketch uploading, regarding to the dmesg, the usb device is being reconnected and in that moment I can see different permissions:

rw------- 1 root root

And after some time (seconds) permissions are back as they were. dmesg output here:

[  313.042695] usb 2-1.2: USB disconnect, device number 3
[  313.253085] usb 2-1.2: new full-speed USB device number 4 using ehci-pci
[  313.352387] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device
[  321.234517] usb 2-1.2: USB disconnect, device number 4
[  321.439445] usb 2-1.2: new full-speed USB device number 5 using ehci-pci
[  321.541392] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device
...

I've tried to solve that with several custom udev rules, but without success:

SUBSYSTEMS="usb", ATTRS{idVendor}== "2341", GROUP="uucp", MODE="0666"
KERNEL=="ttyACM[0-9]*", SYMLINK+="%k", GROUP="uucp", MODE="0666"

How to force group or mode from the first moment when appeared in the system? I hope this is not just a bug in the Arduino 1.8.3. Kernel version 4.11.9-1-ARCH.

EDIT #1:

I found that usb reconnection behavior occurs after exiting minicom too, but in case of avrdude this is problem because it is happening when program needs to access the device.

Screencast here

EDIT #2:

After some time I came back to this issue and I found I have problem just with ttyACM0 (Yun/Micro/etc. connected with microUSB cable) and ttyUSB0 (Uno connected with USB-B) is ok. But even this is interesting clue I can't figure it out.

I'm monitoring the rights on the tty devices:

watch -n 0.1 'ls -la /dev/ttyUSB* /dev/ttyACM*'
  • when uploading to ttyUSB0 just the date/time is changing and everything is working
  • when uploading to ttyACM0 device disappeared for a moment then a new one with wrong rights (and root:root) has been created, upload failed and then right are set properly by udev (with root:uucp) ... and then another one cycle (disappear-wrong-correct)

My user is in the lock and uucp groups, I've tried to add some udev rules or disable them but without success ...

I'm for 99% sure this is something before udev rule is touching it.

4
  • have you ever tried adding the changing permissions command on /etc/rc.local? this script is called at the end of the boot sequence. This script is executed with root permission so you should be able to chmod the ACM0 device Commented Jul 14, 2017 at 20:35
  • AFAIK there is no rc.local in ArchLinux but even this can't prevent avrdude from resetting port upon the upload.
    – dmnc
    Commented Jul 14, 2017 at 21:17
  • I'm not sure about it, but I think you can find somethin here wiki.archlinux.org/index.php/User:Herodotus/Rc-Local-Systemd Commented Jul 14, 2017 at 21:58
  • I know that there is still pending the avrdude, I'm going to take a look on that. Commented Jul 14, 2017 at 22:06

1 Answer 1

0

I had the same issue, I removed the tlp package and this problem is gone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .