It is very hacky, but involves the following steps:
- Add a UDP sink to the
gr-satnogs
flowcharts connected directly to the osmocom source. Use 127.0.0.1 as the IP and10*rigctl_port
as the port. - Set the
SATNOGS_PRE_OBSERVATION_SCRIPT
environment variable to call a pre-observation script. Pass it the frequency, and possibly the script name. I useSATNOGS_PRE_OBSERVATION_SCRIPT="sh <path_to_script>/preobs_vhf.sh {{SCRIPT_NAME}} {{ID}} {{FREQ}}"
- Create a pre-observation script that starts
rffft
reading from a fifo andnc
listening to UDP packets from the specified port and dumping them into the fifo. My script is below.
My VHF (#39) and UHF (#40) stations run from the same x86_64 PC. Hence, I use 10*rigctl_port
to differentiate between VHF and UHF recordings scripts, this to prevent both flowcharts sending UDP packets to the same port. The VHF and UHF satnogs-clients then have their own SATNOGS_PRE_OBSERVATION_SCRIPT
and SATNOGS_RIG_PORT
variables.
By using the UDP port, the gr-satnogs
flowcharts can run even when starting nc
or rffft
failed, or are even turned off.
As you can see from the VHF pre-observation script, it only runs on the CW and AFSK flowcharts. I’ve also hardcoded the 1e6 sample rate, which is the gr-satnogs
definition for an rtl-sdr. The -n 3600
option means only a single bin file is written by rffft
, as the passes are usually shorter than 20 mins or so.
#!/usr/bin/bash
# Run strf
if [ "$1" = "satnogs_cw_decoder.py" ] || [ "$1" = "satnogs_afsk1200_ax25.py" ]; then
freq=`echo $3 | awk '{printf("%d\n",$1-100000)}'`
rffft -i <path_to_fifo> -p <output_path> -f $freq -s 1e6 -q -c 20 -n 3600 -F float &
nc -l -p 45340 -u ><path_to_fifo> &
echo "rffft and nc started"
fi