SOLUTION - Cannot upload after upgrading to Linux Mint 21

Yesterday I upgraded my laptop to Linux Mint21 and today I couldn’t upload code to my Uno (or other) boards from PlatformIO and from the Arduino IDE. I did all of the following:

  • Updated my udev rules and restarted udev.
  • Checked I was still in upload and dialout groups.
  • Added upload_port to platformio.ini.

To no avail. Plugging in my Uno normally gives am a /dev/ttyUSB0 device file, but on Mint 21, this was not the case.

Running dmesg --follow I got this:

[  833.816734] usb 3-2.3.4: new full-speed USB device number 9 using xhci_hcd
[  833.942762] usb 3-2.3.4: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
[  833.942771] usb 3-2.3.4: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[  833.942774] usb 3-2.3.4: Product: USB2.0-Serial
[  833.951868] ch341 3-2.3.4:1.0: ch341-uart converter detected
[  833.952865] usb 3-2.3.4: ch341-uart converter now attached to ttyUSB0
[  834.477846] input: BRLTTY 6.4 Linux Screen Driver Keyboard as /devices/virtual/input/input30
[  834.598088] usb 3-2.3.4: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
[  834.598667] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[  834.598681] ch341 3-2.3.4:1.0: device disconnected
[  945.437544] usb 3-2.3.4: USB disconnect, device number 9

Which gives the information that my board was connecvted to /dev/ttyUSB0 but then disconnected. Hmmm. The culprit is this:

[  834.477846] input: BRLTTY 6.4 Linux Screen Driver Keyboard as /devices/virtual/input/input30
[  834.598088] usb 3-2.3.4: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1

Something called brltty is claiming my Uno’s interface. (Or something like that!) So, a quick hunt and it turns out that Linux Mint 21 installs brltty which is a braille terminal for visually impared people. As I’m not yet visually impaired, I only need reading glasses (so far!) I can remove it:

sudo apt remove brltty

Now dmesg gives me this:

[  955.157650] usb 3-2.3.4: new full-speed USB device number 10 using xhci_hcd
[  955.283692] usb 3-2.3.4: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
[  955.283701] usb 3-2.3.4: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[  955.283704] usb 3-2.3.4: Product: USB2.0-Serial
[  955.292350] ch341 3-2.3.4:1.0: ch341-uart converter detected
[  955.293220] usb 3-2.3.4: ch341-uart converter now attached to ttyUSB0

And no disconnect.

PlatformIO and the Arduino IDE can both now see /dev/ttyUSB0 as an available port.

HTH

Cheers,
Norm.

Yes that worked for me.
Arduino clone ch341 ch340
Driving me mad.
Shame its a driver for blind peoples braille machines that causing problem!

1 Like