Scroll to navigation

GPSRINEX(1) GPSD Documentation GPSRINEX(1)


gpsrinex - Read data from gpsd convert to RINEX3 and save to a file.


gpsrinex [-D debuglevel] [-f filename] [-h] [-i interval] [-n count] [-V] [server [:port [:device]]]


gpsrinex is a tool to connect to gpsd and output the received raw measurements as a RINEX 3 observation file. This is useful for sending raw measurements (pseudorange and carrierphase) from gpsd to a Precise Point Positioning (PPP) program or service.

gpsrinex does not require root privileges, and can be run concurrently with other tools connecting to a local or remote gpsd without causing problems.

gpsrinex needs the GPS receiver to be sending raw measurements to gpsd. Only a few GPS have this capability. In addition, the gpsd driver for that GPS must support raw mode. Currently only the u-blox driver has this support. Only a few u-blox 8 GPS implment the required UBX-RXM-RAWX message. The NEO-M8T is known to work, but requires configuration with ubxtool.

RINEX has its own definitions and abbreviations. Be sure to consult their documentation. An observation file (.obs) contains data sets, called epochs, that contain the pseudorange and carrierphase for each satellite seen.

gpsrinex by default will acquire 20 epochs spaced apart by 30 seconds. That will take 10 minutes to complete. Most users consider the 30 second interval to be optimal. Many PPP programs require at least 1 or 2 hours data, but no more than 24 or 48 hours of data. Most users consider 4 to 6 hours of data as a minimum for good accuracy. Additional hours will not yield much improvement.

The output will consist of one RINEX 3 observation file that is ready to be read by your PPP program. The default filename will be in the form: gpsrinexYYYYJJJHHMMSS.obs. You can override this filename with the -f option.

Optionally a server, TCP/IP port number and remote device can be given. If omitted, gpsrinex connects to localhost on the default port (2947) and watches all devices opened by gpsd.


-D [debuglevel] set debug level to [debuglevel].

-f [filename] save RINEX into [filename].

-h makes gpsrinex print a usage message and exit.

-i [interval] wait [interval] seconds between epochs. OPUS accepts intervals of 1, 2, 3, 5, 10, 15 or,30 seconds. OPUS then reduces the data to 30 second intervals. Defeault is 30.

-n [count] causes [count] epochs to be output. OPUS requires a minimum af 15 minutes, and a maximum of 48 hours, of data.

-V makes gpsrinex print its version and exit.


Example 1:

Create a 4 hour .obs file. With a running gpsd accessible on the localhost do all of the following, in order. Order matters.

The raw measurement messages are long. Be sure your serial port speed is high enough:

gpsctl -s 115200

Disable all NMEA messages, and enable binary messages:

ubxtool -d NMEA
ubxtool -e BINARY

The NEO-M8N will only reliably output raw measurements when only the GPS and QZSS constellations are enabled. If your PPP service can use GLONASS, then enable that as well. Be sure to disable, before enable, so as not to momentarily have too many constellations selected. ubxtool, as recommended by u-blox, enables the QZSS constellation in tandem with GPS. Disable all constellations, except GPS (and QZSS):

ubxtool -d BEIDOU
ubxtool -d GALILEO
ubxtool -d GLONASS
ubxtool -d SBAS
ubxtool -e GPS

Verify the constellations enabled:

ubxtool -p CFG-GNSS

Enable the good stuff, the raw measurement messages:

ubxtool -e RAWX

Verify raw data messages are being sent:

ubxtool | fgrep RAWX

You should see this output:


Collect 4 hours of samples at 30 second intervals, save the RINEX 3 observations in the file today.obs:

gpsrinex -i 30 -n 480 -f today.obs

Wait 4 hours. Enjoy a meal, or do some exercise. When gpsrinex finishes, upload the file today.obs to your favorite PPP service.

Example 2:

Collect raw masurement data from a remote gpsd. The process it later with gpsrinex and gpsprof.

Ensure the GPS is configured properly, as shown in Example 1.

Grab 4 hours of raw live data from remote gpsd at

gpspipe -x 14400 -R > 4h-raw.ubx

When gpspipe is complete, feed the data to gpsfake:

gpsfake -1 -P 3000 4h-raw.ubx

In another window, feed the data to gpsrinex. Use -n 10000000 so that all the data from the raw file is used::

gpsrinex -i 30 -n 1000000

Repeat the process with gpsfake to send the data to gpsprof.


One service known to work with obsrinex output is at:

OPUS requires 2 frequency observation files.

The curious can find the RINEX 3.03 format described here:

gpsd(8), gpsfake(1), ubxtool(1).


Gary E. Miller <>.
09 Nov 2018 The GPSD Project