faq.html.in 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  1. <!DOCTYPE HTML>
  2. <html lang="en">
  3. <!-- @MASTER@ -->
  4. <head lang="en">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta name="Author" content="Eric S. Raymond">
  7. <meta name="Description" content="GPSD Frequently Asked Questions">
  8. <meta name="Keywords" content="GPS,gpsd,FAQ,frequently asked questions,android,garmin,raspberry pi,fix">
  9. <meta name="revised" content="@DATE@">
  10. <meta name="robots" content="index,follow">
  11. <link rel="stylesheet" href="main.css" type="text/css">
  12. <title>GPSD FAQ</title>
  13. </head>
  14. <body>
  15. <div id="Header">
  16. GPSD Frequently Asked Questions
  17. </div>
  18. <div id="Menu">
  19. <img src="gpsd-logo-small.png" alt="Small gpsd Logo" height="126"
  20. width="105"><br>
  21. <a href="index.html">Home</a><br>
  22. <a href="index.html#news">News</a><br>
  23. <a href="index.html#downloads">Downloads</a><br>
  24. <a href="index.html#mailing-lists">Mailing lists</a><br>
  25. <a href="index.html#documentation">Documentation</a><br>
  26. FAQ<br>
  27. <a href="xgps-sample.html">Screenshots</a><br>
  28. <a href="index.html#recipes">Recipes</a><br>
  29. <a href="index.html#others">Other GPSDs</a><br>
  30. <a href="hardware.html">Hardware</a><br>
  31. <a href="for-vendors.html">For GPS Vendors</a><br>
  32. <a href="wishlist.html">Wish List</a><br>
  33. <a href="hall-of-shame.html">Hall of Shame</a><br>
  34. <a href="troubleshooting.html">Troubleshooting Guide</a><br>
  35. <a href="hacking.html">Hacker's Guide</a><br>
  36. <a href="protocol-transition.html">Application Compatibility</a>
  37. <a href="references.html">References</a><br>
  38. <a href="history.html">History</a><br>
  39. <a href="future.html">Future</a><br>
  40. <div>&nbsp;</div>
  41. <a href='http://www.catb.org/hacker-emblem/'><img
  42. src='glider.png' alt='hacker emblem' height="55" width="55"></a><br>
  43. <script src="https://www.openhub.net/p/3944/widgets/project_thin_badge.js"></script>
  44. <hr>
  45. <script><!--
  46. google_ad_client = "pub-1458586455084261";
  47. google_ad_width = 160;
  48. google_ad_height = 600;
  49. google_ad_format = "160x600_as";
  50. google_ad_type = "text";
  51. google_ad_channel = "";
  52. //--></script>
  53. <script
  54. src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
  55. </script>
  56. <hr>
  57. <a href="https://validator.w3.org/check/referer"><img
  58. src="https://www.w3.org/Icons/valid-html401"
  59. alt="Valid HTML 4.01!" height="31" width="88"></a>
  60. </div>
  61. <div id="Content">
  62. <ul>
  63. <li>Troubleshooting GPSD: the basics
  64. <ul>
  65. <li><a href='#verify'>How can I verify operation of a new GPS?</a></li>
  66. <li><a href='#willitwork'>Will a GPS not on the GPSD hardware list work?</a></li>
  67. <li><a href='#android'>Android reports that gpsd is draining my battery. Help!</a></li>
  68. <li><a href='#garmin'>My Garmin USB GPS doesn't work.</a></li>
  69. <li><a href='#agps'>Can GPSD use Assisted GPS data from cellphone networks?</a>
  70. <li><a href='#raspberry'>Time is wrong on my Raspberry Pi</a></li>
  71. </ul>
  72. </li>
  73. <li>Licensing and support
  74. <ul>
  75. <li><a href='#bug-reporting'>How do I report bugs in GPSD?</a></li>
  76. <li><a href='#support'>What support channels does GPSD have?</a></li>
  77. <li><a href='#license'>What is the license of GPSD?</a></li>
  78. <li><a href='#commercial'>Can I use GPSD in commercial products?</a></li>
  79. </ul>
  80. </li>
  81. <li>GPS performance
  82. <ul>
  83. <li><a href='#startup'>Why does getting a fix take so long after powerup?</a></li>
  84. <li><a href='#timelag'>Why does GPS time lag wall time by 11-15 seconds?</a></li>
  85. <li><a href='#timelag2'>Why is my GPS time off by exactly one second?</a></li>
  86. <li><a href='#speed'>Why does my receiver report wildly fluctuating speed?</a></li>
  87. <li><a href='#accuracy'>How can I improve fix accuracy from my GPS?</a></li>
  88. <li><a href='#time'>How can I improve time reference accuracy from my GPS?</a></li>
  89. <li><a href='#waas'>How can I tell if SBAS Augmentation (eg WAAS/EGNOS) is working?</a></li>
  90. </ul>
  91. </li>
  92. <li>Problems with specific applications
  93. <ul>
  94. <li><a href='#gpsdrive'>Why do I get implausibly low speeds when using gpsdrive?</a></li>
  95. <li><a href='#kismet'>Why do I get no results when I try to use <code>gpsd</code> with Kismet?</a></li>
  96. </ul>
  97. </li>
  98. <li>Troubleshooting GPSD: advanced topics
  99. <ul>
  100. <li><a href='#baud'>What about serial port speed (baud rate)?</a></li>
  101. <li><a href='#conflict'>Why does GPSD open non-GPS USB devices?</a></li>
  102. <li><a href='#efficiency'>What is gpsd's CPU and power overhead?</a></li>
  103. <li><a href='#usblockup'>My USB port becomes unavailable after gpsd uses it.</a><li><a href='#lockup'>My <code>gpsd</code> sometimes stops responding overnight</a></li>
  104. </ul>
  105. </li>
  106. <li>Application development with GPSD
  107. <ul>
  108. <li><a href='#why_not_parse_nmea'>Why use the <code>gpsd</code> protocol rather than parsing raw NMEA?</a></li>
  109. <li><a href='#interfacing'>How should I interface my application with <code>gpsd</code>?</a></li>
  110. <li><a href='#almanac'>How can my application get almanac/ephemeris/pseudorange data?</a></li>
  111. </ul>
  112. </li>
  113. <li>Linux issues
  114. <ul>
  115. <li><a href='#bluetooth'>Why do I have to restart <code>gpsd</code> whenever I power-cycle my Bluetooth device?</a></li>
  116. <li><a href='#sleep'>Why does my GPS get lost when I sleep/wake my laptop?</a></li>
  117. </ul>
  118. </li>
  119. </ul>
  120. <p>If none of these FAQs seems to address your problem, look at the <a
  121. href="upstream-bugs.html">Upstream Bugs</a> page.</p>
  122. <h1 id='verify'>How can I verify operation of a new GPS?</h1>
  123. <p>1. First, check that the GPS has power. If it is a USB device, it
  124. needs to be cabled to a USB port to have power. All Bluetooth GPSes
  125. and some serial GPSes are powered by an on-board battery; check that
  126. the battery is present and charged. The GPS may have an on-off switch
  127. which needs to be in the 'on' position.</p>
  128. <p>2. Most GPSes have a power-on LED; it should be continuously on
  129. or blinking once a second. If it is continuously off, your GPS is dead
  130. or disconnected. Check that it has power.</p>
  131. <p>3. For anything other than a serial (RS232) device, there should be
  132. a discovery utility that allows you to check that the device is connected.</p>
  133. <p>3a. For a USB device, run <code>"lsusb"</code> before and after
  134. connecting your GPS; after, you should see an additional line
  135. indicating a new device. Expect the new line to describe a
  136. serial-to-USB adapter chip, often (but not always) the Prolific
  137. Technology PL2303. Then run "dmesg", looking for a message indicating
  138. a new USB device of that kind and giving you the device path -
  139. <code>/dev/ttyUSBn</code> for some number n.</p>
  140. <p>3b. If your receiver lists in lsusb(1) but doesn't show up as a ttyUSBx
  141. device, don't lose hope. It might be a ttyACM device, probably
  142. /dev/ttyACM0; some receivers, including for example the u-blox EVK 6H
  143. evaluation kit, announce themselves as USB modems.</p>
  144. <p>3c. For a Bluetooth device, see our <a href="bt.html">Bluetooth
  145. instructions</a>.</p>
  146. <p>4. If you have installed a GPSD binary package on a Linux system and
  147. are using a USB GPS, you should not need to start gpsd manually,
  148. because the hotplug system will have done it for you. You should be
  149. able to start a test client (such as <code>cgps</code> or <code>xgps</code>)
  150. and watch it report fixes.</p>
  151. <p>5. If your test client fails to run, a good test to try is to,
  152. after stopping any instances of gpsd that are running
  153. (eg, <code>killall gpsd</code> ),
  154. run <code>gpsmon</code> on the device (give it the device path as an
  155. argument). If yours reports no data at all, you probably have some
  156. low-level system problem with serial or USB that you'll need to fix
  157. before <code>gpsd</code> will operate.</p>
  158. <p>6. USB GPSes actually emulate RS232 serial using converter chips.
  159. Under Linux, the usbserial kernel module must be loaded for correct
  160. operation of this class of device. Normally this module load should
  161. happen automatically when the device activates, but if you don't
  162. receive data check for it with <b>lsmod(1)</b>.</p>
  163. <p>On Linux systems with module autoloading disabled or misconfigured,
  164. it is possible you may need to load the module manually with a command
  165. such as <code>sudo modprobe usbserial vendor=0x1a86
  166. product=0x7523</code>. Do not copy those hex numbers slavishly, they
  167. are examples. To get the right numbers, you will need to dig up the
  168. vendor and product ID of your USB-serial converter device.</p>
  169. <p>For more detailed troubleshooting instructions, <a
  170. href="troubleshooting.html">see the Troubleshooting Guide</a>.</p>
  171. <h1 id='willitwork'>Will a GPS not on the GPSD hardware list work?</h1>
  172. <p>Probably.</p>
  173. <p>GPSD's support for the NMEA protocol is mature and stable. If the
  174. specification for your receiver says "NMEA 0183" (maybe with a version 2.x
  175. or 3.x qualifier) it should just work.</p>
  176. <p>Beware of receivers that do not say "NMEA" somewhere in the specification;
  177. while it may indicate that the receiver only uses a binary protocol, it often
  178. means that the receiver cannot be used as data source for a computer, as is
  179. usually the case with car navigation devices.</p>
  180. <p>We also support many proprietary protocols, in case your receiver
  181. doesn't emit NMEA. Datasheets often indicate which chip the receiver
  182. is based on, for example a <i>NavCorp NX666</i>. Check to see if other
  183. <i>NavCorp</i> receivers are listed, either as a vendor or a
  184. chipset. Compare this with the output of <code>gpsd -l</code> which
  185. will list the protocols compiled into gpsd. If your receiver doesn't
  186. support NMEA and we don't have a special driver for the chipset, talk
  187. to us. But it'll probably just work.</p>
  188. <p>Assuming the receiver has a USB interface, do a web search to see
  189. if someone has tried it with linux already, eg. "<code>NavCorp NX666
  190. linux</code>". Search for the product and "driver install" to find
  191. instructions on installing Windows drivers for the product - these
  192. often hint at which bridge chip is used, if the specifications don't
  193. say so.
  194. <p>A GPS receiver claiming Macintosh compatibility is usually based on
  195. one of the common bridge chips from FTDI, Prolific or Silicon
  196. Laboratories. These will just work.</p>
  197. <h1 id='android'>Android reports that gpsd is draining my battery. Help!</h1>
  198. <p>Yes, Android 4.0 and later versions use gpsd to interpret the data
  199. stream from the onboard GPS. No, the battery drain is not actually
  200. due to a GPSD bug or design error.</p>
  201. <p>You probably have a badly-written or buggy app installed that is
  202. running in background, keeping gpsd awake by keeping a client session
  203. to it constantly open; this can happen if the app is using "Fine
  204. Location" rather than computing its location the cheaper way using
  205. cell-tower signal strengths ("Coarse Location"). What you need to
  206. do is identify that app, and decide if you wish to remove it.</p>
  207. <p>On the Samsung Galaxy SIII, vendor firmware provides a "Remote
  208. Location" service with a similar bug. You can disable this through
  209. Settings. See <a
  210. href="http://www.gadgethelpline.com/gpsd-stop-samsung-galaxy-siiis-battery-life/">this
  211. blog post</a> for a fix.</p>
  212. <h1 id='garmin'>My Garmin USB GPS doesn't work.</h1>
  213. <p>Garmin binary protocol is weird enough that it can't be handled
  214. through the regular serial-device layer of Linux - you couldn't tell
  215. where the packet boundaries are. To deal with it, you need a special
  216. loadable kernel module called 'garmin_gps'.</p>
  217. <p>The most common cause of problems with these devices is that the
  218. module is failing to load as it should when the Garmin USB ID is
  219. recognized. Here is a typical resolution:</p>
  220. <blockquote>
  221. After several more days of effort I did eventually get it to work
  222. [under Ubuntu 12.4]. It turned out that garmin_gps was on the black
  223. list and this needed to be commented out. I then had to 'sudo apt-get
  224. install gps-clients gpsbabel' and a 'sudo modprobe garmin_gps' and all
  225. was working.
  226. </blockquote>
  227. <p>On the BSDs and Mac OS X, you're out of luck. As of April 2013 we
  228. don't know of any shim that makes USB Garmins work on these.</p>
  229. <h1 id='raspberry'>Time is wrong on my Raspberry Pi</h1>
  230. <p>The Raspberry Pi has no real-time clock. Without this, the GPS may
  231. not return sufficient information to for GPSD to pin down which GPS
  232. clock rollover period you are in. If you set the system clock to
  233. some date in the current year <em>before</em> launching gpsd you
  234. will see correct time reports.</p>
  235. <h1 id='bug-reporting'>How do I report bugs in GPSD?</h1>
  236. <p>Note: Because we have been informed that some people are insane
  237. about this, we shall state the obvious: we welcome security-related
  238. bug reports and will <em>not</em> sue people who send them to us. If
  239. your report includes sensitive information or discloses an exploit,
  240. please email the maintainer rather than letting it all hang out on
  241. the public bugtracker. We will fix such bugs promptly.</p>
  242. <p>When you have a problem with gpsd, here are some steps you can take to
  243. help get your bug resolved as quickly as possible.</p>
  244. <blockquote>
  245. <h3>1. Read this whole FAQ first</h3>
  246. <p>First, read this whole FAQ before reporting apparent misbehavior as a
  247. bug. You may find a solution here.</p>
  248. <h3>2. Make sure it's not a problem with your toolchain or OS</h3>
  249. <p>See our page on <a href='upstream-bugs.html'>upstream bugs</a>.</p>
  250. <h3>3. Make sure it's not a problem in your client software</h3>
  251. <p>Make sure it is a real gpsd bug and not a problem with
  252. your client software. A good way to do this is to run your client and
  253. the gpsd test client (xgps) side by side. If xgps seems to report
  254. good numbers but your client does not, you have a client problem.
  255. If xgps reports the same sort of bad numbers as your client, you
  256. have a real <code>gpsd</code> bug.</p>
  257. <h3>4. Check the latest version of <code>gpsd</code> for the bug.</h3>
  258. <p>If you are using an old version of <code>gpsd</code>, it is
  259. possible your bug has already been fixed. Download the latest public
  260. version from the <a href='@DOWNLOADPAGE@'>download page</a> and test it.
  261. To be really helpful, check out git head
  262. and test that. We don't mind getting reports that say "I saw
  263. version foo had the following bug, but you've fixed it."</p>
  264. <h3>5. Capture a log that triggers the problem</h3>
  265. <p>If we can reproduce your gpsd problem, we can usually fix it very
  266. rapidly. If we can't reproduce it, you might get lucky or you might
  267. not &mdash; and we try hard, but all too often the result is 'not'.</p>
  268. <p>Therefore the most important step you can take is to capture a log
  269. of some receiver output that reproduces the bug; <code>gpscat</code> will
  270. help you.</p>
  271. <h3>6. Trim the capture log that reproduces the problem</h3>
  272. <p>Your next step should be to feed the log you just captured to a
  273. <code>gpsd</code> instance through <code>gpsfake</code> to verify that
  274. the log does in fact reproduce the bug.</p>
  275. <p>Once you have the log, trim it to the smallest span of data that
  276. reproduces the bug. A systematic way to do this is to cut the log in
  277. half at the middle and test each half. If one half doesn't reproduce
  278. the bug but the other does, throw away the half that doesn't. Repeat
  279. this procedure on each half that tickles the bug until you can't make
  280. it any smaller. Then send us that.</p>
  281. <p>If possible, use the -l option of gpsfake to pin down the sentence
  282. or packet that produces the bug, and tell us that.</p>
  283. <h3>7. Look at <code>gpsd</code> log output to see if it gives you a clue</h3>
  284. <p>You may get a better handle on your problem by running gpsd in
  285. foreground (-N option) with the -D option set to a high level (-D 5 is
  286. often good). If the transcript has anything that looks like a clue
  287. in it, send it along with your bug report. When in doubt about
  288. whether it holds a clue, send it.</p>
  289. <p>One of the things this should tell you, if the chip reports it at
  290. all, is the firmware version. You will want that for your report.</p>
  291. <h3 id="logformat">8. Annotate the capture log and send us a copy</h3>
  292. <p>We'll describe the annotation steps here for completeness, but the
  293. easiest way to do this is with <a href="@WEBFORM@">our web form</a>.</p>
  294. <p>A logfile should consist of an identifying header followed by a
  295. straight unencoded dump of receiver data, whether NMEA or binary. The
  296. header should consist of text lines beginning with # and ending with LF.
  297. Here is the beginning of one log file I already have:</p>
  298. <pre>
  299. # Name: Magellan eXplorist 210
  300. # Chipset: unknown
  301. # Submitter: "Paul B van den Berg" &lt;paulberg@wanadoo.nl&gt;
  302. # Date: 2006-05-26
  303. # Location: Groningen, NL, 53.2N 6.6E
  304. #
  305. # mode V2.1 GSA
  306. # Lines up to but not including the first GPGLL are
  307. # `cat /dev/ttyACM0` at startup
  308. # Following lines are
  309. # `cat /dev/ttyACM0` stationary
  310. $GPGSV,3,1,00,,,,,,,,,,,,,,,,*7B
  311. $GPGSV,3,2,00,,,,,,,,,,,,,,,,*78
  312. $GPGSV,3,3,00,,,,,,,,,,,,,,,,*79
  313. $PMGNST,01.75,3,F,816,11.1,+00000,20*5E
  314. $GPGSV,3,1,00,,,,,,,,,,,,,,,,*7B
  315. $GPGSV,3,2,00,,,,,,,,,,,,,,,,*78
  316. $GPGSV,3,3,00,,,,,,,,,,,,,,,,*79
  317. $PMGNST,01.75,3,F,816,11.1,+00000,20*5E
  318. $GPGSV,3,1,00,,,,,,,,,,,,,,,,*7B
  319. $GPGSV,3,2,00,,,,,,,,,,,,,,,,*78
  320. $GPGSV,3,3,00,,,,,,,,,,,,,,,,*79
  321. $PMGNST,01.75,3,F,822,11.2,+00000,20*5A
  322. $GPGSV,3,1,00,,,,,,,,,,,,,,,,*7B
  323. $GPGSV,3,2,00,,,,,,,,,,,,,,,,*78
  324. $GPGSV,3,3,00,,,,,,,,,,,,,,,,*79
  325. $PMGNST,01.75,3,F,822,11.2,+00000,20*5A
  326. $GPGSV,3,1,12,09,76,287,,17,38,073,36,26,34,163,,05,33,230,*72
  327. $GPGSV,3,2,12,29,27,161,,18,24,256,,22,24,299,,28,11,055,*73
  328. $GPGSV,3,3,12,14,08,319,,11,03,017,,30,02,232,,24,00,084,*71
  329. $PMGNST,01.75,3,F,822,11.2,-00673,20*5E
  330. $GPGLL,5313.2228,N,00634.4228,E,200619.295,A*35
  331. $GPGGA,200619.30,5313.2228,N,00634.4228,E,1,05,2.6,00000,M,,,,*2C
  332. $GPRMC,200619.30,A,5313.2228,N,00634.4228,E,00.0,000.0,200506,00,W*59
  333. $GPGSA,A,3,26,05,22,09,18,,,,,,,,05.1,02.6,04.4*03
  334. $GPGSV,3,1,10,09,78,288,39,17,38,071,,05,34,230,45,26,33,163,39*77
  335. $GPGSV,3,2,10,29,26,162,,18,24,255,42,22,24,298,44,28,10,056,*75
  336. $GPGSV,3,3,10,14,09,319,,11,03,016,,136,27,157,,124,28,162,*71
  337. </pre>
  338. <p>The way to fill in the Name, Submitter, and Date
  339. headers should be pretty obvious.</p>
  340. <p>Chipset should include the name and (if possible) model and/or
  341. firmware revision of the chipset in the GPS.</p>
  342. <p>Please also include a Location header giving your city,
  343. state/province, country code, and a rough latitude/longitude.</p>
  344. <p>A log file is most useful when it contains (a) some sentences
  345. generated when the GPS has no fix, (b) some sentences representing
  346. a fix with the GPS stationary, and (c) some sentences representing
  347. a fix with the GPS moving.</p>
  348. <p>If you have notes or comments on the logfile or the GPS, or any
  349. additional information you think might be helpful, add them as
  350. additional # comments (not containing a colon) after these headers.
  351. The test machinery that interprets the headers will ignore these and
  352. any empty comment lines.</p>
  353. <h3>9. If it's a dual-mode GPS, see if the problem reproduces in NMEA mode</h3>
  354. <p>If you're using a SiRF, Evermore, iTalk or u-blox GPS in binary mode
  355. (which you can tell from the -D 4 output), switch back to NMEA mode
  356. using the N command (or a vendor-provided tool) and see if the bug is
  357. still reproducible.</p>
  358. <h3>10. If your bug core-dumps gpsd, send us a stack trace.</h3>
  359. <p>Though it happens seldom (we've had only 3 such reports since about
  360. mid-2005), badly-formed input from a device with poor standards
  361. compliance has been known to core-dump gpsd. If your gpsd has
  362. core-dumped, try to use gdb or whatever your local symbolic debugger
  363. is to generate a stack trace ("bt full") of the crash, and send us
  364. that.</p>
  365. <p>Very occasionally we have also received reports of core dumps in
  366. gpsfake and gpson. A stack trace is also useful in those cases.</p>
  367. <p>A good technique in all such cases is to try to reproduce the bug
  368. by feeding a log with the bad packet in it to gpsdecode. This utility
  369. exercises the same packet decoders as gpsd/gpsfake/gpsmon but without
  370. involving nearly as much other code. If you can send a test log that
  371. crashes gpsdecode, you can expect the bug to be fixed very quickly.</p>
  372. <h3>11. Try to determine what release introduced the bug</h3>
  373. <p>If you have upgraded from a previous version of <code>gpsd</code>,
  374. and the upgrade broke something that was working previously, the
  375. most useful thing you can do is pin down the release in which the
  376. bug was introduced.</p>
  377. <p>How efficiently you can do this depends on whether or not you have
  378. a client for the git version control system. If you don't, all
  379. you can do is download and test named releases. If you do, you can
  380. pin down the exact change that introduced the bug. The latter is
  381. far more helpful to us and will get your bug fixed faster, so we'll
  382. describe that procedure here.</p>
  383. <ol>
  384. <li><p>Follow <a
  385. href='https://help.github.com/en/articles/cloning-a-repository'
  386. >these instructions</a> to clone
  387. a copy of the source repository.</p></li>
  388. <li><p>Use <a
  389. href="https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-bisect.html"
  390. >git bisect</a> to locate the exact revision that introduced your bug.
  391. This will happen very quickly, as the number of tests required will be
  392. the log to the base 2 of the number of revisions in your original
  393. span. Even if there are (say) 500 revisions in the span you should
  394. only require 9 tests to nail down the exact change in
  395. question.</p></li>
  396. </ol>
  397. <h3>12. Include the vendor, mode, and firmware version in your report.</h3>
  398. <p>Always include with your bug report the receiver vendor and model. Try
  399. to include the firmware version as well. This should be in your xgps
  400. display if your device makes it available; in a form field before
  401. 2.35, or as the window title in 2.35 and later. If the ID string is
  402. too long to fit, let the daemon run for a few minutes and issue an "I"
  403. command to it. Alternatively, running the daemon at -D 4 may reveal
  404. the version.</p>
  405. <p>In 3.10 and newer versions, runing gpsctrl with your GPS's device
  406. path as an argument will produce a report that includes both the GPS
  407. type and subtype, if that information is available at all.</p>
  408. <h3>13. Report it on the GPSD bugtracker</h3>
  409. <p>There is a <a href="@BUGTRACKER@">GPSD bug tracker</a>. Use that.
  410. If your bug narrative does not fit the tracker template well and
  411. you've done these data-gathering steps, it's acceptable to send an
  412. email report to the <a href="mail:@DEVMAIL@">GPSD developers'
  413. list</a>.</p>
  414. </blockquote>
  415. <h1 id='support'>What support channels does GPSD have?</h1>
  416. <p>If you are submitting a code patch or a technically detailed bug
  417. report, write the <a href="mail:@DEVMAIL@">GPSD developers'
  418. list</a> (and see the previous entry on how to report bugs).</p>
  419. <p>Please do <em>not</em> write to the dev list unless you are willing
  420. to actively work with our developers on a solution. If you are
  421. non-technical and confused, the <a href="mail:@USERMAIL@">GPSD users'
  422. list</a> will be more appropriate.</p>
  423. <p>GPSD developers are often, though not predictably, available in
  424. real time <a href="@IRCCHAN@">on IRC</a>.</p>
  425. <p>Commercial users: senior GPSD developers are available for contract
  426. engagements at reasonable rates. If you have a hard problem or a tight
  427. deadline or both, request an engagement via the dev list or IRC. We're
  428. professionals and experts and we deliver results.</p>
  429. <h1 id="license">What is the license of GPSD?</h1>
  430. <p>Most of GPSD is under the permissive BSD license. Some portions
  431. are under other permissive licenses, including the MIT/X license and
  432. the ISC license.</p>
  433. <h1 id="commercial">Can I use GPSD in commercial products?</h1>
  434. <p>Yes, GPSD code can be used in commercial and for-profit deployments
  435. without restrictions.</p>
  436. <p>If you use GPSD to make money, please show some concern for the project's
  437. sustainability; @TIPLINK@.</p>
  438. <h1 id="startup">Why does getting a fix take so long after powerup?</h1>
  439. <p>On a Linux machine, the <code>gpsd</code> daemon normally takes
  440. between 0.1 and 0.6 seconds to handshake with your hardware, but this can
  441. vary widely. After
  442. that you will receive GPS reports within a second of when the sensor
  443. issues them. GPSD itself adds <a href="/performance/performance.html"
  444. >almost nomeasurable latency</a>, but RS-232 transmission time to
  445. <code>gpsd</code> can be more significant; you can cut this time by
  446. increasing the serial port speed (baud rate).</p>
  447. <p>Longer handshake delays have been reported from other platforms.
  448. Under OpenBSD, time to handshake with some binary GPSes (including
  449. SiRFs) can be up to two minutes. This seems to reflect some bad
  450. interaction between the autobauding code in <code>gpsd</code> and the
  451. operating system's tty layer; when <code>gpsd</code> is compiled to
  452. use a fixed port speed, handshake times drop to a fraction of a
  453. second.</p>
  454. <p>If you are starting a GPS for the first time, or after it has been
  455. powered off for more than a few weeks, this is a 'cold start'; it needs
  456. to get a new satellite <i>almanac</i> to do its job. The satellites
  457. broadcast this information very slowly (at 50bps) on a fixed schedule,
  458. and it can take up to 20 minutes.</p>
  459. <p>Without an almanac, your GPS has trouble finding the satellites.
  460. The satellites broadcast on a known frequency, but they are moving,
  461. and that gets shifted all over the place by the Doppler effect. ("All
  462. over" means a big shift relative to the bandwidth of the signal.)</p>
  463. <p>If you have a recent almanac and you know the date/time and location, then
  464. you can compute the Doppler and look in the right frequency and find the
  465. satellites quickly. In this context, "find" means hearing a signal at an
  466. expected frequency. If you don't hear anything where you expect it, then you
  467. get to check nearby frequencies. If you don't find anything nearby, you get
  468. to give up and start searching the whole Doppler range. This is the difference
  469. between warm start and cold start.</p>
  470. <p>Once you do see one or more satellites, you can figure out the
  471. date/time and location and after a while get a new almanac. This will
  472. be stored in non-volatile memory in your devices and make subsequent
  473. satellite acquisitions faster, until it gets stale.</p>
  474. <p>Warm start on a modern GPS with a good skyview (4 or more sats
  475. visible) normally takes about 30 seconds. (Vendor spec sheets fib by
  476. quoting this time only, leaving out the cold-start lag to fetch
  477. almanac.) If it's taking longer, the first thing to suspect is that
  478. your skyview is poor. Especially if you're indoors.</p>
  479. <p>The best advice is: go outside and be patient for a few minutes.</p>
  480. <h1 id="timelag">Why does GPS time lag wall time by 11-15 seconds?</h1>
  481. <p>Your GPS may have dropped its leap-second offset. You can tell you
  482. have this problem if your sentence timestamps look wrong at startup.
  483. Wait 20 minutes or so; the lag should go away, as the almanac is updated.</p>
  484. <p>GPS satellites broadcast time using a clock without a leap-second
  485. correction. They broadcast a leap-second correction once each complete
  486. reporting cycle along with the satellite almanac; it's up to the
  487. GPS firmware to add that correction to the time it puts in reports.
  488. If your GPS has forgotten the current correction, you'll have to wait
  489. until an updated almanac is downloaded (should be less than 20 minutes).</p>
  490. <p>GPSes are supposed to retain the leap-second correction along with
  491. the last fix in NVRAM when they power down, but we've observed that
  492. many seem prone to occasionally drop this information. All you can do
  493. is wait for the problem to resolve itself.</p>
  494. <p>SiRF-based GPSes have a more specific timelag problem. 4800 is just
  495. a bit too slow for SiRF binary at full flood; the device can actually
  496. fail to ship all its reports before the next once-per-second fix,
  497. producing an accumulating stall. The symptom of this is sentence times that
  498. look right at startup but gradually fall behind clock time. To fix
  499. this, bump your speed to 9600 or higher.</p>
  500. <h1 id="timelag2">Why is my GPS time off by exactly one second?</h1>
  501. <p>This can happen if (a) there has been a recent <a
  502. href="ftp://maia.usno.navy.mil/ser7/tai-utc.dat">leap-second
  503. adjustment</a>, (b) you have a version of GPSD that was built before
  504. the adjustment, and (c) your GPS doesn't ship the current leap-second
  505. offset in a form GPSD can see. If this happens, GPSD will fall back
  506. to a compiled-in default that is off by one</p>
  507. <p>Some SiRFs have a particularly insidious version of this. They are
  508. supposed to ship a MID52 sentence (which GPSD knows how to interpret)
  509. containing the current leap-second offset. But there is at least one
  510. firmware revision that ships a damaged version of MID52 with a garbled
  511. start sequence or a zero length field. GPSD cannot handle this.</p>
  512. <p>The bad revision is 2.3.2-GSW2-2.05.024-C1Prod1.1; there may be
  513. others. Suspect this if you have persistent off-by-one errors. If you
  514. are able to identify other bad firmware versions, please let us
  515. know about it.</p>
  516. <h1 id='speed'>Why does my receiver report wildly fluctuating speed?</h1>
  517. <p>If your problem is wildly fluctuating speed reports on a SiRF,
  518. switch on static navigation mode using the <code>M</code> command in
  519. <code>gpsmon</code>. Static navigation mode will freeze your position
  520. if your speed is below 1.2 m/s for three seconds, and will begin
  521. updating your position again when speed exceeds 1.4 m/s. This
  522. prevents multipath, weak signals, or poor constellation geometry
  523. from dragging your solutions around too much. Other receivers may
  524. suffer the same problem and may have a similar solution.</p>
  525. <h1 id='accuracy'>How can I improve fix accuracy from my GPS?</h1>
  526. <p>Use an external antenna, and place the sensor (and/or antenna) properly.</p>
  527. <p>A good antenna can help, especially if you're using PPS as a time
  528. reference. It should be particularly helpful for reducing timing
  529. jitter.</p>
  530. <p>One common error is to place the GPS or antenna as high as
  531. possible. This will increase <a
  532. href="https://en.wikipedia.org/wiki/Error_analysis_for_the_Global_Positioning_System#Multipath_effects">
  533. multipath effects</a> due to signal bounce from the ground or water,
  534. which can cause the GPS to mistake its position and the time signal.
  535. The correct location for a boat GPS antenna is on the gunwale rail or
  536. pushpit rail, close to the water and as far from the mast as possible
  537. (to reduce signal bounce from the mast). If you're outside or in a
  538. fixed location, put the GPS antenna as far from buildings as possible,
  539. and on the ground. If you're in a car, don't put the GPS antenna on
  540. the roof, put it on the towbar, far forward on the dashboard, or some
  541. similar location.</p>
  542. <p>If you're driving in a heavily built up area, you're going to get
  543. signal bounce off buildings and reduced accuracy. That's just how
  544. the physics works. Note, however, that as your velocity goes up it
  545. becomes easier for the convergence filters in your GPS to spot
  546. and discard delayed signal, so multipath effects are proportionally
  547. less important in fast-moving vehicles.</p>
  548. <p>If you're using <code>gpsd</code> with software that plots your
  549. position on a map, and you seem to be getting latitude/longitude that
  550. is at a fixed offset from reality, it is possible the base datum of
  551. the map is something other than the WGS84 GPS uses. A
  552. frequently-occurring case of this is older maps in the United States
  553. based on NAD27 (e.g., USGS topo maps); you may see a displacement of
  554. as much as 100-150m with respect to WGS84. While modern datums (e.g.,
  555. NAD83) are almost all very close to WGS84, typically each area of
  556. world has an older datum that only agrees at the 100m level.</p>
  557. <h1 id='time'>How can I improve time reference accuracy from my GPS?</h1>
  558. <p>All the measures you'd take to improve <a href="#accuracy">fix
  559. accuracy</a> will help. Time referencing at accuracies below
  560. 0.01sec has its own set of issues related to latency in your
  561. sensor and computer.</p>
  562. <p>There is now a <a href="gpsd-time-service-howto.html">GPSD Time
  563. Service HOWTO</a> that gives detailed setup instructions.</p>
  564. <h1 id='waas'>How can I tell if SBAS Augmentation (eg WAAS/EGNOS) is working?</h1>
  565. <p>The earliest SBAS systems were WAAS (North America) and EGNOS
  566. (Europe). Multiple such systems exist, covering Japan (MSAS),
  567. India (GAGAN), etc, with more being deployed.</p>
  568. <p>In your skyview, look for GPS sats with numbers 120 and above;
  569. those are the Space Based Augmentation System (SBAS) birds. For U.S.
  570. users 138 is the most likely PRN to show up.
  571. If your GPS receiver can see them at all, it can probably use them
  572. for correction when you're within the coverage area of a
  573. SBAS. But you can't be sure of this unless
  574. they're marked as part of the satellite set for a fix. On the other
  575. hand, some receivers may use them <em>without</em> marking the SBAS
  576. satellites as part of the fix set. Vendor documentation in this area
  577. tends to be murky or nonexistent.</p>
  578. <p>If your receiver emits the NMEA GGA sentence, look at field 6 right
  579. after the E or W qualifier for the latitude. This is the GPS fix
  580. quality indicator field. 2 indicates that the receiver is getting and
  581. using differential-GPS corrections. On a consumer-grade GPS this
  582. usually means SBAS is in use.</p>
  583. <p>Unfortunately, the mere presence of "WAAS" in your receiver's
  584. feature list is not a guarantee that WAAS is actually supported. This
  585. feature causes significant additional power usage, and OEMs sometimes
  586. condition it out of their firmware builds without documenting that
  587. fact.</p>
  588. <p>It has been found that while SiRF-II chips generally had WAAS
  589. working, SiRF-III support varies by firmware level.</p>
  590. <h1 id='agps'>Can GPSD use Assisted GPS data from cellphone networks?</h1>
  591. <p>Sadly, no. There are both hardware and software barriers to this.</p>
  592. <p>Using AGPS would requires picking up and interpreting information
  593. broadcast by cellphone towers, so it would at minimum need another
  594. receiver (separate from the GPS mouse) operating in those frequency
  595. bands. Of course, a cellphone has one of those built in. Standalone
  596. GPS sensors don't.</p>
  597. <p>There's another level of the problem, too. Supposing we had the
  598. right sort of receiver, AGPS systems are carrier-dependent. As far as
  599. we know there aren't any published standards for the format of the
  600. corrections. So even if we had the signals, GPSD couldn't know what to
  601. do with them.</p>
  602. <h1 id='gpsdrive'>Why do I get implausibly low speeds when using gpsdrive?</h1>
  603. <p>This is a gpsdrive bug, as you can verify by running
  604. <code>xgps</code> alongside it.</p>
  605. <h1 id='kismet'>Why do I get no results when I try to use <code>gpsd</code> with Kismet?</h1>
  606. <p>Your Kismet configuration has to include the setting
  607. "gps=true" This is a surprisingly easy detail to forget.</p>
  608. <h1 id='baud'>What about serial port speed (baud rate)?</h1>
  609. <p>The <code>gpsd</code> code is designed to be autoconfiguring for both
  610. static and hot-plugged devices. The <code>gpsd</code> command line
  611. options are only for problem solving or odd configurations.</p>
  612. <p>One common problem is GNSS receivers that operate over Bluetooth.
  613. Changing the speed of these is difficult to impossible. Some go
  614. catatonic if you try to change the serial port speed rate, which is
  615. why we have a -b option that prevents <code>gpsd</code> from trying to
  616. configure the GPSes it talks to.</p>
  617. <p>Another problem is that some systems may have long autobaud detection
  618. times, or be set to impossible to detect framing, like 8O1.
  619. On most systems, simply set the speed and framing before calling
  620. <code>gpsd</code> and <code>gpsd</code> will try those settings first.
  621. This works for both devices specified on the <code>gpsd</code> command
  622. line and those hot-plugged with <code>gpsdctl</code>.</p>
  623. <p>Accordingly, you can short-circuit the autobaud if you use stty(1) to set
  624. the bit rate just before starting gpsd. For example, suppose you know that
  625. your GPS is on serial port 0 and operates at a fixed bps of 54600. You
  626. can set that up like this:</p>
  627. <pre><code>
  628. stty -F /dev/ttyS0 speed 54600
  629. gpsd -n /dev/ttyS0
  630. </code></pre>
  631. <p>If you have a Trimble that needs 115200 and 8O1, do this:</p>
  632. <pre><code>
  633. stty -F /dev/ttyS0 speed 115200 parodd
  634. gpsd -n /dev/ttyS0
  635. </code></pre>
  636. <p>If you only have one device connected to <code>gpsd</code> and
  637. that device is specified on the command line, then you can instead
  638. specify the speed with the -s [SPEED] option and/or the framing
  639. with the -f [FRAMING] option.</p>
  640. <p>For more details and discussion about autobaud refer to the
  641. <a href="hacking.html">Hacker's Guide</a>.</p>
  642. <h1 id='conflict'>Why does GPSD open non-GPS USB devices?</h1>
  643. <p>Most USB devices have a defined <a
  644. href="https://www.usb.org/developers/defined_class">device class</a> -
  645. mass storage, video, hub, and human interface device are three of the
  646. more common ones. Using GPSD will never interfere with such devices,
  647. nor will they interfere with GPSD.</p>
  648. <p>Unfortunately, there is no device class for USB GPSes. Nor is there
  649. a device class for USB-to-serial adapter chips. Both are assigned the
  650. catch-all class 0xFF, "Vendor Specific". Almost every USB GPS we've ever seen
  651. consists of a GPS module with TTL-level RS232 outputs connected to an
  652. RS232-to-USB adapter chip, and presents the class ID 0xFF to your USB
  653. subsystem. The only exceptions we know of are some u-blox modules that
  654. pretend to be USB modems.</p>
  655. <p>When you install GPSD, it puts in place rules that watch for
  656. hotplug activation events from devices that might be GPSes. When such
  657. a hotplug event happens, a <code>gpsd</code> instance is started (if
  658. one is not already running) and puts a copy of the device path in an
  659. internal stash list. Later, if a client application requests GPS data,
  660. <code>gpsd</code> will try to read from the device, and discard it
  661. from the stash list if it is not emitting data that <code>gpsd</code>
  662. recognizes.</p>
  663. <p>GPSD's notion of "might be a GPS" depends on the fact that all USB
  664. GPSes are made with one of a small number of USB-to-serial adapter
  665. chips, the most common of which is the Prolific Logic 2303. GPSD's
  666. hotplug rules expect that anything exhibiting the USB vendor:product
  667. ID pair of one of these chips will be a GPS.</p>
  668. <p>A problem can arise if you have other devices connected to your
  669. system through one of these specific adaptor chips. When these
  670. activate, the GPSD hotplug rules will believe they are GPSes, and
  671. <code>gpsd</code> will try to read from them when a GPS-ware client
  672. application requests data. We've had reports of this happening with
  673. USB modems and various microcontroller kits. It's not a problem we can
  674. solve with clever programming, the devices simply don't yield
  675. enough information about themselves to avoid conflicts.</p>
  676. <p>Under Linux, <code>gpsd</code> at 3.1 and later versions checks
  677. each serial and USB device after opening it to see if any other
  678. process has that device open; if so, it's dropped. This should at
  679. least keep GPSD from usurping data sources belonging to other service
  680. daemons.</p>
  681. <p>Note that GPSD never tries to configure USB devices until it has
  682. identified them as sensors of a known type. Also, it tries to open with
  683. TIOCEXCL and thus will not open devices that another process already
  684. has open. So the worst case is a race between GPSD and another process
  685. to open a device not in use, in which the other process's open fails.</p>
  686. <p>If this sort of conflict becomes a problem, you can work around
  687. it by disabling the GPSD hotplug rules. Unfortunately, this means
  688. you will have to start <code>gpsd</code> manually with a device-path
  689. argument when you want to use a GPS.</p>
  690. <h1 id='efficiency'>What is gpsd's CPU and power overhead?</h1>
  691. <p>The daemon, <code>gpsd</code>, is designed to run light so it can be
  692. used in low-power embedded-systems deployments. Data throughput from GPSes
  693. and other navigational sensors is low and tends to be concentrated in bursts
  694. at about one-second intervals; accordingly, <code>gpsd</code> spends most
  695. of its time simply waiting in select(2) at effectively zero CPU cost. Even
  696. with a client session and a GPS active, we have measured gpsd's CPU load
  697. at steadily less than 1% on a low-power, low-speed ARM SBC.</p>
  698. <h1 id='usblockup'>My USB port becomes unavailable after gpsd uses it.</h1>
  699. <p>Occasionally we get a bug report from a user who says a USB port
  700. locks up or becomes unavailable after <code>gpsd</code> has closed it.
  701. Such problems may persist until the USB port is unplugged and
  702. replugged, or until all devices in that root hub are unplugged and
  703. replugged, or even until a reboot.</p>
  704. <p>This is not a GPSD bug. Bugs in the serial-device layer of your
  705. operating system, tickled by gpsd's unusual autobauding loop and
  706. serial-parameter changes, can cause problems like this. They may be
  707. driver-specific bugs, or they may be due to bad interactions between
  708. ioctl() and select() in the kernel's generic tty code. Bugs in the USB
  709. chipset on your motherboard or in a hub can do it, too.</p>
  710. <p>Here are some possible fixes:</p>
  711. <dl>
  712. <dt><b>1. Suppress the autobauding loop</b></dt>
  713. <dd>The autobauding hunt loop in <code>gpsd</code> stresses chipsets and
  714. drivers in unusual ways, which is why these sorts of bugs show up more
  715. often under <code>gpsd</code> than most other USB-using software. The first
  716. thing to try is to <a href="#baud">suppress the autobauding loop</a>.</dd>
  717. <dt><b>2. Upgrade your kernel</b></dt>
  718. <dd>Upgrading your kernel may help. Obscure tty-layer kernel bugs pop
  719. up relatively often and are usually fixed pretty quickly.</dd>
  720. <dt><b>3. Try a different USB-to-serial chip</b></dt>
  721. <dd>Another thing to try is a GPS with a different USB-to-serial chip.
  722. You probably do not have a a chip-specific problem if you're using
  723. a PL23203, as those drivers have been tested a lot. But we've seen
  724. reports that were definitely chip-specific on less common chipsets
  725. such as FTDI. The CP210x chips are also known to be problematic,
  726. mainly because the vendor refused to release enough programming
  727. information to allow a decent open-source driver to be written.</dd>
  728. <dt><b>4. Replace your USB hub</b></dt>
  729. <dd>Some USB hubs are flaky. You may need to replace yours.</dd>
  730. </dl>
  731. <p>When you have had such a problem with <code>gpsd</code>, and are
  732. able to work around it or fix it, please inform us so we can
  733. improve this FAQ.</p>
  734. <h1 id='lockup'>My <code>gpsd</code> sometimes stops responding overnight</h1>
  735. <p>At one point in the development of <code>gpsd</code> we got a
  736. report of the daemon ceasing to respond to queries when run for
  737. more than a day or so; the user, quite reasonably, suspected some sort
  738. of resource leak in the daemon. On the other hand, other users reported
  739. good operation over much longer periods with the same version of
  740. the software. That suggests a bug at the level of the user's operating
  741. system or local site configuration.</p>
  742. <p>Nevertheless, the possibility of a resource-leak bug alarmed us
  743. enough that after 2.26 one of us (ESR) built an entire test framework
  744. for auditing the code's dynamic behavior and used it to apply <a
  745. href="http://valgrind.org">Valgrind</a>. You can look at the
  746. resulting script, valgrind-audit, in the source distribution. This
  747. turned up a couple of minor leaks, but nothing sufficient to explain
  748. the report.</p>
  749. <p>One of our senior developers, Rob Janssen, has seen
  750. <code>gpsd</code> interact badly with overnight backups, pushing the
  751. system load average through the roof. He says: "when you copy many
  752. gigabytes of data from disk to disk, the [Linux] kernel's buffer
  753. management goes completely haywire. [...] I think this is caused both
  754. by allocation of many buffers for reading files, and by accumulation
  755. of many dirty buffers that still have to be written. At some point,
  756. programs like gpsd (but also all interactive programs and the X
  757. display manager) come to a complete standstill while the system is
  758. swapping like mad."</p>
  759. <p>If Rob's analysis is correct, <code>gpsd</code> is a canary in a
  760. coal mine. If your <code>gpsd</code> locks up after a long period of
  761. operation, you should look at your logs and see if you can connect the
  762. point at which it stopped responding to some kind of resource crisis
  763. brought on by lots of I/O activity.</p>
  764. <p>Another thing to try is running <code>gpsd</code> under Valgrind overnight
  765. and seeing if it reports any leaks.</p>
  766. <h1 id='why_not_parse_nmea'>Why use the <code>gpsd</code> protocol rather than parsing raw NMEA?</h1>
  767. <p>Some applications that use <code>gpsd</code> start raw mode
  768. and parse the NMEA directly. This is not a good idea.</p>
  769. <p>One problem with raw mode is that NMEA is a poorly specified
  770. standard. There are, for example, two different and incompatible
  771. variants of GPVTG. Another issue is that implementations vary as to
  772. whether they leave fields they don't supply empty or fill them in with
  773. a special value such as 0.0. Interpretation of the different NMEA
  774. status fields is a black art.</p>
  775. <p>It is all too easy to write an NMEA parser that works well on one
  776. variant but breaks on another, delivering subtly incorrect results or
  777. even crashing your application. Because <code>gpsd</code> specializes
  778. in the job, we collect knowledge on all variants and do parsing that
  779. is much less likely to get tripped up.</p>
  780. <p>Another issue is that some of the reports your application would
  781. like to have are not generated by all GPSes. Estimated position error
  782. in meters is the most obvious example; climb/sink is another. When a GPS
  783. doesn't supply these, <code>gpsd</code> can fill them in using the
  784. same sorts of computation that more capable GPSes use.</p>
  785. <h1 id='interfacing'>How should I interface my application with <code>gpsd</code>?</h1>
  786. <p>The <code>gpsd</code> package provides two ways for C code to get
  787. data from a GPS or AIS receiver. Both go through the libgps.a library,
  788. which supports two sets of entry points. The <a
  789. href="libgps.html">low-level interface</a> talks directly to the GPS.
  790. The <a href="libgps.html">high-level interface</a> communicates with
  791. an instance of <code>gpsd</code>, which uses its own copy of libgps.a
  792. to talk to the device.</p>
  793. <p>A third way would be to open a socket to <code>gpsd</code> and
  794. interpret <code>gpsd</code> protocol or raw NMEA in your application.
  795. Before 2.0, all <code>gpsd</code>-aware applications had to do this
  796. because libgps.a didn't exist. Now that it does, the exercise is
  797. rather pointless. Using libgps.a will probably simplify your code a
  798. lot.</p>
  799. <p>You will almost always want to use the high-level interface and go
  800. through the daemon; among other things, this means more than one
  801. application will be able to query the GPS without causing confusion.
  802. The only exception will be in very space-constrained single-user
  803. scenarios, perhaps on embedded systems or PDAs. On those it may be
  804. appropriate to use the low-level interface directly, probably with a
  805. build from source that conditions out all but one of the drivers.</p>
  806. <p>For Python programmers, there is a gps.py module the high-level
  807. interface. It exports a class that encapsulates a GPS session.</p>
  808. <h1 id='almanac'>How can my application get almanac/ephemeris/pseudorange data?</h1>
  809. <p>Sorry, there's no easy way to do these things through GPSD yet.
  810. The reason is that there is no consistent way to make GPS receivers
  811. report this information.</p>
  812. <p>Many don't ship it at all. Others (including some but not all
  813. devices shipping SiRF binary packets) ship it occasionally in SUBFRAME
  814. information, but you have to know exactly how to grovel through the
  815. SUBFRAME fields to get it and the documentation of those in
  816. IS-GPS-200E (the over-the-air protocol used by GPS satellites) is
  817. extremely obscure. Still others report varying subsets of
  818. almanac/ephemeris/pseudorange data in reasonably straightforward ways,
  819. but in vendor-proprietary sentences that are extremely specific to
  820. individual receiver types, poorly documented or undocumented, and
  821. often needing to be activated by control sequences that are equally
  822. specific and even worse documented.</p>
  823. <p>We'd like to do a better job of extracting this information, but
  824. handling all the potential variations would be an extremely difficult
  825. and messy job. It's hard to know what to do, and even harder to know
  826. how to test the correctness of the extraction code once you think you
  827. have it. The spectacularly bad design and documentation of most
  828. vendor-specific GPS reporting protocols is at its abysmal worst in
  829. this exact area.</p>
  830. <p>On a SiRF-based device you might be able to get some use out of
  831. the SUBFRAME JSON. If you succeed in extracting
  832. almanac/ephemeris/pseudorange data from those raw fields, we salute
  833. you - and please share that code with us!</p>
  834. <h1 id='bluetooth'>Why do I have to restart <code>gpsd</code> whenever I power-cycle my Bluetooth device?</h1>
  835. <p>The Bluetooth stack returns 0 for a read from a missing device,
  836. rather than -1, and doesn't set errno. This is wrong and needs to be
  837. fixed at OS level.</p>
  838. <h1 id='sleep'>Why does my GPS get lost when I sleep/wake my laptop?</h1>
  839. <p>This is not a GPSD problem, but a result of the way Linux handles
  840. USB serial devices. In a default Linux configuration, USB serial
  841. device name do not depend on which physical port you plug the
  842. USB/serial adaptor, but on what order you plug devices in: 1st device
  843. gets /dev/ttyUSB0, 2nd gets /dev/ttyUSB1, etc....</p>
  844. <p>This collides with what happens during a suspend/resume. If you
  845. suspend while <code>gpsd</code> has a device active, it will hold the
  846. device open while your laptop is asleep - but, meanwhile, the suspend
  847. logic is shutting down hotpluggable devices to be recreated at
  848. resume time. On resume, Linux will see that the old device is open
  849. <em>and recreate one with a different name</em>, leaving <code>gpsd</code>
  850. looking at a bad file descriptor.</p>
  851. <p>There is a solution to this problem: create a stable gps-usb device
  852. that is actually a symlink which gets modified by hotplug events, and
  853. give <code>gpsd</code> that device when you invoke it. You'll need <a
  854. href="70-persistent-usb-gps.rules">these replacement udev rules</a>,
  855. and the experience required to patch them so the vendor ID in the last
  856. one matches your GPS hardware (look in your lsusb output).</p>
  857. <hr>
  858. <script src="datestamp.js"></script>
  859. </div>
  860. </body>
  861. </html>