Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on Ubuntu fully succesfull #6

Open
stman opened this issue Aug 29, 2020 · 12 comments
Open

Test on Ubuntu fully succesfull #6

stman opened this issue Aug 29, 2020 · 12 comments

Comments

@stman
Copy link

stman commented Aug 29, 2020

Hello

I have tested it on Ubuntu 18.04.5 LTS and it works fine.

I highly suggest that you would mention your correction to the original chinese developer and that this version would be integrated into most linux distributions as it works fine.

@juliagoda
Copy link
Owner

Interestingly, my tutorial is mainly based on how the module is to be launched. I did not change anything in the code. I just downloaded it from the Chinese side (their side) while it was still working. After a while someone sent a Pull Request. That is all. I can try but I don't know what their reaction will be...

juliagoda added a commit that referenced this issue Aug 29, 2020
@robertclarkson
Copy link

Hi @stman How did you install on ubuntu? I can't see the device in my list I am on Ubuntu 20
I have the file in my drivers list
/usr/lib/modules/5.4.0-52-generic/kernel/drivers/usb/serial/ch341.ko
but lsusb doesnt show the device when i connect it

@CallMeReznov
Copy link
Contributor

Test On CentOS Linux release 8.3.2011 succesfull
it's works!

@stman
Copy link
Author

stman commented Feb 19, 2021

Hi @stman How did you install on ubuntu? I can't see the device in my list I am on Ubuntu 20
I have the file in my drivers list
/usr/lib/modules/5.4.0-52-generic/kernel/drivers/usb/serial/ch341.ko
but lsusb doesnt show the device when i connect it

Hello.

On Ubuntu, you need to perform the following :

  • Place yourself in the directory of the new CH341 source code you downloaded here.
  • Compile the source code with sudo make
  • Then you need to suppress the old CH341 module that is already installed typing this command : sudo rmmod ch341
  • Then you need to install the new module sudo make load or you can alternatively load it manualy with sudo insmod ch34x.ko
  • Please note that these installation are temporary, and you would need to do this process after every boot.

I managed to make it persistant using a hack, but there is a more official way of doing it with modprobe command.
What I did to make it persistant after reboot was that I erased the old module file "ch341.ko" in the module directory for ubuntu (It's something after /lib/ ... " but I don't remember it right now, so you will have to find this info yourself), I copied the new freshly compiled ch34x.ko to this same directory, but renamed it into ch341.ko, and of course, I changed this file access rights group and owner so that they correspond to what is set for all other modules present in this directory, and then I rebooted and it worked fine.

According to what I have read, the modprobe command can do the same, but in an automated way. The only difficulty I noticed was that it was necessary to remove the old module, both on disk and in RAM in order to have the new recompiled one taken into consideration.

Then I test unpluging and repluging my CH341 device, and display the debug message with the dmesg command, that show if the device was well recognized or not, meaning, if the new module replacing the old one that doesn't work, is working normaly.

Please let me know how it worked out for you,

Kind regards,

Frederic.

@juliagoda juliagoda pinned this issue Mar 15, 2021
@D0m3L
Copy link

D0m3L commented Jul 4, 2022

Works like a charm under QNAP QTS 5.0.0:
5.10.60-qnap #1 SMP Tue May 31 09:28:39 CST 2022 x86_64 GNU/Linux

Got a lag under my zigbee coordinator (cc2652P) on a version from USBSerialdrivers_5.0.0_x86_64.qpkg, but from this repo, the module is 50% smaller thus faster - zero delays.

Thanks!

@juliagoda
Copy link
Owner

Great to hear that !

@drzraf
Copy link

drzraf commented Oct 19, 2022

I think the way to go would be to identify the difference between this module and the official one at https://github.com/torvalds/linux/blob/master/drivers/usb/serial/ch341.c (which pretends to actually support 1a86:7523) :
https://github.com/torvalds/linux/blob/aae703b02f92bde9264366c545e87cec451de471/drivers/usb/serial/ch341.c#L86

and (if CH341SER is under a GPL license), extract and merge the actual changes affecting the communication.

@Maximus48p
Copy link

Great to hear it works for QNAP as wel... but...

How did you manage to install?
Does it also work for QTS 5.0.1 kernel 5.10.60?

@D0m3L
Copy link

D0m3L commented Nov 2, 2022

Great to hear it works for QNAP as wel... but...

How did you manage to install?
Does it also work for QTS 5.0.1 kernel 5.10.60?

Yes it works for me on 5.10.60.
You have to get qts5.0 toolchain/kernel source from https://sourceforge.net/projects/qosgpl/ and you are ready to compile the module from this repo

Regrds,
dml

@Maximus48p
Copy link

Thank you for help dml... but...

A bit struggling through.
don't know how to compile. I have found instructions using commands like 'make' and 'insmod', but i'm getting errors when i'm using them.
I have managed to copy (and change the name) the driver file from this site to folder /lib/modules/5.10.60-qnap/ch341.ko followed up with chmod 644 /lib/modules/5.10.60-qnap/ch341.ko

a) So i'm not sure why i need to download the kernel file from the site you mentioned.
b) what to do next?

Also read that you need to redo this after every reboot?
Because drivers are in memory in QNap?

You're help is really appreciated. thx!

@D0m3L
Copy link

D0m3L commented Nov 2, 2022

Thank you for help dml... but...

A bit struggling through.
don't know how to compile. I have found instructions using commands like 'make' and 'insmod', but i'm getting errors when i'm using them.
I have managed to copy (and change the name) the driver file from this site to folder /lib/modules/5.10.60-qnap/ch341.ko followed up with chmod 644 /lib/modules/5.10.60-qnap/ch341.ko

a) So i'm not sure why i need to download the kernel file from the site you mentioned.
b) what to do next?

Also read that you need to redo this after every reboot?
Because drivers are in memory in QNap?

You're help is really appreciated. thx!

To compile the module correctly you have to use kernel source code from the sourceforge link above. You may need to edit Makefile from this repo to set a proper KERNELDIR variable pointing to the extracted kernel source code/directory. Then follow readme.txt instructions (mainly do make and make load to compile the module). Then do insmod pathtocompiledmodule/ch34x.ko and at the end modprobe ch34x and voila, your driver is ready to work. If you dont get a proper /dev/ttyUSB0 try 'mknod /dev/ttyUSB0 c 188 0'

If you still struggling with module compiler and you trust some random dml from the internet you can get my pre-compiled version for qnap 5.10 kernel here.
You can also find a compiled version within USB serial drivers 5.0.0 package on qnap forum: https://forum.qnap.com/viewtopic.php?f=320&t=150684&start=30 but on this version I had some communication delays thus I used this repo for my own compilation...
Hope that helps!
/dml

@Maximus48p
Copy link

Well, compiling is still a bridge to far for me for now :(
But your file and instruction did the trick. Works like a charm.
So thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants