INSTALL.adoc 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. = GPSD Installation Instructions
  2. :title: GPSD Installation Instructions
  3. :description: Steps for installing GPSD and verifying its performance.
  4. :keywords: GPSD, GPS, installation
  5. :author: Eric S. Raymond <esr@thyrsus.com>
  6. :robots:index,follow
  7. Here are the steps for installing GPSD and verifying its performance.
  8. They assume you have GPSD available as an installable binary package,
  9. Instructions for building GPSD from source (including cross-building)
  10. are in the file "build.adoc" in the source distribution.
  11. Most of these installation instructions are generic to Linux. There are
  12. some special notes on installation on *BSD, WSL, OS X, macOS, and the
  13. Raspberry Pi near the end of this file.
  14. == Check that your GPS is live and you can get data from it
  15. Start by making sure you can get data from your GPS, otherwise the later
  16. steps will be very frustrating. In this command:
  17. stty -F /dev/ttyXXX ispeed 4800 && cat </dev/ttyXXX
  18. replace ttyXXX with the filename of the port. This will probably be
  19. either /dev/ttyUSB0 or /dev/ttyS0. If you are on a *BSD Unix or MacOS X,
  20. replace -F with -f.
  21. When you run this command, you should see text lines beginning with $
  22. come to stdout (possibly after a short initial burst of binary
  23. garbage). If you don't see this, you may have OS-level problems with
  24. your serial support, but more likely have the wrong device. Look
  25. again.
  26. If you have trouble with the preceding step, check your cabling
  27. first. Verify that the device is connected and that its power LED
  28. (if it has one) is lit.
  29. If you seem to have some sort of serial-device problem, check that
  30. your kernel properly supports the device you are using. For GPSes
  31. using an RS-232 port (which is no longer common) you will need
  32. serial-port support compiled into your kernel. Various USB-to-serial
  33. adapter chips found in GPSes require specific drivers.
  34. Under a stock Linux kernel these will all be loaded on demand when
  35. the USB system sees the appropriate vendor/product ID combinations.
  36. See build.adoc for instructions relating to custom kernels.
  37. == Check that your system configuration will allow GPSD to work
  38. Ensure that device permissions will enable gpsd to read from and write
  39. to GPS devices even after it drops root privileges. If you are
  40. running Fedora Core, Ubuntu, or stock Debian you can skip this step,
  41. as the stock configuration has the right properties.
  42. gpsd requires two things: (1) that GPS devices have group read and
  43. write enabled, and (2) all of them have the same group ID as a
  44. prototypical device, typically /dev/ttyS0 under Linux or /dev/tty00
  45. under *BSD. It does not actually matter what the owning group is, as
  46. gpsd will look this up on startup. Alternatively, (3), you can set a
  47. fallback group with the gpsd-group option in case the prototype is not
  48. found: this should be the group that has write access to serial
  49. devices. On Debian and derivatives including Ubuntu this is "dialout";
  50. on Gentoo/Fedora/openSuse it is "uucp".
  51. Before dropping privileges, gpsd will ensure that it has access to
  52. devices given to it on the command line by forcing their group read
  53. and write permissions on.
  54. On a Linux with udev, check the files in /etc/udev/permissions.d to
  55. ensure that /dev/tty* devices are all created with the same group
  56. and with 0660 permissions.
  57. When gpsd drops privileges, its default is to set uid to 'nobody' and
  58. group to the owning group of the prototype device (the configure
  59. option gpsd-user=foo will cause gpsd to change to 'foo'
  60. instead).
  61. If your system has the Linux hotplug facility installed you can skip
  62. the permission-setting part; the hotplug scripts will force the
  63. permissions for you. You still have to make sure all the tty devices
  64. are in the same group.
  65. == Check your installation prerequisites
  66. A minimum build of GPSD can run pretty close to the metal; all it
  67. absolutely needs is the C runtime support. The test clients and
  68. various additional features have additional prerequisites:
  69. |===============================================================================
  70. |asciidoctor | to build the documentation and www
  71. |dbus | gpsd will issue DBUS notifications
  72. |gnuplot | to plot gpsprof output.
  73. |GTK | for python-GI
  74. |libtinfo5 | low-level terminfo library (see below)
  75. |libusb-1.0.x or later | for older Garmin USB devices
  76. |ncurses | for cgps and gpsmon clients
  77. |pps-tools | for PPS time keeping
  78. |PyGObject | for xps and xgpsspeed clients (see below)
  79. |pyserial | for ubxtool and zerk in direct-serial mode
  80. |python2.x(x>=6) or 3.y(y>=2) | required for various clients and utilities
  81. |python-cairo | for python-GI
  82. |Qt | libQgpsmm depends on this
  83. |===============================================================================
  84. Some ncurses packages contain the terminfo library; some break it out
  85. separately as libtinfo5 or libtinfo.
  86. The PyGObject package goes by several names, and is split up into sub
  87. packages different ways, depending on the distribution. Sometimes
  88. python-gi, python-gobject, python-cairo, etc. The packages also need
  89. the underlying system libraries (GTK, GLib, etc.)
  90. The asynchronous python module (gps/aiogps.py) and its example client
  91. (example_aiogps.py) require Python 3.6+.
  92. See below for more specific module requirements in the individual
  93. distribution instructions.
  94. == Installing gpsd
  95. === Install your distributions package(s)
  96. Up-to-date gpsd packages are generally available for Linux distributions
  97. including Debian and derivatives (including Ubuntu and Mint), Fedora and
  98. derivatives (including CentOS), openSUSE, PCLinuxOS, Mageia, Gentoo, and
  99. Slackware. In the embedded space, CeroWRT and Yocto carry GPSD. The
  100. GPSD package in the FreeBSD ports tree is also reliably up to date.
  101. Even if your distribution is not on this list, it is quite likely GPSD
  102. has already been packaged for it.
  103. Whatever distribution you are running, the name of the core GPSD
  104. package containing the service daemon is almost certainly "gpsd".
  105. However, many distributions break up GPSD into separate installable
  106. packages for the core daemon and clients; you should search your
  107. repository index for anything with gpsd as a prefix.
  108. === Install from source code
  109. Directions for installing from source are in the file build.adoc found
  110. in the source distribution.
  111. == How to test the software
  112. 1. Start gpsd. You'll need to give it as an argument a path to
  113. a serial or USB port with a GPS attached to it. Your test command
  114. should look something like this:
  115. gpsd -D 5 -N -n /dev/ttyUSB0
  116. 2. Once gpsd is running, telnet to port 2947. You should see a
  117. greeting line that's a JSON object describing GPSD's version.
  118. Now plug in your GPS (or AIS receiver, or RTCM2 receiver).
  119. 3. Type '?WATCH={"enable":true,"json":true};' to start raw and
  120. watcher modes. You should see lines beginning with '{' that are
  121. JSON objects representing reports from your GPS; these are reports
  122. in GPSD protocol.
  123. 4. Start the xgps or cgps client. Calling it with no arguments
  124. should do the right thing. You should see a display panel with
  125. position/velocity-time information, and a satellite display. The
  126. displays won't look very interesting until the GPS acquires satellite
  127. lock.
  128. 5. Have patience. If you are cold-starting a new GPS, it may take
  129. 15-20 minutes after it gets a skyview for it to download an ephemeris
  130. and begin delivering fixes.
  131. 6. A FAQ and troubleshooting instructions can be found at the GPSD
  132. project site.
  133. == Once you have verified correct operation
  134. 1. If you installed from a '.deb' package under Debian or a
  135. Debian-derived system, you may need to `dpkg-reconfigure -plow gpsd' to
  136. enable the hotplug magic ("Start gpsd automatically").
  137. 2. Check out the list of supported hardware at the Hardware page on
  138. the GPSD project's website. If your GPS isn't on the list, please send
  139. us information to add a new line to the table. Directions are
  140. included on that page. We can also use updates of the latest version
  141. number known to work with hardware already supported.
  142. 3. GPSD includes gpsd.php, a PHP script, that you can use to generate
  143. a PHP status page for your GPS if you wish. (It may not be in the
  144. core package.) It should be manually copied to your HTTP document
  145. directory. The first time it's invoked, it will generate a file
  146. called 'gpsd_config.inc' in that directory containing configuration
  147. information; edit to taste.
  148. 4. There are other non-essential scripts that may be useful; these
  149. are in the contrib/ directory of the source. They may not be available
  150. in the packages available from distributions.
  151. For special instructions related to using GPSD for time service, see the
  152. GPSD Time Service HOWTO in the distribution or on the web.
  153. == Apple Desktop
  154. === Special Notes for macOS X Installation
  155. gpsd will build, install and run on macOs. Install the Xcode application
  156. from the Apple store. Then install Homebrew (https://brew.sh/) to get
  157. all the stuff you need, like git, scons, python, etc.
  158. As a normal user, install homebrew, then install scons and asciidoctor.
  159. Installing scons pulls in python3. Brew will become root as needed, so
  160. starting asd a normal user is just security theater.
  161. --------------------------------------------------------------
  162. $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  163. $ brew install scons asciidoctor
  164. --------------------------------------------------------------
  165. Now you need to become root. Make a place for the gpsd source to live,
  166. use git to install it there, then go there. Build gpsd with "scons",
  167. then install it with "scons install"
  168. --------------------------------------------------------------
  169. # mkdir -p /usr/local/src/GPS
  170. # cd /usr/local/src/GPS
  171. # git clone https://gitlab.com/gpsd/gpsd.git
  172. # cd gpsd
  173. # scons && scons install
  174. --------------------------------------------------------------
  175. === Special Notes for OS X Installation
  176. gpsd will build, install and run on OS X (osX). The easiest way to
  177. do so is to first install the MacPorts package. Follow their install
  178. procedure at: http://www.macports.org/install.php
  179. Then use their port command to install scons. Optionally git if you
  180. want to access the development source. Optionally install libxslt and
  181. xmlto to build the documentation.
  182. --------------------------------------------------------------
  183. # port install scons
  184. # port install git
  185. # port install libxslt
  186. # port install xmlto
  187. --------------------------------------------------------------
  188. Currently the osX port does not work with Qt5. To see the build
  189. failure:
  190. --------------------------------------------------------------
  191. # port install qt5
  192. # scons --config=force qt_versioned=5
  193. --------------------------------------------------------------
  194. If you have Qt5 installed, and want to avoid the build failure, bui.d
  195. this way:
  196. --------------------------------------------------------------
  197. # scons --config=force qt=no
  198. --------------------------------------------------------------
  199. While running gpsd, or scons check, you may run out of shared memory
  200. segments. If so, you will see this error message:
  201. --------------------------------------------------------------
  202. gpsd:ERROR: shmat failed: Too many open files
  203. --------------------------------------------------------------
  204. By default OS X allows a very small number of shared segments. You
  205. can check your allowed maximum number of shared segments, then increase
  206. the maximum number, with these commands:
  207. --------------------------------------------------------------
  208. # sysctl kern.sysv.shmseg=8
  209. kern.sysv.shmseg: 32 -> 8
  210. # sysctl -a | fgrep shmseg
  211. kern.sysv.shmseg: 8
  212. # sysctl kern.sysv.shmseg=16
  213. kern.sysv.shmseg: 8 -> 16
  214. # sysctl -a | fgrep shmseg
  215. kern.sysv.shmseg: 16
  216. --------------------------------------------------------------
  217. If you are using a USB based GPS you will likely need the Prolific
  218. PL2303 driver. You can find it here:
  219. http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41
  220. == Special Notes for Raspberry Pi Installation
  221. gpsd will build, install and run on the Raspberry Pi (RasPi) and Pi 2
  222. using Debian jessie. Other distributions based on
  223. Debian (raspbian, etc) will work fine as well. The gpsd
  224. package in Debian Wheezy is known to be flaky, be sure to update to a
  225. new version of gpsd from source.
  226. === Raspbian
  227. Before compiling gpsd from source, you will need to update your system
  228. as root. Switching to the latest Raspbian distribution (Buster) is
  229. strongly recommended.
  230. --------------------------------------------------------------
  231. # apt-get update
  232. # apt-get dist-upgrade
  233. # rpi-update
  234. # reboot
  235. --------------------------------------------------------------
  236. Multiple versions of gpsd can not co-exist on the same system. You need
  237. to ensure gpsd from a package is not on the system:
  238. --------------------------------------------------------------
  239. # apt purge gpsd
  240. --------------------------------------------------------------
  241. Then install the required packages:
  242. --------------------------------------------------------------
  243. # apt-get install scons libncurses5-dev python-dev pps-tools
  244. # apt-get install git-core
  245. --------------------------------------------------------------
  246. Git-core is required to build from a git repository. pps-tools is for
  247. PPS timing.
  248. The rest of the installation is just as for any other source based
  249. install, as noted in the file *build.adoc*.
  250. === Other Debian derivatives (including stock)
  251. ==== Buster (10) with python2
  252. These Buster instructions seem to also work for Devuan and Maemo Leste.
  253. Multiple versions of gpsd can not co-exist on the same system. You need
  254. to ensure gpsd from a package is not on the system:
  255. --------------------------------------------------------------
  256. # apt purge gpsd
  257. --------------------------------------------------------------
  258. Then update your system, and install the packages required by gpsd:
  259. --------------------------------------------------------------
  260. # apt-get update
  261. # apt-get dist-upgrade
  262. # reboot
  263. # apt-get install scons libncurses-dev python-dev pps-tools
  264. # apt-get install git-core
  265. # apt-get install build-essential manpages-dev pkg-config
  266. --------------------------------------------------------------
  267. If "apt-get install scons" fails, check the file "/etc/apt/sources.list".
  268. Git-core is required to build from a git repository.
  269. pps-tools is for PPS timing.
  270. Build-essential installs the compiler and associated tools.
  271. Manpages-dev is the associated man pages.
  272. Pkg-config is a helper for scons.
  273. Gtk3 is only required to run xgps and xgpsspeed. You do not need a local
  274. X11 server installed, but it still pulls in a lot of packages.
  275. --------------------------------------------------------------
  276. # apt-get install python-gi-dev python-cairo-dev
  277. # apt-get install python-gobject-dev libgtk-3-dev
  278. --------------------------------------------------------------
  279. Ubxtool and zerk may optionally use the pyserial module for
  280. direct connection to the GNSS receiver:
  281. --------------------------------------------------------------
  282. # apt-get install python-serial
  283. --------------------------------------------------------------
  284. gpsd may optional connect to dbus with the libdbus package:
  285. --------------------------------------------------------------
  286. # apt-get install libdbus-1-dev
  287. --------------------------------------------------------------
  288. Some very old Garmin USB devices need libusb:
  289. --------------------------------------------------------------
  290. # apt-get install libusb-1.0-0-dev
  291. --------------------------------------------------------------
  292. If you wish to build the documentation, be warned it pulls in a
  293. lot of packages. Build the documentation is a prerequisite to
  294. building the HTML files for the website (www/), and also to make
  295. a source tarball (scons dist). To install the tools to build the
  296. documentation:
  297. --------------------------------------------------------------
  298. apt-get install xsltproc docbook-xsl xmlto asciidoctor
  299. --------------------------------------------------------------
  300. The rest of the installation is just as for any other source based
  301. install, as noted in the file *build.adoc*.
  302. --------------------------------------------------------------
  303. # git clone https://gitlab.com/gpsd/gpsd.git
  304. # cd gpsd
  305. # scons --config=force && scons install
  306. --------------------------------------------------------------
  307. ==== Jessie (8)
  308. Multiple versions of gpsd can not co-exist on the same system. You need
  309. to ensure gpsd from a package is not on the system:
  310. --------------------------------------------------------------
  311. # apt purge gpsd
  312. --------------------------------------------------------------
  313. Then install the required packages:
  314. --------------------------------------------------------------
  315. # apt-get install scons libncurses5-dev python-dev pps-tools
  316. # apt-get install git-core
  317. --------------------------------------------------------------
  318. Git-core is required to build from a git repository. pps-tools is for
  319. PPS timing.
  320. The rest of the installation is just as for any other source based
  321. install, as noted in the file *build.adoc*.
  322. ==== Wheezy
  323. Multiple versions of gpsd can not co-exist on the same system. You need
  324. to ensure gpsd from a package is not on the system:
  325. --------------------------------------------------------------
  326. # apt purge gpsd
  327. --------------------------------------------------------------
  328. Wheezy, being older, requires updating the tools for compiling
  329. and testing gpsd:
  330. You need scons at 2.3.0 or higher to build.
  331. If your scons is less than 2.3.0 you will need to get a newer scons
  332. from wheezy-backport. Partial instructions are detailed here:
  333. https://backports.debian.org/Instructions/
  334. Basically you need to add this line to /etc/apt/sources.list:
  335. --------------------------------------------------------------
  336. deb http://http.debian.net/debian wheezy-backports main
  337. --------------------------------------------------------------
  338. Then do another update:
  339. --------------------------------------------------------------
  340. apt-get update
  341. --------------------------------------------------------------
  342. Which may lead you to this error if you lack a full set of debian keys:
  343. --------------------------------------------------------------
  344. W: GPG error: http://http.debian.net wheezy-backports Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553
  345. --------------------------------------------------------------
  346. Partial but detailed instructions to fix that are here:
  347. --------------------------------------------------------------
  348. https://wiki.debian.org/SecureApt
  349. --------------------------------------------------------------
  350. Use either of the following code blocks. The first is more robust:
  351. --------------------------------------------------------------
  352. apt-get install debian-archive-keyring
  353. --------------------------------------------------------------
  354. --------------------------------------------------------------
  355. gpg --keyserver pgpkeys.mit.edu --recv 8B48AD6246925553
  356. gpg -a --export 46925553 | apt-key add -
  357. apt-get update
  358. --------------------------------------------------------------
  359. You can now install scons from the wheezy-backports repository:
  360. --------------------------------------------------------------
  361. apt-get -t wheezy-backports install scons
  362. --------------------------------------------------------------
  363. and other tools:
  364. --------------------------------------------------------------
  365. # apt-get install scons libncurses5-dev python-dev pps-tools
  366. # apt-get install git-core
  367. --------------------------------------------------------------
  368. Git-core is required to build from a git repository. pps-tools is for
  369. PPS timing.
  370. The rest of the installation is just as for any other source based
  371. install, as noted in the file *build.adoc*.
  372. ==== Ubuntu Buster 20
  373. If you have Raspbian Buster, that is not this.
  374. Preliminary install notes.
  375. Multiple versions of gpsd can not co-exist on the same system. You need
  376. to ensure gpsd from a package is not on the system:
  377. --------------------------------------------------------------
  378. # apt purge gpsd
  379. --------------------------------------------------------------
  380. Then install the required packages:
  381. --------------------------------------------------------------
  382. apt install gcc scons python-gi python-gi-cairo g++
  383. apt install python-gobject libgtk-3-dev
  384. apt install libncurses5-dev libtinfo-dev pps-tools
  385. apt install gir1.2-gtk-3.0
  386. --------------------------------------------------------------
  387. If you wish to build the documentation, be warned it pulls in a
  388. lot of packages. Build the documentation is a prerequisite to
  389. building the HTML files for the website (www/), and also to make
  390. a source tarball (scons dist). To install the tools to build the
  391. documentation:
  392. --------------------------------------------------------------
  393. apt install xsltproc docbook-xsl xmlto asciidoctor
  394. --------------------------------------------------------------
  395. The rest of the installation is just as for any other source based
  396. install, as noted in the file *build.adoc* .
  397. ==== Ubuntu 18.04 LTS
  398. Preliminary install notes.
  399. If you have Raspbian Buster, that is not this.
  400. Multiple versions of gpsd can not co-exist on the same system. You need
  401. to ensure gpsd from a package is not on the system:
  402. --------------------------------------------------------------
  403. # apt purge gpsd
  404. --------------------------------------------------------------
  405. Then install the required packages:
  406. --------------------------------------------------------------
  407. apt install gcc scons python-gi python-gi-cairo g++
  408. apt install libncurses5-dev libtinfo-dev pps-tools
  409. apt install gir1.2-gtk-3.0
  410. --------------------------------------------------------------
  411. If you wish to build the documentation, be warned it pulls in a
  412. lot of packages. Build the documentation is a prerequisite to
  413. building the HTML files for the website (www/), and also to make
  414. a source tarball (scons dist). To install the tools to build the
  415. documentation:
  416. --------------------------------------------------------------
  417. apt install xsltproc docbook-xsl xmlto asciidoctor
  418. --------------------------------------------------------------
  419. The rest of the installation is just as for any other source based
  420. install, as noted in the file *build.adoc*.
  421. === Other Raspberry Pi tips
  422. Any USB connected GPS that is known to work with gpsd will work fine on
  423. the RasPi. No special instructions apply.
  424. A very popular option is to install the AdaFruit Ultimate GPS HAT. With
  425. this GPS you also get a good 1PPS signal. This works as any other GPS
  426. with gpsd, but there are two things to note. The GPS takes over the
  427. serial console: /dev/ttyAMA0. The PPS signal will be on GPIO Pin #4.
  428. Only three specific changes need to be made to make the HAT work. First
  429. in the file /boot/cmdline.txt, remove this part "console=ttyAMA0,115200
  430. kgdboc=ttyAMA0,115200". That frees the serial port from console use so
  431. the GPS can use it.
  432. Second you need to tell the boot process to load the pps_gpio module
  433. and attach /dev/pps0 to GPIO pin 4. Do that by adding this line
  434. to the bottom of /boot/config.txt: dtoverlay=pps-gpio,gpiopin=4
  435. Reboot so those changes take effect.
  436. Run gpsd like this:
  437. --------------------------------------------------------------
  438. ~ # gpsd -D 5 -N -n /dev/ttyAMA0 /dev/pps0
  439. --------------------------------------------------------------
  440. If you are on the RasPi with gpsd version 3.17, or above, /dev/pps0 can
  441. be autodetected, and used for PPS if available.
  442. gpsd 3.17 and up only:
  443. --------------------------------------------------------------
  444. ~ # gpsd -D 5 -N -n /dev/ttyAMA0
  445. --------------------------------------------------------------
  446. You can verify gpsd is using the PPS by running ntpshmmon:
  447. --------------------------------------------------------------
  448. ~ # ntpshmmon
  449. # Name Seen@ Clock Real L Prec
  450. sample NTP0 1461619703.641899335 1461619703.445224418 1461619703.000000000 0 -1
  451. sample NTP2 1461619703.642203397 1461619702.999262204 1461619703.000000000 0 -20
  452. sample NTP0 1461619704.142097363 1461619703.445224418 1461619703.000000000 0 -1
  453. sample NTP2 1461619704.142204134 1461619703.999258157 1461619704.000000000 0 -20
  454. --------------------------------------------------------------
  455. If you do not see NTP2 then you misconfigured the pps_gpio driver.
  456. The serial time is provided to ntpd on NTP0, the PPS time is on NTP2, not
  457. on NTP1 like described earlier. So your ntp.conf will need to be adjusted
  458. from:
  459. --------------------------------------------------------------
  460. # GPS PPS reference (NTP1)
  461. server 127.127.28.1 prefer
  462. fudge 127.127.28.1 refid PPS
  463. --------------------------------------------------------------
  464. To:
  465. --------------------------------------------------------------
  466. # GPS PPS reference (NTP2)
  467. server 127.127.28.2 prefer
  468. fudge 127.127.28.2 refid PPS
  469. --------------------------------------------------------------
  470. Now proceed as for any other operating system to use gpsd.
  471. Be sure to validate that your PPS signal is not offset by the pulse
  472. width. That would mean gpsd is using the wrong edge.
  473. Detailed instructions are available from their website:
  474. https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/
  475. You will need to dig deeper to make the PPS work, here is a good reference:
  476. http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html
  477. == BSD derivatives ==
  478. === Special Notes for FreeBSD Installation ===
  479. gpsd will build, install and run on FreeBSD.
  480. Due to the missing CAN bus support (linux/can.h), NMEA2000/CAN
  481. is not supported on FreeBSD.
  482. Use their pkg command to install scons, and optionally git if you
  483. want to access the development source.
  484. If you want to build the QT bindings, you'll also need the
  485. qt5-network and pkgconf packages.
  486. --------------------------------------------------------------
  487. # pkg install scons
  488. # pkg install git
  489. # ln -s /usr/local/bin/python2.7 /usr/local/bin/python
  490. # ln -s /usr/local/bin/python2.7 /usr/local/bin/python2
  491. # ln -s /usr/local/bin/python3.6 /usr/local/bin/python3
  492. # git clone https://gitlab.com/gpsd/gpsd.git
  493. # cd gpsd
  494. # scons --config=force && scons install
  495. --------------------------------------------------------------
  496. FreeBSD fails to create the python links as required by PEP394.
  497. So you need to add them yourself, as above.
  498. === Special Notes for NetBSD 8.1 Installation
  499. gpsd will build, install and run on NetBSD.
  500. Use their 'pkg_add' command to install pkgin. Then use pkgin to
  501. install the required tools.
  502. --------------------------------------------------------------
  503. # export PKG_PATH=\
  504. "http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.1/All"
  505. # pkg_add -v pkgin
  506. # echo http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.1/All > \
  507. /usr/pkg/etc/pkgin/repositories.conf
  508. # pkgin update
  509. # pkgin install python37 py37-curses
  510. # ln -s /usr/pkg/bin/python3.7 /usr/pkg/bin/python
  511. # ln -s /usr/pkg/bin/python3.7 /usr/pkg/bin/python3
  512. # pkgin install py37-scons
  513. # pkgin install ncurses
  514. # pkgin install openssl mozilla-rootcerts
  515. # mozilla-rootcerts install
  516. # pkgin install git
  517. # git clone https://gitlab.com/gpsd/gpsd.git
  518. # cd gpsd
  519. # scons --config=force && scons install
  520. --------------------------------------------------------------
  521. === Special Notes for OpenBSD 6.6 Installation
  522. gpsd will build, install and run on NetBSD.
  523. All you need for a basic gpsd install is scons and git. Then
  524. create the missing python link.
  525. --------------------------------------------------------------
  526. # pkg_add scons
  527. # pkg_add git
  528. # ln -s /usr/local/bin/python2 /usr/local/bin/python
  529. --------------------------------------------------------------
  530. Then install the normal way.
  531. --------------------------------------------------------------
  532. # git clone https://gitlab.com/gpsd/gpsd.git
  533. # cd gpsd
  534. # scons --config=force && scons install
  535. --------------------------------------------------------------
  536. == Special Notes for Fedora derivatives
  537. === Special Notes for CentOS 7 Installation
  538. gpsd currently will build, install and run on CentOS 7.
  539. Install the gcc compiler and tools. Install EPEL.
  540. Note: there is no EPEL for i386.
  541. Use the yum command to install git if you
  542. want to access the development source.
  543. --------------------------------------------------------------
  544. # yum group install "Development Tools"
  545. # yum install git
  546. # yum install \
  547. https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  548. # yum install scons
  549. # yum install python-devel
  550. # yum install ncurses-devel
  551. # yum install pps-tools-devel
  552. # git clone https://gitlab.com/gpsd/gpsd.git
  553. # cd gpsd
  554. # scons
  555. --------------------------------------------------------------
  556. == Special Notes for Windows
  557. Only Windows Subsystem for Linux 1 provides a reasonable means
  558. of running gpsd at this time. WSL2 lacks a GUI, USB and serial
  559. support making it unsuitable at this time.
  560. === About WSL 1
  561. WSL 1 is a component of Microsoft
  562. Windows that implements an alternate kernel. Linux
  563. distributions, notably Alpine, Debian, Kali, OpenSUSE, and
  564. Ubuntu may run on top of it.
  565. There are some issues known which affect gpsd.
  566. * /dev/ttyS* nodes have a 1 indexed number, like in MS Windows.
  567. * Windows 10 may attempt to use your GPS itself.
  568. * Older pl2303 (knockoff) serial chipsets are no longer supported \
  569. in Windows 10
  570. === Installing a Linux distribution on WSL 1 or WSL 2
  571. 1. Install a Linux distribution by clicking on the `Microsoft Store` \
  572. Icon in the taskbar.
  573. 2. Click on the search icon (it is a magnifying glass).
  574. 3. Type in 'Linux' or the name of a supported distribution. (see list)
  575. 4. Click on the icon of your chosen Linux Distribution
  576. 5. Click 'Get' then click 'Install' and busy-wait.
  577. 6. Click on the start menu and scroll to your Linux distribution and \
  578. click it.
  579. 7. Follow the distribution-specific on-screen instructions to finish \
  580. installing your Linux distribution.
  581. === Recommended packages
  582. Due to current WSL limitations, it is recommended at this time that you
  583. only install the equivalent of the following packages on your distribution.
  584. ----
  585. Python
  586. SCons (preferably 3.0+)
  587. ncurses-dev (to build/run cgps and gpsmon)
  588. asciidoctor (to build the documentation)
  589. xmlto (to build the man pages)
  590. ----
  591. Optionally, the following packages might also be installed
  592. ----
  593. pyserial (for direct control of UBlox GPS and GREIS devices)
  594. gnuplot (to generate graphs of gpsprof data)
  595. libusb-dev (to possibly use crusty old Garmin GPS receivers)
  596. git (if building from the development sources)
  597. ----
  598. === Building on WSL 1 or WSL 2
  599. 1. Get the list of packages from the appropriate section above.
  600. 2. Follow instructions in the distro-specific section above.