|
|
|
|
@ -250,7 +250,7 @@ if [ "$1" = "" ]; then
|
|
|
|
|
elif [ "$1" = "e" ]; then
|
|
|
|
|
echo "Mode is Repeater"
|
|
|
|
|
elif [ "$1" = "n" ]; then
|
|
|
|
|
echo -n "Mode is Transmit Command and Control with "
|
|
|
|
|
echo -n "Mode is Transmit Commands with "
|
|
|
|
|
FILE=/home/pi/CubeSatSim/transmit_dtmf
|
|
|
|
|
if [ -f "$FILE" ]; then
|
|
|
|
|
echo -n "DTMF"
|
|
|
|
|
@ -365,8 +365,17 @@ elif [ "$1" = "-a" ]; then
|
|
|
|
|
|
|
|
|
|
echo "changing CubeSatSim to AFSK mode"
|
|
|
|
|
sudo echo "a" > /home/pi/CubeSatSim/.mode
|
|
|
|
|
if [ "$1" == "f" ] || [ "$1" == "b" ] ; then
|
|
|
|
|
FILE=/home/pi/CubeSatSim/battery_saver
|
|
|
|
|
if [ -f "$FILE" ]; then
|
|
|
|
|
restart=1
|
|
|
|
|
else
|
|
|
|
|
reboot=1
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
restart=1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-m" ]; then
|
|
|
|
|
|
|
|
|
|
@ -382,8 +391,17 @@ elif [ "$1" = "-m" ]; then
|
|
|
|
|
|
|
|
|
|
echo "changing CubeSatSim to CW mode"
|
|
|
|
|
sudo echo "m" > /home/pi/CubeSatSim/.mode
|
|
|
|
|
if [ "$1" == "f" ] || [ "$1" == "b" ] ; then
|
|
|
|
|
FILE=/home/pi/CubeSatSim/battery_saver
|
|
|
|
|
if [ -f "$FILE" ]; then
|
|
|
|
|
restart=1
|
|
|
|
|
else
|
|
|
|
|
reboot=1
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
restart=1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-f" ]; then
|
|
|
|
|
|
|
|
|
|
@ -399,7 +417,7 @@ elif [ "$1" = "-f" ]; then
|
|
|
|
|
|
|
|
|
|
echo "changing CubeSatSim to FSK mode"
|
|
|
|
|
sudo echo "f" > /home/pi/CubeSatSim/.mode
|
|
|
|
|
reboot=1
|
|
|
|
|
restart=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-b" ]; then
|
|
|
|
|
@ -416,7 +434,7 @@ elif [ "$1" = "-b" ]; then
|
|
|
|
|
|
|
|
|
|
echo "changing CubeSatSim to BPSK mode"
|
|
|
|
|
sudo echo "b" > /home/pi/CubeSatSim/.mode
|
|
|
|
|
reboot=1
|
|
|
|
|
restart=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-s" ]; then
|
|
|
|
|
@ -433,8 +451,18 @@ elif [ "$1" = "-s" ]; then
|
|
|
|
|
|
|
|
|
|
echo "changing CubeSatSim to SSTV mode"
|
|
|
|
|
sudo echo "s" > /home/pi/CubeSatSim/.mode
|
|
|
|
|
if [ "$1" == "f" ] || [ "$1" == "b" ] ; then
|
|
|
|
|
|
|
|
|
|
FILE=/home/pi/CubeSatSim/battery_saver
|
|
|
|
|
if [ -f "$FILE" ]; then
|
|
|
|
|
restart=1
|
|
|
|
|
else
|
|
|
|
|
reboot=1
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
restart=1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-t" ]; then
|
|
|
|
|
|
|
|
|
|
@ -811,31 +839,31 @@ elif [ "$1" = "-d" ]; then
|
|
|
|
|
elif [ "$1" = "-D" ]; then
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "Change Transmit command state"
|
|
|
|
|
echo "Change Transmit Commands state"
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
FILE=/home/pi/CubeSatSim/transmit_dtmf
|
|
|
|
|
if [ -f "$FILE" ]; then
|
|
|
|
|
echo "Transmit commands in DTMF is set"
|
|
|
|
|
echo "Transmit Commands in DTMF is set"
|
|
|
|
|
echo
|
|
|
|
|
echo "Do you want to transmit commands in APRS (y/n) "
|
|
|
|
|
echo "Do you want to Transmit Commands in APRS (y/n) "
|
|
|
|
|
read reset
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then
|
|
|
|
|
echo "Transmit commands in APRS"
|
|
|
|
|
echo "Transmit Commands in APRS"
|
|
|
|
|
sudo rm /home/pi/CubeSatSim/transmit_dtmf > /dev/null 2>&1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
echo "Transmit commands in APRS is set"
|
|
|
|
|
echo "Transmit Commands in APRS is set"
|
|
|
|
|
echo
|
|
|
|
|
echo "Do you want to transmit commands in DTMF (y/n) "
|
|
|
|
|
echo "Do you want to Transmit Commands in DTMF (y/n) "
|
|
|
|
|
read reset
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then
|
|
|
|
|
echo "Transmit commands in DTMF"
|
|
|
|
|
echo "Transmit Commands in DTMF"
|
|
|
|
|
touch /home/pi/CubeSatSim/transmit_dtmf
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
@ -1122,25 +1150,28 @@ elif [ "$1" = "-o" ]; then
|
|
|
|
|
FILE=/home/pi/CubeSatSim/beacon_off
|
|
|
|
|
if [ -f "$FILE" ]; then
|
|
|
|
|
echo "Transmit beacon telemetry is off"
|
|
|
|
|
echo
|
|
|
|
|
echo "Do you want to turn beacon telemetry ON (y/n) "
|
|
|
|
|
read reset
|
|
|
|
|
# echo
|
|
|
|
|
# echo "Do you want to turn beacon telemetry ON (y/n) "
|
|
|
|
|
# read reset
|
|
|
|
|
|
|
|
|
|
reset="y"
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then
|
|
|
|
|
echo "Turn beacon telemetry ON"
|
|
|
|
|
sudo rm /home/pi/CubeSatSim/beacon_off > /dev/null 2>&1
|
|
|
|
|
sudo systemctl stop rpitx
|
|
|
|
|
sudo python3 -u /home/pi/CubeSatSim/rpitx.py s & > /dev/null 2>&1
|
|
|
|
|
sudo systemctl restart rpitx
|
|
|
|
|
# sudo python3 -u /home/pi/CubeSatSim/rpitx.py s & > /dev/null 2>&1
|
|
|
|
|
|
|
|
|
|
# restart=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
echo "Transmit beacon telemetry is on"
|
|
|
|
|
echo
|
|
|
|
|
echo "Do you want to turn beacon telemetry OFF (y/n) "
|
|
|
|
|
read reset
|
|
|
|
|
# echo
|
|
|
|
|
# echo "Do you want to turn beacon telemetry OFF (y/n) "
|
|
|
|
|
# read reset
|
|
|
|
|
reset="y"
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then
|
|
|
|
|
@ -1222,11 +1253,7 @@ elif [ "$1" = "-e" ]; then
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-n" ]; then
|
|
|
|
|
|
|
|
|
|
echo "changing CubeSatSim to Transmit Command and Control mode"
|
|
|
|
|
|
|
|
|
|
value=`cat /home/pi/CubeSatSim/.mode`
|
|
|
|
|
echo "$value" > /dev/null
|
|
|
|
|
set -- $value
|
|
|
|
|
echo "changing CubeSatSim to Transmit Commands mode"
|
|
|
|
|
|
|
|
|
|
if [ "$1" = "n" ]; then
|
|
|
|
|
echo "Turning Transmit Command and Control mode OFF"
|
|
|
|
|
@ -1314,6 +1341,23 @@ elif [ "$1" = "-A" ]; then
|
|
|
|
|
reboot=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-L" ]; then
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "Setting microphone level for command and control"
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
echo -e "Enter microphone level in percentage (integer 0 - 100): "
|
|
|
|
|
|
|
|
|
|
read mic
|
|
|
|
|
|
|
|
|
|
if ! [ -z $mic ] && [[ $mic =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then
|
|
|
|
|
echo "Updating mic level"
|
|
|
|
|
value=`arecord -l | grep "card"` && echo "$value" > /dev/null && set -- $value && amixer -c ${2:0:1} set Mic $mic%
|
|
|
|
|
else
|
|
|
|
|
echo "Not updating mic level"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-h" ]; then
|
|
|
|
|
|
|
|
|
|
echo "config OPTION"
|
|
|
|
|
@ -1326,7 +1370,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 " -n Change to Transmit Command and Control mode"
|
|
|
|
|
echo " -n Change to Transmit Commands mode"
|
|
|
|
|
echo " -e Change to Repeater mode"
|
|
|
|
|
echo " -i Restart CubeSatsim software"
|
|
|
|
|
echo " -c Change the CALLSIGN in the configuration file sim.cfg"
|
|
|
|
|
@ -1346,9 +1390,9 @@ elif [ "$1" = "-h" ]; then
|
|
|
|
|
echo " -v Display voltage and current data"
|
|
|
|
|
echo " -P Change the PL (Private Line) CTCSS/CDCSS codes for RX and TX"
|
|
|
|
|
echo " -A Transmit APRS control packets to control another CubeSatSim"
|
|
|
|
|
echo " -D Change Transmit command state APRS or DTMF"
|
|
|
|
|
echo " -D Change Transmit Commands state APRS or DTMF"
|
|
|
|
|
echo " -o Change telemetry beacon transmit state"
|
|
|
|
|
|
|
|
|
|
echo " -L Change microphone level for command and control"
|
|
|
|
|
echo
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
|
|
@ -1365,6 +1409,8 @@ fi
|
|
|
|
|
|
|
|
|
|
# echo $noreboot
|
|
|
|
|
|
|
|
|
|
#reboot=0
|
|
|
|
|
#restart=1
|
|
|
|
|
|
|
|
|
|
if [ "$reboot" = "1" ] ; then
|
|
|
|
|
if [ "$noreboot" = "0" ] ; then
|
|
|
|
|
@ -1380,10 +1426,9 @@ fi
|
|
|
|
|
if [ "$restart" = "1" ] ; then
|
|
|
|
|
if [ "$reboot" = "0" ] ; then
|
|
|
|
|
echo "Restarting"
|
|
|
|
|
sudo systemctl stop rpitx
|
|
|
|
|
sudo systemctl restart cubesatsim
|
|
|
|
|
else
|
|
|
|
|
echo "Restart needed for changes to take effect"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|