diff --git a/config b/config index 324a5512..b5917680 100755 --- a/config +++ b/config @@ -95,9 +95,10 @@ function check_restart { echo "$value" > /dev/null set -- $value - if [ "$1" = "p" ] || [ "$1" = "P" ] ; then - reboot=1 - elif [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then +# if [ "$1" = "p" ] || [ "$1" = "P" ] ; then +# reboot=1 +#el + if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then FILE=/home/pi/CubeSatSim/battery_saver if [ -f "$FILE" ]; then restart=1 @@ -1833,7 +1834,8 @@ elif [ "$1" = "-I" ]; then # echo "changing CubeSatSim to Pacsat mode" - reboot=1 +# reboot=1 + check_restart sudo echo "P" > /home/pi/CubeSatSim/.mode value=`cat /home/pi/CubeSatSim/sim.cfg` @@ -1872,7 +1874,8 @@ elif [ "$1" = "-k" ]; then echo sudo systemctl stop pacsatsim &>/dev/null sudo rm -r /home/pi/PacSat - reboot=1 +# reboot=1 + sudo systemctl restart pacsatsim elif [ "$1" = "-h" ]; then diff --git a/groundstation/command.sh b/groundstation/command.sh new file mode 100755 index 00000000..e471e3cb --- /dev/null +++ b/groundstation/command.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# script to send APRS or DTMR commands to a CubeSatSim + +value=`cat /home/pi/CubeSatSim/.mode` +echo "$value" > /dev/null +set -- $value + +if [ "$1" != "n" ]; then + + echo "You are not in Transmit Commands mode" + sleep 10 + exit + +fi + +sudo killall -9 zenity &>/dev/null + +echo + +autotune=0 + +mode=$(zenity --timeout=20 --list 2>/dev/null --width=300 --height=360 --title="Transmit Command" --text="Choose the command to transmit" --column="Mode" --column="Result" a "APRS Mode" f "FSK Mode" b "BPSK Mode" s "SSTV Mode" m "CM Mode" e "Repeater Mode" j "FUNcube Mode" o "Beacon On/Off") + +# echo $mode + +if [ -z "$mode" ]; then + + echo "No choice made." + sleep 10 + + exit + +fi + +/home/pi/CubeSatSim/config -$mode +sleep 10 + + + + diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index cf6a6282..5fc934e5 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -5,6 +5,12 @@ echo "Startup script to run FoxTelem for FIAB v4" echo +value=`cat /home/pi/CubeSatSim/.mode` +echo "$value" > /dev/null +set -- $value +echo $1 +if [ "$1" != "P" ] ; then + sudo killall -9 FoxTelem &>/dev/null FILE=/home/pi/FoxTelemetryData/.foxprofile @@ -36,4 +42,10 @@ sleep 10 fi +else + echo "Don't run FoxTelem since PacSat Ground Station mode is set" +# /home/pi/CubeSatSim/groundstation/pacsat-run.sh + +fi + #$SHELL diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 68f390c4..85db5762 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -71,29 +71,15 @@ set -- $value MODE=$1 if [ ! "$MODE" = "P" ] && [ ! "$loopback" = "1" ] ; then + echo + echo "Changing to PacSat Ground Station Mode." + echo "You might reboot" + echo + sleep 5 + /home/pi/CubeSatSim/config -I +fi - echo - echo "Mode is not PacSat Ground Station" - echo - echo "Would you like to change to PacSat Ground Station mode and reboot? (y/n)?" - - read -r ANS - - if [ "$ANS" = "y" ]; then - - /home/pi/CubeSatSim/config -I - exit - - else - - echo - echo "You can run the PacSat Ground Station after you change mode and reboot." - sleep 10 - exit - - fi - -elif [ "$loopback" = "1" ] ; then +if [ "$loopback" = "1" ] ; then # if [ ! "$MODE" = "p" ] ; then echo @@ -107,7 +93,8 @@ elif [ "$loopback" = "1" ] ; then cd sudo rm PacSatGroundLoop.zip &>/dev/null - wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b/spacecraft/PacSatGround_0.46o/PacSatGround.zip +# wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b/spacecraft/PacSatGround_0.46o/PacSatGround.zip + cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/PacSatGround.zip . unzip PacSatGround.zip -d PacSatGroundLoop sudo rm PacSatGround.zip @@ -141,7 +128,8 @@ else cd sudo rm PacSatGround.zip &>/dev/null - wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b/spacecraft/PacSatGround_0.46o/PacSatGround.zip +# wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b/spacecraft/PacSatGround_0.46o/PacSatGround.zip + cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/PacSatGround.zip . unzip PacSatGround.zip sudo rm PacSatGround.zip @@ -302,7 +290,7 @@ echo cat $DIREWOLF_CONF echo -direwolf -r 48000 -c $DIREWOLF_CONF -t 0 & +direwolf -qd -r 48000 -c $DIREWOLF_CONF & cd /home/pi/Desktop/PacsatGround/ diff --git a/install b/install index 1992de40..c5e5451a 100755 --- a/install +++ b/install @@ -516,8 +516,8 @@ FILE=/home/pi/pi_pacsat/Debug/pi_pacsat # code has already been compiled if [ ! -f "$FILE" ]; then cd - #git clone https://github.com/alanbjohnston/pi_pacsat.git - git clone https://github.com/ac2cz/pi_pacsat.git + git clone https://github.com/alanbjohnston/pi_pacsat.git + #git clone https://github.com/ac2cz/pi_pacsat.git cd pi_pacsat #git checkout master-debug cd Debug diff --git a/pacsatsim.sh b/pacsatsim.sh index 49213e18..93a6b1b0 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -87,7 +87,8 @@ if [ ! -d "/home/pi/PacSat" ]; then mkdir /home/pi/PacSat mkdir /home/pi/PacSat/pacsat mkdir /home/pi/PacSat/pacsat/dir - wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.2/pacsat-dir.zip +# wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.2/pacsat-dir.zip + cp /home/pi/pi_pacsat/zip/pacsat-dir.zip . unzip pacsat-dir.zip sudo rm pacsat-dir.zip @@ -96,7 +97,8 @@ if [ ! -d "/home/pi/PacSat" ]; then sudo rm /home/pi/pi_pacsat/Debug/pacsat.state sudo rm /home/pi/pi_pacsat/Debug/pacsat_upload_table.dat sudo rm pi_pacsat.zip - wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.2/pi_pacsat.zip +# wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.2/pi_pacsat.zip + cp /home/pi/pi_pacsat/zip/pi_pacsat.zip . unzip pi_pacsat.zip -d / sudo rm pi_pacsat.zip @@ -296,7 +298,8 @@ echo cat $DIREWOLF_CONF echo -direwolf -P+ -D1 -qd -dp -r 48000 -c $DIREWOLF_CONF -t 0 & +#direwolf -P+ -D1 -qd -dp -r 48000 -c $DIREWOLF_CONF -t 0 & +direwolf -qd -r 48000 -c $DIREWOLF_CONF & # arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 & ## arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 4000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 &