Using UART instead of USB

If you wish to use HW UART instead of the USB cable, it's perfectly possible - you just need to do a bit more work to free the UART up on your Pi.

To get started, hook the GPS module up to your Pi as follows, cross-connecting the TX and RX pins (TX on one device goes to RX on the other and vice versa), and supply 5V from the Pi to the VIN pin on the GPS module:

We designed the Ultimate GPS with a built-in regulator, so even if it's powered with 5V, the signal levels are still 3.3V - safe for your Pi!
  • GPS Vin  to 3.3V (red wire)
  • GPS Ground to Ground (black wire)
  • GPS RX to TX (green wire)
  • GPS TX to RX (white wire)

Disable Serial console and Enable UART

Run sudo raspi-config and select the following:

Interfacing Options

Serial

Select No on enabling the login shell

Select Yes on enabling serial port hardware

Once complete you should have no console and yes on serial interface:

sensors_image.png

Then reboot

Once you've rebooted, you can use the built in UART via /dev/ttyS0 or /dev/serial0.

Reboot your Pi

After rebooting the Pi for the above changes to take effect, you can proceed with running gpsd

 

Restart GPSD with HW UART

Restart gpsd and redirect it to use HW UART instead of the USB port we pointed it to earlier. Simply entering the following two commands.

For the Raspberry Pi 1 or 2 (but NOT the 3!) run these commands:

Download: file
$ sudo killall gpsd
$ sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock

And for the Raspberry Pi 3 or the Pi Zero W, run these commands to use the different serial port:

Download: file
sudo killall gpsd
sudo gpsd /dev/serial0 -F /var/run/gpsd.sock
As with the USB example, you can test the output with:
Download: file
$ cgps -s
This guide was first published on Jan 24, 2013. It was last updated on Jan 24, 2013. This page (Using UART instead of USB) was last updated on Oct 01, 2018.