This plugin allows race directors to import pilots directly from Google Sheets or Google Forms(indirectly) into RotorHazard. Before being able to import pilots, race directors are required to follow a few steps to obtain credentials from Google which allows Rotorhazard and Google sheets to connect. These steps only need to be done once.
There are 3 steps to get this plugin going. First is to create the credential file and service account in Google Cloud. This only needs to be done once. Step 2 is to simply grant access to the service account from the Google Sheets and finally step 3 is to install this plugin itself and most importantly copy the Google credentials.json file into the Plugin folder within RotorHazard. Steps are listed below. There is an installation guide video available as well at the following link:
-
Visit https://cloud.google.com
-
Create a new project and give it a name. It could be any name such as your chapter or club name. e.g. My Drone Race Club
-
With newly created project selected, click on APIs and Services
-
In the top search bar, search for Google Drive API and press enter
-
Click enable Google Drive
-
In the top search bar, search for Google Sheets API and press enter
-
Click enable Google Sheet
-
On the left side bar, click on "Credentials".
-
Click on Manage Service Accounts on the right followed by "+ CREATE SERVICE ACCOUNT" at the top
-
Enter a service account name and thats it. Copy the generated service email address and click done. Step 2 and 3 are not required
-
Once back on the main page, the service account status will be Enabled. On the far right, click on the 3 dots and select manage keys
-
Click on Add Key -> Create New Key -> Select JSON -> Create.
-
Save the newly created JSON file on desktop and rename it to credentials.json
- Head over to https://drive.google.com
- Create a Google sheets anywhere.
- Give it a name. Any name. e.g: Pilot Registration Form
- For the current version of the plugin, create collumns called "Name" and "Callsign". These are mandatory. Any other collumns can be created but wont be picked up by the plugin.
- Hit the "Share" button at the top right corner and enter teh service email address from step 10 in section 1 above.
- Hit done and that's.
- SSH into the timer.
- Copy the plugin files into the
~/RotorHazard/src/server/plugins
directory with the following cmd lines or download latest from: https://github.com/Barracuda-Technologies/rh-google-pilot-import/releases
cd ~
sudo rm -r RotorHazard/src/server/plugins/googlepilot
wget https://github.com/Barracuda-Technologies/rh-google-pilot-import/archive/refs/tags/v1.0.0.zip -O temp.zip
unzip temp.zip
mv rh-google-pilot-import-1.0.0 RotorHazard/src/server/plugins/googlepilot
rm temp.zip
- Intall a required library for Google Sheets to work in the timer with the following cmd line:
pip install gspread
-
Copy over the credentials.json file from step 13 in section 1 above to the newly created plugin folder.
-
Restart the Pi and a new section called Google Pilots will appear in the Format page.
- Create a new google sheet page or a new Google Form which sends results to a Google Sheet. Give the Google Sheet a name or take note of the given name. e.g: Registration Form
- Make sure there is 1 collumn called Name and 1 collumn called Callsign.
- Click on the Share button on the top right corner of the sheet and enter the service email address created in Section 1 of the Setup Guide above. Click done.
- Start up RotorHazard and head over the format page. Under hte panel Google Pilot Import, enter the name of the Google sheet created in step 1. e.g: Registration Form
- Hit the import button and the pilot names and callsigns will be imported automatically.
Note
If name and callsign already exist in the RotorHazard database, this pilot will be skipped. Only new pilots will be added. No removal is done.