Go to file
Fabian P. Schmidt 0ae102d19b get_scheduled_passes_from_network: Fix next_url logic
The observations endpoint is paginated and ordered by observation
start time, i.e. most recent / future observations come at first.

The `get_scheduled_passes_from_network` method fetches the first page,
parses it, and then fetches new pages as long as the last observation
is still before the user-provided pass scheduling end time.

"Established" stations have plenty of past observations, so this pass
scheduling end time will be reached before the endpoint runs out of
observations (and thus stops to provide a `links['next']['url']` header.

For "young" stations the endpoint will run out of observations though
and the old `get_scheduled_passes_from_network` implementation didn't
detect the missing header and thus failed as described in issue #15.

This commit introduces logic to detect a missing link header.

Fixes issue #15.
2019-11-02 23:44:53 +01:00
auto_scheduler Satellite: Fix class name (uppercase) 2019-11-02 21:31:45 +01:00
.gitignore Decoupled credentials from argparse into configuration file 2019-05-10 10:21:26 +03:00
LICENSE Remove loop checking of gs info in favor of API filtering 2018-12-02 14:09:23 +02:00
README.md README: Add systemd-timer section 2019-11-02 20:41:03 +01:00
cache.py Refactor SatNOGS API calls into an own module 2019-11-02 22:11:17 +01:00
env-dist Decoupled credentials from argparse into configuration file 2019-05-10 10:21:26 +03:00
requirements.txt Update satellitetle 2019-07-05 03:17:35 +02:00
satnogs_client.py get_scheduled_passes_from_network: Fix next_url logic 2019-11-02 23:44:53 +01:00
schedule_single_station.py Refactor SatNOGS API calls into an own module 2019-11-02 22:11:17 +01:00
settings.py Refactor caching into a CacheManager module and add CACHE_DIR setting 2019-11-02 22:02:26 +01:00
setup.cfg Fix code for pep8 via yapf 2019-05-10 10:33:54 +03:00
test_cache.py Refactor SatNOGS API calls into an own module 2019-11-02 22:11:17 +01:00
utils.py Refactor SatNOGS API calls into an own module 2019-11-02 22:11:17 +01:00

README.md

auto-scheduler

This is a tool to automatically compute passes of satellites on the SatNOGS network. It uses code from the SatNOGS network scheduler. It requires python-satellitetle for downloading TLEs.

Dependencies

sudo apt-get install libxml2-dev libxslt1-dev
pip install -r requirements.txt

Configuration

Copy the env-dist file to .env and set your legacy SatNOGS Network credentials.

Test run

Perform a test run to download orbital elements and transmitter priorities (these are stored in /tmp/cache) with

schedule_single_station.py -s <ground station ID> -n

The -n option computes the passes but does not schedule them. To schedule these passes, run

schedule_single_station.py -s <ground station ID>

Setup priority scheduling

The following commands will add a list consisting of all DUV, BPSK1k2, BPSK9k6, [G]MSK and [G]FSK transmitters into priorities_37.txt. Please change the station id (here 37 - in the cache file and the list file name) to your corresponding one!

STATION_ID=37
TRM_FILE="/tmp/cache/transmitters_${STATION_ID}.txt"
PRIO_FILE="priorities_${STATION_ID}.txt"

awk '{if ($3>=80) print $0 }' ${TRM_FILE} | grep -e "FSK" | awk '{printf("%s 1.0 %s\n",$1,$2)}' > ${PRIO_FILE}
awk '{if ($3>=0) print $0 }' ${TRM_FILE} | grep -e "BPSK1k2" | awk '{printf("%s 1.0 %s\n",$1,$2)}' >> ${PRIO_FILE}
awk '{if ($3>=0) print $0 }' ${TRM_FILE} | grep -e "BPSK9k6" | awk '{printf("%s 1.0 %s\n",$1,$2)}' >> ${PRIO_FILE}
awk '{if ($3>=80) print $0 }' ${TRM_FILE} | grep -e "MSK" | awk '{printf("%s 1.0 %s\n",$1,$2)}' >> ${PRIO_FILE}
sort -n -k 4 ${TRM_FILE} | grep -e "DUV" | awk '{printf("%s 1.0 %s\n",$1,$2)}' >> ${PRIO_FILE}

Add cron-job

Start editing your default user's cron (select your preferred editor):

crontab -e

Add a line like this - execute the scheduling script on each full hour:

0 */1 * * * <path_to_auto_scheduler>/schedule_single_station.py -s <station_id> -d 1.2 -P <path_to_priority_list>/<priority_file>.txt -f -z

Omit the -f option to also fill in the gaps, but be aware if using a rotator setup! This will wear-out your rotator very quickly! Add -w 60 for a delay if you want to give your rotator a bit of time (60 s) to reset or home.

Add systemd-timer

The advantage of using a systemd-timer for invoking the auto-scheduler lies in the better logging output (you can use journalctl -u satnogs-auto-scheduler.service to access the log output).

  • Add a systemd service unit file at /etc/systemd/system/satnogs-auto-scheduler.service:

    [Unit]
    Description=Schedule SatNOGS observations for 1.2h on station 132
    
    [Service]
    Type=oneshot
    ExecStart=<path_to_auto_scheduler>/env/bin/python <path_to_auto_scheduler>/schedule_single_station.py -s <station_id> -d 1.2 -P <path_to_priority_list>/<priority_file>.txt -z
    User=pi
    
  • Add a systemd timer unit file at /etc/systemd/system/satnogs-auto-scheduler.timer:

    [Unit]
    Description=Run satnogs-auto-scheduler hourly and on boot
    
    [Timer]
    OnBootSec=2min
    OnUnitActiveSec=1h
    
    [Install]
    WantedBy=timers.target
    
  • Start the timer with

    sudo systemctl start satnogs-auto-scheduler.timer
    
  • Enable the timer to be started on boot with

    sudo systemctl enable satnogs-auto-scheduler.timer
    

If you want to run the auto-scheduler once manually, you can do so with

sudo systemctl start satnogs-auto-scheduler.service

Usage

The following command will list all available command-line arguments:

./schedule_single_station.py --help

License

license Copyright 2019 - Cees Bassa, Fabian Schmidt, Pierros Papadeas