'Why would ch341-uart is disconnected from ttyUSB?

Here's the deal, I want to flash my stm32 board with my USB serial port. And my stm32 board comes with an extended board which carries CH340.

When I connected the board to my computer, I can see the device with the command lsusb, and the output is Bus 001 Device 039: ID 1a86:7523 QinHeng Electronics CH340 serial converter.

But I can't find the ttyUSB file under /dev path.

And then I ran dmesg | grep tty, here is the output:

[1182096.667353] usb 1-9: ch341-uart converter now attached to ttyUSB0
[1182096.729868] audit: type=1130 audit(1637925474.011:3648): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=brltty-device@sys-devices-pci0000:00-0000:00:14.0-usb1-1\x2d9 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[1182096.800144] audit: type=1130 audit(1637925474.081:3649): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=brltty@-sys-devices-pci0000:00-0000:00:14.0-usb1-1\x2d9 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[1182096.803145] usb 1-9: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
[1182096.803731] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0

Does anyone know what's the problem here? Thanks.



Solution 1:[1]

Well, I just found a post in forum.manjaro.org, here's the link: https://forum.manjaro.org/t/cant-connect-serial-port-error-ch341-uart-disconnected-from-ttyusb0/87208

It seems for arch/manjaro system(not sure if suitable for other distros), you need to remove some udev rules.

sudo mv /usr/lib/udev/rules.d/90-brltty-device.rules /usr/lib/udev/rules.d/90-brltty-device.rules.disabled
sudo mv /usr/lib/udev/rules.d/90-brltty-uinput.rules /usr/lib/udev/rules.d/90-brltty-uinput.rules.disabled
sudo udevadm control --reload-rules

I don't know why, but I did it. And it worked. Now I can find my ttyUSB0 device file.

Solution 2:[2]

I'm using ubuntu 22.04, and sudo apt remove brltty worked for me.

Solution 3:[3]

So, there is a braille ereader that uses this same serial converter, and the udev rules configure the chip for that device. You actually don't need to remove the udev rules files completely, you can simply disable/comment out the rule for the single device. It is this one:

# Device: 1A86:7523
# Baum [NLS eReader Zoomax (20 cells)]
ENV{PRODUCT}=="1a86/7523/*", ENV{BRLTTY_BRAILLE_DRIVER}="bm", GOTO="brltty_usb_run"

Comment the line starting with ENV.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 LunarEclipse
Solution 2 intlsy
Solution 3 user1671163