WCHSoftGroup / ch343ser_linux

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

How do I read from ttyCH343USB0? #26

Open UltraSBe opened 10 months ago

UltraSBe commented 10 months ago

Hi,

I added the driver to my embedded linux device and tried to communicate with a CH9101 chip.

Setting up the communication and sending data to the CH9101 chip (either via echo in command line or via write call in c++ code) works fine.

But reading doesn't work at all. I tried different methods (e.g. cat on the tty device, read call in c++). The CH9101 device communication works fine out of the box with windows.

I locally added multiple debug prints to this driver: In the transfer buffers the correct data can be read but it is not written to ttyCH343USB0.

Is there a code example on how to read the data or some sort of tutorial/explanation available.

Thanks :)

WCHSoftGroup commented 10 months ago

Hello, you can try this demo: https://github.com/WCHSoftGroup/tty_uart