1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
.TH GPSFS 8
.SH NAME
gpsfs, gpsevermore \- GPS time and position service
.SH SYNOPSIS
.B aux/gpsfs
[
.B -d
.I device
]
[
.B -b
.I baud
]
[
.B -s
.I srvname
]
[
.B -m
.I mntpt
]
.PP
.B aux/gpsevermore
[
.B -d
.I device
]
[
.B -b
.I baud
]
[
.B -n
.I baud
]
[
.B -l
.I location
]
.SH DESCRIPTION
.B Aux/gpsfs
reads an NMEA-compatible serial GPS (Global Positioning System)
device and provides time and position
through a file system, by default mounted on
.B /mnt
and implementing
.BR /mnt/gps .
.PP
It implements four files in the
.B gps
directory:
.BR position ,
.BR time ,
.BR satellites ,
and
.BR raw .
.PP
The read-only
.B position
file contains one line of information in 9 tab-separated fields:
.TF "\fImagnetic deviation
.PD
.TP
.I "fix quality
0 means position data invalid, 1 means a 2D position is available, 2 means a 3D position is available.
The value is 8, 9, or 10, respectively, when the fix data comes from a file rather than an actual GPS.
.TP
.I "zulu time
universal coordinated time encoded as hhmmss followed by the character 'Z'.
.TP
.I "system time
time and date converted to the format of
.IR time (2).
.TP
.I longitude
in degrees, east of Greenwich is positive, west negative.
.TP
.I latitude
in degrees, positive is north, negative south of the equator.
.TP
.I altitude
above sea level, in meters.
.TP
.I course
degrees, clockwise from true north.
.TP
.I "ground speed
in km/h
.TP
.I "magnetic deviation
(not provided by all GPSs), in degrees, positive is westerly, negative easterly.
.PP
The read-only
.B time
file contains one line of information in 4 tab-separated fields:
.TF "\fIsystem time
.PD
.TP
.I "gps time
in
.IR time (2)
format.
.TP
.I "gps time
in
.I nsec
(see
.IR time (2))
format (ms accuracy).
.TP
.I "system time
in
.I nsec
format. This is the system time at the time of the
.I "gps time
sample. The difference between this and the previous field is used in clock
synchronization. See
.IR timesync (8).
.TP
.I validity
the character
.B A
meaning sample valid and usable for clock synchronization. The other values are
not usable for clock sync:
.B B
means valid sample from file playback,
.B V
means invalid sample, and
.B W
means invalid playback sample.
.PP
The read-only
.B satellites
file contains information about the current satellite constellation. It consists
of one line of general information, followed by zero or more lines, one for each satellite in use.
The first line contains two fields:
.TF "\fIsatellites in view
.PD
.TP
.I "fix quality
same as in the
.B position
file.
.TP
.I "satellites in view
number of satellites above the horizon
.PP
Subsequent lines have four fields:
.TF "\fIelevation
.PD
.TP
.I prn
satellite ID
.TP
.I elevation
above the horizon, degrees.
.TP
.I azimuth
direction, degrees from true north
.TP
.I snr
Signal to noise ratio, 0 - 99 dB
.PP
The contents of these files are refreshed once per second when reading from an actual GPS,
and once per 100 ms (giving a speed up of a factor 10) when playing back from file.
.PP
The read-only
.B raw
file can be read to obtain a copy of the raw NMEA GPS output.
.I Gpsfs
keeps an internal buffer of 8KB, so the reader must keep up with the output
(typically 500 or so bytes per second).
.PP
The
.B \-d
flag establishes the device the GPS samples are read from. If the device file is not
a serial interface,
.I gpsfs
assumes playback from file and modifies quality parameters as such.
.PP
The
.B \-b
flag specifies the baud rate of the serial line. The standard baud rate for NMEA
GPS is 4800 baud, but many device allow changing to higher speeds.
.PP
The
.B \-s
flag specifies the name under which the
.I gpsfs
service is posted in
.BR /srv .
.PP
The
.B \-m
flag specifies a mount mount other than
.BR /mnt .
.SS Evermore
.B Aux/gpsevermore
is used to configure GPSs using an Evermore chipset.
.PP
The
.B \-d
flag specifies the serial device to the GPS.
.PP
The
.B \-b
flag specifies the baud rate of the serial line. The standard baud rate for NMEA
GPS is 4800 baud, but many device allow changing to higher speeds.
.PP
The
.B \-n
flag specifies the speed to set the GPS to. When the command finishes, the
GPS should be read (and configured) at the new speed.
.PP
The
.B \-l
flag is sued to specify the location to initialize the GPS to. The format is
.B dd:mm:ssX
or
.B dd:mm.mmmX
or
.BR dd.dddX ,
where
.B dd
stands for degrees (one or more digits),
.B mm
for minutes and
.B ss
for seconds of arc.
.B X
is one of
.BR W ,
.BR E ,
.B N
or
.BR S .
Longitudes come with
.B W
or
.BR E ,
latitudes with
.B N
or
.BR S .
The
.B \-l
flag is followed by two such fields, one for longitude, one for latitude. They may be
given in a single argument (separated by white space), or in two arguments, in either order.
Initialization time is taken from
.IR time (2).
.SH "SEE ALSO
.IR timesync (8),
.IR time (2)
.SH FILES
.TF /mnt/gps/satellites
.TP
.B /mnt/gps/position
position, time, speed and heading
.TP
.B /mnt/gps/satellites
satellites in view
.TP
.B /mnt/gps/time
GPS time (millisecond accuracy)
.TP
.B /dev/eia0
default GPS device
.SH SOURCE
.B /sys/src/cmd/aux/gps
|