Coder Social home page Coder Social logo

Comments (12)

D0m3L avatar D0m3L commented on July 23, 2024 1

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

from ch341ser.

juliagoda avatar juliagoda commented on July 23, 2024

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...

from ch341ser.

robertclarkson avatar robertclarkson commented on July 23, 2024

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

from ch341ser.

CallMeReznov avatar CallMeReznov commented on July 23, 2024

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

from ch341ser.

stman avatar stman commented on July 23, 2024

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.

from ch341ser.

D0m3L avatar D0m3L commented on July 23, 2024

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!

from ch341ser.

juliagoda avatar juliagoda commented on July 23, 2024

Great to hear that !

from ch341ser.

drzraf avatar drzraf commented on July 23, 2024

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.

from ch341ser.

Maximus48p avatar Maximus48p commented on July 23, 2024

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?

from ch341ser.

D0m3L avatar D0m3L commented on July 23, 2024

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

from ch341ser.

Maximus48p avatar Maximus48p commented on July 23, 2024

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!

from ch341ser.

Maximus48p avatar Maximus48p commented on July 23, 2024

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!

from ch341ser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.