gpsd on Windows (using cygwin)

All you need to run gpsd on Microsoft Windows using cygwin - with ready to use binaries.

gpsd is required by several Open Source programs that deal with GPS receivers: navit, viking, gpsdrive, ... only to name a few. Unfortunately, the gpsd website http://gpsd.berlios.de/ states: "No, we don't support Windows — get a better operating system.". However, with an installed cygwin you can easily run gpsd under Windows with the binaries provided here.
  1. gpsd on Windows (using cygwin)
    1. Status
    2. Serial / USB / Bluetooth
    3. Tested with ...
      1. Windows versions
      2. GPS receivers
      3. gpsd based applications
    4. GPSD Programs
    5. Install
    6. Run gpsd daemon
    7. Run gpsd client
    8. Hints / Troubleshooting
    9. Support
    10. Licensing
    11. Compile

Status

This software should be considered in alpha status for now. It's not thoroughly tested and is currently a simple console program (no fancy features like an installer, a system service, tray icon or such). However, it works remarkably stable on my test system.

This gpsd is depending on http://cygwin.com/, but it would be desirable to have no such dependency for ease of use. Unfortunately it's not easily possible to port gpsd to Visual Studio - in fact this would possibly mean to reimplement gpsd almost completely.

Serial / USB / Bluetooth

I'm owning a Navilock NL302U, a small GPS receiver with a USB connector. It is connected to the USB port of my PC and internally uses a Serial to USB bridge. So GPS software (including gpsd) simply sees the GPS receiver through a serial connection, Windows will hide the physical connection details, being it RS232, USB or even Bluetooth.

So a typical gpsd configuration looks like this:

Typical gpsd configuration

It seems that most (all?) recent USB receivers are connected that way. Even GPS receivers connected via Bluetooth usually seem to work with such a "virtual RS232" connection.

The connection between the GPSD server daemon and the client program is done through the TCP/IP network - in fact it's easy to run the client and server programs of a gpsd based system on different computers. You can even have several client programs connected to one server daemon!

Tested with ...

I tested gpsd with my own Navilock NL302U (SiRF III based, ~35 EUR) on Windows XP Professional. A usGlobalSat ND-100 is also reported to work fine.

