GPSD is a service daemon that can monitor GPS receivers and provide the
data for multiple clients. It normally provides client data on port
2947. See the website here:
Newer versions of GPSD allow for using TCP/IP connections
to NMEA data sources including Share GPS. Follow below for
Obtain these packages or equivalent for your distribution:
GPS daemon, can connect to TCP sockets
Helper programs for gpsd that can help with troubleshooting
Make sure you have created a TCP/IP connection in Share GPS.
Before testing with GPSD, let's use netcat to be sure the strings
are coming through. If Share GPS is a TCP/IP client, setup netcat
to listen (in this example port 50000 is used):
nc -l 50000
If Share GPS is a TCP/IP server, setup netcat to connect (but
make sure Share GPS is started and listening first!). The
IP address of the phone is used below.
nc 192.168.219.282 50000
Share GPS should now indicate connected. If it does, but
no data is seen, then try setting 'Create NMEA in settings
and try again
Ctrl-c to get out of netcat. Now test that GPSD can connect
to Share GPS. Let's try and kill any running gpsd:
Start GPSD in debug mode and test it out. If running Share
GPS as a server, change localhost in the following command to the
IP address of the phone (use port setup in Share GPS, in this
gpsd -D5 -N -n -b tcp://localhost:20175
You should see some connection info followed by the NMEA
If you are using a RedHat variant and saw something with
selinux popup or were using a Debian variant and saw
it come up and complain about not being able to bind
to the TCP ports, see the troubleshooing section.
Ctrl-C to get out of gpsd. Now run gpsd in the mode
you would normally run in.
gpsd -b -n tcp://localhost:20175
You will be back at a command prompt as GPSD will run
in the background.
Share GPS should indicate Connected at this point as the
-n switch tells GPSD to connect immediately.
Try one of the clients to ensure that works. Use 'xgps'
or 'cgps' and ensure it is getting NMEA data.
Now you can connect the GPSD client of your choice.
OpenCPN is an example or Navit for navigation. If wanting
to use Google Earth try
this python script
with the desired kml file specified.
python gpsd.py ./gps.kml
For RedHat variants, I had issue with selinux blocking gpsd from using tcp ports.
Whenever I tried to run gpsd, it would pop up a window and give me the option to
add a rule allowing it, and I did that.
The other option would be to just disable selinux all together. Be sure you
understand the consequences before you do that (do the following as root):
sed -i 's/enforcing/disabled/g' /etc/sysconfig/selinux
For Debian variants, I had issues with it binding to tcp ports. Couldn't figure it
out, so I just rebuilt from source as opposed to using the packages. That worked
sudo apt-get remove gpsd gpsd-clients
sudo apt-get build-dep gpsd
or just do a git clone of the latest
cd gpsd-3.15;sudo scons;sudo scons install
It should build and install gpsd. Now go back and try again.