How to connect an usb GPS receiver with a Raspberry PI?

I created this step by step instructions by using Raspbian. Possibly there might be a slight difference if you are using another Linux distribution in RaspberryPI but they should be very similar. 

1. Plug in the GPS receiver

After plugging in a GPS / GNSS receiver through the USB port, your GPS should be automatically configured. To verify, type the below command.

ls /dev/tty* 

You will see the “/dev/ttyACM0” has been created automatically. To further verify if the GPS has been bound to this folder. please type 

sudo cat /dev/ttyACM0

The GPS input stream show similar to the below.

If you can see the above, which means your GPS receiver works with your Linux computer. 

2. Install gpsd

The next step of installation is to bind the “gpsd” daemon to the GPS receiver so that the applications running on Raspbian can access the GPS receiver through the “gpsd” daemon. 

The purpose of “gpsd”.

“gpsd” is used to connect applications with the GPS receiver hardware. It manages USB GPS devices so the applications don’t have to. In Raspbian, if you set up the “gpsd” properly with GPS receivers hardware, most GPS location aware applications can get the GPS data by calling “gpsd”. Furthermore, “gpsd” shares the GPS receiver for all applications running on this Raspberry PI machine..

To install GPSD, type

sudo apt install gpsd

3. Make gpsd available on boot.

To make gpsd automatic startup on boot, update the /etc/default/gpsd file a below.

Make sure 

GPSD_OPTIONS=”/dev/ttyACM0″

is included in the gpsd config file.

Restart the RaspberryPI, the new setting will take effect.

4. Test gpsd with xgps (optional)

If you are confident the GPS is already working properly, just skip this section.

Now the GPS signal should be available for applications. It is not mandatory but good to confirm that. It can be tried by a tool called  “xgps”. XPGS is included in the gpsd-clients package. 

To Install gpsd-clients, type

sudo apt install gpsd-clients

After gpsd-clients has been installed, type

xgps

xgps should look similar to this, when the GPS signal is available:

5. Ready to serve.

Now your GPS applications can make use of gpsd to acquire GPS data. Congratulations!

We have tested the below USB GPS/GNSS receivers

work with this instruction. They can be purchased from gpswebshop.com

Leave a Reply