Serial Attached GPS on Raspberry Pi 4 with Pure Maps
In this article, we will discuss how to use a serial attached GPS device with a Raspberry Pi 4 running the latest 64-bit distro, and navigate using Pure Maps. We will cover the key concepts, provide detailed context, and include subtitles and code blocks where necessary.
1. Introduction
Pure Maps is an open-source, offline maps and navigation app for mobile devices and desktops. It supports various map sources, including OpenStreetMap, OpenTopoMap, and Bing Maps. However, it does not have built-in support for external GPS devices. To use a serial attached GPS device with Pure Maps, we need to use a GPS daemon that can communicate with the device and provide the GPS data to Pure Maps via a virtual serial port.
2. Hardware Requirements
To follow this guide, you will need the following hardware:
- A Raspberry Pi 4 with a 64-bit operating system installed
- A serial attached GPS device (e.g., a USB GPS receiver or a Bluetooth GPS receiver)
3. Software Requirements
To follow this guide, you will need the following software:
- GPSd, a GPS daemon that can communicate with the GPS device and provide the GPS data to Pure Maps
- Pure Maps, a free and open-source maps and navigation app
4. Installing GPSd
To install GPSd, open a terminal window on your Raspberry Pi and enter the following commands:
sudo apt update
sudo apt install gpsd gpsd-clients
5. Configuring GPSd
To configure GPSd, you need to know the device path of your GPS device. To find the device path, enter the following command:
sudo dmesg | grep tty
This will display a list of all the serial devices connected to your Raspberry Pi. Look for the line that contains your GPS device. It will look something like this:
[ 3.433351] usb 1-1.2: cp210x converter now attached to ttyUSB0
In this example, the device path is /dev/ttyUSB0. Once you have the device path, you can configure GPSd by editing the configuration file.
sudo nano /etc/default/gpsd
Find the line that starts with DEVICES and add your device path to the list, like this:
DEVICES="/dev/ttyUSB0"
Save the file and exit the editor. Restart GPSd to apply the changes.
sudo systemctl restart gpsd
6. Installing Pure Maps
To install Pure Maps, open a terminal window on your Raspberry Pi and enter the following commands:
sudo apt update
sudo apt install pure-maps
7. Configuring Pure Maps
To configure Pure Maps to use the GPS data from GPSd, you need to create a virtual serial port. To do this, enter the following command:
sudo apt install socat
Then, enter the following command to create the virtual serial port:
socat PTY,raw,echo=0,link=/dev/gps0 /dev/ttyUSB0
Now, open Pure Maps and go to the settings. Under the "Navigation" section, select "GPS" as the location source. In the "GPS Device" field, enter /dev/gps0. Save the settings and restart Pure Maps. The app should now be able to receive the GPS data from your serial attached GPS device.
8. Conclusion
In this article, we have discussed how to use a serial attached GPS device with a Raspberry Pi 4 running the latest 64-bit distro, and navigate using Pure Maps. We have covered the key concepts, provided detailed context, and included subtitles and code blocks where necessary. With this guide, you should be able to use your serial attached GPS device with Pure Maps and enjoy offline maps and navigation on your Raspberry Pi.