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.
- gpsd on Windows (using cygwin)
- Status
- Serial / USB / Bluetooth
- Tested with ...
- Windows versions
- GPS receivers
- gpsd based applications
- GPSD Programs
- Install
- Run gpsd daemon
- Run gpsd client
- Hints / Troubleshooting
- Support
- Licensing
- 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:

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 Version | Works? | Notes |
| 32 bit | 64 bit |
| Vista | ? | ? | |
| Server 2003 | ? | ? | |
| XP Pro | Ok | ? | |
| 2000 | ? | - | |
| NT | ? | - | USB not supported |
| 9x / ME | ? | - | cygwin support will be discontinued in 1.7.0 |
| CE | No | - | not supported by cygwin |
GPS receivers
| Brand | Model | Chipset | Interface | Status | Notes |
| Navilock | NL302U | SiRF star III | USB | Good | - |
| Wintec | WBT-201 | u-blox Antaris 4
| Bluetooth | Good | On very bad receiving situations, may need a longer time (minutes) for a satellite fix. |
gpsd based applications
I've done a quick check of some applications using gpsd:
GPSD Programs
The provided zip file below includes the following gpsd programs (
tested on my XP machine):
- gpsd: the deamon
- cgps: text mode gpsd client, e.g. shows lat/lon (needs cygwins ncurses package - not installed by default)
- gpspipe: simple gpsd client
- cgpxlogger: log position to a GPX file
The provided zip file also includes the following
untested programs:
- gpsctl: control GPS receiver settings - use with caution!
- sirfmon: text mode control tool for SiRF based GPSs - use with caution! (needs cygwins ncurses package - not installed by default)
- rtcmdecode: rtcm-104 DGPS protocol decoder
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):
- xgps / xgpsspeed / libgps / libgpsmm / libgpsd / gpsprof / gpsfake / gpscat / gpsflash
Install
How to install gpsd on Windows:
- Install and test your GPS receiver on Windows with the native drivers and tools (make sure it runs ok)
- Install cygwin from: http://cygwin.com/
- Download gpsd-2.37-1-win32-bin.zip (598 KB)
- Unzip and copy the zip file content into the cygwin bin dir. This is usually: c:\cygwin\bin
- 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
- Stop all programs using the GPS receiver (... including the GPS vendor test program!)
- Start a new console window (cmd.exe) and cd to: c:\cygwin\bin
- Start gpsd.exe in the console, for example: gpsd -b -N -D 2 /dev/com5 (replace com5 with your own COM port)
- If the Windows-Firewall now issues a warning, click the "Don't block" button
- 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/com5gpsd: launching (Version 2.37)gpsd: listening on port 2947gpsd: Unable to start ntpshm. gpsd must run as root.gpsd: running with effective group ID 513gpsd: running with effective user ID 1003gpsd: opening read-only GPS data source at '/dev/com5'gpsd: speed 4800, 8N1gpsd: garmin_gps not active.gpsd: gpsd_activate(0): opened GPS (4)gpsd: ntpd_link_activate: 0gpsd: 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 -wThe 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
- If you get an error "Could not find cygwin1.dll", then your probably not running in: c:\cygwin\bin
- All gpsd console programs are closed by pressing Crtl-C in the corresponding console window.
- Running the GPS receiver for the first time, it may take a few minutes before the receiver has a satellite fix.
- In
case your GPS gets confused, e.g. if you had run both gpsd and another
software using the GPS, try to unplug and replug the GPS.
- If you plug your GPS into a different USB port, it might get a new COM port number!
- Bluetooth
may use very high COM port numbers (COM40 !) that won't work with gpsd
(or cygwin?) - try to set a lower COM port number in your Bluetooth software
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