A Python script to display photos of aircraft flying near your location using data from a local PiAware server and the OpenSky API.
- Fetches live aircraft data from a local PiAware (SkyAware) server.
- Looks up aircraft tail numbers using the OpenSky Network API.
- Displays aircraft photos in a Firefox browser using Selenium.
- Python
- Firefox browser
- GeckoDriver (for Selenium)
- Selenium Python package
- Requests Python package
- Install Python dependencies:
pip install selenium requests
- Install Firefox and GeckoDriver:
sudo apt install firefox firefox-geckodriver
- Clone or copy this repository to your machine.
- Edit
aircraftGet.pyto set your latitude and longitude:myLat = myLatCordinate myLon = myLongCordinate
- Make sure the PiAware server URL is correct:
url = "http://192.168.40.187/skyaware/data/aircraft.json"
- Run the script:
python3 aircraftGet.py
- When a nearby plane is found, a Firefox window will open with its photo. Press Enter in the terminal to close the window.
- The script uses the OpenSky API to look up tail numbers. If the API is unavailable, tail numbers may not be shown.
- You can adjust the proximity threshold by changing the
degvariable inaircraftGet.py. - There is a way to do this without using the API, however, I determined it'd be easier to query the API rather than dig through PiAware's local database of tail numbers.
MIT License