How to solve the problem with CH341 USB/RS-232 adapter?

Hi there!

First step:

root@OpenWrt:~# opkg update && opkg install usbutils
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/targets/ar71xx/generic/packages/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/targets/ar71xx/generic/packages/Packages.sig Signature check passed.
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/base/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/base/Packages.sig Signature check passed.
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/luci/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/luci/Packages.sig Signature check passed.
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/packages/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/packages/Packages.sig Signature check passed.
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/routing/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/routing/Packages.sig Signature check passed.
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/telephony/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/telephony/Packages.sig Signature check passed.
Installing usbutils (007-7) to root...
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/base/usbutils_007-7_mips_24kc.ipk Installing librt (1.1.19-1) to root...
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/targets/ar71xx/generic/packages/librt_1.1.19-1_mips_24kc.ipk Installing libusb-1.0 (1.0.22-1) to root...
Downloading hxxp://downloads.openwrt.org/releases/18.06.0/packages/mips_24kc/base/libusb-1.0_1.0.22-1_mips_24kc.ipk Configuring librt.
Configuring libusb-1.0.
Configuring usbutils.

Next step is: "opkg install kmod-usb-serial-ch341"

...but it does not work. /dev/ttyUSB0 is available, but it does not work with ANY terminal software. Settings are OK: 9600b, 8n1, no flow control. I want to control the open boot prompt (OPB) of an old Sun SPARC machine.

But the terminal software (every one) has problems, the cursor moves on several lines and positions, when i try to quit the terminal i get some weird characters on it.

kmod-usb-serial-ch341 and it's dependencies was installed successfully too...

maybe i need to compile my own kernel module with "ch341.c" or something like that, there seems to be no workaround for that problem.

Does somebody know more about that issue?

Kernel messages:

[ 1318.205853] usb 1-1.2: USB disconnect, device number 3
[ 1318.267830] usb 1-1.2: ch341_read_int_callback - usb_submit_urb failed: -19
[ 1318.351850] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 1318.442565] ch341 1-1.2:1.0: device disconnected
[ 2317.922108] usb 1-1.1: new full-speed USB device number 4 using ehci-platform
[ 2318.154669] ch341 1-1.1:1.0: ch341-uart converter detected
[ 2318.242631] usb 1-1.1: ch341-uart converter now attached to ttyUSB0
[ 3211.838309] usb 1-1.1: USB disconnect, device number 4
[ 3211.900116] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 3211.990849] ch341 1-1.1:1.0: device disconnected
[ 3218.274367] usb 1-1.1: new high-speed USB device number 5 using ehci-platform
[ 3225.193918] usb 1-1.2: new full-speed USB device number 6 using ehci-platform
[ 3225.426458] ch341 1-1.2:1.0: ch341-uart converter detected
[ 3225.514616] usb 1-1.2: ch341-uart converter now attached to ttyUSB0
[ 3592.915446] ch341-uart ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
[ 3593.012576] ch341-uart ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
[ 3593.110928] usb 1-1.2: USB disconnect, device number 6
[ 3593.172635] usb 1-1.2: ch341_read_int_callback - usb_submit_urb failed: -19
[ 3593.256428] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 3593.347093] ch341 1-1.2:1.0: device disconnected
[ 3601.214305] usb 1-1.1: USB disconnect, device number 5
[ 3604.326772] usb 1-1.1: new full-speed USB device number 7 using ehci-platform
[ 3604.559237] ch341 1-1.1:1.0: ch341-uart converter detected
[ 3604.647113] usb 1-1.1: ch341-uart converter now attached to ttyUSB0

Thank you for your feedbacks!

With best regards,
Jan

Sounds like a driver issue. Could try removing all USB1 drivers and use only USB2. ¯_(ツ)_/¯

USB 1.x drivers are not installed so it seems. But the 2.0 ones are, as a dependency of the ch341 package.

BusyBox v1.28.3 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 18.06.1, r7258-5eb055306f
 -----------------------------------------------------
root@OpenWrt:~# opkg remove kmod-usb-uhci
No packages removed.
root@OpenWrt:~# opkg remove kmod-usb-ohci
No packages removed.
root@OpenWrt:~#

With best regards,
Jan

The ch341 rs232 controller is not the only one with that problem: https://bugs.openwrt.org/index.php?do=details&task_id=160

Regards,
Jan

P.S.: Is it possible to send private messages to members or admins? Can't see any option. (And i can't post more than 3 threads to ask that question in the first 24 hours so it seems..)
Regards,
Jan

Yes, click on the icon for the member

Maybe the only solution is that, right?

...or to try it with another USB/RS-232 adapter, e.g. from FTDI. Has somebody experiences with the FTDI ones?

Regards,
Jan

I'd get your opkg problems straightened out first :wink:

1 Like

Yes, they work very well, as long as the chip is genuine.

I use a cp2102. It works well for me.

The CH341 chip operates in two modes based on hardware selection by setting the level on one of the pins. The CH341 adapters sold for programming SPI flash chips will be set for the mode that does not offer an async port.

All of my adapters are PL2303. That chip has excellent Linux compatibility.

Thank you for your feedbacks!!

It works on Windows, without any problems. So it's not a question of the mode.

With best regards,
Jan

FTDI works great, beware of fakes however
Prolific PL2303 also works fine, avoid the HX/HXD series (known fakes)
CP210* is probably your safest bet if you want something cheap.

OK, thanx.

I've bought it in a swiss online shop, no ebay or alibada or similiar. so not a problem i think.

Best regards,
Jan

FTDI seems to work with picocom, but not with minicom. Thank, now can i start my old Sun Ultra 45 over my router, hehe!

P.S.: Can i define a signature somewhere?

Best regards,
Jan

You might want to checkout tio (in ports) =)

thx, will try it!

Regards,
Jan