Score:2

ch340g usb to ttl error: ch341-uart ttyUSB0: failed to read modem status: -110

cn flag

im using Ubuntu 20.04.3 LTS

when i try to upload from arduino i get

avrdude: ser_open(): can't open device "/dev/ttyUSB0": Input/output error

when i try to open serial monitor

Error opening serial port '/dev/ttyUSB0'. (Port not found)

if i use another type of usb to serial (pl2303) serial monitor is working fine the hardware is working fine i tested on a windows machine and no problem.

$ lsmod | grep usbserial
usbserial              53248  2 pl2303,ch341

dmesg gives:

[  451.329190] usb 10-2: new full-speed USB device number 2 using xhci_hcd
[  451.505205] usb 10-2: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
[  451.505219] usb 10-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[  451.505223] usb 10-2: Product: USB2.0-Serial
[  451.556668] usbcore: registered new interface driver usbserial_generic
[  451.556686] usbserial: USB Serial support registered for generic
[  451.558302] usbcore: registered new interface driver ch341
[  451.559378] usbserial: USB Serial support registered for ch341-uart
[  451.559976] ch341 10-2:1.0: ch341-uart converter detected
[  451.573480] usb 10-2: ch341-uart converter now attached to ttyUSB0
[  463.937493] usb 10-2: failed to receive control message: -110
[  463.937504] ch341-uart ttyUSB0: failed to read modem status: -110
[  482.625628] usb 10-2: failed to receive control message: -110
[  482.625701] ch341-uart ttyUSB0: failed to read modem status: -110
[  501.281699] usb 10-2: failed to receive control message: -110
[  501.281710] ch341-uart ttyUSB0: failed to read modem status: -110

and with pl2303:

[ 1751.189867] usb 10-2: USB disconnect, device number 2
[ 1751.190187] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 1751.190220] ch341 10-2:1.0: device disconnected
[ 1786.822056] usb 10-2: new full-speed USB device number 3 using xhci_hcd
[ 1786.996937] usb 10-2: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 3.00
[ 1786.996946] usb 10-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1786.996951] usb 10-2: Product: USB-Serial Controller
[ 1786.996954] usb 10-2: Manufacturer: Prolific Technology Inc.
[ 1787.046337] usbcore: registered new interface driver pl2303
[ 1787.046367] usbserial: USB Serial support registered for pl2303
[ 1787.046410] pl2303 10-2:1.0: pl2303 converter detected
[ 1787.076108] usb 10-2: pl2303 converter now attached to ttyUSB0

I tried a lot of things like adding user to dialout and file permissions

what can be done?

edit:

ls -al /dev/ | grep ttyUSB*
crw-rw----   1 ss   dialout   188,   0 dec 19 16:58 ttyUSB0

same for both devices

edit:

after

sudo usermod -a -G dialout username && sudo chmod a+rw /dev/ttyUSB0 && sudo chown root:dialout -R /dev/

ls -al /dev/ttyUSB*
crw-rw-rw- 1 root dialout 188, 0 dec 19 20:40 /dev/ttyUSB0

arduino serial monitor same error and dmesg same as above

update:

installed arduino on another machine (same laptop with windows7 different hdd) only run the add user to dialout group and is working fine uploaded a test sketch from arduino. Same version "Ubuntu 20.04.3 LTS" The laptop is an older model only usb2.0 the pc is "newer" (5-6 years old) and using a usb3.0 port. Switch to a 2.0 port and now is better but other problem: serial monitor is picking up random characters at random intervals:

MCbK19:kEPUqPJv0Zyq71dlX19QDFDFR
2K19:m4GjpRJ7cNnR9AxB
X19K19:M4yD0kmEvONihR79X19
DFUDK19:OVyzqIbEKK4VAUCcX19DF

?????

i can upload a sketch if i manage to send between the random chars.

Problem resolved by using a USB2.0 port.

nobody avatar
gh flag
are the device nodes present? `ls -al /dev/ | grep ttyUSB*` please. [edit] your question for reply.
abu-ahmed al-khatiri avatar
in flag
Please run `sudo usermod -a -G dialout username && sudo chmod a+rw /dev/ttyUSB0 && sudo chown root:dialout -R /dev/ ` and check again `ls -al /dev/tty*`
abu-ahmed al-khatiri avatar
in flag
i think you need to manually reset to do the upload, cause DTR and RST held on reset mode, add 100nf capacitor to convert into low pulse. i really to recommended to buy FTDI FT232 breakout. they have the DTR pin to do automatic reset. make sure to use 115200 baudrate.
sergiu sora avatar
cn flag
i'm not at that part yet. the converter is not working, i have a wire soldered on the converter to grab the DTR signal and is working ok on a windows machine. it should be able to do serial monitor with TX-RX connected and return the data send. i tried with Putty and get "unable to open serial port"
abu-ahmed al-khatiri avatar
in flag
@sergiu sora what the board are you using?, install the driver to read the port or add udev rule manually.
sergiu sora avatar
cn flag
@abu-ahmed al-khatiri converter is: [link](https://icmasteronline.com/product/3-3v-5v-usb-to-ttl-converter-ch340g-uart-serial-adapter-module-stc/)
abu-ahmed al-khatiri avatar
in flag
@sergiu sora seems like the usb2serial is not created udev default rule to read your tty, try to add new rule to `/etc/udev/rule.d/prolific.rules` and add lines `#udev rules for prolific usb2serial boards ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE="0666", SYMLINK+="ttyUSB%n"`
sergiu sora avatar
cn flag
there is no prolific.rules `/etc/udev/rules.d$ ls 40-dfuse.rules 59-smfp_samsung.rules <br/> 99-arduino-101.rules 49-stlinkv1.rules <br/> 70-snap.picard.rules 99-jlink.rules<br/> 49-stlinkv2-1.rules 70-snap.qelectrotech.rules avrisp.rules 49-stlinkv2.rules 70-snap.snapd.rules z010_mchp_tools.rules 49-stlinkv3.rules 70-snap.snap-store.rules z011_mchp_jlink.rules 51-android.rules 90-extraacl.rules z012_mchp_efr.rules 56-hpmud.rules 98-openocd.rules`
abu-ahmed al-khatiri avatar
in flag
@sergiu sora that's problem, add new file of prolific.rules and add lines above.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.