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.
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="/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
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.
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.