Setting Up a GPS Module on the Astroberry

I set up and tested my Raspberry Pi with Astroberry a few days ago. The GPS Module I ordered finally arrived and this post walks through how I set it up to get real-time GPS data for KStars. This is not really necessary, more something I wanted to tinker with. Astroberry includes a virtualgps and you can enter your location data (longitude, latitude, elevation) in /etc/location.conf. GPSD then uses the virtual GPS, but I want to use an actual GPS module so I don’t have to update the location.conf if I set up somewhere different… and I just want to tinker with the GPS module.

I picked up an inexpensive GPS module for the Raspberry Pi.

I’ll probably end up connecting it to the GPIO, to free up a USB port, but for now I’m just going to use the USB connection. Eventually it will also get some kind of case. For now, just going to get it working.

I configured gpsd to get the GPS data from the GPS module using the instructions at this link for guidance.

Since I want to use this hardware GPS Module to provide my location I need to stop and disable virtualgps:

sudo systemctl stop virtualgps
sudo systemctl disable virtualgps

I can re-enable it and use /etc/location.conf if I have issues with the GPS Module.

Tailed /var/log/messages to get the device path (/dev/ttyACM0) when I plugged in the GPS module.

tail -f /var/log/messages

To configure GPSD to get location data from the GPS module I edited the file /etc/default/gpsd and under the comment/section “# Other options you want to pass to gpsd” I commented out the original GPSD_OPTIONS line and created a new GPSD_OPTIONS line with the GPS device path and socket so it looks like this:

# Other options you want to pass to gpsd
#GPSD_OPTIONS="-n"
GPSD_OPTIONS="/dev/ttyACM0 -F /var/run/gpsd.sock"

The GPS Module has a red LED which will blink when it has acquired satellites and is receiving valid GPS data. It took a minute or so for the LED to go from solid red to blinking red.

Restarted gpsd and ran gpsmon to make sure I was receiving GPS information from the module.

sudo systemctl restart gpsd
gpsmon

gpsmon showing data received from the GPS module
There is a panel in the Astroberry Server web portal which displays GPS information. This was not working after disabling the virtualgps. I restarted gpspanel.

sudo systemctl restart gpspanel

The GPS Panel in the Astroberry Server web portal is now showing valid data on the GPS Information panel.
Astroberry Server GPS Information Panel
The Astroberry GPS panel also shows you some other interesting information like what GPS satellites you are receiving data from, a sky map of where they (the satellites) are in the sky, and what the signal strength from each satellite is.

I checked KStars to verify it was seeing the GPS data as well.
KStars GPS Location

Pretty neat!

4 thoughts on “Setting Up a GPS Module on the Astroberry

  1. Hello!

    Did you ever get a case and connect it to the GPIO connector?

    Thank you very much. If you could point me to one that already has a case that would work and maybe do a quick follow up on connecting to GPIO, that’d be awesome!

    1. I have not, still kind of looking around. Just got it put together a couple days ago.

      I do plan to connect it up to the GPIO at some point. I will definitely follow up with a post on that when I get around to it.

      Thanks for stopping by.
      Hersey

      1. Thanks!

        Complete newbie to PI

        Can U suggest a case and mounting method? Just received mine and I’d like to enclose it soon…

        Thanks again

        1. David,

          For the Pi itself, just about any case which will fit it. This is a pretty good kit, basic case with the heat sinks and fan https://amzn.to/3KjHwWw. I have not been able to find a case for the GPS module, probably going to have a buddy 3D print something.

          Thanks
          Hersey

Leave a Reply

Your email address will not be published. Required fields are marked *

twelve − eight =