1Connect things together
Connect the Pi to the GPS sensor and the FPV transmitter.
Depending on the voltage level, the GPS sensor might need to be connected directly to the Pi without TTL converter.
Connect the Pi to the Camera module.
FPV transmitter and the Pi might be powered from the ESCs or from the drone power distribution board (depends on the voltage)
2Set up necessary packages and install Python modules
First, you need to enable the Pi Camera and disable using Pi Serial interface via this command:
Then, install the GPSD package and its Python bindings:
sudo apt-get update sudo apt-get install gpsd gpsd-clients python-gps
After GPSD is installed, I recommend disabling its automatic start:
sudo systemctl stop gpsd.socket sudo systemctl disable gpsd.socket
Now, if your GPS sensor is hooked up to the Pi's serial interface and is designed to run at 38400 Baud, run this command:
stty -F /dev/ttyAMA0 ispeed 38400
If you are on Pi Zero W or Pi 3, you might need to switch up the default port:
stty -F /dev/ttyS0 ispeed 38400
Finally, start up the GPSD service manually (use /dev/ttyS0 port on Pi Zero W or Pi 3):
sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock
You can now try out if your GPS sensor works ok by launching CGPS:
If this command works fine, you should be able to use Python to get the data from the GPS sensor!