diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 5c118cdb..96fbef3b 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -2,7 +2,14 @@ # script to auto decode packet using rtl_fm and Direwolf and run Pacsat Ground Station -if [ ! -d "/home/pi/PacSatGround" ]; then +loopback=0 +if [ "$1" = "l" ] ; then + + loopback=1 + +fi + +if [ ! -d "/home/pi/PacSatGround" ] ; then mkdir /home/pi/PacSatGround @@ -13,6 +20,20 @@ if [ ! -d "/home/pi/PacSatGround" ]; then fi +value=`cat /home/pi/CubeSatSim/sim.cfg` +echo "$value" > /dev/null +set -- $value + +callsign="$1" + +oldcallsign=$(grep -oP '(?<=callsign=).*(?=-)' /home/pi/PacSatGround/PacSatGround.properties) + +if [ ! "$callsign" = "$oldcallsign" ] + + sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties + +fi + sudo modprobe snd-aloop #sudo systemctl stop cubesatsim >/dev/null 2>&1 @@ -90,15 +111,17 @@ echo sudo usermod -a -G gpio pi -if [ ! "$1" = "l" ]; then +if [ "$loopback" = "1" ]; then #/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-df.sh" - echo "Using TXC FM transceiver" - /home/pi/CubeSatSim/groundstation/pacsat-df.sh & -else - echo "Using audio loopback" + echo "Using Audio Loopback" /home/pi/CubeSatSim/groundstation/pacsat-d.sh & +else + + echo "Using TXC FM Transceiver" + /home/pi/CubeSatSim/groundstation/pacsat-df.sh & + fi # 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 435045 &