1

I am using Raspberry Pi 3 with U-blox AG USB GPS. I am not getting a fix in it. To check the data coming out of GPS I used the following command:

sudo cat /dev/ttyACM0

It did not show any data.

My default configuration file is as follows:

sudo nano /etc/default/gpsd

# Default settings for the gpsd init script and the hotplug wrapper.

# 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/ttyACM0"

# Other options you want to pass to gpsd
GPSD_OPTIONS=""

So why I am not getting any data when using cat /dev/ttyACM0?

Why am I getting no fix?

  • 1
    I doubt /dev/ttyACM0 is correct. Could you add a photo and describe the connections between the GPS unit and the Pi? – joan Jul 16 '18 at 16:48
  • It seems that some people had the same issue. raspberrypi.org/forums/viewtopic.php?t=56023 – user8496831 Jul 16 '18 at 16:52
  • In my experience, the device is correct. – eftshift0 Jul 16 '18 at 17:03
1

You have another process reading from it (gpsd)? Then maybe it's because that process is reading from the file already. Try stopping the service and then do the cat. It should work.

In my experience with GPS devices so far, there's no need to use an external service if you know how to parse the output from the device. If that's the case then just plug in the device and read from the file.

  • How can I check that another process is reading from gpsd? – Thoht Jul 19 '18 at 7:29
  • lsof should be able to list files opened by any given process. I'd just try stopping gpsd and checking if then I could cat from the file. – eftshift0 Jul 19 '18 at 14:19
0

From Unable to find USB/TTY GPS unit, notably this post:

Plug the USB GPS into the Pi, you should be able to see it detected in:

sudo lsusb

Mine came up as

Bus 001 Device 004: ID 1546:01a6 U-Blox AG

Using

dmesg | grep -i usb

I established that the GPS device was paired to:

ttyAMA0

You can check your GPS data feed by using the cat command and viewing the GPS data directly by typing

sudo cat /dev/ttyACM0

Next I piped the GPS feed into the GPS demon - gpsd by

sudo gpsd /dev/ttyACM0 -n -F /var/run/gpsd.sock

I had to ensure that the -n flag was present in this command, as trying without the flag resulted in a time out.

then just to be safe I killed the gpsd and restarted it

sudo killall gpsd

You should now be able to use

cgps -s

to view the interpreted GPS data coming from your unit.

0

Since you are taking STDIN from /dev/ttyACM0, the command is:

cat < /dev/ttyACM0

You should also check that your userid has read permissions to /dev/ttyACM0:

ls -l /dev/ttyACM0

You may need to grant read permissions to 'other':

sudo chmod o+r /dev/ttyACM0

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.