Hi,
I need to connect to an Arduino board using Arduino IDE. When I plug in the board, it is recognised and a /dev/ttyACM0 is created and available in the Tools menu of the IDE. However whenever I tried to upload a sketch it give the following error:
avrdude: ser_open(): can't open device "/dev/ttyACM0": Input/output error
I have search on the web and tried the following solution but without success:
Add the user to ‘dialout’ group.
Change the permission of /dev/ttyACM0 to 666.
Disable/Stop ModemManager service.
There was a discussion in one Arch based forum about kernel issues. So I booted into my Kubuntu installation that runs kernel 5.8 and ran the same sketch and it works without any problem. So I tested again with another distro - Garuda Linux (Arch based) also worked without any problem. This was running kernel 5.11.17. So the I deduced that the problem could be just the Tumbleweed kernel.
Then I checked for kernel messages and found this:
Okay, not sure if it helps but I connected a board, did run Arduino 1.8.9 and uploaded a sketch successfully and below I what I see:
When I connect the board dmesg shows:
[20270.041272] usb 2-3: New USB device found, idVendor=239a, idProduct=800b, bcdDevice= 1.00
[20270.041277] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[20270.041279] usb 2-3: Product: Feather M0
[20270.041280] usb 2-3: Manufacturer: Adafruit
[20270.041282] usb 2-3: SerialNumber: 530C7DD4514D503259202020FF181733
[20270.055549] cdc_acm 2-3:1.0: ttyACM0: USB ACM device
[20270.056246] usbcore: registered new interface driver cdc_acm
[20270.056249] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Checking things:
$ ls -als /dev/ttyACM0
0 crw-rw---- 1 root dialout 166, 0 May 5 13:27 **/dev/ttyACM0**
$ groups
users docker wireshark dialout
Once I uploaded the sketch I see in dmesg that the board disconnects and connects again.
[20414.304328] usb 2-3: USB disconnect, device number 11
[20415.077516] usb 2-3: new full-speed USB device number 12 using xhci_hcd
[20415.226116] usb 2-3: New USB device found, idVendor=239a, idProduct=000b, bcdDevice= 2.00
[20415.226122] usb 2-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[20415.227773] cdc_acm 2-3:1.0: ttyACM0: USB ACM device
[20417.696988] usb 2-3: USB disconnect, device number 12
[20418.481531] usb 2-3: new full-speed USB device number 13 using xhci_hcd
[20418.636490] usb 2-3: New USB device found, idVendor=239a, idProduct=800b, bcdDevice= 1.00
[20418.636508] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[20418.636515] usb 2-3: Product: Feather M0
[20418.636520] usb 2-3: Manufacturer: Adafruit
[20418.636525] usb 2-3: SerialNumber: 530C7DD4514D503259202020FF181733
[20418.641195] cdc_acm 2-3:1.0: ttyACM0: USB ACM device
This is what I get in ‘dmesg -w’ when I plugin the board and then try to connect serial monitor from Arduino IDE…
[55305.245690] usb 3-1.1.3: new full-speed USB device number 30 using xhci_hcd
[55305.497743] usb 3-1.1.3: New USB device found, idVendor=2341, idProduct=0043, bcdDevice= 0.01
[55305.497749] usb 3-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[55305.497750] usb 3-1.1.3: Manufacturer: Arduino (www.arduino.cc)
[55305.497752] usb 3-1.1.3: SerialNumber: 757353230303518001E1
[55305.537975] cdc_acm 3-1.1.3:1.0: ttyACM0: USB ACM device
[55317.312996] cdc_acm 3-1.1.3:1.0: acm_port_activate - usb_submit_urb(ctrl irq) failed <<== Me trying to connect the serial monitor
[55333.912743] cdc_acm 3-1.1.3:1.0: acm_port_activate - usb_submit_urb(ctrl irq) failed <<== Me trying to connect the serial monitor
So you do not see the two lines after “ttyACM0: USB ACM device” that I see:
[20270.056246] usbcore: registered new interface driver cdc_acm
[20270.056249] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
If so, that might be the reason your are running into a problem.
Also to double check: the rights on /dev/ttyACM0 are matching and you are member of the dailout group?
Bus 004 Device 002: ID 05e3:0620 Genesys Logic, Inc. USB3.2 Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 048d:c100 Integrated Technology Express, Inc. ITE Device(8910)
Bus 003 Device 003: ID 8087:0029 Intel Corp. AX200 Bluetooth
Bus 003 Device 006: ID 24ae:1813 Shenzhen Rapoo Technology Co., Ltd. E9260 Wireless Multi-mode Keyboard
Bus 003 Device 007: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 003 Device 009: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
Bus 003 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 048d:c955 Integrated Technology Express, Inc. ITE Device(8295)
Bus 001 Device 002: ID 13d3:56ff IMC Networks Integrated Camera
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I am running kernel 5.12.0-2-default at the moment. If I recall correctly, kernel 5.11.15 also had this problem. So I am wondering if this is only my setup???
[FONT=arial]Thanks for helping me out here. I was hoping that this could be solved with a work around but looks like I need to wait for the next kernel version to be released.
Anyway at the moment I am running Arduino IDE on a Ubuntu 18.04 on VBox. Funny thing this setup works! I just have to tick the Arduino’s USB connect in VBox and Ubuntu picks it up.
The bug page says “So the problem was introduced between 5.11.11 and 5.11.12”.
What kernel version is Ubuntu running? I guess it is an older version.
Your usb-device command output shows some differences with mine but I am no USB expert so I think it is better to wait for 5.13 or you can try an older kernel.
How do I go back to an older kernel with Tumbleweed? Because every new kernel will cause previous to previous kernel uninstalled. Is there a way to keep a specific kernel permenantly?