From 22fff4df09f62439f6d4a9dc7223e72b6c188d94 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 3 Jul 2024 10:25:22 -0400 Subject: [PATCH] Update config prompt to turn C&C on if off during direwolf change --- config | 55 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/config b/config index 5717e25f..ddd9a25e 100755 --- a/config +++ b/config @@ -122,7 +122,7 @@ elif [ "$1" = "-i" ]; then reboot=1 ## echo "Rebooting CubeSatSim" ## sudo reboot now -# sudo systemctl restart cubesatsim +# sudo restart cubesatsim ## exit elif [ "$1" = "-a" ]; then echo "changing CubeSatSim to AFSK mode" @@ -139,9 +139,9 @@ elif [ "$1" = "-a" ]; then reboot=1 ## echo "rebooting" -## sudo systemctl stop rpitx +## sudo stop rpitx ## sudo reboot now -# sudo systemctl restart cubesatsim +# sudo restart cubesatsim ## exit elif [ "$1" = "-m" ]; then @@ -158,9 +158,9 @@ elif [ "$1" = "-m" ]; then fi reboot=1 ## echo "rebooting" -## sudo systemctl stop rpitx +## sudo stop rpitx ## sudo reboot now -# sudo systemctl restart cubesatsim +# sudo restart cubesatsim ## exit elif [ "$1" = "-f" ]; then echo "changing CubeSatSim to FSK mode" @@ -168,9 +168,9 @@ elif [ "$1" = "-f" ]; then # if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi reboot=1 ## echo "rebooting" -## sudo systemctl stop rpitx +## sudo stop rpitx ## sudo reboot now -# sudo systemctl restart cubesatsim +# sudo restart cubesatsim ## exit elif [ "$1" = "-b" ]; then echo "changing CubeSatSim to BPSK mode" @@ -178,9 +178,9 @@ elif [ "$1" = "-b" ]; then # if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi reboot=1 ## echo "rebooting" -## sudo systemctl stop rpitx +## sudo stop rpitx ## sudo reboot now -# sudo systemctl restart cubesatsim +# sudo restart cubesatsim ## exit elif [ "$1" = "-s" ]; then echo "changing CubeSatSim to SSTV mode" @@ -196,9 +196,9 @@ elif [ "$1" = "-s" ]; then fi reboot=1 ## echo "rebooting" -## sudo systemctl stop rpitx +## sudo stop rpitx ## sudo reboot now -# sudo systemctl restart cubesatsim +# sudo restart cubesatsim ## exit elif [ "$1" = "-t" ]; then @@ -245,7 +245,7 @@ elif [ "$1" = "-t" ]; then reboot=1 ## sudo reboot now -# sudo systemctl restart cubesatsim +# sudo restart cubesatsim elif [ "$1" = "-c" ]; then @@ -447,6 +447,7 @@ elif [ "$1" = "-C" ]; then sudo systemctl stop cubesatsim sudo systemctl stop rpitx + sudo systemctl stop command sudo mv -f /home/pi/CubeSatSim/telem.txt /home/pi/CubeSatSim/telem.txt.bk @@ -540,6 +541,28 @@ elif [ "$1" = "-d" ]; then fi + FILE=/home/pi/CubeSatSim/command_control + if [ -f "$FILE" ]; then + echo + + else + echo "Radio command and control is OFF" + echo + echo "Do you want to set command and control to ON (y/n) " + read reset + echo + + if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then + echo "Command and control set to ON" + sudo touch /home/pi/CubeSatSim/command_control + echo "restarting command and control" +# reboot=1 + sudo systemctl restart command +## sudo reboot now + fi + + fi + elif [ "$1" = "-R" ]; then @@ -869,7 +892,7 @@ elif [ "$1" = "-h" ]; then echo " -f Change to FSK/DUV mode" echo " -b Change to BPSK mode" echo " -s Change to SSTV mode" - echo " -i Reboots CubeSatsim software" + echo " -i Restart CubeSatsim software" echo " -c Change the CALLSIGN in the configuration file sim.cfg" echo " -t Change the Simulated Telemetry setting in sim.cfg" echo " -r Change the Resets Count in the configuration file sim.cfg" @@ -881,8 +904,8 @@ elif [ "$1" = "-h" ]; then echo " -R Change the Commands Count in the file command_count.txt" echo " -B Change Safe Mode (battery saver mode) manually" echo " -q Change the Squelch setting for command receiver" - echo " -F Change the rx and tx frequency" - echo " -H Chnage the Balloon mode" + echo " -F Change the RX and TX frequency" + echo " -H Change the Balloon (HAB) mode" echo " -p Display payload sensor data" echo " -v Display voltage and current data" echo " -P Change the PL (Private Line) CTCSS/CDCSS codes for RX and TX" @@ -905,7 +928,7 @@ fi if [ "$reboot" = "1" ] ; then if [ "$noreboot" = "0" ] ; then - echo 'Reboot due to mode change!' | wall + echo 'Reboot due to config change!' | wall echo "Rebooting" sudo systemctl stop rpitx sudo reboot now