WCHSoftGroup / ch343ser_linux

USB driver for USB to serial chip ch342, ch343, ch344, ch9101, ch9102, ch9103, etc
123 stars 46 forks source link

CH9102 driver cannot be driven normally under Ubuntu20.04 #11

Open BG6TPX opened 2 years ago

BG6TPX commented 2 years ago

After installing the driver according to the README, restart the computer to recognize the device, but an error is reported when downloading

[Errno 2] could not open port ttyCH343USB0: [Errno 2] No such file or directory: 'ttyCH343USB0'

Background: I has opened the serial port permissions and added the account to the dialout group, and it can be downloaded under Windows.

SoldierJazz commented 2 years ago

you can type command 'lsusb' to confirm that if the usb hardware works well, if ch9102 works, you will see the usb device with VID 0x1A86

BG6TPX commented 2 years ago

Thanks!

mjeka89 commented 2 years ago

Good evening, could you help me explain why I can't install this driver on Ubuntu 22.04

BG6TPX commented 2 years ago

Good evening, could you help me explain why I can't install this driver on Ubuntu 22.04

ok,According to the author's installation information in the README, enter the drive folder after the download is complete, and run make, make load, and make install in the README. If there is any problem, can you post the error message?

SoldierJazz commented 2 years ago

i think you can type "lsusb" command to confirm that if the usb hardware works well in your os.

finger563 commented 1 year ago

i'm getting device showing the right VID: image but even after building and installing the driver, all I get is /dev/ttyACM0 which doesn't work :/ I cannot see the /dev/ttyCH343USB0 as expected

xiay-vk commented 1 year ago

I may have hit the same issue.

In my case, cdc_acm driver was loaded instead of the ch343 driver when the USB cable got plugged to the dev board. And you would see /dev/ttyACM0 instead of /dev/ttyCH343USB0 getting enumerated.

Debugging into it, it turns out to be that somehow depmod -a command which was part of sudo make install not taking effect. Meaning the modules.alias and modules.deps file /lib/module/$(uname -r)/ are not updated with necessary information for ch343.ko

Here is what I did to manually fix it:

  1. add following to /lib/module/$(uname -r)/modules.deps

    kernel/drivers/usb/serial/ch343.ko: kernel/drivers/usb/serial/usbserial.ko
  2. add following to /lib/module/$(uname -r)/modules.alias

    alias usb:v1A86p55DFd*dc*dsc*dp*ic*isc*ip01in* ch343 
    alias usb:v1A86p55D7d*dc*dsc*dp*ic*isc*ip01in* ch343 
    alias usb:v1A86p55D4d*dc*dsc*dp*ic*isc*ip01in* ch343 
    alias usb:v1A86p55D8d*dc*dsc*dp*ic*isc*ip01in* ch343 
    alias usb:v1A86p55DDd*dc*dsc*dp*ic*isc*ip01in* ch343 
    alias usb:v1A86p55DBd*dc*dsc*dp*ic*isc*ip01in* ch343 
    alias usb:v1A86p55DAd*dc*dsc*dp*ic*isc*ip01in* ch343 
    alias usb:v1A86p55D5d*dc*dsc*dp*ic*isc*ip01in* ch343 
    alias usb:v1A86p55D3d*dc*dsc*dp*ic*isc*ip01in* ch343 
    alias usb:v1A86p55D2d*dc*dsc*dp*ic*isc*ip01in* ch343

Why one would have to manually do this to get it in remains a mystery and it might be messed up by future kernel installations.