I'm using a Arduino Nano clone (with CH341 chip and old bootloader) and on the two Linux devices I have both give the error "minicom: cannot open /dev/ttyUSB0: Input/output error" when trying to connect to them in minicom. I get a similar message when trying to connect in the Arudino IDE too.
The device shows up as ttyUSB0. And I'm using baud rate 9600 8N1 to connect.
[ 712.064882] ch34x 1-1.1:1.0: ch34x converter detected
[ 712.069367] usb 1-1.1: ch34x converter now attached to ttyUSB0
[ 712.089250] usbcore: registered new interface driver ch341
[ 712.089310] usbserial: USB Serial support registered for ch341-uart
I've uninstalled brltty and modemmanager. Tried USB 2.0 and 3.0 ports.
In Windows connecting to serial via Putty and uploading via the Arduino IDE works fine with the exact same setup.
The two Linux machines are a Linux laptop running Ubuntu 22.04.3 with kernel 6.5.4, and Raspberry Pi 4 running the latest Raspbian with kernel 6.1.0. I also tried downgrading the kernel on Raspbian to 5.14 but had no luck.
I also have an original Arduino Uno which shows up as ttyACM0 which connects to serial just fine on Windows and Linux, so it seems to be only related to the Nano clone.
I'm at a loss and don't know what to try next, any one have any ideas please?
EDIT:
Just noticed in dmesg that I'm getting these errors whenever I try to start minicom and make a serial connection:
Have you joined the dial out group? Try this:
Type 'groups', is 'dialout' there ?
sudo usermod -a -G tty yourUserName -example: sudo usermod -a -G tty gil
sudo usermod -a -G dialout yourUserName
Log off and log on again for the changes to take effect.
Yep already in the dialout (EDIT: and tty too) group on both machines. On Raspbian the user appears to be in the dialout group by default, and on my Ubuntu laptop I've already done that before.
I know there is an issue on Windows with the fake CH340, but for me Windows is working fine. I did manually install the CH340 driver on Windows when it wasn't working at first, and so my driver version is 3.4.2014.8.
But has anyone had issues with the fakes on Linux?
Why is your Ubuntu not up to date ?
Just the dialout group should be enough, I did not have to set permissions to 666 for a serial port (I had to set permissions when using a USBasp programmer to burn the firmware).
Do not install drivers for the CH340G in linux. I'm afraid that something is messed up now.
Please do not install a older version of a driver or operating system, that is such a bad idea. Such things cause trouble later when upgrading to a new version of the Operating System.
The text "CH340G" should be visible on the chip. Is your chip blank ?
What does 'lsusb' say when you connect it ?
Remove everything from the Nano clone. Use a good USB cable and a other USB port.
From what I read online, it could be caused if the Nano runs at a low voltage. If that is not the cause, then it is a internal linux error and there is something wrong with the CH340G chip. Either a bad CH340G chip or the wrong firmware in that chip or a fake chip.
Maybe a fake CH340G is made to work with Windows and they forgot about making it compatible with linux and the linux driver is more strict with the communication.
My advice: Get rid of that board with the faulty chip.
Do you know the story of 2013 with the fake FTDI chips ? The manufacturer of the real FTDI chip made a driver that bricked the fake FTDI chips. The only way to deal with such things as a user is to stay away from such things as far a possible.
I can easily do a fresh install on the Raspberry Pi and the same problem is still there even with the default kernel drivers. Today I also tried on an Orange Pi 5 with the exact same results.
The chip is blank, there is no text on it. So I'm fairly certain it's a fake CH340.
lsusb reports:
Bus 001 Device 003: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Everything is removed from the Nano. And it can't be a voltage problem because I also have it powered via 'Vin' with 12V. But even if I turn 12V off and run it from the USB power supply the problem is exactly the same. And I've tried three cables and all the USB ports on all devices to no avail.
I've ordered another Arduino in from another seller now, so hopefully I can confirm the fake chip theory soon.
But I find it odd that I seem to be the only one whose reported this issue. Surely these fake chips are widespread enough that I'm not the first with issues on Linux.
As far as I know, every real CH340G has readable print on it.
Thank you for reporting it I think there will be more users with fake usb-serial chips and linux.
Would you mind posting the full error message you get in Arduino IDE?
I am interested in this information for the sake of being able to support others who might be affected by this problem. As you mentioned, there is a known problem with certain CH340 chips on Windows when the latest driver version. We have received many reports of that here. I haven't seen the same from Linux users but it might only be that I haven't identified the unique symptom of the problem on Linux (which might be completely different than the well known symptom on Windows).
OK got two more clones, this time ones with the real CH340 chip. I know it's real because these actually have CH340 markings on them, and the fake one has no markings.
Serial and programming works first time on LInux on these boards too.
So it's confirmed that the fake CH340 was the cause of my issues.