ติดตั้ง gpsd program parsing the raw GPS data
Open a terminal session and type sudo apt-get install gpsd gpsd-clients and press Enter.
After that installs, let's start the serial port:
Type stty -F /dev/ttyAMA0 9600 and press Enter.
Now start GPSD:
Type sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock and press Enter.
Now display by typing cgps -s and press Enter.
- [ How to Use this Module ]: https://drive.google.com/open?id=15cIa03wqNB7sItn6I2s5xZ8PGOZ1Q0JF; Video - https://www.youtube.com/watch?v=bgOZLgaLa0g. ★Library: http://arduiniana.org/libraries/tinygpsplus/. ★The easiest way to use the GPS module is to use TinyGPSPlus library: https://github.com/mikalhart/TinyGPSPlus/releases; GPSBaud needs to be set to 9600 instead of 4800; PPS pin is not needed unless using the GPS to drive a hardware high precision clock.
- [ High Sensitivity ]: The GPS module uses the original 7th generation chip and the software is compatible with NEO-6M. The GT-U7 module features high sensitivity, low power consumption, and miniaturization. Its extremely high tracking sensitivity greatly expands its coverage.
- [ Advantage ]: In the area that the ordinary GPS receiver can not locate , such as narrow urban sky, dense Jungle environment, Our module can achieve high-precision positioning.
- [ Effect ]: With a USB interface, you can directly use the phone data cable on the computer point of view positioning effect. With IPEX antenna interface, the default distribution of active antenna, can be quickly positioned.
- [ Application Areas ]: Vehicle-mounted, handheld devices such as PDAs, Vehicle-monitoring, Mobile phones, camcorders and other mobile positioning systems, Sharing bike, Sharing mobile power
You can always just read that raw data, but its much nicer if you can have some Linux software prettify it. We'll try out gpsd which is a GPS-handling Daemon (background-helper)
Installing a GPS Daemon (gpsd)
The first step is installing some software on your Raspberry Pi that understands the serial data that your GPS module is providing via /dev/ttyAMA0.
Thankfully other people have already done all the hard work for you of properly parsing the raw GPS data, and we can use (amongst other options) a nice little package named 'gpsd', which essentially acts as a layer between your applications and the actual GPS hardware, gracefully handling parsing errors, and providing a common, well-defined interfaces to any GPS module.
To install gpsd, make sure your Pi has an Internet connection and run the following commands from the console:
- sudo apt-get update
- sudo apt-get install gpsd gpsd-clients python-gps
And install the software as it prompts you to do.
pi@raspberrypi:~ $ stty -F /dev/ttyS0 9600
pi@raspberrypi:~ $ cat /dev/ttyS0