From aecbb6986a2de1abfedf69b61fb0a4baf00ab0c6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 13 Aug 2023 11:11:37 -0400 Subject: [PATCH] Update config to add command changes --- config | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/config b/config index 9d63b24f..f7fa9f0a 100755 --- a/config +++ b/config @@ -341,23 +341,66 @@ elif [ "$1" = "-S" ]; then echo "Scan both I2C buses on the Raspberry Pi" echo + i2cdetect -y 1 + + i2cdetect -y 3 + elif [ "$1" = "-C" ]; then echo echo "Clear logs" echo + sudo systemctl stop cubesatsim + sudo systemctl stop rpitx + + sudo journalctl --vacuum-time=1s + + sudo systemctl reboot now + + echo "rebooting" + elif [ "$1" = "-T" ]; then echo echo "Change command state" echo + echo "Current command state is:" + cat /home/pi/CubeSatSim/command_state.txt + echo + + echo "Do you want to set beacon transmit to ON (y/n) " + read reset + echo + + if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then + echo "True" > /home/pi/CubeSatSim/command_count.txt + echo "Command state set to True to enable beacon" + else + echo "False" > /home/pi/CubeSatSim/command_count.txt + echo "Command state set to False to disable beacon" fi + elif [ "$1" = "-R" ]; then echo - echo "Change the Commands Count in the file command_count.txt" + echo "Reset the Commands Count in the file command_count.txt" echo + + echo "Current commands count is:" + cat /home/pi/CubeSatSim/commands_count.txt + echo + + echo "Do you want to reset the commands count to zero (y/n) " + read reset + echo + + if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then + echo "0" > /home/pi/CubeSatSim/command_count.txt + echo "Commands count reset to 0" + else + echo "Commands count not reset" + fi fi # sudo systemctl restart cubesatsim