Raspberry Pi 2 GPSD Not Running

3.5k views Asked by At

I am following this tutorial to hook up Adafruit's Ultimate GPS Breakout to my Raspberry Pi 2. I have carefully read each step.

When I run gpsmon /dev/ttyUSB0, it displays expected output with my location, speed, etc. When I run cgps -s, however, I get this message cgps: no gpsd running or network error: -4, can't create socket.

The really weird thing is that the GPSD seems to be failing. Here is me trying to start it:

pi@raspberrypi:~$ sudo service gpsd status
[FAIL] gpsd is not running ... failed!
pi@raspberrypi:~$ sudo service gpsd restart
[ ok ] Restarting GPS (Global Positioning System) daemon: gpsd.
pi@raspberrypi:~$ sudo service gpsd status
[FAIL] gpsd is not running ... failed!
pi@raspberrypi:~$ sudo service gpsd start
pi@raspberrypi:~$ sudo service gpsd status
[FAIL] gpsd is not running ... failed!

So, it is apparent that cgps is failing because GPSD is not starter. Any suggestions to get GPSD working?

EDIT When I run sudo gpsd -N -D3 -F /var/run/gpsd.sock, I get this output:

gpsd:INFO: launching (Version 3.6)
gpsd:ERROR: can't bind to IPv4 port gpsd, Cannot assign requested address
gpsd:ERROR: can't create IPv6 socket
gpsd:DATA: command sockets creation failed, netlib errors -1, -1
2

There are 2 answers

0
Simon Arons On

Late answer. However I just bumped into this problem and found that my /etc/network/interfaces didn't exist. Thusly there was no loopback interface present. If interfaces doesn't exist, try creating it by running sudo nano /etc/network/interfaces and add:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

(Or as it suits your setup.)

Then run ifup -a and check if there's a new interface by running ifconfig. It should be somewhat like:

eth0      Link encap:Ethernet  HWaddr b8:27:eb:16:bc:52
[...]

lo       Link encap:Local Loopback
[...]

Hope it works for others as well.

0
Wyatt Smith On

For unrelated reasons, I reimaged my Pi, and the gps module is now working as expected. I don't know what was wrong last time, but it is working now.