gpsrinex.adoc 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. = gpsrinex(1)
  2. :author: Gary E. Miller
  3. :date: 25 February 2021
  4. :email: gem@rellim.com
  5. :keywords: gps, gpsd, gpsrinex, RINEX, ubxtool
  6. :manmanual: GPSD Documentation
  7. :mansource: GPSD, Version {gpsdver}
  8. :robots: index,follow
  9. :sectlinks:
  10. :toc: macro
  11. :type: manpage
  12. :webfonts!:
  13. include::../www/inc-menu.adoc[]
  14. == NAME
  15. gpsrinex - Read data from gpsd convert to RINEX3 and save to a file.
  16. == SYNOPSIS
  17. *gpsrinex* [OPTIONS] [server[:port[:device]]]
  18. *gpsrinex* -h
  19. *gpsrinex* -V
  20. == DESCRIPTION
  21. *gpsrinex* is a tool to connect to *gpsd* and output the received raw
  22. measurements as a RINEX 3 observation file. This is useful for sending
  23. raw measurements (pseudorange and carrierphase) from *gpsd* to a Precise
  24. Point Positioning (PPP) program or service.
  25. *gpsrinex* does not require root privileges, but may be run as root.
  26. Some of the examples in this file may not work when run under *sudo*.
  27. It can be run concurrently with other tools connecting to a local or
  28. remote *gpsd* without causing problems.
  29. *gpsrinex* needs the GNSS receiver to be sending raw measurements to *gpsd*.
  30. Only a few GNSS have this capability. In addition, the *gpsd* driver for
  31. that GNSS must support raw mode. Currently only the u-blox driver has
  32. this support. Only a few u-blox 8 and 9 receivers implement the required
  33. UBX-RXM-RAWX message. The NEO-M8T is known to work, but requires
  34. configuration with *ubxtool*.
  35. Before using *ubxtool* be sure to set the UBXOPTS environment variable
  36. with the correct protocol version for your u-blox receiver. If your
  37. protocol version is 32.00, you would do this:
  38. ----
  39. export UBXOPTS="-P 32.00"
  40. ----
  41. RINEX has its own definitions and abbreviations. Be sure to consult
  42. their documentation. An observation file (.obs) contains data sets,
  43. called epochs, that contain the pseudorange and carrierphase for each
  44. satellite seen.
  45. *gpsrinex* by default will acquire 20 epochs spaced apart by 30 seconds.
  46. That will take 10 minutes to complete. Most users consider the 30 second
  47. interval to be optimal. Many PPP programs require at least 1 or 2 hours
  48. data, but no more than 24 or 48 hours of data. Most users consider 4 to
  49. 6 hours of data as a minimum for good accuracy. Additional hours will
  50. not yield much improvement.
  51. The output will consist of one RINEX 3 observation file that is ready to
  52. be read by your PPP program. The default filename will be in the form:
  53. gpsrinex.obs. You can override this filename with the
  54. *-f* option.
  55. Optionally a server, TCP/IP port number and remote device can be given.
  56. If omitted, *gpsrinex* connects to localhost on the default port (2947)
  57. and watches all devices opened by *gpsd*.
  58. == OPTIONS
  59. *-?*, *-h*, *--help*::
  60. Print a usage message and exit.
  61. *-D LVL*, *-debug LVL*::
  62. Set debug level to LVL.
  63. *-f FILE*, *--fileout FILE*::
  64. save RINEX into FILE.
  65. *-i SECS*, *--interval SECS*::
  66. wait [interval] seconds between epochs. The interval can be specified
  67. to the millisecond. OPUS accepts intervals of 1, 2, 3, 5, 10, 15 or,30
  68. seconds. OPUS then reduces the data to 30 second intervals. Default is
  69. 30.000.
  70. *-n COUNT*, *--count COUNT*::
  71. Causes COUNT epochs to be output. OPUS requires a minimum af 15
  72. minutes, and a maximum of 48 hours, of data.
  73. *-V*, *--version*::
  74. makes *gpsrinex* print its version and exit.
  75. The following options set strings that are placed in the generated RINEX
  76. 3 obs file. They do not change how *gpsrinex* computes anything.
  77. *--agency AGENCY*::
  78. The name of the agency creating the current file.
  79. *--ant_num NUMBER*::
  80. The antenna serial number.
  81. *--ant_type TYPE*::
  82. The antenna type.
  83. *--marker_name NAME*::
  84. The marker name.
  85. *--marker_type TYPE*::
  86. The marker type
  87. *--observer OBSERVER*::
  88. The name of the observer (you).
  89. *--rec_num NUM*::
  90. The receiver serial number.
  91. *--rec_type TYPE*::
  92. The receiver type.
  93. *--rec_vers VERS*::
  94. The receiver version.
  95. The following options set floating point numbers that are placed in the
  96. generated RINEX 3 obs file. They do not change how *gpsrinex* computes
  97. anything.
  98. *--ant_e EASTING*::
  99. The antenna easting from marker in meters.
  100. *--ant_h HEIGHT*::
  101. The antenna height from marker in meters.
  102. *--ant_n NORTHING*::
  103. The antenna northing from marker in meters.
  104. == ARGUMENTS
  105. By default, clients collect data from the local *gpsd* daemon running
  106. on localhost, using the default GPSD port 2947. The optional argument
  107. to any client may override this behavior: *[server[:port[:device]]]*
  108. For further explanation, and examples, see the *ARGUMENTS* section in
  109. the *gps*(1) man page
  110. == EXAMPLES
  111. Example 1:
  112. Create a 4 hour .obs file. With a running *gpsd* accessible on the
  113. localhost do all of the following, in order. Order matters.
  114. The raw measurement messages are long. Be sure your serial port speed is
  115. high enough:
  116. ----
  117. gpsctl -s 115200
  118. ----
  119. Disable all NMEA messages, and enable binary messages:
  120. ----
  121. ubxtool -d NMEA
  122. ubxtool -e BINARY
  123. ----
  124. The NEO-M8N will only reliably output raw measurements when only the GPS
  125. and QZSS constellations are enabled. If your PPP service can use
  126. GLONASS, then enable that as well. Be sure to disable, before enable, so
  127. as not to momentarily have too many constellations selected. *ubxtool*, as
  128. recommended by u-blox, enables the QZSS constellation in tandem with
  129. GPS. Disable all constellations, except GPS (and QZSS):
  130. ----
  131. ubxtool -d BEIDOU
  132. ubxtool -d GALILEO
  133. ubxtool -d GLONASS
  134. ubxtool -d SBAS
  135. ubxtool -e GPS
  136. ----
  137. Verify the constellations enabled:
  138. ----
  139. ubxtool -p CFG-GNSS
  140. ----
  141. Enable the good stuff, the raw measurement messages:
  142. ----
  143. ubxtool -e RAWX
  144. ----
  145. Verify raw data messages are being sent:
  146. ----
  147. ubxtool | fgrep RAWX
  148. ----
  149. You should see this output:
  150. ----
  151. UBX-RXM-RAWX:
  152. UBX-RXM-RAWX:
  153. ----
  154. Collect 4 hours of samples at 30 second intervals, save the RINEX 3
  155. observations in the file today.obs:
  156. ----
  157. gpsrinex -i 30 -n 480 -f today.obs
  158. ----
  159. Wait 4 hours. Enjoy a meal, or do some exercise. When *gpsrinex* finishes,
  160. upload the file today.obs to your favorite PPP service.
  161. Example 2:
  162. Collect raw measurement data from a remote *gpsd*. Then process it later
  163. with *gpsrinex* and *gpsprof*.
  164. Ensure the receiver is configured properly, as shown in Example 1.
  165. Grab 4 hours of raw live data from remote *gpsd* at 10.168.1.2:
  166. ----
  167. gpspipe -x 14400 -R 10.168.1.2 > 4h-raw.ubx
  168. ----
  169. When gpspipe is complete, feed the data to gpsfake:
  170. ----
  171. gpsfake -1 -P 3000 4h-raw.ubx
  172. ----
  173. In another window, feed the data to *gpsrinex*. Use *-n 10000000* so that
  174. all the data from the raw file is used:
  175. ----
  176. gpsrinex -i 30 -n 1000000 :3000
  177. ----
  178. Repeat the process with gpsfake to send the data to *gpsprof*.
  179. == RETURN VALUES
  180. *0*:: on success.
  181. *1*:: on failure
  182. == SEE ALSO
  183. One service known to work with gbsrinex output is at:
  184. https://webapp.geod.nrcan.gc.ca/geod/tools-outils/ppp.php
  185. OPUS requires 2 frequency observation files.
  186. https://www.ngs.noaa.gov/OPUS/
  187. The curious can find the RINEX 3.04 format described here:
  188. ftp://igs.org/pub/data/format/rinex304.pdf
  189. *gpsd*(8), *gps*(1), *gpsprof*(1), *gpsfake*(1). *ubxtool*(1)
  190. == RESOURCES
  191. *Project web site:* {gpsdweb}
  192. == COPYING
  193. This file is Copyright 2013 by the GPSD project +
  194. SPDX-License-Identifier: BSD-2-clause