gpsfs 4.8 KB

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