problem with communication over serial cable

problem with communication over serial cable

Post by Stefan Seefel » Sun, 16 Feb 2003 04:58:55



hi there,

I'm using the serial port to communicate with a peripheric
device (a tracking system) under linux. Setup and initialization
works fine, and most of the time the communication is correct, too.
However, it happens (apparently non-deterministically) that the reply
from the tracking system indicates a communication error:

The sent command consists of a message plus a checksum. The tracking
system sometimes replies indicating that the checksum doesn't match
the message. This error depends on the baud rate I use (the tracking
system can be configured for multiple rates). The error seems to
occure specifically for large messages (> 100 bytes).

Note that the same code runs fine under IRIX (O2).

Does anybody have ideas as to

1) what errors can cause this behavior ?
2) how (with what tools) can I debug it ?

Any help would be highly appreciated,

                Stefan

 
 
 

problem with communication over serial cable

Post by Frank da Cr » Sun, 16 Feb 2003 05:09:39




: I'm using the serial port to communicate with a peripheric
: device (a tracking system) under linux. Setup and initialization
: works fine, and most of the time the communication is correct, too.
: However, it happens (apparently non-deterministically) that the reply
: from the tracking system indicates a communication error:
:
: The sent command consists of a message plus a checksum. The tracking
: system sometimes replies indicating that the checksum doesn't match
: the message. This error depends on the baud rate I use (the tracking
: system can be configured for multiple rates). The error seems to
: occure specifically for large messages (> 100 bytes).
:
Suggesting a lack of effective flow control.

: Note that the same code runs fine under IRIX (O2).
:
Which has a different API for flow control and other facets of
serial-port i/o.

: Does anybody have ideas as to
:
: 1) what errors can cause this behavior ?
:
Not only flow control but almost anything else -- wiggly cables,
rays from outer space, etc.  A serial connection is not error-corrected
like a TCP one is; thus any protocol that needs to use serial ports
and aims to provide an error-corrected stream must incorporate error
detection and correction methods, like PPP does.

: 2) how (with what tools) can I debug it ?
:
Kermit:

  http://www.columbia.edu/kermit/ckermit.html

Since the device sends checksums, presumably it allows the receiver
to request retransmission.  In that case, it's easy to write a Kermit
script to execute the protocol, modeled on this one for TAP/ISO pager
protocol:

  ftp://kermit.columbia.edu/kermit/scripts/ckermit/alphapage

in the Kermit script library:

  http://www.columbia.edu/kermit/ckscripts.html

- Frank

 
 
 

1. How to set up serial port when programming serial communication

I am in the project that uses serial communication between SUN(solaris 2.4)
and Windows 95.
I use the sample program in the Stevens' Advanced Programming
in the UNIX Environment.
How to set up a serial port in this situation?

Thanks in advance.

2. Developing KDE

3. LPI exam pass mark

4. Cable pin-out for Serial Port fanout cable

5. Xfree 86 v3.1

6. Problems on Serial Communication

7. -=How do i get into a xwindow thing?

8. Serial Communication Problem

9. Problem with program doing serial communication under Cygwin

10. problems in serial communication

11. Serial communication problem

12. Problems with communication via serial port