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

Bug#704242: Driver for PL-2303 HX not working



Am 18.04.2013 11:35, schrieb Johan Hovold:
I have used a little perl program that opens the port and send "Test"
to the looped back device.
The length of the log looks good.
Great. Now I can see what's going on. The only problem (?) is that
everything seems to be working. The write succeeds and the four bytes
are read back as they should by the driver.

But where the data has gone?
With cutecom i can see that some of the first bytes are looped back.

It must be possible to read any binary (streamed) data.


The first thing that comes to mind that could prevent you from reading
the received data would be if the tty device is configured for canonical
input processing. Have you made sure this is not the case? Can you read
the data back if you add a newline to your test string (e.g. "test\n")?

Hmmn - i don't know which method is used by programs like cutecom or putty?
But i know everything works fine before.
In this programs every data is terminated with newline, but it does not work.
I use this script with a ch341 adapter and it works.
Hmmm. Did you remember to initialise the device (e.g. set the termios
flags)?

Here you can see what's initialized in Perl:

use Device::SerialPort 0.12;

$port->baudrate(9600)   || die "failed setting baudrate";
$port->parity("none")    || die "failed setting parity";
$port->databits(8)       || die "failed setting databits";
$port->handshake("none") || die "failed setting handshake";
$port->write_settings    || die "could not write settings";
$port->lookclear         || die "could not empty buffer";
$port->read_char_time(0);        # don't wait for each character
$port->read_const_time(1000);        # 1 second per unfulfilled "read" call
my $STALL_DEFAULT = 1;            # how many seconds to wait for new input


Cheers
Karsten


Johan


Reply to: