Update fctelem.sh add auto-tune

fiabv4-auto-tune
Alan Johnston 2 months ago committed by GitHub
parent 8a3a1a07f2
commit 07fc9aeb7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -80,8 +80,9 @@ else
echo echo
fi fi
autotune=0
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=180 --title="FUNcube Telem Decoding" --text="Choose the frequency for FUNcube decoding:" --column="kHz" --column="Use" 434900 "CubeSatSim" Other "Choose another frequency") frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=220 --title="FUNcube Telem Decoding" --text="Choose the frequency for FUNcube decoding:" --column="kHz" --column="Use" 434900 "CubeSatSim" Auto-tune "CubeSatSim Auto-tune" Other "Choose another frequency")
echo $frequency echo $frequency
@ -96,6 +97,11 @@ if [ "$frequency" = "434900" ]; then
frequency=434900000 frequency=434900000
elif [ "$frequency" = "Auto-tune" ]; then
frequency=434900000
autotune=1
elif [ "$frequency" = "Other" ]; then elif [ "$frequency" = "Other" ]; then
echo echo
@ -110,6 +116,38 @@ elif [ "$frequency" = "Other" ]; then
fi fi
if [ "$autotune" = "1" ]; then
threshold=1
delay=5
retries=5
echo "Starting Auto-tune scanning"
echo "Scan will stop when confidence exceeds threshold value of" $threshold "or after" $retries "retries"
tries=0
confidence=0
delay=$((delay-2)) # subtract 2 second built in delay
while [ $tries -le $retries ] && [ "$confidence" -le "$threshold" ]; do
sleep $delay
source /home/pi/venv/bin/activate
python3 /home/pi/CubeSatSim/groundstation/auto-tune.py 434900000 n 2> null > /home/pi/CubeSatSim/groundstation/auto-tune.txt
# echo "auto-tune.txt"
# cat /home/pi/CubeSatSim/groundstation/auto-tune.txt
confidence=$(awk '{print $2}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune confidence:" $confidence
tries=$((tries+1))
done
if [ "$confidence" -gt "$threshold" ]; then
frequency=$(awk '{print $1}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune frequency:" $frequency
else
echo "Auto tune failed, frequency unchanged"
fi
fi
echo "Frequency is" $frequency echo "Frequency is" $frequency
echo echo
echo "If your CubeSatSim is transmitting in FUNcube mode (mode 7) you should get some frames after 30 seconds" echo "If your CubeSatSim is transmitting in FUNcube mode (mode 7) you should get some frames after 30 seconds"

Loading…
Cancel
Save

Powered by TurnKey Linux.