NMEA serial driver using 9600 baud rate

186 views
Skip to first unread message

Chaofu Chen

unread,
Apr 17, 2010, 1:37:15 PM4/17/10
to
Hi all, I'm confused that ntp does not support NMEA serial driver using 9600 baud rate. According to the doc, this should done by specifing "mode 18"(GGA sentence at speed of 9600bps) in ntp.conf. while it seems does not work in my case(FreeBSD 7.2R with NTP v4.2.4p5).

Any suggestions?
thx :)

Dave Hart

unread,
Apr 18, 2010, 6:48:28 PM4/18/10
to

You must be looking at documentation for a newer revision of the NMEA
driver. In 4.2.4p5 it supports 4800 only unless you hack the source:

fd = refclock_open(device, SPEED232, LDISC_CLK);

becomes:

fd = refclock_open(device, B9600, LDISC_CLK);

Alternatively, use a newer ntpd built from a ntp.org tarball. Here's
the text of the driver20.html for 4.2.4p5:

Generic NMEA GPS Receiver

--------------------------------------------------------------------------------

Synopsis
Address: 127.127.20.u
Reference ID: GPS
Driver ID: GPS_NMEA
Serial Port: /dev/gpsu; 4800 baud, 8-bits, no parity
Serial Port: /dev/gpsu; symlink to server:port (for nmead) Features: tty_clk

Description
This driver supports GPS receivers with the $GPRMC NMEA output string
by default. Alternately the $GPGGA or $GPGLL may be selected.

The driver expects the receiver to be set up to transmit a $GPRMC
message every second.

The accuracy depend on the receiver used. Inexpesive GPS models are
available with a claimed PPS signal accuracy of 1 ms or better
relative to the broadcast signal. However, in most cases the actual
accuracy is limited by the precision of the timecode and the latencies
of the serial interface and operating system.

If the Operating System supports the PPSAPI, RFC-2783, it will be used.


The various GPS sentences that this driver recognises look like this:
(others quietly ignored)

$GPRMC,POS_UTC,POS_STAT,LAT,LAT_REF,LON,LON_REF,SPD,HDG,DATE,MAG_VAR,MAG_REF*CC<cr><lf>
$GPGLL,LAT,LAT_REF,LONG,LONG_REF,POS_UTC,POS_STAT*CC<cr><lf>
$GPGGA,POS_UTC,LAT,LAT_REF,LONG,LONG_REF,FIX_MODE,SAT_USED,HDOP,ALT,ALT_UNIT,GEO,G_UNIT,D_AGE,D_REF*CC<cr><lf>

POS_UTC - UTC of position. Hours, minutes and seconds [fraction
(opt.)]. (hhmmss[.fff])
POS_STAT - Position status. (A = Data valid, V = Data invalid)
LAT - Latitude (llll.ll)
LAT_REF - Latitude direction. (N = North, S = South)
LON - Longitude (yyyyy.yy)
LON_REF - Longitude direction (E = East, W = West)
SPD - Speed over ground. (knots) (x.x)
HDG - Heading/track made good (degrees True) (x.x)
DATE - Date (ddmmyy)
MAG_VAR - Magnetic variation (degrees) (x.x)
MAG_REF - Magnetic variation (E = East, W = West)
FIX_MODE - Position Fix Mode ( 0 = Invalid, >0 = Valid)
SAT_USED - Number Satellites used in solution
HDOP - Horizontal Dilution of Precision
ALT - Antenna Altitude
ALT_UNIT - Altitude Units (Metres/Feet)
GEO - Geoid/Elipsoid separation
G_UNIT - Geoid units (M/F)
D_AGE - Age of last DGPS Fix
D_REF - Reference ID of DGPS station
CC - Checksum (optional)
<cr><lf> - Sentence terminator.
Alternate GPS sentences (other than $GPRMC - the default) may be
enabled by setting the relevent bits of 'mode' in the server
configuration line
* server 127.127.20.x mode X
bit 0 - enables RMC ( value = 1)
bit 1 - enables GGA ( value = 2)
bit 2 - enables GLL ( value = 4)
multiple sentences may be selected

The driver will send a $PMOTG,RMC,0000*1D<cr><lf> message each time a
$GPRMC string is needed. This is not needed on most GPS receivers
because they automatically send the $GPRMC string every second and
will only work on GPS receivers that understand the $PMOTG string.
Others will just ignore it.

Setting up the Garmin GPS-25XL
Switch off all output with by sending it the following string.
"$PGRMO,,2<cr><lf>"
Now switch only $GPRMC on by sending it the following string.

"$PGRMO,GPRMC,1<cr><lf>"
On some systems the PPS signal isn't switched on by default. It can be
switched on by sending the following string.

"$PGRMC,,,,,,,,,,,,2<cr><lf>"
Monitor Data
The GPS sentence(s) that is used is written to the clockstats file.

Fudge Factors
time1 time
Specifies the time offset calibration factor, in seconds and fraction,
with default 0.0.
time2 time
Not used by this driver.
stratum number
Specifies the driver stratum, in decimal from 0 to 15, with default 0.
refid string
Specifies the driver reference identifier, an ASCII string from one to
four characters, with default GPS.
flag1 0 | 1
Not used by this driver.
flag2 0 | 1
Specifies the PPS signal on-time edge: 0 for assert (default), 1 for clear.
flag3 0 | 1
Controls the kernel PPS discipline: 0 for disable (default), 1 for enable.
flag4 0 | 1
Not used by this driver.
Additional Information

Reference Clock Drivers


Cheers,
Dave Hart

David Lord

unread,
Apr 18, 2010, 8:05:45 PM4/18/10
to

Type 22 driver on 4.2.4p6 here doesn't appear to support other
than 4800.

You could try with gpsd and shm type 28 driver since gpsd should
auto detect/set baud rate. I didn't have any success with that
due to poor reception at time I tried and using a not very good
GPS (GS-BR-304).


David

Steve Kostecke

unread,
Apr 20, 2010, 9:33:59 AM4/20/10
to
On 2010-04-17, Chaofu Chen <chaof...@yahoo.com> wrote:

> Hi all, I'm confused that ntp does not support NMEA serial driver
> using 9600 baud rate. According to the doc,

http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver20.html is the
documentation for the NMEA driver in NTP 4.2.6* (the NTP-dev release).

> this should done by specifing "mode 18"(GGA sentence at speed of
> 9600bps) in ntp.conf. while it seems does not work in my case(FreeBSD
> 7.2R with NTP v4.2.4p5).

The documentation for the NMEA driver in your version is NTP is:

http://doc.ntp.org/4.2.4/drivers/driver20.html

--
Steve Kostecke <kost...@ntp.org>
NTP Public Services Project - http://support.ntp.org/

David Lord

unread,
Apr 20, 2010, 10:39:16 AM4/20/10
to
David Lord wrote:
> Chaofu Chen wrote:
>> Hi all, I'm confused that ntp does not support NMEA serial driver
>> using 9600 baud rate. According to the doc, this should done by
>> specifing "mode 18"(GGA sentence at speed of 9600bps) in ntp.conf.
>> while it seems does not work in my case(FreeBSD 7.2R with NTP v4.2.4p5).
>>
>> Any suggestions?
>> thx :)
>
> Type 22 driver on 4.2.4p6 here doesn't appear to support other
> than 4800.

OOPS

bit late now, that was a typo and should have been "type 20"

Reply all
Reply to author
Forward
0 new messages