gpsfs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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. .IR nsec (2)
  100. format (ms accuracy).
  101. .TP
  102. .I "system time
  103. in
  104. .IR nsec (2)
  105. format. This is the system time at the time of the
  106. .I "gps time
  107. sample. The difference between this and the previous field is used in clock
  108. synchronization. See
  109. .IR timesync (8).
  110. .TP
  111. .I validity
  112. the character
  113. .B A
  114. meaning sample valid and usable for clock synchronization. The other values are
  115. not usable for clock sync:
  116. .B B
  117. means valid sample from file playback,
  118. .B V
  119. means invalid sample, and
  120. .B W
  121. means invalid playback sample.
  122. .PP
  123. The read-only
  124. .B satellites
  125. file contains information about the current satellite constellation. It consists
  126. of one line of general information, followed by zero or more lines, one for each satellite in use.
  127. The first line contains two fields:
  128. .TP
  129. .I "fix quality
  130. same as in the
  131. .B position
  132. file.
  133. .TP
  134. .I "satellites in view
  135. number of satellites above the horizon
  136. .PP
  137. Subsequent lines have four fields:
  138. .TP
  139. .I prn
  140. satellite ID
  141. .TP
  142. .I elevation
  143. above the horizon, degrees.
  144. .TP
  145. .I azimuth
  146. direction, degrees from true north
  147. .TP
  148. .I snr
  149. Signal to noise ratio, 0 - 99 dB
  150. .PP
  151. The contents of these files are refreshed once per second when reading from an actual GPS,
  152. and once per 100 ms (giving a speed up of a factor 10) when playing back from file.
  153. .PP
  154. The read-only
  155. .B raw
  156. file can be read to obtain a copy of the raw NMEA GPS output.
  157. .I Gpsfs
  158. keeps an internal buffer of 8KB, so the reader must keep up with the output
  159. (typically 500 or so bytes per second).
  160. .PP
  161. The
  162. .B \-d
  163. flag establishes the device the GPS samples are read from. If the device file is not
  164. a serial interface,
  165. .I gpsfs
  166. assumes playback from file and modifies quality parameters as such.
  167. .PP
  168. The
  169. .B \-b
  170. flag specifies the baud rate of the serial line. The standard baud rate for NMEA
  171. GPS is 4800 baud, but many device allow changing to higher speeds.
  172. .PP
  173. The
  174. .B \-s
  175. flag specifies the name under which the
  176. .I gpsfs
  177. service is posted in
  178. .BR /srv .
  179. .PP
  180. The
  181. .B \-m
  182. flag specifies a mount mount other than
  183. .BR /mnt .
  184. .PP
  185. .B Aux/gpsevermore
  186. is used to configure GPSs using an Evermore chipset.
  187. .PP
  188. The
  189. .B \-d
  190. flag specifies the serial device to the GPS.
  191. .PP
  192. The
  193. .B \-b
  194. flag specifies the baud rate of the serial line. The standard baud rate for NMEA
  195. GPS is 4800 baud, but many device allow changing to higher speeds.
  196. .PP
  197. The
  198. .B \-n
  199. flag specifies the speed to set the GPS to. When the command finishes, the
  200. GPS should be read (and configured) at the new speed.
  201. .PP
  202. The
  203. .B \-l
  204. flag is sued to specify the location to initialize the GPS to. The format is
  205. .B dd:mm:ssX
  206. or
  207. .B dd:mm.mmmX
  208. or
  209. .BR dd.dddX ,
  210. where
  211. .B dd
  212. stands for degrees (one or more digits),
  213. .B mm
  214. for minutes and
  215. .B ss
  216. for seconds of arc.
  217. .B X
  218. is one of
  219. .BR W ,
  220. .BR E ,
  221. .B N
  222. or
  223. .BR S .
  224. Longitudes come with
  225. .B W
  226. or
  227. .BR E ,
  228. latitudes with
  229. .B N
  230. or
  231. .BR S .
  232. The
  233. .B \-l
  234. flag is followed by two such fields, one for longitude, one for latitude. They may be
  235. given in a single argument (separated by white space), or in two arguments, in either order.
  236. Initialization time is taken from
  237. .IR time (2).
  238. .SH "SEE ALSO
  239. .IR timesync (2),
  240. .IR time (2),
  241. .IR nsec (2).
  242. .SH FILES
  243. .TF /mnt/gps/satellites
  244. .TP
  245. .B /mnt/gps/position
  246. position, time, speed and heading
  247. .TP
  248. .B /mnt/gps/satellites
  249. satellites in view
  250. .TP
  251. .B /mnt/gps/time
  252. GPS time (millisecond accuracy)
  253. .TP
  254. .B /dev/eia0
  255. default GPS device
  256. .SH SOURCE
  257. .B /sys/src/cmd/aux/gps