2

I have GPSd installed, but I can't get it to work after reboot.

After reboot, when I run cgps -s I just get cgps: GPS timeout. However, if I run: sudo killall gpsd; sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock then cgps works just fine.

After running sudo dpkg-reconfigure gpsd, here's my /etc/default/gpsd file:

# Default settings for gpsd.
# Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
# change the options.
START_DAEMON="true"
GPSD_OPTIONS="-n"
DEVICES="/dev/ttyUSB0"
USBAUTO="true"
GPSD_SOCKET="/var/run/gpsd.sock"

What can I do to get it working after reboot? Thanks!

2

I had a problem with this today with Raspbian Jesse, which may help some people. Solution for my set up to enable automatic start of GPS on bootup for NAVIT, was as follows:

First set the following with sudo nano /etc/default/gpsd:

START_DAEMON="true"
# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="true"
# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyUSB0"
# Other options you want to pass to gpsd
GPSD_OPTIONS="/dev/ttyUSB0"
GPSD_SOCKET=”/var/run/gpsd.sock”

I had previously worked through the following:

https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/use-gpsd

So I simply did the following to re-enable the psd systemd service:

sudo systemctl enable gpsd.socket
sudo systemctl start gpsd.socket
1

I found a solution from here: https://www.raspberrypi.org/forums/viewtopic.php?f=45&t=53644

The TL;DR is that you run sudo dpkg-reconfigure gpsd and disable USB AutoLoad

My steps:

  1. sudo dpkg-reconfigure gpsd
  2. Start gpsd automatically? Yes
  3. Should gpsd handle attached USB GPS receivers automatically? No
  4. Device the GPS receiver is attached to: /dev/gps0 (check that on your machine to match)
  5. Options to gpsd: -n
  6. gpsd control socket path: /var/run/gpsd.sock

So the correct /etc/default/gpsd would be:

# Default settings for gpsd.
# Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
# change the options.
START_DAEMON="true"
GPSD_OPTIONS="-n"
DEVICES="/dev/gps0"
USBAUTO="false"
GPSD_SOCKET="/var/run/gpsd.sock"
1

I had the same problem and like @Dan Mandle, I found the answer at the same URI https://www.raspberrypi.org/forums/viewtopic.php?f=45&t=53644

However, the configuration file was different as submitted by amrbekhit. The/etc/default/gpsd file that worked for me was the following:

# Default settings for gpsd.
# Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
# change the options.
START_DAEMON="true"
GPSD_OPTIONS="/dev/ttyUSB0"
DEVICES=""
USBAUTO="true"
GPSD_SOCKET="/var/run/gpsd.sock"
1

Same problem here on Raspbian Lite of July 2017, release date 2017-07-05, with a ublox based USB GPS from Navilock.

The /etc/default/gpsd file that worked for me was the following:

START_DAEMON="true"
USBAUTO="true"
DEVICES="/dev/ttyACM0"
GPSD_OPTIONS="-n"
GPSD_SOCKET="/var/run/gpsd.sock"

But systemctl enable gpsd.service does not create the correct symlink, instead it modifies the old sysvinit with update-rc.d. I don't know why systemctl chooses to go for sysvinit here, but it took me a couple of hours figuring that out. With some more searching I found this post from federico.human referring to this original guide who also come to this solution:

sudo ln -s /lib/systemd/system/gpsd.service /etc/systemd/system/multi-user.target.wants/

After a reboot gpsd is up an running, check with ps -aux | grep gpsd

0

I had problems for sometime to trying to get cgps to run on the terminal, sometimes it worked, most times it never worked correctly, what I had used to edit the file and save was..

sudo nano /etc/default/gpsd 

But when I typed in the following code at the terminal. sudo dpkg-reconfigure gpsd

I received "Creating/updating gpsd user account..." I then rebooted and it all Worked when I ran cgps or gpsmon.

Thank you Dan Mandel :)

Since my GPS is not a USB device, my code in the gpsd file: etc/default/gpsd

was only

START_DAEMON="true"
DEVICES="/dev/serial0"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.