I an setting up a stratum 1 ntp server using a GPS as a reference clock.
To do this, the GPS talks to the computer through one serial port for
the time information and a second serial port for a pps (pulse per
second) signal to condition the computer's clock.

The default serial port configuration for the GPS is 4800 8N1 with no
flow control. I can monitor the GPS 'sentences', from the command line
with:

 stty --file /dev/ttyS0 4800 igncr 
 cat /dev/ttyS0

or I cam use minicom, and monitor the data whether flow control is on or
off.

(BTW: the output data looks something like this:
$GPGSV,3,1,11,01,00,000,,02,00,000,,03,00,000,,25,00,000,*7C
$GPGSV,3,2,11,26,00,000,,27,00,000,,28,00,000,,29,00,000,*78
$GPGSV,3,3,11,30,00,000,,31,00,000,,32,00,000,,,,,*49
$PGRME,,,,,,*4D
$GPRMC,142410,V,2503.715)

The problem is that you occasionally need to talk to the GPS as well
through the first serial port.

I can do this with minicom, because I can turn off flow control, but I
cannot do it from the command line and when I exit minicom, it resets
the
port with flow control turned on.

A command sentence, say to turn off the $PGRMC sentence above that
contains no useful data, would look like:

$PGRMO,PGRME,0

To make matters worse, the command sentence must end with a <CR><LF> or
0D 0A hex.

The questions:

How do I configure the serial ports from the command line (or a shell
script) or change the default setup on boot? They need to be 4800 8N1
flow control none.

How do I generate a carriage return, line feed from the command line so
that a command like:

cat \$PGRMO,PGRME,0<CR><LF> > /dev/ttyS0

would work? Specifically, is there an escape or Alt key sequence that
will generate the code for carriage return and line feed?

Thank you for the help.  John T

Reply via email to