LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-13-2018, 11:58 AM   #1
hal8000b
Member
 
Registered: Mar 2001
Location: UK
Distribution: Mint, Arch, Debian7
Posts: 194

Rep: Reputation: 23
QinHeng HL-340 USB-Serial Adapter kernel 4.4 and Module ch341 [SOLVED]


I have a QinHeng USB-Serial adapter using the HL340 Chipset.

lsusb:
Bus 002 Device 005: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter

Distro is Linux Mint 17.3 kernel:
uname -a
Linux orac 4.4.0-135-lowlatency #161~14.04.1-Ubuntu SMP PREEMPT Tue Aug 28 14:17:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

This adapter works perfectly on same computer with Debian 8 (kernel 3.16) and Arch Linux kernel 4.15 but not with Linux Mint and my 4.4.0 kernel


Device is enumerated as /dev/ttyUSB0
ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Oct 13 17:28 /dev/ttyUSB0

I am a member of group dialout and current testing with a jumper wire
connected between pins 2 and 3 of the serial connector.

I am testing with minicom:
minicom -D /dev/ttyUSB0

From minicom options , HW and SW flow control set to NO , returning to minicom any characters typed should be echoed on the screen (works in Arch and DEbian, but not Mint).

There are many posts about this . I have tried to compile the ch34x module:
https://github.com/SkyRocknRoll/CH341SER_LINUX


The source code for my kernel is installed and module compiles and installs but still the adapter refuses to transmit and receive characters.

Is there any other ch341 patch for a 4.4 kernel?

I'm currently working with Mint, but can revert to Debian, if this cant be fixed.

Thanks in advance.

Last edited by hal8000b; 10-14-2018 at 06:19 AM.
 
Old 10-13-2018, 12:44 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,366

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Just pumping that usb id (1a86:7523) along with the word 'module' produced hits from ubuntuforums, stackexchange, this site and many other places.

I suggest you verify that yourself, and see what those links have to say. you'll get the module name. Post the output of
Code:
sudo lsmod |grep <your_module>
 
Old 10-13-2018, 12:59 PM   #3
hal8000b
Member
 
Registered: Mar 2001
Location: UK
Distribution: Mint, Arch, Debian7
Posts: 194

Original Poster
Rep: Reputation: 23
Thanks for your reply, If I use mint stock module:

lsmod | grep ch341
ch341 16384 0
usbserial 53248 1 ch341


Or if I unload the module and try the ch34x module
as mentioned in the link:

lsmod | grep ch34x
ch34x 16384 0
usbserial 53248 1 ch34x

Neither work on Mint 17.3and there is a bug mentioned in Ubuntu. Due to the fact it works in my other distributions
makes me think I need to compile a new ch341 module, but there are so many links.

I forgot to point out that aftyer compiling the ch34x, I ran

sudo depmod -a

to update module dependencies. (Not sure if this step is required)
 
Old 10-14-2018, 04:32 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,366

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Right: ch341 looks ok to me. It might be iffy, but let's not get too devious before we have to :-)

This thing (1a86:7523) is a "QinHeng Electronics HL-340 USB-Serial adapter."
Let's say you have the 'usb' section right. Have you the 'serial' section right? In particular, have you the usbnet module, or the 16550 (as in the 8250 or 16550a com port drivers) module in the kernel? If they're there in /lib/modules and not used, fine. But if they're not there and perhaps one of them is wanted, that could be an issue. Com ports are usually last millenium stuff. Even usb-1.0 beats the pants off them. Here's a kernel doc that might excite your interest more than it does mine. I was there in the bad old days, and had my fill of com ports.

https://www.kernel.org/doc/Documenta...usb-serial.txt

EDIT: The 16550A gave slow serial com ports (115kbaud) and the earlier 8250 insanely slow serial coms (8Kbaud?).

Last edited by business_kid; 10-14-2018 at 04:55 AM.
 
Old 10-14-2018, 06:18 AM   #5
hal8000b
Member
 
Registered: Mar 2001
Location: UK
Distribution: Mint, Arch, Debian7
Posts: 194

Original Poster
Rep: Reputation: 23
Thanks for your help with this.
I have done some more digging and got this solved using the following post:

https://forums.linuxmint.com/viewtopic.php?t=230835

The makefile and ch341.c code are quite different from the one I used earlier,
and perhaps down to changes specific to Linux Mint distribution but the new
ch341.ko module now works and recognises the HL340 adapter.

Serial ports are mostly redundant now but I have an old radio which is controlled
via RS232 on the serial port.

Will mark first post as [solved]
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best route to replace module drivers/usb/serial/ch341.ko for QinHeng Usb2Serial adapter will_kranz Linux - Hardware 3 09-05-2017 04:11 PM
Antique, 9 pin, serial trackball - thru' Plugable USB to RS-232 DB9 Serial Adapter TheBigMing Linux - Newbie 10 07-31-2014 06:57 AM
Problem inserting a USB serial modem kernel module R00ts Linux - Kernel 2 12-17-2010 09:21 AM
linux kernel module for usb adapter johnvillegas Slackware 1 03-09-2006 03:45 PM
zoom external serial with usb to serial adapter foustware Linux - Hardware 1 12-07-2003 02:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration