📄 gpsd.xml
字号:
<para>Sending SIGHUP to a running <application>gpsd</application>forces it to close all GPSes and all client connections. It will thenattempt to reconnect to any GPSes on its device list and resumelistening for client connections. This may be useful if your GPSenters a wedged or confused state but can be soft-reset by pullingdown DTR.</para></refsect1><refsect1 id='devices'><title>GPS DEVICE MANAGEMENT</title> <para><application>gpsd</application> maintains an internal list ofGPS devices. If you specify devices on the command line, the list isinitialized with those pathnames; otherwise the list starts empty.Commands to add and remove GPS device paths from the daemon's devicelist must be written to a local Unix-domain socket which will beaccessible only to programs running as root. This control socket willbe located wherever the -F option specifies it.</para><para>To point <application>gpsd</application> at a device that may bea GPS, write to the control socket a plus sign ('+') followed by thedevice name followed by LF or CR-LF. Thus, to point the daemon at<filename>/dev/foo</filename>. send "+/dev/foo\n". To tell the daemonthat a device has been disconnected and is no longer available, send aminus sign ('-') followed by the device name followed by LF orCR-LF. Thus, to remove <filename>/dev/foo</filename> from the searchlist. send "-/dev/foo\n".</para><para>To send a control string to a specified device, write to the control socket a '!', followed by the device name, followed by '=',followed by the control string.</para><para>Your client may await a response, which will be a line beginningwith either "OK" or "ERROR". An ERROR reponse to an add command meansthe device did not emit data recognizable as GPS packets; an ERRORresponse to a remove command means the specified device was not in<application>gpsd</application>'s device list. An ERROR response to a! command means the daemon did not recognize the devicenamespecified.</para><para>The control socket is intended for use by hotplug scripts and other device-discovery services. This control channel is separate from the public <application>gpsd</application> service port, and onlylocally accessible, in order to prevent remote denial-of-service andspoofing attacks.</para></refsect1><refsect1 id='accuracy'><title>ACCURACY</title> <para>The base user error (UERE) of GPSes is 8 meters or less at 66%confidence, 15 meters or less at 95% confidence. Actual horizontalerror will be UERE times a dilution factor dependent on currentsatellite position. Altitude determination is more sensitive tovariability to atmospheric signal lag than latitude/longitude, and isalso subject to errors in the estimation of local mean sea level; baseerror is 12 meters at 66% confidence, 23 meters at 95% confidence.Again, this will be multiplied by a vertical dilution of precision(VDOP) dependent on satellite geometry, and VDOP is typically largerthan HDOP. Users should <emphasis>not</emphasis> rely on GPS altitude forlife-critical tasks such as landing an airplane.</para><para>These errors are intrinsic to the design and physics of the GPSsystem. <application>gpsd</application> does its internalcomputations at sufficient accuracy that it will add no measurableposition error of its own.</para><para>DGPS correction will reduce UERE from roughly 8 meters toroughly 2 meters, provided you are within about 100mi (160km) of aDGPS ground station.</para><para>On a 4800bps connection, the time latency of fixes provided by<application>gpsd</application> will be one second or less 95% of thetime. Most of this lag is due to the fact that GPSes normally emitfixes once per second, thus expected latency is 0.5sec. On thepersonal-computer hardware available in 2005, computation lag inducedby <application>gpsd</application> will be negligible, on the order ofa millisecond. Nevertheless, latency can introduce significant errorsfor vehicles in motion; at 50km/h (31mi/h) of speed over ground, 1second of lag corresponds to 13.8 meters change in position betweenupdates.</para></refsect1><refsect1 id='ntp'><title>USE WITH NTP</title> <para>gpsd can provide reference clock information to<application>ntpd</application>, to keep the system clock synchronizedto the time provided by the GPS receiver. This facility isonly available when the daemon is started from root. If you're goingto use <application>gpsd</application> you probably want to run it<option>-n</option> mode so the clock will be updated even when noclients are active.</para><para>Note that deriving time from messages received from the GPS isnot as accurate as you might expect. Messages are often delayed inthe receiver and on the link by several hundred milliseconds, and thisdelay is not constant. On Linux, <application>gpsd</application>includes support for interpreting the PPS pulses emitted at the startof every clock second on the carrier-detect lines of some serialGPSes; this pulse can be used to update NTP at much higher accuracythan message time provides. You can determine whether your GPS emitsthis pulse by running at -D 5 and watching for carrier-detect statechange messages in the logfile. On OpenBSD <application>gpsd</application>makes use of the nmea(4) line discipline and the tty(4) timestampingfacilities to export PPS time via the sensors framework. OpenBSD's ntpduses these sensors to adjust the hardware clock and frequency. To makeuse of this feature, <application>gpsd</application> must be startedas root so it can activate the timestamping and line discipline; afterattempting to set up PPS, it will relinquish root privileges.</para><para>When <application>gpsd</application> receives a sentence with atimestamp, it packages the received timestamp with current local timeand sends it to a shared-memory segment with an ID known to<application>ntpd</application>, the network time synchronizationdaemon. If <application>ntpd</application> has been properlyconfigured to receive this message, it will be used to correct thesystem clock.</para><para>Here is a sample <filename>ntp.conf</filename> configurationstanza telling <application>ntpd</application> how to read the GPSnotfications:</para><programlisting>server 127.127.28.0 minpoll 4 maxpoll 4fudge 127.127.28.0 time1 0.420 refid GPSserver 127.127.28.1 minpoll 4 maxpoll 4 preferfudge 127.127.28.1 refid GPS1</programlisting><para>The magic pseudo-IP address 127.127.28.0 identifies unit 0 ofthe <application>ntpd</application> shared-memory driver; 127.127.28.1identifies unit 1. Unit 0 is used for message-decoded time and unit 1for the (more accurate, when available) time derived from the PPSsynchronization pulse. Splitting these notifications allows<application>ntpd</application> to use its normal heuristics to weightthem.</para><para>With this configuration, <application>ntpd</application> willread the timestamp posted by <application>gpsd</application> every 16seconds and send it to unit 0. The number after the parameter time1is an offset in seconds. You can use it to adjust out some of thefixed delays in the system. 0.035 is a good starting value for theGarmin GPS-18/USB, 0.420 for the Garmin GPS-18/LVC.</para><para>After restarting ntpd, a line similar to the one below shouldappear in the output of the command "ntpq -p" (after allowing a coupleof minutes):</para><screen> remote refid st t when poll reach delay offset jitter=========================================================================+SHM(0) .GPS. 0 l 13 16 377 0.000 0.885 0.882</screen><para>If you are running PPS then it will look like this:</para><screen> remote refid st t when poll reach delay offset jitter=========================================================================-SHM(0) .GPS. 0 l 13 16 377 0.000 0.885 0.882*SHM(1) .GPS1. 0 l 11 16 377 0.000 -0.059 0.006</screen><para>When the value under "reach" remains zero, check that gpsd isrunning; and some application is connected to it or the '-n' option wasused. Make sure the receiver is locked on to at least one satellite,and the receiver is in SiRF binary, Garmin binary or NMEA/PPS mode. PlainNMEA will also drive ntpd, but the accuracy as bad as one second. Whenthe SHM(0) line does not appear at all, check the system logs for errormessages from ntpd.</para><para>When no other reference clocks appear in the NTP configuration,the system clock will lock onto the GPS clock. When you have previouslyused <application>ntpd</application>, and other reference clocks appearin your configuration, there may be a fixed offset between the GPS clockand other clocks. The <application>gpsd</application> developers wouldlike to receive information about the offsets observed by users for eachtype of receiver. Please send us the output of the "ntpq -p" commandand the make and type of receiver.</para></refsect1><refsect1 id='dbus'><title>USE WITH D-BUS</title> <para>On operating systems that support D-BUS,<application>gpsd</application> can be built to broadcast GPS fixes toD-BUS-aware applications. As D-BUS is still at a pre-1.0 stage, wewill not attempt to document this interface here. Read the<application>gpsd</application> source code to learn more.</para></refsect1><refsect1 id='security'><title>SECURITY AND PERMISSIONS ISSUES</title> <para><application>gpsd</application> must start up as root in orderto open the NTPD shared-memory segment, open its logfile, and createits local control socket. Before doing any processing of GPS data, ittries to drop root privileges by setting its UID to "nobody" (or anotheruserid as set by configure) and its group ID to the group of the initialGPS passed on the command line — or, if that device doesn't exist,to the group of <filename>/dev/ttyS0</filename>.</para><para>Privilege-dropping is a hedge against the possibility thatcarefully crafted data, either presented from a client socket or froma subverted serial device posing as a GPS, could be used to inducemisbehavior in the internals of <application>gpsd</application>.It ensures that any such compromises cannot be used for privilegeelevation to root.</para><para>The assumption behind <application>gpsd</application>'sparticular behavior is that all the tty devices to which a GPS mightbe connected are owned by the same non-root group and allow groupread/write, though the group may vary because of distribution-specificor local administrative practice. If this assumption is false,<application>gpsd</application> may not be able to open GPS devices inorder to read them (such failures will be logged).</para><para>In order to fend off inadvertent denial-of-service attacks byport scanners (not to mention deliberate ones),<application>gpsd</application> will time out inactive clientconnections. Before the client has issued a command that requests achannel assignment, a short timeout (60 seconds) applies. There is notimeout for clients in watcher or raw modes; rather,<application>gpsd</application> drops these clients if they fail toread data long enough for the outbound socket write buffer to fill.Clients with an assigned device in polling mode are subject to alonger timeout (15 minutes).</para></refsect1><refsect1 id='limitations'><title>LIMITATIONS</title> <para>If multiple NMEA talkers are feeding RMC, GLL, and GGA sentencesto the same serial device (possible with an RS422 adapter hooked up tosome marine-navigation systems), an 'O' response may mix an altitudefrom one device's GGA with latitude/longitude from another's RMC/GLLafter the second sentence has arrived.</para><para><application>gpsd</application> may change control settings onyour GPS (such as the emission frequency of various sentences orpackets) and not restore the original settings on exit. This is aresult of inadequacies in NMEA and the vendor binary GPS protocols,which often do not give clients any way to query the values of controlsettings in order to be able to restore them later.</para><para>If your GPS uses a SiRF chipset at firmware level 231, and it isafter 31 May 2007, reported UTC time may be off by the differencebetween 13 seconds and whatever leap-second correction is currentlyapplicable, from startup until complete subframe information isreceived (normally about six seconds). Firmware levels 232 and updon't have this problem. You may run <application>gpsd</application> atdebug level 4 to see the chipset type and firmware revisionlevel.</para><para>When using SiRF chips, the VDOP/TDOP/GDOP figures and associatederror estimates are computed by <application>gpsd</application> ratherthan reported by the chip. The computation does not exactly matchwhat SiRF chips do internally, which includes some satellite weightingusing parameters <application>gpsd</application> cannot see.</para><para>Autobauding on the Trimble GPSes can take as long as 5 secondsif the device speed is not matched to the GPS speed.</para><para>If you are using an NMEA-only GPS (that is, not using SiRF orGarmin or Zodiac binary mode) and the GPS does not emit GPZDA at thestart of its update cycle (which most consumer-grade NMEA GPSes donot) and it is after 2099, then the century part of the dates<application>gpsd</application> delivers will be wrong.</para></refsect1><refsect1 id='files'><title>FILES</title><variablelist><varlistentry><term><filename>/dev/ttyS0</filename></term><listitem><para>Prototype TTY device. After startup,<application>gpsd</application> sets its group ID to the owner of thisdevice if no GPS device was specified on the command line does notexist.</para></listitem></varlistentry><!--<varlistentry><term><filename>/usr/share/gpsd/dgpsip-servers</filename></term><listitem><para>A text file listing DGPSIP servers worldwide. If no DGPSIPserver is specified at startup (via the -d option)<application>gpsd</application> will look here to find the nearest one. Each line has three space-separated fields: latitude (decimal degrees), longitude (decimal degrees) anda server name (optionally followed by a colon and a port number).Text following # on a line is ignored. Blank lines are ignored.</para></listitem></varlistentry>--></variablelist></refsect1><refsect1 id='standards'><title>APPLICABLE STANDARDS</title> <para>The official NMEA protocol standard is available on paper fromthe <ulink url='http://www.nmea.org/pub/0183/'>National MarineElectronics Association</ulink>, but is proprietary and expensive; themaintainers of <application>gpsd</application> have made a point ofnot looking at it. The <ulink url="http://gpsd.berlios.de/">GPSDwebsite</ulink> links to several documents that collect publiclydisclosed information about the protocol.</para><para><application>gpsd</application> parses the following NMEAsentences: RMC, GGA, GLL, GSA, GSV, VTG, ZDA. It recognizes thesewith either the normal GP talker-ID prefix, or with the II prefixemitted by Seahawk Autohelm marine navigation systems, or with the INprefix emitted by some Garmin units. It recognizes one vendorextension, the PGRME emitted by some Garmin GPS models.</para><para>Note that <application>gpsd</application> returns pure decimaldegrees, not the hybrid degree/minute format described in the NMEAstandard.</para></refsect1><refsect1 id='see_also'><title>SEE ALSO</title><para><citerefentry><refentrytitle>gps</refentrytitle><manvolnum>1</manvolnum></citerefentry>,<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>,<citerefentry><refentrytitle>libgpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,<citerefentry><refentrytitle>gpsprof</refentrytitle><manvolnum>1</manvolnum></citerefentry>,<citerefentry><refentrytitle>gpsfake</refentrytitle><manvolnum>1</manvolnum></citerefentry>,<citerefentry><refentrytitle>gpsctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,<citerefentry><refentrytitle>gpscat</refentrytitle><manvolnum>1</manvolnum></citerefentry>,<citerefentry><refentrytitle>rtcm-104</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></refsect1><refsect1 id='maintainer'><title>AUTHORS</title> <para>Remco Treffcorn, Derrick Brashear, Russ Nelson, Eric S. Raymond,Chris Kuethe. This manual page by Eric S. Raymond<email>esr@thyrsus.com</email>. There is a project site at <ulinkurl="http://gpsd.berlios.de/">here</ulink>.</para></refsect1></refentry>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -