[] (https://travis-ci.org/glidernet/ogn-python) [] (https://coveralls.io/r/glidernet/ogn-python) [] (https://pypi.python.org/pypi/ogn-python)
A database backend for the Open Glider Network. The ogn-python module saves all received beacons into a database with SQLAlchemy. It connects to the OGN aprs servers with python-ogn-client. It requires PostgreSQL and PostGIS.
-
Checkout the repository
git clone https://github.com/glidernet/ogn-python.git
-
Install python requirements
pip install -r requirements.txt
-
Install PostgreSQL with PostGIS Extension. Create a database (use "ogn" as default, otherwise you have to modify the configuration, see below)
-
Optional: Install redis for asynchronous tasks (like takeoff/landing-detection)
apt-get install redis-server
-
Create database
./manage.py db.init
To schedule tasks like takeoff/landing-detection (logbook.compute
),
Celery with Redis is used.
The following scripts run in the foreground and should be deamonized
(eg. use supervisord).
-
Start the aprs client
./manage.py gateway.run
-
Start a task server (make sure redis is up and running)
celery -A ogn.collect worker -l info
-
Start the task scheduler (make sure a task server is up and running)
celery -A ogn.collect beat -l info
To load a custom configuration, create a file myconfig.py
(see config/default.py)
and set the environment variable OGN_CONFIG_MODULE
accordingly.
touch myconfig.py
export OGN_CONFIG_MODULE="myconfig"
./manage.py gateway.run
usage: manage.py [<namespace>.]<command> [<args>]
positional arguments:
command the command to run
optional arguments:
-h, --help show this help message and exit
available commands:
[db]
drop Drop all tables.
import_airports Import airports from a ".cup" file
import_ddb Import registered devices from the DDB.
import_file Import registered devices from a local file.
init Initialize the database.
upgrade Upgrade database to the latest version.
[gateway]
run Run the aprs client.
[logbook]
compute_logbook Compute logbook.
compute_takeoff_landingCompute takeoffs and landings.
show Show a logbook for <airport_name>.
[show.airport]
list_all Show a list of all airports.
[show.deviceinfos]
stats Show some stats on registered devices.
[show.devices]
aircraft_type_stats Show stats about aircraft types used by devices.
hardware_stats Show stats about hardware version used by devices.
software_stats Show stats about software version used by devices.
stealth_stats Show stats about stealth flag set by devices.
[show.receiver]
hardware_stats Show some statistics of receiver hardware.
list_all Show a list of all receivers.
software_stats Show some statistics of receiver software.
Only the command logbook.compute
requires a running task server (celery) at the moment.
ogn.collect.database.import_ddb
- Import registered devices from the ddbogn.collect.database.import_file
- Import registered devices from a local fileogn.collect.receiver.update_receivers
- Populate/update receiver tableogn.collect.logbook.compute_takeoff_and_landing
- Generate TakeoffLanding table
If the task server is up and running, tasks could be started manually.
python3
>>>from ogn.collect.database import import_ddb
>>>import_ddb.delay()
Licensed under the AGPLv3.