Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RS232 console communication - set baudrate to 1 MBaud

Within a bash script, I use the following:

$ stty -F /dev/ttyUSB0 921600 raw
$ echo -n "some test data" >/dev/ttyUSB0

and it works as expected. Using a PL2303 USB to RS232 adapter:

$ lsusb
...
Bus 006 Device 010: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 006 Device 011: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Now I tried to do the same with 1 MBd, but got an error:

$ stty -F /dev/ttyUSB0 1000000 raw
stty: /dev/ttyUSB0: unable to perform all requested operations

Also the same message when I try with 500 kBd. Trying 250 kBd the error message is different:

$ stty -F /dev/ttyUSB0 250000 raw
stty: invalid argument `250000'
Try `stty --help' for more information.

As seen here, it's a problem in the PL2303 linux driver.

I'm working on Kubuntu 12.04, 32 Bit. Unfortunally, I don't know how to fix that driver on my system (getting driver source, patch em, compile, install … hmm, maybe I learn a bit and give it a try - advice is welcome).

But maybe there is an updated driver avaliable which is easy to install?

Or does someone know an alternate USB to RS232 adapter which works at 1 MBd (hardware flowcontrol via rts/cts is needed, which works pretty well with the PL2303)?

like image 421
Joe Avatar asked Nov 10 '22 11:11

Joe


1 Answers

After the realization that »Prolific and FTDI are competitors«, I bought Ftdi US232R-10 which is a FT232R based device and specified for 1 MBd transfer rate.

With this adapter I'd successfully tested communication at 1 MBd by transfering some GiB data without any error (including usage of Rts/Cts hardware flow control).

Configuring this device using stty like:

$ stty -F /dev/ttyUSB0 1000000 raw

works successfully.

like image 110
Joe Avatar answered Nov 15 '22 06:11

Joe