1GPSFAKE(1) GPSD Documentation GPSFAKE(1)
2
3
4
6 gpsfake - test harness for gpsd, simulating a GPS
7
9 gpsfake [-1] [-h] [-b] [-c interval] [-i] [-D debuglevel] [-l]
10 [-m monitor] [-n] [-o options] [-p] [-r initcmd] [-s speed]
11 [-u] [-v] [logfile...]
12
14 gpsfake is a test harness for gpsd and its clients. It opens a pty
15 (pseudo-TTY), launches a gpsd instance that thinks the slave side of
16 the pty is its GPS device, and repeatedly feeds the contents of one or
17 more test logfiles through the master side to the GPS. If there are
18 multiple logfiles, sentences from them are interleaved in the order the
19 fuiles are specified.
20
21 gpsfake does not require root privileges, and can be run concurrently
22 with a production gpsd instance without causing problems.
23
24 The logfiles may be of NMEA, SiRF packets, TSIP packets, or Zodiac
25 packets. Leading lines beginning with # will be treated as comments and
26 ignored.
27
28 The gpsd instance is run in foreground. The thread sending fake GPS
29 data to the daemon is run in background.
30
32 With the -1 option, the logfile is interpreted once only rather than
33 repeatedly. This option is intended to facilitate regression testing.
34
35 The -b option enables a twirling-baton progress indicator on standard
36 error. At termination, it reports elapsed time.
37
38 The -c option sets the delay between sentences in seconds. Fractional
39 values of seconds are legal. The default is zero (no delay).
40
41 The -l option makes the program dump a line or packet number just
42 before each sentence is fed to the daemon. If the sentence is textual
43 (e.g. NMEA), the text is dumped as well. If not, the packet will be
44 dumped in hexadecimal (except for RTCM packets, which aren't dumped at
45 all). This option is useful for checking that gpsfake is getting packet
46 boundaries right.
47
48 The -i option is for single-stepping through logfiles. It dumps the
49 line or packet number (and the sentence if the protocol is textual)
50 followed by "? ". Only when the user keys Enter is the line actually
51 fed to gpsd.
52
53 The -m option specifies a monitor program inside which the daemon
54 should be run. This option is intended to be used with valgrind(1),
55 gdb(1) and similar programs.
56
57 The -g option uses the monitor facility to run the gpsd instance within
58 gpsfake under control of gdb.
59
60 The -o option specifies options to pass to the daemon. The -n option
61 passes -n to start the daemon reading the GPS without waiting for a
62 client (equivalent to -o "-n"). The -D option passes a -D option to the
63 daemon: thus -D 4 is shorthand for -o "-D 4".
64
65 The -p ("pipe") option sets watcher mode and dumps the NMEA and GPSD
66 notifications generated by the log to standard output. This is useful
67 for regression-testing.
68
69 The -r option specifies an initialization command to use in pipe mode.
70 The default is ?WATCH={"enable":true,"json":true}.
71
72 The -s option sets the baud rate for the slave tty. The default is
73 4800.
74
75 The -u option forces the test framework to use UDP rather than pty
76 devices. This may be useful for testing from within chroot jails where
77 access to pty devices is locked out.
78
79 The -v option enables verbose progress reports to stderr. It is mainly
80 useful for debugging gpsfake itself.
81
82 The -x option dumps packets as gpsfake gathers them. It is mainly
83 useful for debugging gpsfake itself.
84
85 The -h option makes gpsfake print a usage message and exit.
86
87 The argument must be the name of a file containing the data to be
88 cycled at the device. gpsfake will print a notification each time it
89 cycles.
90
91 Normally, gpsfake creates a pty for each logfile and passes the slave
92 side of the debice to the daemon. If the header comment in the logfile
93 contains the string "UDP", packets are instead shipped via UDP port
94 5000 to the addess 192.168.0.1.255. You can monitoer them with this:
95 tcpdump -s0 -n -A -i lo udp and port 5000.
96
98 gpsfake is a trivial wrapper around a Python module, also named
99 gpsfake, that can be used to fully script sessions involving a gpsd
100 instance, any number of client sessions, and any number of fake GPSes
101 feeding the daemon instance with data from specified sentence logs.
102
103 Source and embedded documentation for this module is shipped with the
104 gpsd development tools. You can use it to torture-test either gpsd
105 itself or any gpsd-aware client application.
106
107 Logfiles for the use with gpsfake can be retrieved using gpspipe,
108 gpscat, or gpsmon from the gpsd distribution, or any other application
109 which is able to create a compatible output.
110
111 If gpsfake exits with "Cannot execute gpsd: executable not found." the
112 environment variable GPSD_HOME can be set to the path where gpsd can be
113 found. (instead of adding that folder to the PATH envirnment variable
114
116 gpsd(8), gps(1), libgps(3), libgpsd(3), gpsctl(1), gpspipe(1),
117 gpsprof(1) gpsmon(1).
118
120 Eric S. Raymond esr@thyrsus.com. There is a project page for gpsd
121 here[1].
122
124 1. here
125 http://gpsd.berlios.de/
126
127
128
129The GPSD Project 12 Feb 2005 GPSFAKE(1)