In general, I would think all GPS receivers that works with Windows and noted on the gpsd hardware page (http://gpsd.berlios.de/hardware.html) should work. Anyway, please report success or failure with different receivers, other Windows versions or gpsd based applications to my contact address mentioned above, so I can add them here.

Windows versions

Windows VersionWorks?Notes 
32 bit64 bit
7OK?-
Vista??-
Server 2003??-
XP ProOk?-
2000?--
NT?- USB not supported
9x / ME?-cygwin support will be discontinued in 1.7.0
CENo- not supported by cygwin

GPS receivers

BrandModelChipsetInterfaceStatusNotes
NavilockNL302USiRF star IIIUSBGood-
WintecWBT-201u-blox Antaris 4 BluetoothGoodOn very bad receiving situations,
may need a longer time (minutes) for a satellite fix.
RoyaltekRGM-3800??Good-

gpsd based applications

I've done a quick check of some applications using gpsd:

ProgramDescriptionURLVersion  testedWindows port available?gpsd works?
GpsDriveGpsDrive is a car (bike, ship, plane) navigation systemhttp://www.gpsdrive.de/none (2.10pre6)NoNo
LiveGPS
(JOSM)
LiveGPS plugin for the JAVA OpenStreetMap editorhttp://wiki.openstreetmap.org/wiki/JOSM/Plugins/LiveGPS11936Yes: JAVAYes
NavitCar navigationhttp://wiki.navit-project.org/index.php/NavIt_on_Windows0.0.4Yes, but unstableNo (how to select gpsd?)
RoadMapA car navigation system for Linux and UNIXhttp://roadmap.sourceforge.net/none
(1.1.0)
NoNo
RoadNavRoadnav is an open source street navigation solutionhttp://roadnav.sourceforge.net/0.19YesNo (unstable behaviour when selecting gpsd)
positionThe GNUstep Gps Navigator http://www.gnustep.it/enrico/position/none
(0.3)
NoNo
VikingViking is a free/open source program to manage GPS datahttp://viking.sf.net0.9.4.0YesNo (how to select gpsd?)

GPSD Programs

The provided zip file below includes the following gpsd programs (tested on my XP machine):The provided zip file also includes the following untested programs:
Not included in the zip file are files that are more difficult to compile or with limited use on Windows (e.g. would require an X11 or D-Bus server):

Install

How to install gpsd on Windows:
  1. Install and test your GPS receiver on Windows with the native drivers and tools (make sure it runs ok)
  2. Install cygwin from: http://cygwin.com/
  3. Download gpsd-2.37-1-win32-bin.zip (598 KB)
  4. Unzip and copy the zip file content into the cygwin bin dir. This is usually: c:\cygwin\bin
  5. Find out the COM port that your GPS receiver uses
Especially the last point can be tricky. The NL302U I own comes with a small Windows test program that displays details like the satellite signals and the virtual COM port number used. If your GPS vendor doesn't provide a helper tool that displays the COM port in use, you can try to have a look at the device manager (Control panel -> System -> Hardware -> Device Manager -> Ports (COM & LPT), you may find something like: "Prolific USB-to-Serial Comm Port (COM4)".

Beware: If you plug your GPS into a different USB port, it might get a new COM port number!

Run gpsd daemon

  1. Stop all programs using the GPS receiver (... including the GPS vendor test program!)
  2. Start a new console window (cmd.exe) and cd to: c:\cygwin\bin
  3. Start gpsd.exe in the console, for example: gpsd -b -N -D 2 /dev/com5 (replace com5 with your own COM port)
  4. If the Windows-Firewall now issues a warning, click the "Don't block" button
  5. After some initial text on the console, nothing happens - that's ok!
The console output now should look like:

C:\cygwin\bin>gpsd -b -N -D 2 /dev/com5
gpsd: launching (Version 2.37)
gpsd: listening on port 2947
gpsd: Unable to start ntpshm.  gpsd must run as root.
gpsd: running with effective group ID 513
gpsd: running with effective user ID 1003
gpsd: opening read-only GPS data source at '/dev/com5'
gpsd: speed 4800, 8N1
gpsd: garmin_gps not active.
gpsd: gpsd_activate(0): opened GPS (4)
gpsd: ntpd_link_activate: 0
gpsd: can't use GGA time until after ZDA or RMC has supplied a year.
gpsd: closing GPS=/dev/com5 (4)

... gpsd now waits for a client program to connect!

If you later want to stop gpsd.exe, simply enter Ctrl-C in the corresponding console window.

Run gpsd client

In a new console (cmd.exe), cd to: c:\cygwin\bin and then type:

gpspipe.exe -w


The following text output should show some basic GPS information.

C:\cygwin\bin>gpspipe -w
GPSD,F=/dev/com5
GPSD,X=1226879329.019125,I=Generic NMEA
GPSD,W=1
GPSD,O=GGA ? 0.005 49.439357 11.087195 362.70 22.40 13.60 ? ? 0.000 ? ? ? 3
GPSD,O=GSA ? 0.005 49.439357 11.087195 362.70 22.40 13.60 ? ? 0.000 ? ? ? 3
...

Obviously, the exact text on your console will differ from the above.

To stop the output, press Crtl-C in the corresponding console window.


If you don't have gpsd running, after a few seconds the output will look like:

C:\cygwin\bin>gpspipe -w
gpspipe: could not connect to gpsd 127.0.0.1:2947, Connection refused(111)

Hints / Troubleshooting

Support

As I'm no gpsd developer myself, I can only offer limited help in case of any problems - but you can try to ask me anyway through the contact above. If you want to contact one of the official gpsd mailing lists http://gpsd.berlios.de/#mailing-lists, please make sure that you explicitly state that you use this unofficial Windows port!!!

If there's a new official gpsd version available and you'll only find an older version here, let me know and I'll try an update.

Licensing

gpsd (http://gpsd.berlios.de/) is licensed under the BSD license. The sources and binaries provided here have no significant own work from me involved, so the same license applies (the license text "COPYING" is included in both the binary and source zip files).

The binaries are compiled using the cygwin environment. Cygwin is licensed under the GPL (with an "OSI exception") http://cygwin.com/licensing.html. With this exception, it's ok to provide binaries without the cygwin sources, as long as the programs own sources are available under an OSI approved license, which is the case here.

Compile

You won't need the following if you just want to run gpsd!

The following are the steps that I've done to compile gpsd on cygwin, in case you want / need to build your own version ...

Installed cygwin tools, including:
python (2.5.1-2)
gcc (3.4.4-3)
ncurses (5.5-3)
diffutils (2.8.7-1)
docbook-xsl (1.69.1-1)
libncurses-devel (5.5-3)

patch gpsctl.c(line 41): FIONREAD -> TIOCINQ
(I found this hack at: http://www.hyperlogos.org/page/gpsd_on_win32, which is a broken link now)

gpsd-2.37-1-win32-src.zip (753 KB) - the gpsd sources patched as described above

in a cygwin console type:
./configure
make