You are not logged in.

#1 2015-01-16 17:48:30

andrealoi
Member
Registered: 2012-12-30
Posts: 7

PL2303 USB-to-UART adapter hangs on read

Hi.

I have a quite strange problem with this serial to usb adapter (PL2303) which is driving me crazy.

I was working on a project based on a PIC24 microcontroller (which produces a "continuous" (10bps) stream of data through UART) when I noticed the output on my pc, captured with a python + pyserial script, suddenly stopped.
At first I thought there was something wrong with the PIC board but the RX LED on the adapter was flashing just like before.

Long story short, the serial adapter randomly stops receiving data. I can only get it back to work opening again the device.
Example:

$ cat /dev/ttyUSB0
[some stuff, usually between 10 and 100 characters, then it stops...]
^C
$ cat /dev/ttyUSB0
[it works for a while, but then it stops again...]
^C

Also "strace cat /dev/ttyUSB0" shows it hangs on "read" syscall, just like when there is no data input.

To be 100% sure it's not related to the PIC board I also put the adapter in loopback (connecting together TX and RX) and tryed writing some characters with minicom.
Same exact result: it writes back some characters and then it stops untill I exit and open again minicom.

I have this problem only on my laptop, on my desktop computer the adapter works flawlessly.
Both have Arch (x86_64) + xfce and I have updated them about three days ago.

Some more infos:

Udev rule to set rw permissions:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE="0666"

lsusb

Bus 003 Device 013: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

dmesg

[104075.460299] usb 3-1: new full-speed USB device number 13 using uhci_hcd
[104075.626603] pl2303 3-1:1.0: pl2303 converter detected
[104075.638683] usb 3-1: pl2303 converter now attached to ttyUSB0

I really can't understand why this is happening...
Any toughts?

Offline

#2 2015-01-16 17:58:13

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,670

Re: PL2303 USB-to-UART adapter hangs on read

Is this arbitrary binary 8 bit data?  Ensure that all forms of software flow control are disabled.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Online

#3 2015-01-16 18:01:11

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,541

Re: PL2303 USB-to-UART adapter hangs on read

I've had experiences with pl2303 doing that.  Most people recommend the more expensive ftdi chipsets.  At times, I've switched to a bona-fide serial port (old machine), and cleared the buffer from the device attached, and then went on.  It seemed that it worked without as much hitch using the pl2303 driver under Windows, but I wasn't using the same device either.  It became a headache to unplug and replug the pl2303, as it would often reassign the tty.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB