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

NAME

6       gpspipe - tool to connect to gpsd and retrieve sentences
7

SYNOPSIS

9       gpspipe [OPTIONS] [server[:port[:device]]]
10
11       gpspipe -h
12
13       gpspipe -V
14

DESCRIPTION

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

OPTIONS

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       -d, --daemonize
38           Run as a daemon.
39
40       -D LVL, --debug LVL
41           Set debug level to LVL.
42
43       -l, --sleep
44           Sleep for ten seconds before attempting to connect to gpsd. This is
45           very useful when running as a daemon, giving gpsd time to start
46           before attempting a connection.
47
48       -n COUNT, --count COUNT
49           Exit after COUNT messages are output.
50
51       -o FILE, --output FILE
52           Cause the collected data to be written to the specified file. Use
53           of this option is mandatory if gpspipe is run as a daemon.
54
55       -p, --profile
56           Dump profiling information in JSON.
57
58       -P, --pps
59           Enables dumping of PPS drift JSON in NMEA and raw modes.
60
61       -r, --nmea
62           Cause NMEA sentences to be output. This may be NMEA, pseudo NMEA
63           built from binary data, or some combination of both.
64
65       -R, --raw
66           Causes super-raw (gps binary) data to be output. This will forward
67           exactly what the device sent.
68
69       -s DEV, --serial DEV
70           Cause the collected data to be written to the specified serial
71           device (DEV) with settings 4800 8N1. Thus gpspipe can be used with
72           -s, --serial and -r, --nmea options to emulate a serial port
73           hardwired to a GPS that gpsd is managing.
74
75       -S, --scaled
76           Set the scaled flag. This is for AIS and SUBFRAME data only. Scaled
77           data will be output in the JSON, instead of raw data in the JSON.
78
79       -t, --timestamp
80           Add a UTC timestamp to each sentence output.
81
82       -T FMT, --timefmt FMT
83           Set the format of the timestamp. See strftime(3) for the available
84           placeholders. Setting this option implies -t (--timestamp). Default
85           setting is "%F %T"
86
87       -u, --usec
88           Use usec resolution time stamp, implies -t (--timestamp). Use twice
89           (-uu) to output sec.usec.
90
91       -v, --spinner
92           Show a spinning activity indicator on stderr. This is useful if
93           stdout is redirected into a file or a pipe. By default the spinner
94           is advanced with every messages written; specifying -v, or
95           --spinner, more than once will double the number of messages
96           required to rotate the spinner.
97
98       -V, --version
99           Print the program version and exit.
100
101       -w, --json
102           Cause native gpsd JSON sentences to be output.
103
104       -x SEC, --seconds SEC
105           Exit after delay of SEC seconds.
106
107       -Z, --zulu
108           Set the timestamp format iso8601: implies -t.
109
110       At least one of -R, -r or -w must be specified.
111
112       You must use -o if you use -d.
113

ARGUMENTS

115       By default, clients collect data from the local gpsd daemon running on
116       localhost, using the default GPSD port 2947. The optional argument to
117       any client may override this behavior: [server[:port[:device]]]
118
119       For further explanation, and examples, see the ARGUMENTS section in the
120       gps(1) man page
121

EXAMPLES

123       When gpsd is running, this example will send one hundred raw NMEA
124       sentences to standard output, then exit:
125
126           $ gpspipe -r -n 100
127
128       When gpsd is running, this example will wait at most 5 seconds for a
129       TPV message, print it to stdout, then exit:
130
131           $ gpspipe -x 5 -w|sed -n '/TPV/{p;q}'
132
133       Use gpspipe and "socat* to serve NMEA from the local gpsd on tcp port
134       2948:
135
136           $ socat EXEC:'gpspipe -r' TCP-LISTEN:2948,reuseaddr,fork
137
138       The paranoid may wish to have socat run as user 'nobody' and only
139       accept connections from the local network. The "su=nobody" means this
140       must be run as root:
141
142           # socat EXEC:'gpspipe -r' \
143              TCP-LISTEN:2948,reuseaddr,fork,su=nobody,range=192.168.0.0/24
144

RETURN VALUES

146       0
147           on success.
148
149       1
150           on failure
151

SEE ALSO

153       gpsd(8), gps(1), gpsfake(1), socat(1).
154

RESOURCES

156       Project web site: https://gpsd.io/
157

COPYING

159       This file is Copyright 2013 by the GPSD project
160       SPDX-License-Identifier: BSD-2-clause
161

AUTHOR

163       Gary E. Miller
164
165
166
167GPSD, Version 3.24                2022-04-27                        GPSPIPE(1)
Impressum