5

I am trying to figure out, what is preventing gpsd from automatically connecting to an external GPS BU 353 dongle via USB and receiving data. I have the same issue on both of my laptops (with different hardware), so this is purely a software configuration issue.

I have managed to get gpsd working manually, using the following steps, but every time my machine is powered off, I must go through these steps again.

  1. sudo killall gpsd

  2. Remove any sockets gpsd might have left behind with :

    sudo rm /var/run/gpsd.sock

  3. Check the device path:

    dmesg - which shows PLU353 
    
  4. Ensure no other programs are using the device. There are none listed

    lsof -n | grep /dev/ttyUSB0
    
  5. Manually launch gpsd:

    sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock
    
  6. xgps sees the GPS output - so this works

My best guesses are that gpsd needs to join a group or be given additional permissions, or alternatively, that it is an issue with udev configuration. But I am blundering about in the dark, just making wild guesses.

Tim
  • 33,500
Geoffrey-c
  • 51
  • 1
  • 1
  • 3

2 Answers2

8

You're correct - it is a group membership problem. First, see who owns the device:

ls -l /dev/ttyUSB0

On MY system, I don't have /dev/ttyUSB0, so I'll use /dev/ttyS0 instead

walt@bat:~(0)$ ls -l /dev/ttyS0
crw-rw---- 1 root dialout 4, 64 Feb 23 08:19 /dev/ttyS0
walt@bat:~(0)$ 

The output of the ls command shows that it's owned by root:dialout, and allows group access to the device.

Add your user to the dialout (or whatever is right for your system) group with:

sudo adduser $USER dialout

Then to make this group membership take effect, logout/login, OR newgrp dialout to start a shell with that group membership.

Check your group membership with /usr/bin/id.

waltinator
  • 37,856
5
  • open TCP port 2947 in your firewall (if you wish other network clients access)
  • in terminal...
  • sudo adduser $USER dialout # add user to group dialout
    • log out/in to finish adduser command
  • sudo -H gedit /etc/default/gpsd # edit the gpsd settings file

# Start the gpsd daemon automatically at boot time
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"

DEVICES=""

Other options you want to pass to gpsd

GPSD_OPTIONS=""


  • save file and quit gedit
  • sudo systemctl restart gpsd # restart gpsd

gpsmon, cgps, and xgps will now work properly.

heynnema
  • 73,649