How to use Neo 6M GPS Module with Raspberry Pi

Tags: 

This tutorial is for using the UART Neo 6M GPS module with a Raspberry Pi. We will use Raspbian as our distribution.

For hooking up the module, see our PDF: neo6m.pdf

Turn off the Serial Console

In older Raspberry Pi's, Raspbian uses the UART as a serial console. We need to turn off that functionality so that we can use the UART for our GPS module.

Backup the file before we start.

sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt

The we need to edit cmdline.txt and remove the serial interface.

sudo nano /boot/cmdline.txt

If the file has "console=ttyAMA0,115200", delete it, and save the file by pressing Ctrl X, Y, and Enter.

sudo nano /etc/inittab

Find ttyAMA0 by pressing Ctrl W and typing "ttyAMA0".

If it finds that line, insert a # symbol to comment out that line, and Ctrl X, Y, Enter to save.

Type "sudo reboot" to reboot the computer.

Try it out

To try out if the installation worked, type

sudo cat /dev/ttyAMA0

You should be seeing a lot of text pass by. That means it works. Type Ctrl + c to return.

Installing software

To install software, type

sudo apt-get install gpsd gpsd-clients

Now run the gps client

sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock

Please note that it can take up to 30 minutes to get a GPS signal on the first run. The LED will be blink red when it has a connection.

Add new review

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.