[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: going beyond a ch341 uart-usb convertor



Hi there,

Am 2021-04-12 05:55, schrieb Gene Heskett:
Building a design/builder for a 3d printer, which when a std usb to
printer cable is connected between the computer and the 3d printer,
Identifies as a ch341 convertor cable once it is plugged into the
printer.

[...]

What would the next thing to try and discover why its not working?

Do you actually have permissions for the device? Typically serial
devices have permissions such that only root and the group 'dialout'
can access them. You can check that via:

ls -l /dev/ttyUSB0

That will typically look something like

crw-rw---- 1 root dialout 4, 64 Apr 12 08:54 /dev/ttyUSB0

You can use id to determine if you are in the 'dialout' group. If
that doesn't appear (but your user and other groups do appear), then
you may add your user to that group via

gpasswd -a USERNAME dialout

(Replace USERNAME by your username, run this command as root.)

(Note that I've used ttyUSB0 here, because CH341 devices typically
appear as such, but other USB to serial converters may also appear
as ttyACM0 instead of ttyUSB0.)

Additionally, even if the permissions are OK, if you have ModemManager
installed (which is typically the case on desktop systems), for the
first 30 to 60 seconds it will try to detect if the device in question
is a model, and only once that fails will it release the device. So it
could be that the device is "stolen" by ModemManager directly after
pluggin it in and/or powering it up, and you have to wait a bit until
ModemManager releases it.

Furthermore, if you have software installed that is used for devices
that help people with vision impairments, it could be that that
interferes with USB serial devices, as some such devices also use a
USB serial interface.

You can check if another software (ModemManager, or something else) is
currently using the serial device by calling:

lsof /dev/ttyUSB0

(Run the command as root.)

Hope that helps!

Regards,
Christian


Reply to: