From 6280e60cfdd144c3ed19398a1115b9fcce616c43 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 20 Mar 2026 18:50:13 -0400 Subject: [PATCH] Update pacsat.sh only check for directory for that mode --- groundstation/pacsat.sh | 68 +++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 940cd020..a98f9145 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -92,9 +92,27 @@ if [ ! "$MODE" = "P" ] && [ ! "$loopback" = "1" ] ; then elif [ "$loopback" = "1" ] ; then - echo - echo "Simulated PacSatSim so mode doesn't matter" - echo + if [ ! "$MODE" = "p" ] + echo + echo "Switching to PacSat mode for the Simulated PacSat Satellite" + echo + /home/pi/CubeSatSim/config -G n + fi + +# if [ ! -d "/home/pi/PacSatGroundLoop" ] ; then + if [ ! "$loopback" = "1" ] ; then # don't do this for now. + + cd + sudo rm PacSatGroundLoop.zip &>/dev/null + wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p/spacecraft/PacSatGround_0.46o/PacSatGroundLoop.zip + unzip PacSatGroundLoop.zip -d PacSatGroundLoop + sudo rm PacSatGroundLoop.zip + + echo + echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign" + sleep 10 + + fi else @@ -102,6 +120,20 @@ else echo "Mode is PacSat Ground Station" echo + if [ ! -d "/home/pi/PacSatGround" ] ; then + + cd + sudo rm PacSatGround.zip &>/dev/null + wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p/spacecraft/PacSatGround_0.46o/PacSatGround.zip + unzip PacSatGround.zip -d PacSatGround + sudo rm PacSatGround.zip + + echo + echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign" + sleep 10 + + fi + fi value=`cat /home/pi/CubeSatSim/sim.cfg` @@ -117,34 +149,6 @@ echo -n "Transmit Frequency is " echo $frequency echo -if [ ! -d "/home/pi/PacSatGround" ] ; then - - cd - sudo rm PacSatGround.zip &>/dev/null - wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p/spacecraft/PacSatGround_0.46o/PacSatGround.zip - unzip PacSatGround.zip -d PacSatGround - sudo rm PacSatGround.zip - - echo - echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign" - sleep 10 - -fi - -if [ ! -d "/home/pi/PacSatGroundLoop" ] ; then - - cd - sudo rm PacSatGroundLoop.zip &>/dev/null - wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p/spacecraft/PacSatGround_0.46o/PacSatGroundLoop.zip - unzip PacSatGroundLoop.zip -d PacSatGroundLoop - sudo rm PacSatGroundLoop.zip - - echo - echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign" - sleep 10 - -fi - sudo sed -i "s/TNC_TX_DELAY=.*$/TNC_TX_DELAY=750/g" /home/pi/PacSatGround/PacSatGround.properties sudo sed -i "s/TNC_TX_DELAY=.*$/TNC_TX_DELAY=750/g" /home/pi/PacSatGroundLoop/PacSatGround.properties @@ -193,8 +197,6 @@ sudo usermod -a -G gpio pi if [ "$loopback" = "1" ] ; then - /home/pi/CubeSatSim/config -G n - echo "Using Audio Loopback" ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1" PTT="PTT GPIOD gpiochip0 17"