Using a HL-340 USB Serial Adapter against 2.6.23 linux kernel

This device is:

idVendor 0x4348
idProduct 0x5523

There is a patch in -mm kernel tree, so I guess it goes to 2.6.24 soon. But if you don’t want to wait, here is a solution using the new ch341 usb serial driver:


wget http://www.csie.ntu.edu.tw/~b94101/ch341_drv.tar.bz2

Then extract the files and comment out lines 301 and 303 of ch341.c file and also line 35 of the tty_ioctl.c file.

Finally run ins.sh to compile and load the modules and use minicom, cu, cutecom or what you prefer to connect to the /dev/ttyUSB0 device.

I’ve seen some people trying to use pl2303 driver with a little patch to use this device. It doesn’t work.

14 Comments

  1. Posted March 3, 2008 at 13:33 | Permalink

    That works! There are too much people spreading the pl2303 patch… and exactly, this didn’t work. This one works perfect!

    Thank you.

  2. axiohm
    Posted April 2, 2008 at 13:00 | Permalink

    i tried to install the package in Ubuntu 7.04 with 2.6.20 kernel version and it failed doing so.

    How can i install the driver to my Ubuntu box?

    Thanks!

  3. slyfox
    Posted May 22, 2008 at 03:45 | Permalink

    Indeed, linux supports ch341 now. Remember to put pl2303 in /etc/modprobe.d/blacklist to prevent the kernel from using it as the converter.
    The correct converter should be ch341-uart.

  4. Kanwar
    Posted October 14, 2008 at 03:22 | Permalink

    I have this version of linux

    Linux version 2.6.24-19-generic (buildd@terranova) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Wed Aug 20 22:56:21 UTC 2008

    I tried the first post steps for my HL-340 USB to Serial Converter. All the data I receive is garbage.I did not install any patch for 2.6.24. Where to find this patch?
    I have set the 115200 baud rate from the GTK terminal.Here is my terminal dump.

    root@kanwar-laptop:/home/kanwar/Desktop/ch341_drv# /bin/sh ins.sh
    make -C /lib/modules/2.6.24-19-generic/build SUBDIRS=/home/kanwar/Desktop/ch341_drv modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.24-19-generic’
    Building modules, stage 2.
    MODPOST 2 modules
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-generic’
    insmod: error inserting ‘tty_ioctl.ko’: -1 Invalid module format
    insmod: error inserting ‘ch341.ko’: -1 File exists

    I also tried to add a line
    blacklist pl2303 in blacklist file.Still the same.

    Any help will be appreciated. I am new to linux and i have just started to play with it.

    Thanks.

  5. Stream
    Posted October 15, 2008 at 02:21 | Permalink

    Rebooting the system will fix this issue.

  6. Posted October 29, 2008 at 14:10 | Permalink

    okkkkkkkkkkkkkkkkkkkkkkkkkkkkk

  7. Desperate
    Posted February 3, 2009 at 11:24 | Permalink

    Is there any chance of putting HL-340 with this vendor id and product id, working in MAC OS X?

  8. Pablo
    Posted January 5, 2010 at 10:17 | Permalink

    Thanks for the post, bur i’ve tried to follow your step, and i get this message when i run the ins.sh file:

    make[2]: *** [/home/X/ch341_drv/ch341.o] Error 1
    make[1]: *** [_module_/home/X/ch341_drv] Error 2
    make[1]: se sale del directorio `/usr/src/linux-headers-2.6.31-16-generic’
    make: *** [default] Error 2
    insmod: can’t read ‘tty_ioctl.ko’: No such file or directory
    insmod: can’t read ‘ch341.ko’: No such file or directory

    Whats am i doing wrong?

    Thanks for the help.

  9. matt
    Posted February 16, 2010 at 12:35 | Permalink

    Hi do you know what the next setp is to get a serial wacom working on this dongle?
    I’m a bit stuck…
    Many thanks.

  10. Posted September 13, 2010 at 06:08 | Permalink

    Thanks for the post! 64bit OpenSuse 11.1, Kernel 2.26.27.48-0.2-default also recognizew the adapter. When a second adapter is plugged in, it is enumerated as /dev/ttyUSB1.

    /Wo

  11. ruud berry
    Posted September 26, 2013 at 04:03 | Permalink

    It din’t work here 😉

    root@ruudberry:/ch341_drv# ./ins.sh
    make -C /lib/modules/3.6.11+/build SUBDIRS=/ch341_drv modules
    make: *** /lib/modules/3.6.11+/build: No such file or directory. Stop.
    make: *** [default] Error 2
    Error: could not load module tty_ioctl.ko: No such file or directory
    Error: could not load module ch341.ko: No such file or directory

    Maybe someone can help me out..

  12. Posted July 11, 2014 at 07:45 | Permalink

    Reblogged this on The Embedded Code and commented:
    I bought these Arduino Nano clones from Aliexpress and it turns out they might not work on the Rpi. This post seems to have an answer. I wanted to bookmark the solution but I am sharing it here instead.

  13. Posted September 5, 2014 at 14:13 | Permalink

    While there are a number of merchants that work straight with affiliates , most web marketers shall
    make almost all their revenue utilizing a network nearly.

  14. Posted October 2, 2014 at 07:46 | Permalink

    Pretty section of content. I just stumbled upon your web
    site and in accession capital to assert that I get actually enjoyed account your blog posts.

    Anyway I’ll be subscribing to your feeds and even I achievement you access consistently fast.

2 Trackbacks

  1. […] 驅動程式 HL-340 […]

  2. […] and mounted as /dev/ttyUSB0. A second one appears as /dev/ttyUSB1. More on this may be found there. Possibly related posts: (automatically generated)ASK Cable Modem Windows USB DriverGetting a […]