Updated Ubunto (Linux) to 21.04, avrdude: ser_open(): can't open device "/dev/ttyACM0": Input/output error


I just upgraded to Ubuntu 21.04 and now can no longer program my Arduino. Arduino uses a virtual serial port over USB. When I plug in my Arduino, a new serial port shows up (/dev/ttyACM0) and dmesg reports:

[61239.444141] usb 1-4: new full-speed USB device number 32 using xhci_hcd
[61239.595108] usb 1-4: New USB device found, idVendor=2341, idProduct=0043, bcdDevice= 0.01
[61239.595123] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[61239.595130] usb 1-4: Manufacturer: Arduino (www.arduino.cc)
[61239.595134] usb 1-4: SerialNumber: 75833353035351E011E0
[61239.598686] cdc_acm 1-4:1.0: ttyACM0: USB ACM device

So far this is the proper operation. However when I try to upload a new program to my Arduino I get the following error in the Arduino IDE:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Input/output error

The only relevant line in /var/log/syslog seems to be:

kernel: [61936.113737] cdc_acm 1-4:1.0: acm_port_activate - usb_submit_urb(ctrl irq) failed

This worked fine before the upgrade to 21.04. A second computer also upgraded to 21.04 exhibits the same failure mode. A third computer running 20.10 with the same Arduino hardware and software works fine.

I am in the dialout group to have correct access permissions. As I said, this was working fine before the upgrade.

Any ideas, besides going back to 20.10?

You need to join the dial out group. Here is how I do it.
sudo usermod -a -G tty yourUserName
sudo usermod -a -G dialout yourUserName
Log off and log on again for the changes to take effect.

sudo usermod -a -G dialout $USER

OP is already a member of the dialout group :wink:

I would also expect that to result in a Permission denied error, not in a Input/Output error; but one never knows.

@sterretje is quite correct; @gilshultz and @pi_okl I appreciate your attempt to answer but as you can see I addressed this in my original post

Try a search for acm_port_activate - usb_submit_urb(ctrl irq) failed.

I did not go through the results but it looks like there is a bug. Note that ubuntuforums might be a better place to ask :wink: But please keep us updated when you find a solution.

I will study search results. I agree it might be a bug but wanted first to rule out operator error (me!). I have also submitted this same question to ubuntuforums, no answer there yet. Thanks @sterretje for your research and suggestions.

Another update: I installed Ubuntu 21.04 from scratch on one of my laptops, and the problem went away for a couple of weeks. However today it has reappeared (perhaps, it has a different error message):

SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Port not found.

I have done some apt upgrades and haven't paid attention to what was upgraded (I know, I should) and did not test Arduino after every one, so I can't be sure that any of them caused this problem.

This time it's more urgent because I am away from home and have no other computer and I have obligations that require the ability to program my Arduino, so I particularly would welcome suggestions at this stage.

In which case I would go back to an Ubuntu version (20.10 or whatever you had before); possibly liveCD/liveUSB might also work.

Possible alternatives:

  1. Downgrade the kernel; not sure if that is possible and if it will help.
  2. You did not state which Arduino. If they use native USB, they use ttyACMx and you have a problem. Those with 8U2/16U2 also use ttyACMx but you might be able to replace them with a clone with CH340 or FTDI TTL-to-USB converter which use ttyUSBx and might not suffer from the same problem.

My bad for leaving out that information. Problem is evident with Arduino Uno and Arduino MKR WiFi 1010. I do have other boards with me but none with CH340 devices (I should have brought a RedBoard) nor an FTDI device.

I downgraded to kernel 5.8.11 and it works, so it seems the error was introduced somewhere between 5.8.11 and 5.11.11. I will try to narrow it down further.

1 Like

My RedBoard has a FTDI232 :smiley: