From 263deb3766d195f4f9d9f944dfb301f99f05b551 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 13 Nov 2023 16:03:06 -0500 Subject: [PATCH] Update config adding -F change rx and tx frequency --- config | 90 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 16 deletions(-) diff --git a/config b/config index 5dc1e373..07a29287 100755 --- a/config +++ b/config @@ -55,7 +55,7 @@ if [ "$1" = "" ]; then echo -e "Current sim.cfg configuration file:" echo - echo $1 $2 $3 $4 $5 $6 + echo $1 $2 $3 $4 $5 $6 $7 $8 echo echo "To change, include an OPTION" @@ -130,6 +130,7 @@ elif [ "$1" = "-h" ]; then echo " -T Change command state" echo " -R Change the Commands Count in the file command_count.txt" echo " -q Change the Squelch setting for command receiver" + echo " -F Change the rx and tx frequency" echo exit @@ -152,7 +153,7 @@ elif [ "$1" = "-t" ]; then echo -# echo $1 $2 $3 $4 $5 $6 +# echo $1 $2 $3 $4 $5 $6 $7 $8 echo "Do you want Simulated Telemetry ON (y/n) " read sim @@ -169,8 +170,8 @@ elif [ "$1" = "-t" ]; then echo echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo - echo $1 $2 $3 $4 $sim $6 - echo $1 $2 $3 $4 $sim $6 > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $3 $4 $sim $6 $7 $8 + echo $1 $2 $3 $4 $sim $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuraation file" echo @@ -195,7 +196,7 @@ elif [ "$1" = "-c" ]; then echo $1 echo -# echo $1 $2 $3 $4 $5 $6 +# echo $1 $2 $3 $4 $5 $6 $7 $8 echo "Enter callsign in all capitals: " read callsign @@ -209,8 +210,8 @@ elif [ "$1" = "-c" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo $callsign $2 $3 $4 $5 $6 - echo $callsign $2 $3 $4 $5 $6 > /home/pi/CubeSatSim/sim.cfg + echo $callsign $2 $3 $4 $5 $6 $7 $8 + echo $callsign $2 $3 $4 $5 $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg fi if [ "$norestart" = "1" ]; then @@ -241,7 +242,7 @@ elif [ "$1" = "-r" ]; then echo $2 echo -# echo $1 $2 $3 $4 $5 $6 +# echo $1 $2 $3 $4 $5 $6 $7 $8 echo -e "Enter Reset Count (integer): " @@ -261,8 +262,8 @@ elif [ "$1" = "-r" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo $1 $resets $3 $4 $5 $6 - echo $1 $resets $3 $4 $5 $6 > /home/pi/CubeSatSim/sim.cfg + echo $1 $resets $3 $4 $5 $6 $7 $8 + echo $1 $resets $3 $4 $5 $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg fi if [ "$norestart" = "1" ]; then @@ -294,7 +295,7 @@ elif [ "$1" = "-l" ]; then echo $3 echo -# echo $1 $2 $3 $4 $5 $6 +# echo $1 $2 $3 $4 $5 $6 $7 $8 echo -e "Enter latitude (decimal degrees, positive is north): " @@ -336,8 +337,8 @@ elif [ "$1" = "-l" ]; then fi echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo $1 $2 $lat $long $5 $6 - echo $1 $2 $lat $long $5 $6 > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $lat $long $5 $6 $7 $8 + echo $1 $2 $lat $long $5 $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg if [ "$norestart" = "1" ]; then echo @@ -441,7 +442,7 @@ elif [ "$1" = "-q" ]; then echo $6 echo -# echo $1 $2 $3 $4 $5 $6 +# echo $1 $2 $3 $4 $5 $6 $7 $8 echo -e "Enter squelch (integer 0 - 8): " @@ -463,14 +464,71 @@ elif [ "$1" = "-q" ]; then echo echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo - echo $1 $2 $3 $4 $5 $sq - echo $1 $2 $3 $4 $4 $sq > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $3 $4 $5 $sq $7 $8 + echo $1 $2 $3 $4 $4 $sq $7 $8 > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuraation file" echo sudo systemctl restart cubesatsim + +elif [ "$1" = "-F" ]; then + + echo + echo "Editing the tx and rx frequency in the" + echo "configuration file for CubeSatSim" + echo + echo "Return keeps current value." +# echo -e "Current sim.cfg configuration file:" +# echo + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo "Current value of tx is" + echo $7 + echo + echo "Current value of rx is" + echo $8 + echo + +# echo $1 $2 $3 $4 $5 $6 $7 $8 + + echo "Enter tx frequency as 4XX.XXXX: " + read tx + + if [ -z $tx ] ; then + + tx="$7" + echo "Keeping value of" $tx + fi + + echo "Enter rx frequency as 4XX.XXXX: " + read rx + + if [ -z $rx ] ; then + + rx="$8" + echo "Keeping value of" $rx + +# else + echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" + + echo $callsign $2 $3 $4 $5 $6 $7 $8 + echo $callsign $2 $3 $4 $5 $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg + fi + +# if [ "$norestart" = "1" ]; then +# echo +# else + echo + echo "Restarting CubeSatSim with new configuraation file" + echo + sudo systemctl restart cubesatsim +# fi + fi # sudo systemctl restart cubesatsim