Serial port error statistics - any comparable data?
Hendrik van Rooyen
mail at microcorp.co.za
Sun Mar 30 15:49:16 CEST 2008
"Diez B. Roggisch" wrote:
>RS232 is unfortunately as bad as a "protocol" as it can get. I've used
>it for communication with a microcontroller for just a few bytes every
>second. And it failed miserably, so I needed to implement a protocol on
>top of it.
We normally do this anyway, except for stuff like menus that are intended
for interactive use as setup - doing without on machine to machine comms
feels a bit too cowboy...
>The machine spec is totally irrelevant - what is interesting is the
>serial hardware you use. Are you by any chance using a
>serial2usb-converter? I had nothing but troubles with these.
I have also heard rumours about this, and you have just hardened
my admittedly irrational attitude towards them. I have never used
one in anger.
>if you have the chance, try & attach a machine with legacy rs232 port,
>and see if the errors still remain.
Alas - the port in question is the native legacy motherboard port.
If it were windows, it would be COM1...
I had hoped that somebody would have done some similar work,
so that we could compare notes on the error frequency. It does not
seem likely though - If I was not testing the performance of the
Lantronix xport device, I would not have kept stats either - it is kind
of tedious to sit and watch the fox scroll up the screen for days on end..
It just surprised me to find that the errors were made in the PC's receive.
I proved this by short circuiting the xport's receive and transmit at the
RS-232 level and gave up after some ten million error free lines. (Most
of an afternoon, overnight, and most of the next morning ;-( )
Then Castironpi wrote:
>Transmit observed minus expected to cluster.
The "cluster" in all the cases observed is the loss of exactly one character,
somewhere from around more or less the middle of the string:
"The quick brown fox jumps over the lazy dog 0123456789"
Why do you make the assertion that the errors would cluster?
>What kind of tables does the input device build?
Whatever the kernel and the cpython implementation does to receive
the string from a port unblocked with fcntl - and the throw away python
script that does the echoing builds the string up with a read(1).
And before I get flamed for wasting resources - The read(1) is necessary
to be able to run a protocol, later.
More information about the Python-list