promod
Posts: 39
Joined: Tue Nov 13, 2012 6:47 pm

USB to Serial ( with CH34x ) not working.

Mon Sep 12, 2016 10:46 am

I try USB to serial convertov with chip CH 341 ( CH340 ) but it doesn't work. I try steps on https://github.com/aperepel/raspberrypi-ch340-driver but 1-Minute How-To nor compilation fails. Is it possible to use CH34x with raspberry?
Thanks for your answer.

User avatar
topguy
Posts: 5618
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: USB to Serial ( with CH34x ) not working.

Mon Sep 12, 2016 11:40 am

Providing error-messages from those failures would be helpful for those people who would like to help but dont know the answer to "Is it possible to use CH34x with raspberry?".

promod
Posts: 39
Joined: Tue Nov 13, 2012 6:47 pm

Re: USB to Serial ( with CH34x ) not working.

Mon Sep 12, 2016 12:47 pm

If I try to follow steps in https://github.com/aperepel/raspberrypi-ch340-driver but:

One minute how to ends :
sudo insmod ch34x.ko
insmod: ERROR: could not insert module ch34x.ko: Invalid module format

Compilation - produces ch34x.ko, but driver doesn't work..

I try to send something with serial parameters 4800 Baud, Even parity, 7 Bits, 1 Stop bit, and I get other bytes that I sent. On raspberry forum there were some discusions about converter CH341 ( CH 340 ) but I didn't find success result of this driver mistake.

ernestzulueta
Posts: 7
Joined: Mon Oct 31, 2016 7:52 am

Re: USB to Serial ( with CH34x ) not working.

Wed Nov 02, 2016 2:50 am

hi everyone, can we use FTDI drivers in ch340 chip ?

Alexandre Toledo
Posts: 1
Joined: Mon Sep 04, 2017 4:16 am

Re: USB to Serial ( with CH34x ) not working.

Mon Sep 04, 2017 4:21 am

download
pi@raspberrypi:~ $ wget https://github.com/aperepel/raspberrypi ... 7/ch34x.ko

check
pi@raspberrypi:~ $ lsmod
Module Size Used by
bnep 12051 2
hci_uart 20020 1
btbcm 7916 1 hci_uart
bluetooth 365511 22 hci_uart,bnep,btbcm
brcmfmac 222874 0
brcmutil 9092 1 brcmfmac
cfg80211 543027 1 brcmfmac
rfkill 20851 4 bluetooth,cfg80211
snd_bcm2835 24427 1
snd_pcm 98501 1 snd_bcm2835
snd_timer 23968 1 snd_pcm
snd 70032 5 snd_timer,snd_bcm2835,snd_pcm
bcm2835_gpiomem 3940 0
evdev 12423 6
joydev 9988 0
uio_pdrv_genirq 3923 0
uio 10204 1 uio_pdrv_genirq
fixed 3285 0
i2c_dev 6913 0
fuse 99603 3
ipv6 408971 70

go towards
pi@raspberrypi:~ $ cd /lib/modules/$(uname -r)/kernel/drivers/usb/serial

Install first
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod usbserial.ko

Check once again
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ lsmod
Module Size Used by
usbserial 29943 0 <===== Need be installed FIRST
bnep 12051 2
hci_uart 20020 1
btbcm 7916 1 hci_uart
bluetooth 365511 22 hci_uart,bnep,btbcm
brcmfmac 222874 0
brcmutil 9092 1 brcmfmac
cfg80211 543027 1 brcmfmac
rfkill 20851 4 bluetooth,cfg80211
snd_bcm2835 24427 1
snd_pcm 98501 1 snd_bcm2835
snd_timer 23968 1 snd_pcm
snd 70032 5 snd_timer,snd_bcm2835,snd_pcm
bcm2835_gpiomem 3940 0
evdev 12423 6
joydev 9988 0
uio_pdrv_genirq 3923 0
uio 10204 1 uio_pdrv_genirq
fixed 3285 0
i2c_dev 6913 0
fuse 99603 3
ipv6 408971 68

NOW, install ch341.ko
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod ch341.ko

Voilá !!!
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ lsmod
Module Size Used by
ch341 6086 0 <==== Must be here first
usbserial 29943 1 ch341 <==== Can you see me now ?
bnep 12051 2
hci_uart 20020 1
btbcm 7916 1 hci_uart
bluetooth 365511 22 hci_uart,bnep,btbcm
brcmfmac 222874 0
brcmutil 9092 1 brcmfmac
cfg80211 543027 1 brcmfmac
rfkill 20851 4 bluetooth,cfg80211
snd_bcm2835 24427 1
snd_pcm 98501 1 snd_bcm2835
snd_timer 23968 1 snd_pcm
snd 70032 5 snd_timer,snd_bcm2835,snd_pcm
bcm2835_gpiomem 3940 0
evdev 12423 6
joydev 9988 0
uio_pdrv_genirq 3923 0
uio 10204 1 uio_pdrv_genirq
fixed 3285 0
i2c_dev 6913 0
fuse 99603 3
ipv6 408971 68

Greetings
Alexandre Toledo
alex_cefet_rj@yahoo.com.br

Posted too at : https://github.com/aperepel/raspberrypi ... r/issues/3

User avatar
gatherer
Posts: 14
Joined: Sat Oct 17, 2015 2:31 pm

Re: USB to Serial ( with CH34x ) not working.

Sat Dec 16, 2017 10:30 pm

Hi,

Still not working?

Kernel 4.9.59-v7+

User avatar
scruss
Posts: 2356
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: USB to Serial ( with CH34x ) not working.

Sun Dec 17, 2017 2:13 am

Has worked fine for me for some time with stock kernel and no recompilation. Are the devices not being seen at all? Anything in lsusb? Are there any /dev/ttyUSB* devices?
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
gatherer
Posts: 14
Joined: Sat Oct 17, 2015 2:31 pm

Re: USB to Serial ( with CH34x ) not working.

Sun Dec 17, 2017 6:58 pm

Hi,

Sorry for the fuzz. It’s working perfect with a new cable.

Thank you

Return to “Troubleshooting”