1GPSCTL(1) GPSD Documentation GPSCTL(1)
2
3
4
6 gpsctl - control the modes of a GPS
7
9 gpsctl [-h] [-b | -n] [-x control] [-e] [-f] [-l] [-s speed]
10 [-t devicetype] [-D debuglevel] [-V] [serial-port]
11
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 almost certainly need to be running as root in order to have write
23 access to the device.
24
25 The program accepts the following options:
26
27 -b
28 Put the GPS into binary mode. After the GPS resets itself, autobaud
29 to the new speed.
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. After the GPS resets itself autobaud to its
50 new speed.
51
52 -s
53 Set the baud rate at which the GPS emits packets.
54
55 Use this option with caution. On USB and Bluetooth GPSes it is also
56 possible for serial mode setting to fail either because the serial
57 adaptor chip does not support non-8N1 modes or because the device
58 firmware does not properly synchronize the serrial adaptor chip
59 with the UART on the GPS chipset whjen the speed changes. These
60 failures can hang your device, possibly requiring a GPS power cycle
61 or (in extreme cases) physically disconnecting the NVRAM backup
62 battery.
63
64 -t
65 Force the device type.
66
67 -x
68 Send a specified control string to the GPS; gpsctl will provide
69 packet headers and trailers and checksum as appropriate for binary
70 packet types, and whatever checksum and trailer is required for
71 text packet types. (You must include the leading $ for NMEA
72 packets.) When sending to a UBX device, the first two bytes of the
73 string supplied will become the message class and type, and the
74 remainder the payload. When sending to a Navcom NCT or Trimble TSIP
75 device, the first byte is interpreted as the command ID and the
76 rest as payload. When sending to a Zodiac device, the first two
77 bytes are used as a message ID of type little-endian short, and the
78 remainder as payload in byte pairs interpreted as little-endian
79 short. C-style backslash escapes in the string, notably \xNN for
80 hex, will be interpreted; additionally, \e will be replaced with
81 ESC. This switch implies -f.
82
83 -T
84 Change the sampling timeout. Defaults to 4 seconds, which should
85 always be sufficient to get a packet from a device emitting at the
86 normal rate of 1 per second.
87
88 -h
89 Display program usage and exit.
90
91 -D
92 Set level of debug messages.
93
94 -V
95 Display program version and exit.
96
97 The argument of the forcing option. -t, should be a string which
98 should be contained in exactly one of the known driver names; for a
99 list, do gpsctl -l.
100
101 Forcing the device type behaves somewhat differently depending on
102 whether this tool is going through the daemon or not. In high-level
103 mode, if the device that daemon selects for you doesn't match the
104 driver you specified, gpsctl exits with a warning. (This may be useful
105 in scripts.)
106
107 In low-level mode, if the device identifies as a Generic NMEA, use the
108 selected driver instead. This will be useful if you have a GPS device
109 of known type that is in NMEA mode and not responding to probes. (This
110 option was originally implemented for talking to SiRFStar I chips,
111 which don't respond to the normal SiRF ID probe.)
112
113 If no options are given, the program will display a message identifying
114 the GPS type of the selected device and exit.
115
116 Reset (-r) operations must stand alone; others can be combined.
117 Multiple opations will be executed in tis order: mode changes (-b and
118 -n) first, speed changes (-s) second, and control-string sends (-c)
119 last.
120
122 gpsctl /dev/ttyUSB0
123 Attempt to identify the device on USB serial device 0. Time out
124 after the default number of seconds. Adding the -f will force
125 low-level access and suppress the normal complaint when this tool
126 can't find a GPSD to work through.
127
128 gpsctl -f -n -s 9600 /dev/ttyUSB0
129 Use low-level operations (not going through a gpsd instance) to
130 switch a GPS to NMEA mode at 9600bps. The tool will identify the
131 GPS type itself.
132
134 SiRF GPSes can only be identified by the success of an attempt to flip
135 them into SiRF binary mode. Thus, the process of probing one of these
136 running in NMEA will change its behavior.
137
139 gpsd(8), gps(1), libgps(3), libgpsd(3), gpsprof(1), gpsfake(1).
140
142 Eric S. Raymond esr@thyrsus.com. There is a project page for gpsd
143 here[1].
144
146 1. here
147 http://gpsd.berlios.de/
148
149
150
151The GPSD Project 29 Oct 2006 GPSCTL(1)