1GPSCTL(1)                     GPSD Documentation                     GPSCTL(1)
2
3
4

NAME

6       gpsctl - control the modes of a GPS
7

SYNOPSIS

9       gpsctl [-h] [-b | -n | -r] [-x control] [-e] [-f] [-l] [-s speed]
10              [-t devicetype] [-R] [-D debuglevel] [-V] [serial-port]
11

DESCRIPTION

13       gpsctl can switch a dual-mode GPS between NMEA and vendor-binary modes.
14       It can also be used to set the device baudrate. Note: Not all devices
15       have these capabilities.
16
17       If you have only one GPS attached to your machine, and gpsd is running,
18       it is not necessary to specify the device; gpsctl does its work through
19       gpsd, which will locate it for you.
20
21       When gpsd is not running, the device specification is required, and you
22       will need to be running as root or be a member of the device's owning
23       group in order to have write access to the device. On many Unix
24       variants the owning group will be named 'dialout'.
25
26       The program accepts the following options:
27
28       -b
29           Put the GPS into native (binary) mode.
30
31       -c
32           Change the GPS's cycle time. Units are seconds. Note, most GPSes
33           have a fixed cycle time of 1 second.
34
35       -e
36           Generate the packet from any other arguments specified and ship it
37           to standard output instead of the device. This switch can be used
38           with the -t option without specifying a device. Note: the packet
39           data for a binary prototype will be raw, not ASCII-ized in any way.
40
41       -f
42           Force low-level access (not through the daemon).
43
44       -l
45           List a table showing which option switches can be applied to which
46           device types, and exit.
47
48       -n
49           Put GPS into NMEA mode.
50
51       -r
52           Reset the GPS. Device port and type must be specified.
53
54       -s
55           Set the baud rate at which the GPS emits packets.
56
57           Use this option with caution. On USB and Bluetooth GPSes it is also
58           possible for serial mode setting to fail either because the serial
59           adaptor chip does not support non-8N1 modes or because the device
60           firmware does not properly synchronize the serial adaptor chip with
61           the UART on the GPS chipset when the speed changes. These failures
62           can hang your device, possibly requiring a GPS power cycle or (in
63           extreme cases) physically disconnecting the NVRAM backup battery.
64
65       -t
66           Force the device type.
67
68       -x
69           Send a specified control string to the GPS; gpsctl will provide
70           packet headers and trailers and checksum as appropriate for binary
71           packet types, and whatever checksum and trailer is required for
72           text packet types. (You must include the leading $ for NMEA
73           packets.) When sending to a UBX device, the first two bytes of the
74           string supplied will become the message class and type, and the
75           remainder the payload. When sending to a Navcom NCT or Trimble TSIP
76           device, the first byte is interpreted as the command ID and the
77           rest as payload. When sending to a Zodiac device, the first two
78           bytes are used as a message ID of type little-endian short, and the
79           remainder as payload in byte pairs interpreted as little-endian
80           short. For all other supported binary GPSes (notably including
81           SiRF) the string is taken as the entire message payload and wrapped
82           with appropriate header, trailer and checksum bytes. C-style
83           backslash escapes in the string, notably \xNN for hex, will be
84           interpreted; additionally, \e will be replaced with ESC. This
85           switch implies -f.
86
87       -T
88           Change the sampling timeout. Defaults to 8 seconds, which should
89           always be sufficient to get an identifying packet from a device
90           emitting at the normal rate of 1 per second.
91
92       -R
93           Remove the GPSD shared-memory segment used for SHM export. This
94           option will normally only be of interest to GPSD developers.
95
96       -h
97           Display program usage and exit.
98
99       -D
100           Set level of debug messages.
101
102       -V
103           Display program version and exit.
104
105       The argument of the forcing option, -t, should be a string which is
106       contained in exactly one of the known driver names; for a list, do
107       gpsctl -l.
108
109       Forcing the device type behaves somewhat differently depending on
110       whether this tool is going through the daemon or not. In high-level
111       mode, if the device that daemon selects for you doesn't match the
112       driver you specified, gpsctl exits with a warning. (This may be useful
113       in scripts.)
114
115       In low-level mode, if the device identifies as a Generic NMEA, use the
116       selected driver instead. This will be useful if you have a GPS device
117       of known type that is in NMEA mode and not responding to probes. (This
118       option was originally implemented for talking to SiRFStar I chips,
119       which don't respond to the normal SiRF ID probe.)
120
121       If no options are given, the program will display a message identifying
122       the GPS type of the selected device and exit.
123
124       Reset (-r) operations must stand alone; others can be combined.
125       Multiple options will be executed in this order: mode changes (-b and
126       -n) first, speed changes (-s) second, and control-string sends (-c)
127       last.
128

ENVIRONMENT VARIABLES

130       By setting the environment variable GPSD_SHM_KEY, you can control the
131       key value used to designate the shared-memory segment removed with the
132       -R option. This will be useful mainly when isolating test instances of
133       gpsd from production ones.
134

EXAMPLES

136       gpsctl /dev/ttyUSB0
137           Attempt to identify the device on USB serial device 0. Time out
138           after the default number of seconds. Adding the -f will force
139           low-level access and suppress the normal complaint when this tool
140           can't find a GPSD to work through.
141
142       gpsctl -f -n -s 9600 /dev/ttyUSB0
143           Use low-level operations (not going through a gpsd instance) to
144           switch a GPS to NMEA mode at 9600bps. The tool will identify the
145           GPS type itself.
146

BUGS

148       SiRF GPSes can only be identified by the success of an attempt to flip
149       them into SiRF binary mode. Thus, the process of probing one of these
150       running in NMEA will change its behavior.
151
152       Baud rate and mode changes work in direct mode but are not reliable in
153       client mode. This will be fixed in a future release.
154

SEE ALSO

156       gpsd(8), gpsdctl(8), gps(1), libgps(3), libgpsmm(3), gpsprof(1),
157       gpsfake(1).
158

AUTHOR

160       Eric S. Raymond <esr@thyrsus.com>.
161
162
163
164The GPSD Project                  29 Oct 2006                        GPSCTL(1)
Impressum