Go Down

Topic: The Linux ttyACM0 drama - more details after a lot of experimenting (Read 122221 times) previous topic - next topic


I have looked and looked at this ttyACM0 thing with linux and tried just about every fix on the net :smiley-eek:

I also have a Decimilia and Duemilanove running other projects, both of which work out of the box on the same system and default appropriately to /dev/ttyUSB0 - no issues.

This is what happens on my xubuntu 12.04 system and UNO compatible - Freetronics Eleven.

First - permissions set as recommended for groups and files.

Next - Uno is selected as the board, and when it appears (not grayed out), serial port /dev/ttyACM0.

From the beginning;

Connect board to USB

Code: [Select]
[ 1562.488131] usb 3-1: USB disconnect, device number 6
[ 1570.049707] usb 3-1: new full-speed USB device number 7 using xhci_hcd
[ 1570.121549] usb 3-1: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 1570.124259] cdc_acm 3-1:1.0: ttyACM0: USB ACM device

Open IDE (1.0 ubuntu installed or 1.0.1 in user folder)

Serial port /dev/ttyACM0 with a tick

But this is where the trouble starts;

Select File (or File > Sketchbook > 'your favorite sketch')

Serial port grayed out; and this

Code: [Select]
[ 1611.679418] xhci_hcd 0000:0c:00.0: ERROR no room on ep ring
[ 1611.679423] cdc_acm 3-1:1.1: acm_submit_read_urb - usb_submit_urb failed: -12
[ 1611.679426] tty_port_close_start: tty->count = 1 port count = 0.
[ 1615.390878] xhci_hcd 0000:0c:00.0: ERROR no room on ep ring
[ 1615.390893] cdc_acm 3-1:1.1: acm_submit_read_urb - usb_submit_urb failed: -12
[ 1615.390903] tty_port_close_start: tty->count = 1 port count = 0.

Now disconnect USB and reconnect;

Serial port /dev/ttyACM0 with a tick. Compile and upload OK, except for

Code: [Select]
avrdude: ser_open(): can't open device
"/dev/tty/ACM0" : Input/output error
ioctl("TIOCMET") : Invalid argument

Sometimes the error above doesn't show

Now try selecting the Serial Monitor (bunch of Java errors). Serial port '/dev/tty/ACM0' not found (of course). dmesg output same as previous failure.

This behaviour occurs when connecting and opening the IDE the first time. Second time around is unpredictable as to whether you even get to upload the script.

As I see it, any attempt to use the IDE causes ttyACM0 to become unavailable. I guess, if I understand dmesg output correctly, writing to the device fails, I think?

Reading further, Kernel 3.4 (version from memory) should fix this. Apparently, it's a bug in 3.2, however, some people have found a fix. Interestingly, there is not a lot of consistency to each one.

I have tried a lot of fixes on the net to no avail, except at one point I had it running smoothly. Then looked the other way and sneezed - and of course it broke. Reapplying the previous 'fix' did not fix it.

Hope there's enough here to help, but I guess it's old news anyhow.


I notice linux is using xhci - are you on a USB3 port? If your computer has any USB2-only ports try using those instead. A few of us have had trouble with USB3 ports on linux. I've upgraded to Kubuntu 12.10 and just checked my Uno on a USB3 port and it seems to be working again.

Please post the output of running "sudo lsusb -v"


I use Uno on 12.04, with ttyACM0, and it works ok. But my laptop as only USB2 ports.
-tu savais que si tu passe le CD de windows à l'envers, tu entends une chanson satanique ?
-non, mais il y a pire : à l'endroit, ça l'installe !


Oct 29, 2012, 11:33 am Last Edit: Oct 29, 2012, 11:37 am by geoland Reason: 1
I have 1 USB2 port and it works without a hitch. I guess I was looking to fix the USB3 thing. Will have to wait for the new kernel? Will have to find a new spot for the mouse  :smiley-eek:

Code: [Select]
[10998.175212] 3-1: USB disconnect, device number 18
[11013.463158] usb 2-1.2: new full-speed USB device number 10 using ehci_hcd
[11013.557924] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device

sudo lsusb -v attached as a .txt file. Too many characters.


The lsusb output looks fine (although being a clone board it uses different vid and pid numbers to a regular Arduino, so if you install any udev rules you might need to change the numbers)

It looks like the problem is the kernel USB3 driver. All you can do is wait for an updated kernel to be released, or there might be a PPA you can install a newer kernel from. It's probably better to ask on the xubuntu forums about that, they will probably know more.


Thanks. That's the conclusion I came to. I'll wait for 3.4 which is not too far away. Annoying more than any other issue. :~


Or get a USB 2.0 hub (preferably powered) and plug that into your single USB 2.0 port, and plug the other devices into the hub.


Did I see somewhere that this could be fixed with a USB 2 hub on the USB 3 port?


My own Uno (original R1) doesn't work through a hub in Linux. It has to be connected to a port on the computer. I don't know if this is fixed in later versions of the board.

The new Arduino Due works fine through a hub in Linux (on both ports).


Yeah! Moving from USB3 to USB2 fixed the problem to me, too!
Thanks for pointing it out!


the hub did not fix the problem for me. but running avrdude as root worked. After that I realize that adding permissions to ttyACM0 for everybody also works. I just executed
sudo chmod 777 /dev/ttyACM0

and after that I could compile and upload the code to the arduino
The only issue with this is that I have to run that line everytime I connect the Arduino to the USB because ttyACM0 is recreated


Oct 20, 2013, 11:36 am Last Edit: Oct 20, 2013, 11:49 am by derick Reason: 1
The solution here is that you need to run the IDE as a superuser:
sudo ./arduino
to gain the necessary permissions to the serial interface.



If you must run the IDE as root, you probably do not have the correct group assigned to your user. The Ubuntu install does not (did not on my install) add dialout group to your user. If you add dialout group to your user, log out, then log in again, you should have access to the  Arduino serial.
Code: [Select]
sudo usermod -a -G dialout yourUserName
Here is another thread on this:
That user needed to add tty group to the user also. On Ubuntu, I needed to add dialout only.


I know this post comes very late to the discussion, but I've spent days debugging problems with /dev/ttyACM0 under Linux (Ubuntu).  I updated my BIOS, tried different kernels, and of course I'd double checked that my user account had read/write access to the device (because it was in the dialout group).

The issue for me was modemmanager.  On my laptop, modemmanager was grabbing the /dev/ttyACM0 somehow and causing contention.  I got "device or resource busy" messages; I got timeouts.  I just got weird behavior in general, and almost always attempts to program failed.

Because it was so hard to find, I'm coming back here to update this thread, which was fairly prominent when I tried to hunt down the issue.  For me the fix was:

$ sudo apt-get --purge remove modemmanager

After that, things work as they should.

On another laptop, modemmanager almost never caused a problem.  Perhaps one in 25 times I had an issue.  But on the laptop I use from day to day it was more like 99 out of 100 times it failed.

Go Up