Using a Raspberry Pi with a Ublox Flight Controller GPS Module GY-NEO6MV2

The following instructions are copied from a blog about Raspberry Pi - GPS Setup and Python [stuffaboutcode.com]

Connecting the GPS module

Raspberry Pi - 5v -> GPS Module - VIN
Raspberry Pi - GND -> GPS Module - GND
Raspberry Pi - Tx -> GPS Module - Rx
Raspberry Pi - Rx -> GPS Module - Tx

Enable the UART

By default the UART is enabled to allow you to connect a terminal window and login, I needed to disable this to free it up for the GPS Module.

Edit the boot options to change the UART so it doesnt provide a terminal connection by default:

sudo nano /boot/cmdline.txt

Change:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

to:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Change inittab so it doesnt spawn a login to the serial connection:

sudo nano /etc/inittab

Change:

#Spawn a getty on Raspberry Pi serial line
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

to:

#Spawn a getty on Raspberry Pi serial line
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Testing it works

Reboot the Pi, and install gpsd and the gpsd-clients

sudo apt-get install gpsd gpsd-clients

Run gpsd

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

Test gpsd using cgps

cgps -s

Observed the following:

┌───────────────────────────────────────────┐┌─────────────────────────────────┐
│    Time:       2014-07-02T21:12:33.000Z   ││PRN:   Elev:  Azim:  SNR:  Used: │
│    Latitude:    55.xxxxxx N               ││   1    64    269    24      Y   │
│    Longitude:    3.xxxxxx W               ││   3    24    160    24      Y   │
│    Altitude:   101.9 m                    ││  11    81    202    35      Y   │
│    Speed:      0.2 kph                    ││  14    32    074    30      Y   │
│    Heading:    0.0 deg (true)             ││  17    12    310    18      Y   │
│    Climb:      0.0 m/min                  ││  19    40    150    26      Y   │
│    Status:     3D FIX (64 secs)           ││  20    24    217    27      Y   │
│    Longitude Err:   +/- 9 m               ││  22    22    056    22      Y   │
│    Latitude Err:    +/- 8 m               ││  24    07    009    06      Y   │
│    Altitude Err:    +/- 30 m              ││  27    10    145    15      Y   │
│    Course Err:      n/a                   ││  28    35    284    27      N   │
│    Speed Err:       +/- 67 kph            ││  32    59    181    44      N   │
│    Time offset:     -112079.743           ││                                 │
│    Grid Square:     IOxxkw                ││                                 │
└───────────────────────────────────────────┘└─────────────────────────────────┘

Sit back and marvel at it for a bit.

Resources

Related

Tags:
Source:
2316hrs.txt
Published:
02-07-2014 23:16