diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index 0e546d89..d6a2483d 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -123,8 +123,8 @@ sleep 5 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 +# echo "auto-tune.txt" +# cat /home/pi/CubeSatSim/groundstation/auto-tune.txt threshold="3" confidence=$(awk '{print $2}' /home/pi/CubeSatSim/groundstation/auto-tune.txt) echo "Auto tune confidence: " @@ -133,14 +133,26 @@ echo $confidence if [ "$confidence" -lt "$threshold" ]; then sleep 10 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 +# 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: " echo $confidence + + if [ "$confidence" -lt "$threshold" ]; then + sleep 10 + 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: " + echo $confidence + fi fi -frequency=$(awk '{print $1}' /home/pi/CubeSatSim/groundstation/auto-tune.txt) +if [ "$confidence" -gt "$threshold" ]; then + frequency=$(awk '{print $1}' /home/pi/CubeSatSim/groundstation/auto-tune.txt) +fi echo "Auto tune frequency: " echo $frequency