SSH using admin - This is useful for running any sudo commands. Run ssh pi@192.168.21.XXX. This will require the admin password — ask the engineering teachers for the password.
Run pip install gps
- NOTE: If this doesn't work, try "pip3 install gps." If it still doesn't work, you might have to install pip.
Disable Serial console and Enable UART
- Run sudo raspi-config and select the following:
- Interfacing options
- Serial
- Select No on enabling the login shell
- Select Yes on enabling serial port hardware
- Once complete you should see " The serial login shell is disabled. The serial interface is enabled"
- Reboot the pi (sudo reboot)
Run cat /dev/<device>
- NOTE: This GPS has a VERY small antenna. It will only output data if its signal is not obstructed. You need to go outside to run this. If you run it while inside, it will output 0's.
The <device> will usually be serial0 or ttyS0 — try both, one should work. This will output raw data in terminal.
Look for the line that says $GPRMC,194509.000,A,4042.6142,N,07400.4168,W,2.03,221.11,160412,,,A*77
- This line is called the RMC (Recommended Minimum) sentence and has pretty much all of the most useful data. Each chunk of data is separated by a comma.
The useful data is the characters before the N and W. The N is latitude and the W is longitude.
- NOTE: People often get confused because the GPS is working but is "5 miles off" - this is because they are not parsing the lat/long data correctly. Despite appearances, the geolocation data is NOT in decimal degrees. It is in degrees and minutes in the following format: Latitude: DDMM.MMMM (The first two characters are the degrees.) Longitude: DDDMM.MMMM (The first three characters are the degrees.)