Precision flying is a sport that has existed for many years but so far it has been a sport for the participants as you go off with your airplane and you return after 1 hour or more and nobody other than the pilot knows where they've been. A recent development of this sport is the newly formed derivative ANR - Air Navigation Race where the competitors are tracked in real-time for the spectators to watch their progression.
My project is to develop an improved tracking device for these type of competitions using the capabilities of the Raspberry Pi Zero W Kit + Hologram Nova Cellular USB Modem to have a secure channel for collecting each aeroplanes GPS position to one or more sites where the position of each airplane will be displayed in real-time.
After reading Google's usage conditions, I decided I can not use Google Maps for this type of presentation. I looked at QGIS and it works to display one airplane but I will need to rewrite that part of QGIS to be able to have simultaneous presentation of up to 4 airplanes. I decided to do this project for only one airplane and attack QGIS later.
On my PC
Installed QGIS2.18.14 "Las Palmas" on my PC: https://github.com/qgis/QGIS/blob/master/doc/INSTALL.html
On my Raspberry PI Nano W:
The UART port, by default, is used for logins. We need to free it for the GPS.
Edit the file /boot/cmdline.txt and 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
After that, change the /etc/inittab file and comment a line so it does not spawn a login console.
Comment the following line (it should be the last one):
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
0
After these changes, reboot the Pi:
sudo reboot
After the reboot, install the GPS applications:
sudo apt-get install gpsd gpsd-clients
Execute gpsd (the GPS daemon):
sudo gpsd /dev/serial0 -F /var/run/gpsd.sock
Now, let’s try the GPS (place it outside so it can work better):
cgps -s
And after a few seconds you should get some signal. I found this video helpful.
Walkthrough: Connecting a Bluetooth GPS to the Raspberry Pi Zero W
This webpage helped to get the Bluetooth connection working: https://raspberrypi.stackexchange.com/questions/51379/rfcomm-channel-cleaning
systemctl status bluetooth
hcitool scan
bluetoothctl
agent NoInputNoOutput
default-agent
scan on
pair 00:0A:xx:xx:xx:xx
paired-devices
quit // exit bluetooth controller
rfcomm
sudo rfcomm bind /dev/rfcomm1 00:0A:xx:xx:xx:xx
sudo gpsd /dev/rfcomm1 -F /var/run/gpsd.sock
A small Python script forwards the GPS coordinates to the Hologram dashboard where they are routed to a Raspberry Pi 3 as I am more familiar with programming on the Raspberry than on the PC.
Routing in Hologram dashboardI use a simple route.
Message received in Hologram dashboard:
{"success":true,"data":{"id":4752002,"logged":"2018-01-22 13:44:15.248015","orgid":10870,"deviceid":158230,"record_id":"5605c53a-ff7a-11e7-bd8e-bc764e200321","device_metadata":"{}","data":"{\"received\": \"2018-01-22T13:44:14+00:00\", \"authtype\": \"deviceid\", \"tags\": [\"ErlingGps\", \"_RESTAPI_\", \"_DEVICE_158230_\"], \"device_name\": \"ErlingsFlyg (80475)\", \"source\": 158230, \"record_id\": \"5605c53a-ff7a-11e7-bd8e-bc764e200321\", \"data\": \"JEdQR0dBLDEzNDA0OC4wMDAsNTkyMy4zMDAxLE4sMDE3NTMuNTI2MCxFLDEsMDcsMS4zLDYuOSxNLDIzLjUsTSwsMDAwMCo1Ng==\", \"device_id\": 158230}","matched_rules":[],"tags":["_DEVICE_158230_","_RESTAPI_","ErlingGps"]}}
On the Raspberry Pi 3
A java program to receive the message from Hologram dashboard and transfer it to a network port in the local network has not been implemented, because my ISP does not allow connections from the outside, so I have not been able to test this part of the project.
On a PC
Install QGIS and a map for the area and activate live GPS tracking. Now the GPS position is displayed on the map.
Comments