arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.18k stars 7.01k forks source link

Linux Sketch serial port permission erroneous error #8376

Closed rvsjimbo closed 5 years ago

rvsjimbo commented 5 years ago

Arduino IDE for Linux V1.8.8 running on Linux Mint 19.1.

Plugged the Arduino in and it comes up on /dev/ttyACM0 in group dialout. Added myself to group dialout, and cat /etc/hosts >/dev/ttyACM0 runs without error, therefore I have write access to the port.

Uploading using the Arduino IDE generates the following error (which is obviously incorrect):

avrdude: Version 6.3-20171130 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "/home/paul/Downloads/arduino-1.8.8/hardware/tools/avr/etc/avrdude.conf"
     User configuration file is "/home/paul/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/ttyACM0
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200

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

avrdude done. Thank you.

Now, whilst there may be an error somewhere, permissions are definitely not the problem.

Best Regards,

Paul.

facchinm commented 5 years ago

Hi @rvsjimbo , did you logout after adding to the dialout group? Probably the echo was working because you where in the same shell, otherwise for the setting to be applied system-wide you need to login again (or simply reboot)

rvsjimbo commented 5 years ago

Hi,

Thanks for the quick response!

Yes, did log out and back again. Did not seem to make any difference. I also ran the Linux id command to verify that I was in the dialout group, and as you can see from the output below, I am :-)

uid=1000(paul) gid=1000(paul) groups=1000(paul),4(adm),20(dialout),24(cdrom),27(sudo),30(dip),46(plugdev),112(lpadmin),128(sambashare)

The only thing I have not done (and did think about this morning) is to reboot the computer. I might get a chance to do that over lunch. (we're in UTC-6 right now). Worst case, I should get to try that this evening sometime.

Best Regards,

Paul.

facchinm commented 5 years ago

Mmmmh, that's funny. The other thing that might be interfering is modemmanager, which you can safely uninstall if you don't use a 56k modem, since it tries to access any virtual serial port to check if it's a modem.

matthijskooijman commented 5 years ago

I have indeed also seen permission denied errors, though they usually only appear within the first few seconds of plugging in a board (and I suspect they are indeed related to modemmanager). Note btw that modemmanager is mostly used for "dialing" with USB 3G modems (and possibly also for tethering to phones over bluetooth or USB). I'm not even sure it can do old skool 56k dialup at all :-)

Uninstalling modemmanager is certainly the easiest way to fix issues it causes. Adding rules to udev to make modemmanager ignore Arduino devices can work if you want to keep modemmanager around.

Still, none of this is necessarily related to modemmanager. But uninstalling it might be a good way to see if it is responsible (I'm not sure stopping it would be enough, could be it runs on udev hotplug...).

rvsjimbo commented 5 years ago

Thats it! The rebels are there!

Yup, modemmanager was the problem. Removing it fixed everything - thanks very much both of you for helping :-)

Paul.