'\" t .\" Title: gpsprof .\" Author: Eric S. Raymond .\" Generator: Asciidoctor 2.0.20 .\" Date: 2023-01-10 .\" Manual: GPSD Documentation .\" Source: GPSD, Version 3.25 .\" Language: English .\" .TH "GPSPROF" "1" "2023-01-10" "GPSD, Version 3.25" "GPSD Documentation" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" gpsprof \- profile a GPS and gpsd, plotting latency information .SH "SYNOPSIS" .sp \fBgpsprof\fP [OPTIONS] [server[:port[:device]]] .sp \fBgpsprof\fP \-h .sp \fBgpsprof\fP \-V .SH "DESCRIPTION" .sp \fBgpsprof\fP performs accuracy, latency, skyview, and time drift profiling on a GPS. It emits to standard output a GNUPLOT program that draws one of several illustrative graphs. It can also be told to emit the raw profile data. .sp Information from the default spatial plot it provides can be useful for characterizing position accuracy of a GPS. .sp \fBgpsprof\fP uses instrumentation built into gpsd. It can read data from a local or remote running gpsd. Or it can read data from a saved logfile. .sp \fBgpsprof\fP is designed to be lightweight and use minimal host resources. No graphics subsystem needs to be installed on the host running \fBgpsprof\fP. Simply copy the resultant plot file to another host to be rendered with \fBgnuplot(1)\fP. .sp \fBgpsprof\fP does not require root privileges, but it will run fine as root. .SH "OPTIONS" .sp The \fB\-f, \-\-formatter\fP option sets the plot type. Currently the following plot types are defined: .sp \fBspace\fP .RS 4 Generate a scatterplot of fixes and plot probable error circles. This data is only meaningful if the GPS is held stationary while \fBgpsprof\fP is running. Various statistics about the fixes are listed at the bottom. This is the default plot type. .RE .sp \fBpolar\fP .RS 4 Generate a heat map of reported satellite Signal to Noise Ratio (SNR) using polar coordinates. A colored dot is plotted for each satellite seen by the GPS. The color of dot corresponds to the SNR of the satellite. The dots are plotted by azimuth and elevation. North, azimuth 0 degrees, is at the top of the plot. Directly overhead, elevation of 90 degrees, is plotted at the center. Useful for analyzing the quality of the skyview as seen by the GPS. .RE .sp \fBpolarunused\fP .RS 4 Similar to the polar plot, but only unused satellites are plotted. Useful for seeing which parts of the antenna skyview are obstructed, degraded, below the GPS elevation mask, or otherwise rejected. .RE .sp \fBpolarused\fP .RS 4 Similar to the polar plot, but only satellites used to compute fixes are plotted. Useful for seeing which parts of the antenna skyview are being used in fixes. .RE .sp \fBtime\fP .RS 4 Plot delta of system clock (NTP corrected time) against GPS time as reported in PPS messages. The X axis is sample time in seconds from the start of the plot. The Y axis is the system clock delta from GPS time. .RE .sp \fBinstrumented\fP .RS 4 Plot instrumented profile. Plots various components of the total latency between the GPS\(cqs fix time and when the client receives the fix. .RE .sp For purposes of the description, below, start\-of\-reporting\-cycle (SORC) is when a device\(cqs reporting cycle begins. This time is detected by watching to see when data availability follows a long enough amount of quiet time that we can be sure we\(cqve seen the gap at the end of the sensor\(cqs previous report\-transmission cycle. Detecting this gap requires a device running at 9600bps or faster. .sp Similarly, EORC is end\-of\-reporting\-cycle; when the daemon has seen the last sentence it needs in the reporting cycle and ready to ship a fix to the client. .sp The components of the instrumented plot are as follows: .sp \fBFix latency\fP .RS 4 Delta between GPS time and SORC. .RE .sp \fBRS232 time\fP .RS 4 RS232 transmission time for data shipped during the cycle (computed from character volume and baud rate). .RE .sp \fBAnalysis time\fP .RS 4 EORC, minus SORC, minus RS232 time. The amount of real time the daemon spent on computation rather than I/O. .RE .sp \fBReception time\fP .RS 4 Shipping time from the daemon to when it was received by \fBgpsprof\fP. .RE .sp Because of RS232 buffering effects, the profiler sometimes generates reports of ridiculously high latencies right at the beginning of a session. The \-m option lets you set a latency threshold, in multiples of the cycle time, above which reports are discarded. .sp \fBuninstrumented\fP .RS 4 Plot total latency without instrumentation. Useful mainly as a check that the instrumentation is not producing significant distortion. The X axis is sample time in seconds from the start of the plot. The Y axis is latency in seconds. It only plots times for reports that contain fixes; staircase\-like artifacts in the plot are created when elapsed time from reports without fixes is lumped in. .RE .sp \fB\-?\fP, \fB\-h\fP, \fB\-\-help\fP .RS 4 Print a usage message and exit. .RE .sp \fB\-d FILE\fP, \fB\-\-dumpfile FILE\fP .RS 4 Dump the plot data, without attached \fBgnuplot(1)\fP code, to a specified file for post\-analysis. .RE .sp \fB\-d LVL\fP, \fB\-\-debug LVL\fP .RS 4 Sets debug level. .RE .sp \fB\-l FILE\fP, \fB\-\-logfile FILE\fP .RS 4 Dump the raw JSON reports collected from the device to the specified FILE. .RE .sp \fB\-n SEC\fP, \fB\-\-wait SEC\fP .RS 4 Sets the number of seconds to sample. The default is 100. Most GPS are configured to emit one fix per second, so 100 samples would then span 100 seconds. .RE .sp \fB\-r\fP, \fB\-\-redo\fP .RS 4 Replot from a JSON logfile (such as \fB\-l, logfile\fP produces) on standard input. Both \fB\-n, \-\-wait\fP and \fB\-l, \-\-logfile\fP options are ignored when this one is selected. .RE .sp \fB\-S STR\fP, \fB\-\-subtitle STR\fP .RS 4 Sets a text string to be included in the plot as a subtitle. This will be below the title. .RE .sp \fB\-t STR\fP, \fB\-\-title STR\fP .RS 4 Sets a text string to be the plot title. This will replace the default title. .RE .sp \fB\-T TERM\fP, \fB\-\-terminal TERM\fP .RS 4 Specify the terminal type setting in the \fBgnuplot(1)\fP code. Typical usage is "\fB\-T png\fP", or "\fB\-T pngcairo\fP" telling \fBgnuplot(1)\fP to write a PNG file. The default terminal is "x11". .sp Different installations of \fBgnuplot(1)\fP will support different terminal types. Different terminal types may work better for you than other ones. "\fB\-T png\fP" will generate PNG images. Use "\fB\-T jpeg\fP" to generate JPEG images. "\fB\-T pngcairo\fP" often works best, but is not supported by some distributions. The same terminal type may work very differently on different distributions. .sp To see which terminal types your copy of \fBgnuplot(1)\fP supports: .RE .sp .if n .RS 4 .nf .fam C gnuplot \-e "set terminal" .fam .fi .if n .RE .SH "ARGUMENTS" .sp By default, clients collect data from the local \fBgpsd\fP daemon running on localhost, using the default GPSD port 2947. The optional argument to any client may override this behavior: \fB[server[:port[:device]]]\fP .sp For further explanation, and examples, see the \fBARGUMENTS\fP section in the \fBgps\fP(1) man page .SH "SIGNALS" .sp Sending SIGUSR1 to a running instance causes it to write a completion message to standard error and resume processing. The first number in the startup message is the process ID to signal. .SH "EXAMPLES" .sp To display the graph, use \fBgnuplot(1)\fP . Thus, for example, to display the default spatial scatter plot on your x11 display, do this: .sp .if n .RS 4 .nf .fam C gpsprof | gnuplot \-persist .fam .fi .if n .RE .sp To generate an image file: .sp .if n .RS 4 .nf .fam C gpsprof \-T png | gnuplot > image.png .fam .fi .if n .RE .sp To generate a polar plot, and save the GPS data for further plots: .sp .if n .RS 4 .nf .fam C gpsprof \-f polar \-T jpeg \-l polar.json | gnuplot > polar.png .fam .fi .if n .RE .sp Then to make the matching polarused and polarunused plots and pngs from the just saved the GPS data: .sp .if n .RS 4 .nf .fam C gpsprof \-f polarused \-T jpeg \-r < polar.json > polarused.plot gnuplot < polarused.plot > polarused.png gpsprof \-f polarunused \-T jpeg \-r < polar.json > polarunused.plot gnuplot < polarunused.plot > polarunused.png .fam .fi .if n .RE .sp You can split the pieces up, so you do not need to run the entire chain at once. To allow tweaking settings without recollecting all the data. Like this: .sp .if n .RS 4 .nf .fam C gpspipe \-w \-x 3600 ::/dev/ttyS0 > MY.raw gpsdecode < MY.raw > MY.json gpsprof \-r \-T pngcairo \-t "MY Title" < MY.json > MY.plt gnuplot MY.plt > MY.png display MY.png .fam .fi .if n .RE .sp The \fBgpspipe\fP saves one hour of raw data from the local \fBgpsd\fP device /dev/ttyS0 into MY.raw. It will take one hour to complete. .sp The \fBgpsdecode\fP converts the raw data in MY.raw into a \fBgpsd\fP JSON file called MY.json. .sp The \fBgpsprof\fP reads MY.json and creates a \fBgnuplot\fP program in MY.plt. .sp The \fBgnuplot\fP executes the program in MY.plt and creates the image file MY.png. .sp The \fBdisplay\fP program paints MY.png on your desktop. .SH "RETURN VALUES" .sp \fB0\fP .RS 4 on success. .RE .sp \fB1\fP .RS 4 on failure .RE .SH "SEE ALSO" .sp \fBgpsd\fP(8), \fBdisplay\fP(1), \fBgnuplot\fP(1), \fBgpsctl\fP(1), \fBgps\fP(1), \fBlibgps\fP(3), \fBlibgpsmm\fP(3), \fBgpsprof\fP(1), \fBgpsfake\fP(1). .SH "RESOURCES" .sp \fBProject web site:\fP \c .URL "https://gpsd.io/" "" "" .SH "COPYING" .sp This file is Copyright 2013 by the GPSD project .br SPDX\-License\-Identifier: BSD\-2\-clause .SH "AUTHOR" .sp Eric S. Raymond