8

I have Kubuntu 14.10 development workstation and recently I have bought a QinHeng Electronics HL-340 USB-Serial adapter. HL-340 is USB<---->Serial adapter and it is recognised by my kernel:

user@comp001:~$ lsusb
    Bus 007 Device 010: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
[..]

I am trying to initiate communication via this adapter with Raspberry Pi B+ board, but I am constantly failing.

Whatever text I send to the Raspberry Pi B+ via minicom, the traffic on the line is dead, I've checked with scope. I've double checked the Raspberry Pi B+ setup, the wirings (triple checked with multimeter), the scope wirings and the serial communication is dead. The port on Raspberry Pi B+ is working, because I've hooked up scope on transmit pin of serial port (on Raspberry Pi B+ side) and if I send text from Raspberry Pi B+ (via minicom under ssh tunnel), I get activity on the scope.

I cannot get data from PC via USB serial dongle. How do I test if the dongle works?

5
  • 2
    How are using minicom? What port / baudrate? Are the Raspberry Pi serial levels real RS232 levels (-5/+5V) or are they TTL levels (0/5V)? And is the device really recognized by your kernel (check dmesg output after plugging)? lsusb simply shows whatever is connected, even if the device is not supported.
    – wurtel
    Commented Mar 13, 2015 at 8:54
  • I have one of these too, the output is not at rs232 signal levels (instead 0V and 5V) and the UART seems to only return the low 5 bits of the input. It doesn't work correctly on raspberry pi or on amd64, probably a counterfeit chip.
    – Jasen
    Commented Mar 10, 2016 at 20:17
  • I compared operation against a known-good PL2303 based serial port,
    – Jasen
    Commented Mar 10, 2016 at 20:23
  • @KernelPanic the link is broken. Commented Apr 13, 2020 at 2:07
  • 1
    @JonasStein at the time of writing this question the link was valid, I've updated it. Commented Apr 13, 2020 at 5:47

2 Answers 2

6

lsusb lists the device here as

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

It is often shipped together with the sds011 sensor. The required kernel module is called ch341 and built with the following .config entry:

CONFIG_USB_SERIAL_CH341=m

If you use make nconfig or make menuconfig you will find this module in

-> Device Drivers
   -> USB support (USB_SUPPORT [=y]) 
      -> USB Serial Converter support

I had to set the communication parameters manually to 9600 baud, 8N1 before I could use the device properly:

$ stty -F /dev/ttyUSB0 9600 raw
4

Is the adapter loading the right kernel module? I've heard that your device may be CH341 compatible:

sudo modprobe ch341
2
  • 1
    should really do lsmod first to confirm that that the module has not loaded automatically.
    – Jasen
    Commented Mar 10, 2016 at 20:20
  • true, but unless there's already a kernel rule to load the module, it's not going to guess that these two devices are compatible
    – scruss
    Commented Mar 12, 2016 at 13:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .