How to update auto-scheduler’s tle file

I noticed that lots of satellites were not able to schedule because the TLEs were missing.

WARNING - Fetch xxx from Celestrak (satcat) failed! happened on every satellite query.

I found that CELESTRAK changed the query format last year and that the fetch_tle.py program needs to be updated:

My version is satnogs-auto-scheduler 0+untagged.183.g2efce6f.dirty which I believe is current

In the file
/satnogs-auto-scheduler/env/lib/python3.7/site-packages/satellite_tle/fetch_tle.py line 51 I changed changed

The old URL
https://www.celestrak.com/satcat/tle.php?CATNR={}

The new URL
https://www.celestrak.com/NORAD/elements/gp.php?CATNR={}

I then cleared the old TLES in /tmp/cache/ and re-ran schedule_single_station.py

Now the /tmp/cache/ files contain the missing satellites.

FYI here are the errors BEFORE making the change

-- Logs begin at Sun 2023-05-07 03:19:00 CDT. --
May 07 03:21:13 raspberrypihole systemd[1]: Starting Schedule SatNOGS observations for 1.2h on station 1682...
May 07 03:21:15 raspberrypihole python[1157]: 2023-05-07 03:21:15,067 - auto_scheduler.satnogs_client - INFO - Requesting information for ground station 1682
May 07 03:21:15 raspberrypihole python[1157]: 2023-05-07 03:21:15,988 - auto_scheduler.satnogs_client - INFO - Ground station information retrieved!
May 07 03:21:15 raspberrypihole python[1157]: 2023-05-07 03:21:15,989 - root - INFO - Updating transmitters and TLEs for station
May 07 03:21:15 raspberrypihole python[1157]: 2023-05-07 03:21:15,990 - auto_scheduler.satnogs_client - INFO - Fetching transmitter information from DB.
May 07 03:21:18 raspberrypihole python[1157]: 2023-05-07 03:21:18,643 - auto_scheduler.satnogs_client - INFO - Transmitters received!
May 07 03:21:18 raspberrypihole python[1157]: 2023-05-07 03:21:18,716 - auto_scheduler.satnogs_client - INFO - Transmitters filtered based on ground station capability.
May 07 03:21:18 raspberrypihole python[1157]: 2023-05-07 03:21:18,717 - auto_scheduler.satnogs_client - INFO - Fetching satellite information from DB.
May 07 03:21:20 raspberrypihole python[1157]: 2023-05-07 03:21:20,410 - auto_scheduler.satnogs_client - INFO - Satellites received!
May 07 03:21:20 raspberrypihole python[1157]: 2023-05-07 03:21:20,456 - root - INFO - Requesting transmitter success rates.
May 07 03:26:24 raspberrypihole python[1157]: 2023-05-07 03:26:24,798 - root - INFO - Transmitter success rates received!
May 07 03:26:24 raspberrypihole python[1157]: 2023-05-07 03:26:24,798 - root - INFO - Fetch from http://mstl.atl.calpoly.edu/~ops/keps/kepler.txt
May 07 03:26:25 raspberrypihole python[1157]: 2023-05-07 03:26:25,148 - root - INFO - Fetch from https://www.amsat.org/amsat/ftp/keps/current/nasabare.txt
May 07 03:26:25 raspberrypihole python[1157]: 2023-05-07 03:26:25,366 - root - INFO - Fetch from https://www.celestrak.com/NORAD/elements/satnogs.txt
May 07 03:26:26 raspberrypihole python[1157]: 2023-05-07 03:26:26,268 - root - INFO - Fetch 25984 from Celestrak (satcat)
May 07 03:26:26 raspberrypihole python[1157]: 2023-05-07 03:26:26,710 - root - WARNING - Fetch 25984 from Celestrak (satcat) failed!
May 07 03:26:26 raspberrypihole python[1157]: 2023-05-07 03:26:26,710 - root - INFO - Fetch 55562 from Celestrak (satcat)
May 07 03:26:27 raspberrypihole python[1157]: 2023-05-07 03:26:27,133 - root - WARNING - Fetch 55562 from Celestrak (satcat) failed!
May 07 03:26:27 raspberrypihole python[1157]: 2023-05-07 03:26:27,134 - root - INFO - Fetch 1291 from Celestrak (satcat)
May 07 03:26:27 raspberrypihole python[1157]: 2023-05-07 03:26:27,534 - root - WARNING - Fetch 1291 from Celestrak (satcat) failed!
May 07 03:26:27 raspberrypihole python[1157]: 2023-05-07 03:26:27,535 - root - INFO - Fetch 37388 from Celestrak (satcat)
May 07 03:26:27 raspberrypihole python[1157]: 2023-05-07 03:26:27,920 - root - WARNING - Fetch 37388 from Celestrak (satcat) failed!
May 07 03:26:27 raspberrypihole python[1157]: 2023-05-07 03:26:27,921 - root - INFO - Fetch 4237 from Celestrak (satcat)
May 07 03:26:28 raspberrypihole python[1157]: 2023-05-07 03:26:28,323 - root - WARNING - Fetch 4237 from Celestrak (satcat) failed!
May 07 03:26:28 raspberrypihole python[1157]: 2023-05-07 03:26:28,324 - root - INFO - Fetch 1804 from Celestrak (satcat)
May 07 03:26:28 raspberrypihole python[1157]: 2023-05-07 03:26:28,708 - root - WARNING - Fetch 1804 from Celestrak (satcat) failed!
May 07 03:26:28 raspberrypihole python[1157]: 2023-05-07 03:26:28,709 - root - INFO - Fetch 48274 from Celestrak (satcat)
May 07 03:26:29 raspberrypihole python[1157]: 2023-05-07 03:26:29,116 - root - WARNING - Fetch 48274 from Celestrak (satcat) failed!
May 07 03:26:29 raspberrypihole python[1157]: 2023-05-07 03:26:29,118 - root - INFO - Fetch 1430 from Celestrak (satcat)
May 07 03:26:29 raspberrypihole python[1157]: 2023-05-07 03:26:29,507 - root - WARNING - Fetch 1430 from Celestrak (satcat) failed!
May 07 03:26:29 raspberrypihole python[1157]: 2023-05-07 03:26:29,508 - root - INFO - Fetch 35865 from Celestrak (satcat)
May 07 03:26:29 raspberrypihole python[1157]: 2023-05-07 03:26:29,911 - root - WARNING - Fetch 35865 from Celestrak (satcat) failed!
May 07 03:26:29 raspberrypihole python[1157]: 2023-05-07 03:26:29,913 - root - INFO - Fetch 31135 from Celestrak (satcat)
May 07 03:26:30 raspberrypihole python[1157]: 2023-05-07 03:26:30,316 - root - WARNING - Fetch 31135 from Celestrak (satcat) failed!

