From BananaPro/Pi
Jump to: navigation, search

Other languages:
English • ‎中文(简体)‎

This is the GPS module tested on the picture:
We can used it by UART(Pic:a). In fact, any UART device can be used on LeMaker Guitar. Or use it via a USB-to-TTL cable(Pic:b). like this:

Gps uart.jpg Gps usb.jpg
(a) (b)

We can find the Pin definition at this link:
And then, use command cat /dev/ttyUSB0(use UART-to-TTL like Pic b) or cat /dev/ttyS0(use UART0 like Pic a)to get the GPS informations like this:
Gps info.png
These information has standard format(get more info by google:) ), so we can get the point where I am is very easy.
awk -F "," '/GPRMC/ {printf(" Latitude is: %s,%s \nLongitude is %s,%s\n\n",$4,$5,$6,$7);}' < /dev/ttyUSB0
And I get the result like this:
Gps result.png