3

Here is the receiver, a G-Mouse USB GPS unit.

(photo)

First thing is to find the tty port it uses.

Start by opening a terminal window. Look at the devices, then plug in the GPS unit and look again:

enter image description here

I can see the new entry is /dev/ttyACM0

So I open PuTTY, which I previously installed by

sudo aptitude install putty

Click on the Serial connection type, and enter /dev/ACM0 in both places as shown here:

(image)

Click on connect (Mine was saved so it says Open) and I get this output:

(image)

Now I know it is connected and that it works, and is receiving data at 9600 baud. (This is an issue, however, since the NMEA standard very specifically says 4800 baud is expected.)

I even know the data is in the NMEA format, described here:

NMEA Data Format

Which I found using this search: https://www.google.com/search?q=nmea+gps+format

Question is: How do I set it up for use?

1
  • FYI- the G-Mouse USB GPS is essentially the same as a u-blox 7 - if you use lusb you will see it identified as a u-blox and not as a G-Mouse
    – SDsolar
    Commented Jun 26, 2017 at 1:38

1 Answer 1

2

First thing is to make sure the tty port is set to the correct baud rate without Putty involved:

stty speed 9600 /dev/ttyACM0

Next, install the daemon:

sudo aptitude install gpsd gpsd-clients python-gps

GPSD Frequently Asked Questions

Invoke the daemon using -nN so it doesn't try to set the baud rate itself:

sudo gpsd -nN /dev/ttyACM0 /var/run/gpsd.sock

Now run the basic test program to verify gpsd is working

cgps -s 

The -s tells it to show processed data to the screen, which looks like this:

enter image description here

---> Actually, the first time I ran this I did not get any data. So I had to do this to jump-start it:

sudo service gpsd stop
sudo gpsd -nN /dev/ttyACM0 /var/run/gpsd.sock

It then took over that terminal window with error messages.
Ignore them, minimize the terminal window and open another.

This time the cgps -s command worked properly. You can end it with Ctrl-C

There is also an X-11 version that looks much better, and is run by this command:

xgps

It looks like this:

(image)

Mine shows 13 satellites, and it is using 8 of them. The red ones are GLONASS.

If you want to run xgps remotely from another Linux machine, use these two commands together:

ssh -Y pi@MASTER
xgps

The -Y is there to allow SSH to carry the X-11 output over ssh.

Personally, I prefer the output of

ssh pi@MASTER
cgps -s

So now the GPS unit is working with Raspbian and connected with the satellites, producing useful data.

6
  • Hacker's guide to gpsd: catb.org/gpsd/hacking.html
    – SDsolar
    Commented Jun 22, 2017 at 7:22
  • Hmmm : How to set the system clock using gps data: blog.petrilopia.net/linux/raspberry-pi-set-time-gps-dongle - Too scary for me, but you might find it interesting. Anyone tried this? I see it needs this: google.com/searchq=linux+gpspipe
    – SDsolar
    Commented Jun 22, 2017 at 7:27
  • Note that in ubuntu 14.04, the tty speed setting command is different, - I had to use sudo stty -F /dev/ttyACM0 9600 -- as explained in superuser.com/questions/747795/…
    – SDsolar
    Commented Jun 26, 2017 at 1:40
  • This started out on a Rpi3B then got scaled up to a $38 computer which is expandable to 8GB RAM and runs ubuntu 14.04 LTS as shown here in Hardware Recommendations: hardwarerecs.stackexchange.com/questions/7624/…
    – SDsolar
    Commented Jun 26, 2017 at 7:27
  • Note that ubuntu will not let child processes directly open tty ports unless the user is in the dialout group. This is most easily solved by installing the Arduino IDE: sudo apt-get install arduino - it will prompt you to join that group. Until you do that, it will not be able to read the GPS data.
    – SDsolar
    Commented Jun 26, 2017 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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