Issues detecting COM Port on Linux (CH343 - ESP32-S3)

Hi!
I'm sorry if this has already been mentioned somewhere as I know this is a common problem on Linux however this time, I don't think i've had a problem like this before.

Using a ESP32S3 dev board from aliexpress with a CH343 serial ic on it, my system (Arch Linux) is able to detect it but it does not appear in the ports list. I've also tried chmod 666 to no success and using minicom as user seems to work.

Dmesg:

[  427.148987] usb 1-2: New USB device strings: Mfr=0, Product=2, SerialNumber=3
[  427.148993] usb 1-2: Product: USB Single Serial
[  427.148998] usb 1-2: SerialNumber: 5734001898
[  427.151689] usb_ch343 1-2:1.0: ttyCH343USB0: usb to uart device
[  427.171322] usbcore: registered new interface driver cdc_acm
[  427.171325] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

The unusual aspect to me is that its presented under /dev/ttyCH343USB0 which i'm thinking may be part of the problem? The driver I'm using is ch343ser-dkms-git.
mv'ing this to /dev/ttyUSB0 as a long shot did not work either in case the naming was an issue.

On a Chromebook, its detected as /dev/ttyACM0 and works as expected, although with the Arduino IDE only permits one flash before needing the IDE to be restarted and recompiled due to some compilation bug (haven't tested if this is still the case in the latest IDE so wont make much of it).

udevadm monitor shows a large output upon inserting the esp32-S3

KERNEL[1736.804583] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
KERNEL[1736.806930] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[1736.807291] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/usbmisc/ch343_iodev0 (usbmisc)
KERNEL[1736.807438] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/tty/ttyCH343USB0 (tty)
KERNEL[1736.807509] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[1736.807735] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 (usb)
KERNEL[1736.807820] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 (usb)
KERNEL[1736.807889] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
UDEV  [1736.816224] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
UDEV  [1736.817252] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
UDEV  [1736.817287] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 (usb)
UDEV  [1736.818114] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/usbmisc/ch343_iodev0 (usbmisc)
UDEV  [1736.818188] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 (usb)
UDEV  [1736.818557] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/tty/ttyCH343USB0 (tty)
UDEV  [1736.819570] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
UDEV  [1736.822796] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)

The IDE works as expected out of the box for my RP2040 so the issue seems more tied to the CH343.
Also I am connected to the COM Port on the module not the USB-C port (As the S3 has two ports), this works on other systems.

I'm at a loss and any help would be greatly appreciated!

What does 'ls -al /dev/ttyCH343USB0' return?

If its not group owned by dialout then you may need to create a UDEV rule.

Just to confirm, you do not have modemmanager or brltty running by any chance?

Thanks for your help!

First command returns
crw-rw---- 1 root uucp 170, 1 Dec 22 12:53 /dev/ttyCH343USB1
(Now USB1 after reinserting)

No brltty or modemmanager installed either.

In frustration I did switch to PlatformIO and had the same problem although I was able to select "custom port" and enter /dev/ttyCH343USB0 to upload and monitor with no problems.

That is interesting. Worth noting as a workaround.

So the port is group owned by uucp. Is your username added to the uucp group?

Another and possibly better/safer option might be to install this UDEV rule file in /etc/udev/rules.d:

https://github.com/WCHSoftGroup/ch343ser_linux/blob/main/udev/99-ch34x.rules

Then add your username to the plugdev group. Of course, make sure that the plugdev group exists.

BTW, the allocation of port number suffixes is dynamic. If the device name is already in use (another device plugged in, application open, process hung etc) then the system will allocate the next available port number,, so in this case USB1. It will revert back to USB0 once the the process is cleared (by closing the application, unplugging the other device or clearing the hung process).

Good. Unless you are using a Braille reader or a modem, you don't need them. They are sometimes found on distributions that are derived from Ubuntu as they tend to have these services running by default for convenience. I suspect that on Arch you would probably have to install them as and when needed, but it is just as well to eliminate the possibility.

Are you member of group "uucp" ?

Thank you both for your help, I was indeed not part of the UUCP group and adding myself to it did partially resolve the issue!

Arduino now does detect the port as an ESP32S3 but will not monitor or upload to it with the following error (bottom right)

Could not connect to serial port. The monitor configuration is missing.

(For Google to index)

I also added the rules and plugdev group but was not able to get any further with that unfortunately.

Just out of curiosity I decided to look for the legacy Arduino IDE (v1.8.18) and install it and right out of the box it worked with no need to even install boards (must be using the same ones from new ide id imagine).

I will say though that on a different Arch Linux system, the device is detected as /dev/ttyACM0 and has no problems with the new IDE. There's something strange going on with both my system and the new IDE but I'm thinking maybe I can get away with the old IDE for now as long as that compilation bug doesn't come back. I'd also note that this cursed board seems to have issues with platform IO in terms of utilising PSRAM where it works fine with Arduino so its a bit of a shame to be stuck with the old IDE but its probably the price to pay for an AliExpress discounted ESP32-S3 N16R8 at less than most specialty coffees delivered.

Thanks again for your help! I'll be sure to update this thread if anything changes and am happy to help try and debug if anyone wants to get to the root cause of it.
Happy Holidays