and now after the change only a few failures

(env) pi@raspberrypihole:~/satnogs-auto-scheduler $ python3 schedule_single_station.py -s 2416  -d 2 -P priorities_2416.txt  -f  -n
2023-05-07 04:57:33,334 - auto_scheduler.satnogs_client - INFO - Requesting information for ground station 2416
2023-05-07 04:57:34,153 - auto_scheduler.satnogs_client - INFO - Ground station information retrieved!
2023-05-07 04:57:34,155 - root - INFO - Updating transmitters and TLEs for station
2023-05-07 04:57:34,156 - auto_scheduler.satnogs_client - INFO - Fetching transmitter information from DB.
2023-05-07 04:57:36,489 - auto_scheduler.satnogs_client - INFO - Transmitters received!
2023-05-07 04:57:36,589 - auto_scheduler.satnogs_client - INFO - Transmitters filtered based on ground station capability.
2023-05-07 04:57:36,590 - auto_scheduler.satnogs_client - INFO - Fetching satellite information from DB.
2023-05-07 04:57:38,434 - auto_scheduler.satnogs_client - INFO - Satellites received!
2023-05-07 04:57:38,535 - root - INFO - Requesting transmitter success rates.
2023-05-07 05:02:59,581 - root - INFO - Transmitter success rates received!
2023-05-07 05:02:59,581 - root - INFO - Fetch from http://mstl.atl.calpoly.edu/~ops/keps/kepler.txt
2023-05-07 05:03:19,676 - root - WARNING - Failed to download from CalPoly.
2023-05-07 05:03:19,676 - root - INFO - Fetch from https://www.amsat.org/amsat/ftp/keps/current/nasabare.txt
2023-05-07 05:03:19,955 - root - INFO - Fetch from https://www.celestrak.com/NORAD/elements/satnogs.txt
2023-05-07 05:03:20,870 - root - INFO - Fetch 40968 from Celestrak (satcat)
2023-05-07 05:03:21,673 - root - WARNING - Fetch 40968 from Celestrak (satcat) failed!
2023-05-07 05:03:21,676 - root - INFO - Fetch 45119 from Celestrak (satcat)
2023-05-07 05:03:22,567 - root - WARNING - Fetch 45119 from Celestrak (satcat) failed!
2023-05-07 05:03:22,571 - root - INFO - Fetch 53346 from Celestrak (satcat)
2023-05-07 05:03:23,405 - root - INFO - Fetch 43118 from Celestrak (satcat)
2023-05-07 05:03:24,238 - root - INFO - Fetch 43125 from Celestrak (satcat)
2023-05-07 05:03:25,159 - root - WARNING - Fetch 43125 from Celestrak (satcat) failed!
2023-05-07 05:03:25,163 - root - INFO - Fetch 53367 from Celestrak (satcat)
2023-05-07 05:03:26,026 - root - INFO - Fetch 53368 from Celestrak (satcat)
2023-05-07 05:03:26,917 - root - INFO - Fetch 43130 from Celestrak (satcat)
2023-05-07 05:03:27,735 - root - INFO - Fetch 53373 from Celestrak (satcat)
2023-05-07 05:03:28,655 - root - INFO - Fetch 53374 from Celestrak (satcat)
2023-05-07 05:03:29,514 - root - INFO - Fetch 53375 from Celestrak (satcat)
2023-05-07 05:03:30,393 - root - INFO - Fetch 53376 from Celestrak (satcat)
2023-05-07 05:03:31,273 - root - INFO - Fetch 53377 from Celestrak (satcat)
2023-05-07 05:03:32,120 - root - INFO - Fetch 53378 from Celestrak (satcat)
2023-05-07 05:03:32,962 - root - INFO - Fetch 53381 from Celestrak (satcat)
2023-05-07 05:03:33,826 - root - INFO - Fetch 53382 from Celestrak (satcat)
2023-05-07 05:03:34,700 - root - INFO - Fetch 43143 from Celestrak (satcat)
2023-05-07 05:03:35,558 - root - INFO - Fetch 43144 from Celestrak (satcat)
2023-05-07 05:03:36,374 - root - WARNING - Fetch 43144 from Celestrak (satcat) failed!
2023-05-07 05:03:36,377 - root - INFO - Fetch 53383 from Celestrak (satcat)
2023-05-07 05:03:37,247 - root - INFO - Fetch 53384 from Celestrak (satcat)

3 Likes