Post-obs script not getting arguments

I am trying to set up my post-obs script in such a way that it only runs for some specific satellites. I found a solution on these forums written in bash that extracts the NORAD ID from the TLE but when I tried using the same code it didn’t get anything; Modified "upload IQ files to Dropbox script" selecting satellites with linear transponders - #2 by mfalkvidd

I wanted to implement the same functionality in python as that is easier for me to work with, but starting even with a single command to display the arguments passed to the script by satnogs already fails, as it appears that the script is getting no arguments whatsoever…
This is what my post-obs “script” currently looks like;

#!/usr/bin/python3
import sys
print("Running post-obs script")
print(sys.argv)
print("End of post-obs script")

And this is what I get in the output;

Aug 28 14:30:05 raspberrypi satnogs-client[770]: Running post-obs script
Aug 28 14:30:05 raspberrypi satnogs-client[770]: ['/home/pi/post-obs/main.py']
Aug 28 14:30:05 raspberrypi satnogs-client[770]: End of post-obs script

Instead of the arguments such as TLE, obs ID, etc it gets nothing.
I am assuming the exact same issue was happening back when I was using the bash sh script, though I couldn’t check for that as I have no idea how to use bash and list all arguments for debug like this.

I have already spent most of the weekend trying to get this to work, I am a bit overwhelmed with the way satnogs works, so any tips would be appreciated

SatNOGS Client Setup - SatNOGS Wiki lists the variables that are available (search for SATNOGS_POST_OBSERVATION_SCRIPT on that page)

Did you configure the post observation script with the variables in satnogs-setup? This is what mine looks like:


Yeah that was it, I had no idea I had to pass the arguments, thanks. Seems to be working now (or at least it managed to differentiate between XW-2F and a NOAA satellite). Hopefully now I can safely allow my station to track other satellites without trying to process them as APT.
I think this was about the biggest hurdle I had to overcome, now I just have to figure out how to get the raw IQ file from the observation at a specific sample rate and I should be able to add any custom decoders I want

1 Like

The path to the IQ file will be available in the IQ_DUMP_FILENAME environment variable.

The sample rate will vary depending on the transmitter, but you can probably convert to your desired rate with sox.

1 Like

If you haven’t already, you need to enable output of the IQ file. Uploading compressed IQ files to Dropbox (or any other cloud storage provider) describes how to do that.

1 Like