How to use Neo 6M GPS Module with Raspberry Pi


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.


dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 root$
*this is what inside my cmdlne.txt file. what should i delete ?
i havent found "console=ttyAMA0,115200"

same problem, how proceed???

Great Information!
I deleted the console=serial0,115200
When I run the sudo cat /dev/ttyAMA0 command, I get a bunch of data including "GPTXT,01,01,01,NMEA unknown msg*58"
However, when I run the "gpsd -s" command, No actual information shows in the table.

Hi, I am having the same problem. did you find a solution to it?

I also have the same error. Will someone help?


stty -F /dev/ttyS0 -echo [enter]
sudo cat /dev/ttyS0


stty -F /dev/ttyS1 -echo [enter]
sudo cat /dev/ttyS1


stty -F /dev/ttyAMA0 -echo [enter]
sudo cat /dev/ttyAMA0

tried this one but still encountered the same problem

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.