GPSPIPE(1)
π GPSPIPE β the gpspipe(1) page, but make it cute π
okay bestie, welcome to gpspipe(1) from the GPSD docs. it's a tiny lil' pipe tool that grabs sentences off gpsd and yeets them to stdout. let's get into it β¨
β¨ NAME β¨
gpspipe β the tool that connects to gpsd and retrieves sentences. that's it, that's the job π
β¨ SYNOPSIS β¨
gpspipe [OPTIONS] [server[:port[:device]]]
gpspipe -h
gpspipe -V
β¨ DESCRIPTION β¨
so basically: gpspipe connects to gpsd and dumps the sentences it receives straight to stdout. that's what makes it so useful β it's literally a pipe from gpsd into another program or a file. chef's kiss. π
the best part? gpspipe does not need root privileges, and you can run it at the same time as other tools that are connecting to the local gpsd without anything breaking. no chaos, no drama, just vibes π¦
the output is one or both of the raw NMEA or native gpsd sentences. each line can optionally get a timestamp slapped on it. there's also an option to exit gracefully once it's seen a given count of packets. polite queen behavior.
gpspipe can be run as a daemon, but heads up: it requires the -o, --output flag so the output actually goes somewhere β a file. no -o, no daemon era. that's the rule π
β¨ OPTIONS β¨
-?,-h,--helpβ print a usage message and dip. bye π-2,--split24β-2sets thesplit24flag on AIS reports.-B,--nobufferβ do not buffer the output. raw, unfiltered, unbothered.-d,--daemonizeβ run as a daemon.-D LVL,--debug LVLβ set debug level to LVL.-l,--sleepβ sleep for ten seconds before attempting to connect togpsd. this is very useful when running as a daemon, because it givesgpsdtime to start up before you come knocking. patience is a flex π§-n COUNT,--count COUNTβ exit after COUNT messages are output.-o FILE,--output FILEβ cause the collected data to be written to the specified file. using this option is mandatory ifgpspipeis run as a daemon. no take-backs.-p,--profileβ dump profiling information in JSON.-P,--ppsβ enables dumping of PPS drift JSON in NMEA and raw modes.-r,--nmeaβ cause NMEA sentences to be output. this may be NMEA, pseudo NMEA built from binary data, or some combination of both.-R,--rawβ causes super-raw (gps binary) data to be output. this will forward exactly what the device sent. no edits, no notes π-s DEV,--serial DEVβ cause the collected data to be written to the specified serial device (DEV) with settings4800 8N1. sogpspipecan be used with-s,--serialand-r,--nmeaoptions to emulate a serial port hardwired to a GPS thatgpsdis managing. iconique.-S,--scaledβ set thescaledflag. this is for AIS and SUBFRAME data only. scaled data will be output in the JSON, instead of raw data in the JSON.-t,--timestampβ add a UTC timestamp to each sentence output.-T FMT,--timefmt FMTβ set the format of the timestamp. seestrftime(3)for the available placeholders. setting this option implies-t(--timestamp). default setting is"%F %T".-u,--usecβ use usec resolution time stamp, implies-t(--timestamp). use it twice (-uu) to outputsec.usec.-v,--spinnerβ show a spinning activity indicator on stderr. this is useful if stdout is redirected into a file or a pipe. by default the spinner is advanced with every messages written; specifying-v, or--spinner, more than once will double the number of messages required to rotate the spinner. β¨ spinny β¨-V,--versionβ print the program version and exit.-w,--jsonβ cause native gpsd JSON sentences to be output.-x SEC,--seconds SECβ exit after delay of SEC seconds.-Z,--zuluβ set the timestamp formatiso8601: implies-t.
okay so important: at least one of-R,-ror-wmust be specified. no format, no output, no service π
and again for the people in the back: you must use-oif you use-d.
β¨ ARGUMENTS β¨
by default, clients collect data from the local gpsd daemon running on localhost, using the default GPSD port 2947. the optional argument to any client may override this behavior: [server[:port[:device]]]
for further explanation, and examples, see the ARGUMENTS section in the gps(1) man page. go read it, it's giving lore π
β¨ EXAMPLES β¨
when gpsd is running, this one sends one hundred raw NMEA sentences to standard output, then exits:
$ gpspipe -r -n 100
when gpsd is running, this one waits at most 5 seconds for a TPV message, prints it to stdout, then exits:
$ gpspipe -x 5 -w|sed -n '/TPV/{p;q}'
use gpspipe and socat to serve NMEA from the local gpsd on tcp port 2948:
$ socat EXEC:'gpspipe -r' TCP-LISTEN:2948,reuseaddr,fork
the paranoid may wish to have socat run as user 'nobody' and only accept connections from the local network. using the -B option to gpspipe will reduce latency and jitter. the "su=nobody" means this must be run as root:
# socat EXEC:'gpspipe -rB' \
TCP-LISTEN:2948,reuseaddr,fork,su=nobody,range=192.168.0.0/24
β¨ RETURN VALUES β¨
0β on success. slay β1β on failure. rip π
β¨ SEE ALSO β¨
gpsd(8), gps(1), gpsfake(1), socat(1).
β¨ RESOURCES β¨
project web site: https://gpsd.io/ π
β¨ COPYING β¨
this file is Copyright 2013 by the GPSD project SPDX-License-Identifier: BSD-2-clause
β¨ AUTHOR β¨
Gary E. Miller π
and that's the whole page, bestie π«Ά this was GPSD, Version 3.27.5, dated 2025-11-04 β now go pipe something. periodt π
π¦ where this page comes from
- arch rolling: gpsd 3.27.5-1 Β· BSD
- fedora 44: gpsd-clients 1:3.27.5-3.fc44 Β· BSD-2-Clause
- fedora 44: gpsd-clients 1:3.27.5-5.fc44 Β· BSD-2-Clause
- nixos 26.05: gpsd 3.27.5
- nixpkgs unstable: gpsd 3.27.5
- opensuse-leap 16.0: gpsd-clients 3.27.5-160000.1.1 Β· BSD-3-Clause
- opensuse-leap 16.0: gpsd-clients 3.27.5-160000.1.1 Β· BSD-3-Clause
- opensuse-leap 16.0: gpsd-clients 3.27.5-160000.1.1 Β· BSD-3-Clause
- opensuse-leap 16.0: gpsd-clients 3.27.5-160000.1.1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms