1GPSPIPE(1) GPSD Documentation GPSPIPE(1)
2
3
4
6 gpspipe - tool to connect to gpsd and retrieve sentences
7
9 gpspipe [OPTIONS] [server[:port[:device]]]
10
11 gpspipe -h
12
13 gpspipe -V
14
16 gpspipe is a tool to connect to gpsd and output the received sentences
17 to stdout. This makes the program useful as a pipe from gpsd to another
18 program or file.
19
20 gpspipe does not require root privileges, and can be run concurrently
21 with other tools connecting to the local gpsd without causing problems.
22
23 The output will consist of one or both of the raw NMEA or native gpsd
24 sentences. Each line can be optionally time stamped. There is also an
25 option to exit gracefully after a given count of packets.
26
27 gpspipe may be run as a daemon, but requires the -o, --output flag for
28 writing the output to a file.
29
31 -?, -h, --help
32 Print a usage message and exit.
33
34 -2, --split24
35 -2 sets the split24 flag on AIS reports.
36
37 -B, --nobuffer
38 Do not buffer the output.
39
40 -d, --daemonize
41 Run as a daemon.
42
43 -D LVL, --debug LVL
44 Set debug level to LVL.
45
46 -l, --sleep
47 Sleep for ten seconds before attempting to connect to gpsd. This is
48 very useful when running as a daemon, giving gpsd time to start
49 before attempting a connection.
50
51 -n COUNT, --count COUNT
52 Exit after COUNT messages are output.
53
54 -o FILE, --output FILE
55 Cause the collected data to be written to the specified file. Use
56 of this option is mandatory if gpspipe is run as a daemon.
57
58 -p, --profile
59 Dump profiling information in JSON.
60
61 -P, --pps
62 Enables dumping of PPS drift JSON in NMEA and raw modes.
63
64 -r, --nmea
65 Cause NMEA sentences to be output. This may be NMEA, pseudo NMEA
66 built from binary data, or some combination of both.
67
68 -R, --raw
69 Causes super-raw (gps binary) data to be output. This will forward
70 exactly what the device sent.
71
72 -s DEV, --serial DEV
73 Cause the collected data to be written to the specified serial
74 device (DEV) with settings 4800 8N1. Thus gpspipe can be used with
75 -s, --serial and -r, --nmea options to emulate a serial port
76 hardwired to a GPS that gpsd is managing.
77
78 -S, --scaled
79 Set the scaled flag. This is for AIS and SUBFRAME data only. Scaled
80 data will be output in the JSON, instead of raw data in the JSON.
81
82 -t, --timestamp
83 Add a UTC timestamp to each sentence output.
84
85 -T FMT, --timefmt FMT
86 Set the format of the timestamp. See strftime(3) for the available
87 placeholders. Setting this option implies -t (--timestamp). Default
88 setting is "%F %T"
89
90 -u, --usec
91 Use usec resolution time stamp, implies -t (--timestamp). Use twice
92 (-uu) to output sec.usec.
93
94 -v, --spinner
95 Show a spinning activity indicator on stderr. This is useful if
96 stdout is redirected into a file or a pipe. By default the spinner
97 is advanced with every messages written; specifying -v, or
98 --spinner, more than once will double the number of messages
99 required to rotate the spinner.
100
101 -V, --version
102 Print the program version and exit.
103
104 -w, --json
105 Cause native gpsd JSON sentences to be output.
106
107 -x SEC, --seconds SEC
108 Exit after delay of SEC seconds.
109
110 -Z, --zulu
111 Set the timestamp format iso8601: implies -t.
112
113 At least one of -R, -r or -w must be specified.
114
115 You must use -o if you use -d.
116
118 By default, clients collect data from the local gpsd daemon running on
119 localhost, using the default GPSD port 2947. The optional argument to
120 any client may override this behavior: [server[:port[:device]]]
121
122 For further explanation, and examples, see the ARGUMENTS section in the
123 gps(1) man page
124
126 When gpsd is running, this example will send one hundred raw NMEA
127 sentences to standard output, then exit:
128
129 $ gpspipe -r -n 100
130
131 When gpsd is running, this example will wait at most 5 seconds for a
132 TPV message, print it to stdout, then exit:
133
134 $ gpspipe -x 5 -w|sed -n '/TPV/{p;q}'
135
136 Use gpspipe and "socat* to serve NMEA from the local gpsd on tcp port
137 2948:
138
139 $ socat EXEC:'gpspipe -r' TCP-LISTEN:2948,reuseaddr,fork
140
141 The paranoid may wish to have socat run as user 'nobody' and only
142 accept connections from the local network. Using the -B" option to
143 *gpspipe will reduce latency and jitter The "su=nobody" means this
144 must be run as root:
145
146 # socat EXEC:'gpspipe -rB' \
147 TCP-LISTEN:2948,reuseaddr,fork,su=nobody,range=192.168.0.0/24
148
150 0
151 on success.
152
153 1
154 on failure
155
157 gpsd(8), gps(1), gpsfake(1), socat(1).
158
160 Project web site: https://gpsd.io/
161
163 This file is Copyright 2013 by the GPSD project
164 SPDX-License-Identifier: BSD-2-clause
165
167 Gary E. Miller
168
169
170
171GPSD, Version 3.25 2023-01-10 GPSPIPE(1)