From e046477303d7f48cb326ee16137c2a3d1b5c5e0d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 13 Mar 2026 16:57:18 -0400 Subject: [PATCH 01/70] Update config for -o start and stop pacsatsim --- config | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/config b/config index 73eae931..7d0ed195 100755 --- a/config +++ b/config @@ -1139,8 +1139,9 @@ elif [ "$1" = "-o" ]; then value=`cat /home/pi/CubeSatSim/.mode` echo "$value" > /dev/null set -- $value + MODE=$1 - if [ "$1" == "n" ]; then + if [ "$MODE" == "n" ]; then transmit_command "o" @@ -1151,34 +1152,27 @@ 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 - - reset="y" + echo "Transmit beacon telemetry is off" 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 restart transmit - # restart=1 + echo "Turn beacon telemetry ON" + sudo rm /home/pi/CubeSatSim/beacon_off > /dev/null 2>&1 + sudo systemctl restart transmit + if [ "$MODE" = "p" ]; then + sudo systemctl restart pacsatsim fi else - echo "Transmit beacon telemetry is on" -# echo -# echo "Do you want to turn beacon telemetry OFF (y/n) " -# read reset - reset="y" + echo "Transmit beacon telemetry is on" echo - if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then - echo "Turn beacon telemetry OFF" - touch /home/pi/CubeSatSim/beacon_off + echo "Turn beacon telemetry OFF" + touch /home/pi/CubeSatSim/beacon_off + if [ "$MODE" = "p" ]; then + sudo systemctl stop pacsatsim + sudo systemctl stop transmit + else sudo systemctl restart transmit - # restart=1 fi fi sleep 3 From 04b2b7be846a838b192587c5b35b297f4e389933 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 13 Mar 2026 17:27:56 -0400 Subject: [PATCH 02/70] Update transmit.py only do PacSat txLED if not safe mode --- transmit.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/transmit.py b/transmit.py index a1ac0991..c431b015 100644 --- a/transmit.py +++ b/transmit.py @@ -556,15 +556,18 @@ if __name__ == "__main__": print("0") while (True): - sleep(0.1) - while (input(ptt) != 0): - sleep(0.2) - output(txLed, 1) - print("1") - while (input(ptt) != 1): - sleep(0.2) - output(txLed, 0) - print("0") + if (txc): + sleep(0.1) + while (input(ptt) != 0): + sleep(0.2) + output(txLed, 1) + print("1") + while (input(ptt) != 1): + sleep(0.2) + output(txLed, 0) + print("0") + else: + sleep(10) else: print("Transmit APRS Commands") system("sudo systemctl stop command") From 22a9c75cdd3be0305e1819129e60f322b05875db Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 13 Mar 2026 17:42:49 -0400 Subject: [PATCH 03/70] Create pacsatsim-direwolf-pwm-loop.conf --- direwolf/pacsatsim-direwolf-pwm-loop.conf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 direwolf/pacsatsim-direwolf-pwm-loop.conf diff --git a/direwolf/pacsatsim-direwolf-pwm-loop.conf b/direwolf/pacsatsim-direwolf-pwm-loop.conf new file mode 100644 index 00000000..a459abac --- /dev/null +++ b/direwolf/pacsatsim-direwolf-pwm-loop.conf @@ -0,0 +1,21 @@ +#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Loopback,DEV=0 +ADEVICE shared_mic plughw:CARD=Headphones,DEV=0 +PTT GPIOD gpiochip0 -27 +MYCALL AMSAT-12 +CHANNEL 0 +MODEM 1200 +##FULLDUP ON +##TXDELAY 15 +#FIX_BITS 1 AX25 + +# +DWAIT 0 +SLOTTIME 10 +PERSIST 63 +TXDELAY 1000 +#TXDELAY 100 +TXTAIL 10 +#TXTAIL 1 +FULLDUP OFF + +DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$ TRACE From a5d8b49f38ab727cc9f3dd45506e0e840f30799d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 13 Mar 2026 17:59:33 -0400 Subject: [PATCH 04/70] Update pacsatsim.sh add safe mode --- pacsatsim.sh | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index bf489175..48826249 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -4,6 +4,8 @@ loopback=0 vox=0 +safe=0 + if [ "$1" = "l" ] ; then loopback=1 @@ -14,6 +16,13 @@ elif [ "$1" = "v" ] ; then fi +FILE=/home/pi/CubeSatSim/battery_saver +if [ -f "$FILE" ]; then + + safe=1 + +fi + if [ ! -d "/home/pi/PacSat" ]; then echo "Setting up PacSatSim default configuration" @@ -71,8 +80,6 @@ if [ ! "$callsign" = "$oldcallsign" ] ; then fi - - sudo /etc/init.d/alsa-utils stop sudo /etc/init.d/alsa-utils start @@ -141,25 +148,51 @@ echo sudo usermod -a -G gpio pi -if [ "$loopback" = "1" ]; then +if [ "$safe" = "1" ] ; then + + echo "Safe mode - battery saver" +# sudo /home/pi/CubeSatSim/pacsatsim-d.sh & + + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm-loopback.conf -t 0 & + + 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 & + + +elif [ "$loopback" = "1" ] ; then echo "Using audio loopback" - sudo /home/pi/CubeSatSim/pacsatsim-d.sh & +# sudo /home/pi/CubeSatSim/pacsatsim-d.sh & + + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & elif [ "$vox" = "1" ]; then echo "Using Soundcard Audio TX and RX (VOX)" - sudo /home/pi/CubeSatSim/pacsatsim-dj.sh & +# sudo /home/pi/CubeSatSim/pacsatsim-dj.sh & + + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14-half.conf -t 0 & else echo "Using TXC FM transceiver" - sudo /home/pi/CubeSatSim/pacsatsim-df.sh & +# sudo /home/pi/CubeSatSim/pacsatsim-df.sh & + + pwm=1 + + if [ "$pwm" = "1" ] ; then + + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm.conf -t 0 & + + else + + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & + + fi 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 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 & +## 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 & ## echo "Don't close the direwolf window or the Pacsatsim will stop running." From 7072f03327f715a7db4494c211bfdbf793d71249 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 10:48:20 -0400 Subject: [PATCH 05/70] Rename pacsatsim-direwolf-pwm-loop.conf to pacsatsim-direwolf-pwm-loopback.conf --- ...irewolf-pwm-loop.conf => pacsatsim-direwolf-pwm-loopback.conf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename direwolf/{pacsatsim-direwolf-pwm-loop.conf => pacsatsim-direwolf-pwm-loopback.conf} (100%) diff --git a/direwolf/pacsatsim-direwolf-pwm-loop.conf b/direwolf/pacsatsim-direwolf-pwm-loopback.conf similarity index 100% rename from direwolf/pacsatsim-direwolf-pwm-loop.conf rename to direwolf/pacsatsim-direwolf-pwm-loopback.conf From 3b6daedb490fa399470175b3c935620d5448cb9e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 10:50:05 -0400 Subject: [PATCH 06/70] Rename pacsatsim-direwolf-pwm-loopback.conf to direwolf-pacsatsim-pwm-loopback.conf --- ...olf-pwm-loopback.conf => direwolf-pacsatsim-pwm-loopback.conf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename direwolf/{pacsatsim-direwolf-pwm-loopback.conf => direwolf-pacsatsim-pwm-loopback.conf} (100%) diff --git a/direwolf/pacsatsim-direwolf-pwm-loopback.conf b/direwolf/direwolf-pacsatsim-pwm-loopback.conf similarity index 100% rename from direwolf/pacsatsim-direwolf-pwm-loopback.conf rename to direwolf/direwolf-pacsatsim-pwm-loopback.conf From aad8a8c77a3b7d0876265f737bcfa825e4d575c8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 10:51:43 -0400 Subject: [PATCH 07/70] Update direwolf-pacsatsim-pwm-loopback.conf add loopback --- direwolf/direwolf-pacsatsim-pwm-loopback.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-pwm-loopback.conf b/direwolf/direwolf-pacsatsim-pwm-loopback.conf index a459abac..2dc8d9eb 100644 --- a/direwolf/direwolf-pacsatsim-pwm-loopback.conf +++ b/direwolf/direwolf-pacsatsim-pwm-loopback.conf @@ -1,5 +1,4 @@ -#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Loopback,DEV=0 -ADEVICE shared_mic plughw:CARD=Headphones,DEV=0 +ADEVICE shared_mic plughw:CARD=Loopback,DEV=0 PTT GPIOD gpiochip0 -27 MYCALL AMSAT-12 CHANNEL 0 From f907b83a18ba002dd1aa3cc27e8d05d3c955f68f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 11:13:09 -0400 Subject: [PATCH 08/70] Update direwolf-pacsatsim-pwm-loopback.conf ptt to 27 --- direwolf/direwolf-pacsatsim-pwm-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-pwm-loopback.conf b/direwolf/direwolf-pacsatsim-pwm-loopback.conf index 2dc8d9eb..87a3ee6a 100644 --- a/direwolf/direwolf-pacsatsim-pwm-loopback.conf +++ b/direwolf/direwolf-pacsatsim-pwm-loopback.conf @@ -1,5 +1,5 @@ ADEVICE shared_mic plughw:CARD=Loopback,DEV=0 -PTT GPIOD gpiochip0 -27 +PTT GPIOD gpiochip0 27 MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 From 418ee8dcc418a77d3df3e9816455e6f93e36e947 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 11:45:03 -0400 Subject: [PATCH 09/70] Update direwolf-pacsatsim-pwm-loopback.conf gpis 17 for PTT (need jumper) --- direwolf/direwolf-pacsatsim-pwm-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-pwm-loopback.conf b/direwolf/direwolf-pacsatsim-pwm-loopback.conf index 87a3ee6a..0d4d022d 100644 --- a/direwolf/direwolf-pacsatsim-pwm-loopback.conf +++ b/direwolf/direwolf-pacsatsim-pwm-loopback.conf @@ -1,5 +1,5 @@ ADEVICE shared_mic plughw:CARD=Loopback,DEV=0 -PTT GPIOD gpiochip0 27 +PTT GPIOD gpiochip0 17 MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 From 2e66c5e80410dc08e9c0692b41d0ff8b4373e3d6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 11:52:14 -0400 Subject: [PATCH 10/70] Update transmit.py add start/stop rpitx --- transmit.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/transmit.py b/transmit.py index c431b015..f68fc3da 100644 --- a/transmit.py +++ b/transmit.py @@ -554,7 +554,8 @@ if __name__ == "__main__": # system("sudo systemctl restart pacsatsim") output(txLed, 0) print("0") - + rpitx = "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 &" + stop_rpitx = "sudo killall -9 rpitx" while (True): if (txc): sleep(0.1) @@ -567,8 +568,19 @@ if __name__ == "__main__": output(txLed, 0) print("0") else: - sleep(10) - else: +# sleep(0.1) + while (input(17) == 0): + sleep(0.05) + system(rpitx) +# print("1") + while (input(17) -= 1): + sleep(0.05) + system(stop_rpitx) +# print("0") + +# sleep(10) + + else: print("Transmit APRS Commands") system("sudo systemctl stop command") # while True: From 698cb0646f3ae777a4c1c7949af080e248d1e9f9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 11:53:50 -0400 Subject: [PATCH 11/70] Update transmit.py typo --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index f68fc3da..e84e2388 100644 --- a/transmit.py +++ b/transmit.py @@ -573,7 +573,7 @@ if __name__ == "__main__": sleep(0.05) system(rpitx) # print("1") - while (input(17) -= 1): + while (input(17) == 1): sleep(0.05) system(stop_rpitx) # print("0") From edada6e8b93bef851dd299c2a559e029b8209e54 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 11:55:34 -0400 Subject: [PATCH 12/70] Update transmit.py indent fix --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index e84e2388..10696468 100644 --- a/transmit.py +++ b/transmit.py @@ -580,7 +580,7 @@ if __name__ == "__main__": # sleep(10) - else: + else: print("Transmit APRS Commands") system("sudo systemctl stop command") # while True: From da0f8f6301d667b825c1c083c8631665efcf8e45 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 11:58:57 -0400 Subject: [PATCH 13/70] Update transmit.py kill arecord too --- transmit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 10696468..9d3342fc 100644 --- a/transmit.py +++ b/transmit.py @@ -555,7 +555,8 @@ if __name__ == "__main__": output(txLed, 0) print("0") rpitx = "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 &" - stop_rpitx = "sudo killall -9 rpitx" + stop_rpitx = "sudo killall -9 rpitx && sudo killall -9 arecord" + system(stop_rpitx) while (True): if (txc): sleep(0.1) From 2b01295c5475df29cba93584dd61c82347228006 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 12:03:48 -0400 Subject: [PATCH 14/70] Update transmit.py rerun rpitx to stop it --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 9d3342fc..45f4af1b 100644 --- a/transmit.py +++ b/transmit.py @@ -555,7 +555,7 @@ if __name__ == "__main__": output(txLed, 0) print("0") rpitx = "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 &" - stop_rpitx = "sudo killall -9 rpitx && sudo killall -9 arecord" + stop_rpitx = "sudo killall -9 rpitx && sudo killall -9 arecord && sudo rpitx -m RF -f 434.9e3" system(stop_rpitx) while (True): if (txc): From 3ad7cdb6f9bc9e4127711a2b3ebf7ba566a93619 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 14:20:36 -0400 Subject: [PATCH 15/70] Update pacsatsim.sh safe mode read frequency from sim.cfg --- pacsatsim.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 48826249..d0d08592 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -58,6 +58,7 @@ echo "$value" > /dev/null set -- $value callsign="$1" +frequency="$7e3" echo "Configured callsign is " echo $callsign @@ -155,7 +156,8 @@ if [ "$safe" = "1" ] ; then direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm-loopback.conf -t 0 & - 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 & +# 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 & + 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 $frequency & elif [ "$loopback" = "1" ] ; then From f5b12239a871d68dbe057459bedb1be68881da4a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 14:28:04 -0400 Subject: [PATCH 16/70] Update transmit.py for safe mode, use sim.cfg frequency --- transmit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transmit.py b/transmit.py index 45f4af1b..520d3212 100644 --- a/transmit.py +++ b/transmit.py @@ -26,7 +26,7 @@ def input(pin): # print(f"Command run was: {query}") # print("Sucess!") # print(f"Output of the command (stdout): {result.stdout}") - print(f"{command}: {result.stdout}") +# print(f"{command}: {result.stdout}") return int(result.stdout) except subprocess.CalledProcessError as e: # print(f"Command failed with return code: {e.returncode}") @@ -554,8 +554,8 @@ if __name__ == "__main__": # system("sudo systemctl restart pacsatsim") output(txLed, 0) print("0") - rpitx = "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 &" - stop_rpitx = "sudo killall -9 rpitx && sudo killall -9 arecord && sudo rpitx -m RF -f 434.9e3" + rpitx = "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 " + rx + "e3 > /dev/null 2>&1 &" + stop_rpitx = "sudo killall -9 rpitx && sudo killall -9 arecord && sudo rpitx -m RF -f 434.9e3 > /dev/null 2>&1" system(stop_rpitx) while (True): if (txc): From fb52cee8b8eaf2b233e4a550f2123174c20a3fe6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 14:29:01 -0400 Subject: [PATCH 17/70] Update pacsatsim.sh remove arecord and rpitx --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index d0d08592..5cf2da1a 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -157,7 +157,7 @@ if [ "$safe" = "1" ] ; then direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm-loopback.conf -t 0 & # 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 & - 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 $frequency & +# 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 $frequency & elif [ "$loopback" = "1" ] ; then From 6f0b5ad64127b3c0bb3bc61f70cd13fbdf1c4d97 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 14:43:26 -0400 Subject: [PATCH 18/70] Update transmit.py change to tx --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 520d3212..d5f180f2 100644 --- a/transmit.py +++ b/transmit.py @@ -4,7 +4,7 @@ import time from time import sleep #import os -import sys +import system from os import system from os import path from PIL import Image, ImageDraw, ImageFont, ImageColor @@ -554,7 +554,7 @@ if __name__ == "__main__": # system("sudo systemctl restart pacsatsim") output(txLed, 0) print("0") - rpitx = "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 " + rx + "e3 > /dev/null 2>&1 &" + rpitx = "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 " + tx + "e3 > /dev/null 2>&1 &" stop_rpitx = "sudo killall -9 rpitx && sudo killall -9 arecord && sudo rpitx -m RF -f 434.9e3 > /dev/null 2>&1" system(stop_rpitx) while (True): From 344da1ae49fdb3ee386c58b086f4a514eac449df Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 14:43:48 -0400 Subject: [PATCH 19/70] Update transmit.py fix sys --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index d5f180f2..56d62236 100644 --- a/transmit.py +++ b/transmit.py @@ -5,7 +5,7 @@ import time from time import sleep #import os import system -from os import system +from os import sys from os import path from PIL import Image, ImageDraw, ImageFont, ImageColor import serial From a85fa3d797847e91989a5f832f1dcff72c2963cf Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 14:56:00 -0400 Subject: [PATCH 20/70] Update transmit.py change back to sys --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 56d62236..189f4f97 100644 --- a/transmit.py +++ b/transmit.py @@ -4,7 +4,7 @@ import time from time import sleep #import os -import system +import sys from os import sys from os import path from PIL import Image, ImageDraw, ImageFont, ImageColor From 657e82899d19f0a819128419e7404f5e54b141ae Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 14 Mar 2026 14:57:12 -0400 Subject: [PATCH 21/70] Update transmit.py fix system --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 189f4f97..b6ac4475 100644 --- a/transmit.py +++ b/transmit.py @@ -5,7 +5,7 @@ import time from time import sleep #import os import sys -from os import sys +from os import system from os import path from PIL import Image, ImageDraw, ImageFont, ImageColor import serial From 4a9811ec945894cda37d20324086055dc06ff720 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 10:43:46 -0400 Subject: [PATCH 22/70] Update transmit.py don't stop and start rpitx --- transmit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index b6ac4475..13c66910 100644 --- a/transmit.py +++ b/transmit.py @@ -557,6 +557,7 @@ if __name__ == "__main__": rpitx = "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 " + tx + "e3 > /dev/null 2>&1 &" stop_rpitx = "sudo killall -9 rpitx && sudo killall -9 arecord && sudo rpitx -m RF -f 434.9e3 > /dev/null 2>&1" system(stop_rpitx) + system(rpitx) while (True): if (txc): sleep(0.1) @@ -572,11 +573,11 @@ if __name__ == "__main__": # sleep(0.1) while (input(17) == 0): sleep(0.05) - system(rpitx) +## system(rpitx) # print("1") while (input(17) == 1): sleep(0.05) - system(stop_rpitx) +## system(stop_rpitx) # print("0") # sleep(10) From 85fed02a784a9d6f1aa67f9699cd64bf9eac0378 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 10:50:15 -0400 Subject: [PATCH 23/70] Update direwolf-pacsatsim.conf to common settings --- direwolf/direwolf-pacsatsim.conf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/direwolf/direwolf-pacsatsim.conf b/direwolf/direwolf-pacsatsim.conf index 87f09de1..c80de461 100644 --- a/direwolf/direwolf-pacsatsim.conf +++ b/direwolf/direwolf-pacsatsim.conf @@ -1,6 +1,10 @@ -ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 -PTT GPIO 20 -MYCALL AMSAT +MYCALL AMSAT-1 # was -12 CHANNEL 0 MODEM 1200 +DWAIT 0 +SLOTTIME 10 +PERSIST 63 +TXDELAY 1000 +TXTAIL 10 FULLDUP OFF +DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$ TRACE From 41c74f422c5ebb413791f2efad9e9007538032c6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 10:56:59 -0400 Subject: [PATCH 24/70] Update pacsatsim.sh use direwolf template to create conf --- pacsatsim.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index 5cf2da1a..e7088bcf 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -149,11 +149,15 @@ echo sudo usermod -a -G gpio pi + if [ "$safe" = "1" ] ; then echo "Safe mode - battery saver" # sudo /home/pi/CubeSatSim/pacsatsim-d.sh & + ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0" + PTT="PTT GPIOD gpiochip0 17" + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm-loopback.conf -t 0 & # 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 & @@ -193,6 +197,16 @@ else fi +echo "$ADEVICE" > /home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf +echo "$PTT" >> /home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf +cat /home/pi/CubeSatSim/direwolf-pacsatsim.conf >> /home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf + +echo +echo "direwolf-pacsatsim-tmp.conf" +echo +cat /home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf +echo + # 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 & From 8348da54e98b8d10c5109c455d55e044b47a31ca Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 11:00:46 -0400 Subject: [PATCH 25/70] Update pacsatsim.sh fix file names --- pacsatsim.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index e7088bcf..f12f7d84 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -197,14 +197,16 @@ else fi -echo "$ADEVICE" > /home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf -echo "$PTT" >> /home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf -cat /home/pi/CubeSatSim/direwolf-pacsatsim.conf >> /home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf +DIREWOLF_CONF="/home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf" + +echo "$ADEVICE" > $DIREWOLF_CONF +echo "$PTT" >> $DIREWOLF_CONF +cat /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim.conf >> $DIREWOLF_CONF echo -echo "direwolf-pacsatsim-tmp.conf" +echo "$DIREWOLF_CONF" echo -cat /home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf +cat $DIREWOLF_CONF echo # 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 & From dcdc203e1f58959097d0bd4cf31f6faec8c37b63 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 11:03:48 -0400 Subject: [PATCH 26/70] Update pacsatsim.sh add configured callsign --- pacsatsim.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index f12f7d84..6fe6b541 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -200,6 +200,7 @@ fi DIREWOLF_CONF="/home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf" echo "$ADEVICE" > $DIREWOLF_CONF +echo "MYCALL $callsign-1" >> $DIREWOLF_CONF echo "$PTT" >> $DIREWOLF_CONF cat /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim.conf >> $DIREWOLF_CONF From 70220236d6fde5ff0b6a495bb67efa151d225980 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 11:04:22 -0400 Subject: [PATCH 27/70] Update direwolf-pacsatsim.conf remove callsign --- direwolf/direwolf-pacsatsim.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim.conf b/direwolf/direwolf-pacsatsim.conf index c80de461..b96fc68f 100644 --- a/direwolf/direwolf-pacsatsim.conf +++ b/direwolf/direwolf-pacsatsim.conf @@ -1,4 +1,3 @@ -MYCALL AMSAT-1 # was -12 CHANNEL 0 MODEM 1200 DWAIT 0 From b4adf4d0591cad9022ebc1a0ec1d4aeadf036d96 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 11:07:58 -0400 Subject: [PATCH 28/70] Update pacsatsim.sh move direwolf call --- pacsatsim.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 6fe6b541..65edc986 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -158,7 +158,7 @@ if [ "$safe" = "1" ] ; then ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0" PTT="PTT GPIOD gpiochip0 17" - direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm-loopback.conf -t 0 & +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm-loopback.conf -t 0 & # 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 & # 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 $frequency & @@ -210,6 +210,8 @@ echo cat $DIREWOLF_CONF echo +direwolf -P+ -D1 -qd -dp -r 48000 -c $DIREWOLF_CONF -t 0 & + # 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 & From 0d8355d0181b7cc5012f29fce9d9f81d52ec32ea Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 11:13:56 -0400 Subject: [PATCH 29/70] Update pacsatsim.sh add pwm --- pacsatsim.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 65edc986..9ec4bd20 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -187,7 +187,10 @@ else if [ "$pwm" = "1" ] ; then - direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm.conf -t 0 & + ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0" + PTT="PTT GPIOD gpiochip0 -20" + +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm.conf -t 0 & else From 836ec52844131ab6dc5390a7390e8ac686d56686 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 11:18:02 -0400 Subject: [PATCH 30/70] Update transmit.py don't stop start rpitx unless safe mode --- transmit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 13c66910..32e89afa 100644 --- a/transmit.py +++ b/transmit.py @@ -556,8 +556,9 @@ if __name__ == "__main__": print("0") rpitx = "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 " + tx + "e3 > /dev/null 2>&1 &" stop_rpitx = "sudo killall -9 rpitx && sudo killall -9 arecord && sudo rpitx -m RF -f 434.9e3 > /dev/null 2>&1" - system(stop_rpitx) - system(rpitx) + if not txc: + system(stop_rpitx) + system(rpitx) while (True): if (txc): sleep(0.1) From 288e4b47abdb5839b108f7b47ef995888b05feaf Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 11:36:27 -0400 Subject: [PATCH 31/70] Update pacsatsim.sh add soundcard mode --- pacsatsim.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 9ec4bd20..50b9d975 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -183,10 +183,11 @@ else echo "Using TXC FM transceiver" # sudo /home/pi/CubeSatSim/pacsatsim-df.sh & - pwm=1 + #pwm=1 if [ "$pwm" = "1" ] ; then - + + echo "Using Soundcard input (JP13), PWM output" ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0" PTT="PTT GPIOD gpiochip0 -20" @@ -194,7 +195,10 @@ else else - direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & + echo "Using Soundcard input (JP13) and output (JP14)" + ADEVICE="ADEVICE shared_mic plughw:CARD=Device,DEV=0" + PTT="PTT GPIOD gpiochip0 -20" +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & fi From 2941a55e61ebd8be8973b6e8cbfa8133548cfb0c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 11:42:35 -0400 Subject: [PATCH 32/70] Update pacsatsim.sh back to pwm --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 50b9d975..49d07f06 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -183,7 +183,7 @@ else echo "Using TXC FM transceiver" # sudo /home/pi/CubeSatSim/pacsatsim-df.sh & - #pwm=1 + pwm=1 if [ "$pwm" = "1" ] ; then From 85ea8724ba4b8ce50dfa4641c6b82509dcec47eb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 11:51:08 -0400 Subject: [PATCH 33/70] Update pacsatsim.sh add vox and pwm set by parameters --- pacsatsim.sh | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 49d07f06..8b42d752 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -5,6 +5,8 @@ loopback=0 vox=0 safe=0 +card=0 +pwm=0 if [ "$1" = "l" ] ; then @@ -13,6 +15,14 @@ if [ "$1" = "l" ] ; then elif [ "$1" = "v" ] ; then vox=1 + +elif [ "$1" = "c" ] ; then + + card=1 + +else + + pwm=1 fi @@ -173,35 +183,28 @@ elif [ "$loopback" = "1" ] ; then elif [ "$vox" = "1" ]; then - echo "Using Soundcard Audio TX and RX (VOX)" + echo "Using Soundcard Audio TX and RX (VOX, no PTT)" + ADEVICE="ADEVICE plughw:CARD=Device,DEV=0" + PTT="PTT GPIOD gpiochip0 17" # sudo /home/pi/CubeSatSim/pacsatsim-dj.sh & - direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14-half.conf -t 0 & +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14-half.conf -t 0 & -else - - echo "Using TXC FM transceiver" -# sudo /home/pi/CubeSatSim/pacsatsim-df.sh & - - pwm=1 - - if [ "$pwm" = "1" ] ; then +elif [ "$pwm" = "1" ] ; then - echo "Using Soundcard input (JP13), PWM output" + echo "FM TXC using Soundcard input (JP13), PWM output" ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0" PTT="PTT GPIOD gpiochip0 -20" # direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm.conf -t 0 & - else +else - echo "Using Soundcard input (JP13) and output (JP14)" + echo "FM TXC using Soundcard input (JP13) and output (JP14)" ADEVICE="ADEVICE shared_mic plughw:CARD=Device,DEV=0" PTT="PTT GPIOD gpiochip0 -20" # direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & - fi - fi DIREWOLF_CONF="/home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf" From cdf9ec99b3268764ef2a5fdc0fc5b48da627f032 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 15:39:22 -0400 Subject: [PATCH 34/70] Update pacsatsim.sh loopback changes --- pacsatsim.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 8b42d752..54ef4c89 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -159,8 +159,17 @@ echo sudo usermod -a -G gpio pi +if [ "$loopback" = "1" ] ; then -if [ "$safe" = "1" ] ; then + echo "Using audio loopback" + ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=0" + PTT="PTT GPIOD gpiochip0 17" + +# sudo /home/pi/CubeSatSim/pacsatsim-d.sh & + +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + +elif [ "$safe" = "1" ] ; then echo "Safe mode - battery saver" # sudo /home/pi/CubeSatSim/pacsatsim-d.sh & @@ -174,13 +183,6 @@ if [ "$safe" = "1" ] ; then # 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 $frequency & -elif [ "$loopback" = "1" ] ; then - - echo "Using audio loopback" -# sudo /home/pi/CubeSatSim/pacsatsim-d.sh & - - direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & - elif [ "$vox" = "1" ]; then echo "Using Soundcard Audio TX and RX (VOX, no PTT)" From 21b9687ddbebe11ee2a1d70985c5890fd154f51c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 15:45:19 -0400 Subject: [PATCH 35/70] Update direwolf-pacsat.conf default pacsat conf --- groundstation/direwolf/direwolf-pacsat.conf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/groundstation/direwolf/direwolf-pacsat.conf b/groundstation/direwolf/direwolf-pacsat.conf index e526e272..3b9d337b 100644 --- a/groundstation/direwolf/direwolf-pacsat.conf +++ b/groundstation/direwolf/direwolf-pacsat.conf @@ -1,5 +1,9 @@ -MYCALL AMSAT -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 -PTT GPIO 20 +CHANNEL 0 +MODEM 1200 KISSPORT 8100 +AGWPORT 8002 +DWAIT 20 +SLOTTIME 300 +PERSIST 63 +TXDELAY 1000 FULLDUP OFF From 0dd73605ea05e455802d11a995d25bf60d93f7c3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 15:55:22 -0400 Subject: [PATCH 36/70] Update pacsat.sh update to using default direwolf conf --- groundstation/pacsat.sh | 52 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 9ffc9657..d4ff81ed 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -16,6 +16,26 @@ elif [ "$1" = "v" ] ; then fi +FILE=/home/pi/CubeSatSim/battery_saver +if [ -f "$FILE" ]; then + + safe=1 + +fi + +value=`cat /home/pi/CubeSatSim/sim.cfg` +echo "$value" > /dev/null +set -- $value + +callsign="$1" +frequency="$7e3" + +echo -n "Callsign is " +echo $callsign +echo -n "Transmit Frequency is " +echo $frequency +echo + if [ ! -d "/home/pi/PacSatGround" ] ; then mkdir /home/pi/PacSatGround @@ -132,10 +152,40 @@ elif [ "$vox" = "1" ]; then else echo "Using TXC FM Transceiver" - /home/pi/CubeSatSim/groundstation/pacsat-df.sh & + pwm=1 +# /home/pi/CubeSatSim/groundstation/pacsat-df.sh & + + if [ "$pwm" = "1" ] ; then + +# direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf -t 0 & + + echo "FM TXC using Soundcard input (JP13), PWM output" + ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0" + PTT="PTT GPIOD gpiochip0 -20" + + else + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 & + + fi fi +DIREWOLF_CONF="/home/pi/CubeSatSim/groundstation/direwolf-pacsat-tmp.conf" + +echo "$ADEVICE" > $DIREWOLF_CONF +echo "MYCALL $callsign-1" >> $DIREWOLF_CONF +echo "$PTT" >> $DIREWOLF_CONF +cat /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf >> $DIREWOLF_CONF + +echo +echo "$DIREWOLF_CONF" +echo +cat $DIREWOLF_CONF +echo + +direwolf -r 48000 -c $DIREWOLF_CONF -t 0 & + # 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 & ##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 435045 & From 4ebdc99d773ed632793f45fc8383f8ec91a73645 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 16:12:46 -0400 Subject: [PATCH 37/70] Update pacsat.sh add loopback --- groundstation/pacsat.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index d4ff81ed..215c52a0 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -142,7 +142,12 @@ if [ "$loopback" = "1" ]; then #/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-df.sh" echo "Using Audio Loopback" - /home/pi/CubeSatSim/groundstation/pacsat-d.sh & +# /home/pi/CubeSatSim/groundstation/pacsat-d.sh & + +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 + + ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1" + PTT="PTT GPIOD gpiochip0 17" elif [ "$vox" = "1" ]; then From fef665ee8f4e41a904e6e056447da2840c4e5bd9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 16:21:06 -0400 Subject: [PATCH 38/70] Update transmit.py add safe mode txLed on/off --- transmit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 32e89afa..d7d8ea5e 100644 --- a/transmit.py +++ b/transmit.py @@ -565,20 +565,22 @@ if __name__ == "__main__": while (input(ptt) != 0): sleep(0.2) output(txLed, 1) - print("1") +# print("1") while (input(ptt) != 1): sleep(0.2) output(txLed, 0) - print("0") +# print("0") else: # sleep(0.1) while (input(17) == 0): sleep(0.05) ## system(rpitx) + output(txLed, 1) # print("1") while (input(17) == 1): sleep(0.05) ## system(stop_rpitx) + output(txLed, 0) # print("0") # sleep(10) From 5b961fc5582e744ac3f30f546e74547e6e59da13 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 17:39:33 -0400 Subject: [PATCH 39/70] Update install bookworm vnc and desktop execute --- install | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install b/install index 2492d91e..74a10384 100755 --- a/install +++ b/install @@ -170,6 +170,8 @@ if [[ $(grep 'bookworm' /etc/os-release) ]]; then # sudo sed -i 's/maxcpus=2/maxcpus=1/g' /boot/firmware/cmdline.txt # single core if Pi Zero 2 sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/firmware/config.txt + + sudo sed -i 's/#dtoverlay=vc4-fkms-v3d/dtoverlay=vc4-fkms-v3d/g' /boot/firmware/config.txt if [[ $(grep 'dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24' /boot/firmware/config.txt) ]]; then echo "dtoverlay=i2c-gpio already in /boot/firmware/config.txt" @@ -813,6 +815,10 @@ cd #fi +sed -i 's/quick_exec=0/quick_exec=1/' ~/.config/libfm/libfm.conf + +sudo apt install -y raspberrypi-ui-mods + if [ "$noreboot" = "0" ] ; then if [ $FLAG -eq 1 ]; then # Not sure if this is needed From a09d1aea2a344f111cb0058ae3c83593542be067 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 17:45:07 -0400 Subject: [PATCH 40/70] Update transmit.py add Safe Mode print --- transmit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index d7d8ea5e..ac8c42b1 100644 --- a/transmit.py +++ b/transmit.py @@ -558,7 +558,8 @@ if __name__ == "__main__": stop_rpitx = "sudo killall -9 rpitx && sudo killall -9 arecord && sudo rpitx -m RF -f 434.9e3 > /dev/null 2>&1" if not txc: system(stop_rpitx) - system(rpitx) + system(rpitx) + print("Safe Mode!") while (True): if (txc): sleep(0.1) From 623c181effde9d8e4943864934f4e269d9e7194c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 15 Mar 2026 18:03:36 -0400 Subject: [PATCH 41/70] Update .gitignore add tmp conf files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 04810931..acb007e4 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,6 @@ logt.txt telem.txt.bk failure_mode.txt sim_mode_auto +direwolf-pacsatsim-tmp.conf +groundstation/direwolf-pacsat-tmp.conf +tlm.bin From 60d11e78d79c7070a1cff5ff98aa622044a9335a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 08:58:50 -0600 Subject: [PATCH 42/70] directory preloaded with PacSatSim --- spacecraft/PacSatGround_0.46o/PacSatGround.zip | Bin 0 -> 3076 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 spacecraft/PacSatGround_0.46o/PacSatGround.zip diff --git a/spacecraft/PacSatGround_0.46o/PacSatGround.zip b/spacecraft/PacSatGround_0.46o/PacSatGround.zip new file mode 100644 index 0000000000000000000000000000000000000000..1ed803547071145536dee3358a256583ad2daf27 GIT binary patch literal 3076 zcmb7`3pkT|9LHbgl5~1hb8vF2W-6K6$?Y5`Q_6jWagbt0>tHkUgmOx59k-gO5IR;i zYL#$Y!l+b^)5WbMiKD1==02e~?`sFMSx(#Yf44n*_WAz)zu))${%3Cu6I%&Dk9sW0 zWA@E|mu~CWZw1XgNDc0k8~(GQtjUg@j52B4Tf005E&82QhH)hbw?5 zAZARhQrcP+06u|VBlt1AOcaSsB;m;v0zP<_P6x@Uf^_^|TVjtYymCb2ba*HH2RjyG zwcQ77tG>*CL?XAed-W)%$H3sNt> ztw9?0h7{X%G=c^G$BtlW(5 zNM(jfVx@Lc#hrEN>Ea`+W1o7snbvvVi`Q%zrjN#WVpgP7jp$9s$K@6wVaA`N>s#q6Q*fNjRrErveeydwd89}>|Ta}L_EuiAz>tmbkgvw zlXI-UT%7CheHO7v)W})ag}rks^W=G_?dQNDd0}7Sg z+GSQ^BYVu;DqKJcwxcZ#@2-^^{hHb^n7>I~rPvji!o{)UJ zwYzOx`LWGN{)1;jK*&_ix1%s00yQ==&`h~9WjCYOk3IxsiIs{s7AJe2IwNDxI@S}% zj1kSj61(yl*#T+SR1)M=0tbrpYm6UpLS%xQIHt$y=ws?*Vtrm?{*>K=pG~r{Vun(Q5^{ZT<1gHgxvo{=chN9`uc&?ByepK4)h_A@i+>R9ES4oo;N-uzz269 zIU8A0b`p)$)KlMHhG1=W)-q%<5Zl#MHSZKMHWxOj7nMbeh{~tS%WsXBM>MA0ZZ(-s zBYPTc{2;n3i-h(5IoFe5>6@(VVQ$`|_B{Rmx;|Y!?Qq>2a6jy2Ec|#P%1?wU3oJCH zfv+h_!uQ~0W4p_Y+nQ{!a%k~YFB~f*6rf&nu`ZZhD1uMuY;V4rj$E#2P{Us5|MLs^ zngZwN2UAEWA1}&mwSizCpe3{y5N*S&7o#GeMW7`}!v`%#(_Uz8IbU(|0>zQMaCjWq z%a_6(Rs>jF=+Xsp6C5JCOa)f$0IP$6DZcFsL~fXabK_5PNCjGaZP-V(wT9`)#12fz zN}IgUDzw@Vm&;tS_3v<%oAt%(D=eR;|5h^7*}_zaXoZ$9}N?Q`m%q-9|Gr0YJW>$pXqkE+HtinT-)a?nPs zk@39#wt-yFs+KFKuB4M6oIQH1U?NUGHL)o6O-fFF9R0AX$+a>6f{a+Lk@B@4w13RR z{dsffC2P7+Pxn%d#eNI73T^$!B>(1d!$v!$8zP(&r}LYc7OV?4?BFQBTB&Y*rQ@fz znHOpP8Vj!t6V*xT%t#J0CBKsgG*cV2$0Ig&zfyQzt)Zfra{htgpxu59ktkQtr&)Z^ zBP`Ip_(+%HM}N*L{g?x}FlD>ovotk$TaN<^S)NOlz`Siy=uI&HlqB1(A9-nGFn(WD zzofmjh^R75*m*4vx(Ry70RNz&SKgBroV_^r^yZrg7b)!Q<{}}RUW(kqkL2Yqnm?$t zM40gwFBrbO#Sen6%oD+gZATB0U zXf8WJi6wJ$Vaogx2w+YE+Kb0>67xCw^-9P^N)^i~@nq`qT7rqnyQ}ZS`5HH$uONBJ zY+dM=V7hY2Tnir*AkSs(@?^oFovRrdcBufF#1p$9eTgvSz4Zh`m$z;y3I2{O(C60Mg*o6rAWaN$AtRrWxQd literal 0 HcmV?d00001 From 10b7a28ee9dc4bef3c95a1df89a743dc6ab802bd Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 11:03:02 -0400 Subject: [PATCH 43/70] Update pacsat-config.sh download preloaded PacSatGround --- groundstation/pacsat-config.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 6a2ce55c..352396b4 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -152,6 +152,11 @@ sudo killall -9 direwolf &>/dev/null if [ "$ANS" = "1" ] ; then sudo rm -r /home/pi/PacSatGround + cd + sudo rm PacSatGround.zip + wget https://github.com/alanbjohnston/CubeSatSim/raw/60d11e78d79c7070a1cff5ff98aa622044a9335a/spacecraft/PacSatGround_0.46o/PacSatGround.zip + unzip PacSatGround.zip + sudo rm PacSatGround.zip else sudo rm -r /home/pi/PacSatGroundLoop fi From d720f030552ef7a8ad9dcfab80fdadaa9c8a2f85 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 11:48:02 -0400 Subject: [PATCH 44/70] Update transmit.py if beacon on, restart pacsatsim --- transmit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index ac8c42b1..fffd0909 100644 --- a/transmit.py +++ b/transmit.py @@ -551,7 +551,8 @@ if __name__ == "__main__": print("Pacsat Ground Station") else: print("Pacsat") -# system("sudo systemctl restart pacsatsim") + if (command_tx == True): + system("sudo systemctl restart pacsatsim") output(txLed, 0) print("0") rpitx = "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 " + tx + "e3 > /dev/null 2>&1 &" From add244e5417fb2260a10525f708a2cd06a5c93ec Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 11:51:41 -0400 Subject: [PATCH 45/70] Update transmit.py stop pacsatsim if not mode p --- transmit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index fffd0909..a3fcda5c 100644 --- a/transmit.py +++ b/transmit.py @@ -324,7 +324,8 @@ if __name__ == "__main__": print("Can't open .mode file, defaulting to FSK") print("Mode is: ") print(mode) -# system("sudo systemctl stop pacsatsim") + if ( mode != "p"): + system("sudo systemctl stop pacsatsim") try: file = open("/home/pi/CubeSatSim/beacon_off") From d05f624998983793725b4b41c56582cf16e3d541 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 11:52:27 -0400 Subject: [PATCH 46/70] Update main.c move start/stop pacsatsim to transmit --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index a7b50540..2f1954a6 100644 --- a/main.c +++ b/main.c @@ -273,7 +273,7 @@ int main(int argc, char * argv[]) { } } } - +/* if ( mode == PACSAT) { FILE * pacsat_file = popen("sudo systemctl restart pacsatsim", "r"); pclose(pacsat_file); @@ -282,7 +282,7 @@ int main(int argc, char * argv[]) { FILE * pacsat_file = popen("sudo systemctl stop pacsatsim", "r"); pclose(pacsat_file); } - +*/ // Open telemetry file with STEM Payload Data telem_file = fopen("/home/pi/CubeSatSim/telem.txt", "a"); if (telem_file == NULL) From cf44ee82d37a12181aff1c447121b06bcd6e562e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 12:02:06 -0400 Subject: [PATCH 47/70] Update config don't restart/stop pacsatsim for beacon on/off --- config | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config b/config index 7d0ed195..9be7c3e1 100755 --- a/config +++ b/config @@ -1158,9 +1158,9 @@ elif [ "$1" = "-o" ]; then echo "Turn beacon telemetry ON" sudo rm /home/pi/CubeSatSim/beacon_off > /dev/null 2>&1 sudo systemctl restart transmit - if [ "$MODE" = "p" ]; then - sudo systemctl restart pacsatsim - fi +# if [ "$MODE" = "p" ]; then +# sudo systemctl restart pacsatsim +# fi else echo "Transmit beacon telemetry is on" @@ -1168,12 +1168,12 @@ elif [ "$1" = "-o" ]; then echo "Turn beacon telemetry OFF" touch /home/pi/CubeSatSim/beacon_off - if [ "$MODE" = "p" ]; then - sudo systemctl stop pacsatsim - sudo systemctl stop transmit - else +# if [ "$MODE" = "p" ]; then +# sudo systemctl stop pacsatsim +# sudo systemctl stop transmit +# else sudo systemctl restart transmit - fi +# fi fi sleep 3 fi From 71321b0c92677d9696cd0fd07a8051c4543205b9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 12:08:15 -0400 Subject: [PATCH 48/70] Update transmit.py add print to start pacsatsim --- transmit.py | 1 + 1 file changed, 1 insertion(+) diff --git a/transmit.py b/transmit.py index a3fcda5c..4127e8db 100644 --- a/transmit.py +++ b/transmit.py @@ -554,6 +554,7 @@ if __name__ == "__main__": print("Pacsat") if (command_tx == True): system("sudo systemctl restart pacsatsim") + print("Starting PacSatSim") output(txLed, 0) print("0") rpitx = "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 " + tx + "e3 > /dev/null 2>&1 &" From a90e87ac061f279082da29e36c53d76ebfd453ca Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 15:32:33 -0400 Subject: [PATCH 49/70] add !command_tx to stop pacsatsim --- transmit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 4127e8db..d299389c 100644 --- a/transmit.py +++ b/transmit.py @@ -324,8 +324,6 @@ if __name__ == "__main__": print("Can't open .mode file, defaulting to FSK") print("Mode is: ") print(mode) - if ( mode != "p"): - system("sudo systemctl stop pacsatsim") try: file = open("/home/pi/CubeSatSim/beacon_off") @@ -337,6 +335,9 @@ if __name__ == "__main__": print("Can't open beacon_off file, defaulting to False") print("Command_tx: ") print(command_tx) + + if (mode != "p") || (!command_tx): + system("sudo systemctl stop pacsatsim") try: file = open("/home/pi/CubeSatSim/command_count.txt", "r") From cb92741418aa488084711b76dadfb661990e6a77 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 15:33:28 -0400 Subject: [PATCH 50/70] Update transmit.py fix or --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index d299389c..d0069606 100644 --- a/transmit.py +++ b/transmit.py @@ -336,7 +336,7 @@ if __name__ == "__main__": print("Command_tx: ") print(command_tx) - if (mode != "p") || (!command_tx): + if (mode != "p") or (!command_tx): system("sudo systemctl stop pacsatsim") try: From 7a7e4e0c5b14624a98e9fb9c05248b4fa7a72a49 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 15:34:40 -0400 Subject: [PATCH 51/70] Update transmit.py fix not --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index d0069606..5ac26bb3 100644 --- a/transmit.py +++ b/transmit.py @@ -336,7 +336,7 @@ if __name__ == "__main__": print("Command_tx: ") print(command_tx) - if (mode != "p") or (!command_tx): + if (mode != "p") or (command_tx == False): system("sudo systemctl stop pacsatsim") try: From 3caa7043332e9f835975bac55d0c54f8fae4242a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 13:47:23 -0600 Subject: [PATCH 52/70] Add files via upload --- .../PacSatGround_0.46o/PacSatGround.zip | Bin 3076 -> 3076 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatGround.zip b/spacecraft/PacSatGround_0.46o/PacSatGround.zip index 1ed803547071145536dee3358a256583ad2daf27..ed8a02312015782bdc385e835d1b838ba137755c 100644 GIT binary patch delta 947 zcmZpXXp!Iv@MdP=VgP}l+KD_WY}&CqG9ScDHeiA2aHFn~Z z^m^ZSlYZn0J+#p-@Oh-Y<*`#ON9arbZ;D#iFRgIjS#qdUG@xmRX7oqCH9~Dl+^drO zjJco5@~qvtrJ?I+k7)F?r~WUw_s$bgDGlb9oENjLihX)@p=1f$Opj0N|0y@!YuWnd z>*dDOJBF`!6q?L@^hC`6*k5tsId>kb99KC!Sweksz4E*VDzCi%I~#>$Kb_xI@32^+ zRBXm4p17}p?l-gEiUy}!Iry3P9q6|>yC_fvS& ztt9I$TNFjsFdc8*QnE4T$qU|u^ImxezOMUTeRb>f+bofrpUzo3?X}XKsZpl)e{>qoj3DY@Wl0x8DD*~*L}f$;*t_C^W7Gk3f10#v*+vm9y3~T=5a5| zl-(<*uDGD?|1th(ZdSXs_YMRH+TPZRwHMR3yK^r+x1n^-+t&)umb`8J*X94({}t!C z!>?|>=y~wF+D19OaDm@Dx0>{wtG^~L@ohfG{wpeb_1fT?>&L%UJvl4u+PKhO_*CP{ zN>0a{8?OA(oX_w3j~SX!Sb-@es&?`pCOvSP(2fNq6(*pFFS8X`#5#6zFLM)9aP4G4 z785o-V7k!*sS%x=z`_O+&0w*{B6^I)7G2b=cCs3)HrtPw9hpBs2@-4quNg2=D&D{S zg%Riu#>s}PqLa8e)HxZLA(cBku}tC z`ApW&d~Mfaq8yGU9qZCP{b~7^);NETNxN3I^7!jT?`=N4cL$GEvyaNp@c)92`G=yu z{d#%8=-rIcI~KEi3X8hcAOGv-^m|u0DS6UE&z{LA>jnJ_guX8QuPC`{>nH!C_6q`g zthjwD+1CGBu{dYzx2~1OvI@&*A4|5)WXMWfle{eWu*HM*^64d0-`!zI`}yT(W9sSs z-OG<3ea~2;kZ4|U@Y}BGvJ+Ka*{*fidO%yP)N^~Z6Ce8%-LRk)=4@U2y;iVUva5w? z#~l?9KDl(uqCk`Sx%rovEJKaL-#P!D-7#VD-PuVylP(`ma$cNl>pS0gn_u^wdvQOt z9dkFzM%@zN3Tu4q6tyctujmWghICc)2UXX9?|pUabZ*m{n?>isPL~S4^IALWeQoQz zpYv-T{$xL|_3*}bx${1sSDv{3k)ibWe6cUgDVY=78uOgw_DphH@hrW5`A3GiEZbQx zZt08bpDYltzy5Li+E%9dVfhbMu9%lQb)9^-xP0FG&1MIz&V4HtD8BT~q5kOduj*e} zo+p0IDRKMo*LL2-%@zUb<;wdu-?{qB;L8eTxoUn9uq2 zz?D5M3vwc|{!KaGuJ)f1nowAQDdj@gABEHO4V3FmLlY5z)m`;aH z7GyDDn+Hrc^FV4uCnvD5fkZP{tg(n5W3fdS-554mja8d14`@Oj+yvf@z(lEd|MnL~ zpgR~R8?uT{;^t82WMGCU+mTsX!Og(P@`9Ox0ZbSm()Z4=$%k3>*=m92RX|(~6cJ@} z28+~6ZjNJ%VPrZPHhB-b5fji`AJ}E#IbgCVhcgq Date: Mon, 16 Mar 2026 13:53:34 -0600 Subject: [PATCH 53/70] Add files via upload --- .../PacSatGround_0.46o/PacSatGround.zip | Bin 3076 -> 2662 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatGround.zip b/spacecraft/PacSatGround_0.46o/PacSatGround.zip index ed8a02312015782bdc385e835d1b838ba137755c..900415dcd54bc85e08ddeafaeec93d4cc324e294 100644 GIT binary patch delta 459 zcmY+9y-EW?6oqfHv&rrqk!1|YE*o4eY^;Kc5VC3lD#A847XFl488BiY2o^yL!EWyh zSVX~6Qsgbv#upH@3y6(PK<6ehkf{#eIcMg~wf|WV+leKpg+-BvGSG&-l4o&tbV^(H zOjKdJ000i`UA7LEANw~+7GPijlsF$d!PD(Ywh(Jmr_7OTzS|8EvFOR!?oMt$L*H3n zAd}Fliz17r)fFC#ir6Hyklx%Wx)VzxU|7X4waY0Yy`rECoKSi2%_E&QOS;FJ!5IxY z?FQptoTFz4r^h#s+N0PN$6}{O^U_n&T8TVwB7o9tv!m-jo zX!pTcRYik&P2JYGY55eo3(7MVKl3xR+;vqlc(^~O8!v96f-#&juHqtn$=oCY!m*z7 Hp&`H@&lFKl delta 803 zcmaDR(js9N;LXg!#Q*|9wFNO?29)4skYNZ&Ob$*gaWBd*%}db_4dG;9){fng`5>a~12CvjjGTOc!%kiqY7of6C5?{2s6bUC z!09C~3s(a&hm{3gO%A6E+(8g?VldRivq?_A&1odB1~&_2-!2Sw8`z{LTX9KDcHrdF zH$zKXA}D&LSkc`f%x*0YQv(T@3=B01?5dL=v5Uz|z|8{rX*-5GE)IKn9jF?JS)6R> Y_C<48im(Dj85p>M&;jU|b?hJ>0LI?EGynhq From 9009f08738e6c98b35de892b94b49c3745e54ba5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 15:55:20 -0400 Subject: [PATCH 54/70] Delete spacecraft/PacSatGround_0.46o/PacSatGround.zip --- spacecraft/PacSatGround_0.46o/PacSatGround.zip | Bin 2662 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 spacecraft/PacSatGround_0.46o/PacSatGround.zip diff --git a/spacecraft/PacSatGround_0.46o/PacSatGround.zip b/spacecraft/PacSatGround_0.46o/PacSatGround.zip deleted file mode 100644 index 900415dcd54bc85e08ddeafaeec93d4cc324e294..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2662 zcmWIWW@h1H00Fbwf*3FZO0YA?Fcg;*=%plOvBbS7 zzcepJub?QuAhoC@Gqo7(BvskEuVf)K}zm6UZ6%PG$Fu%e4^Ru%@yQWLO`_O!G?y3*R3e~q9(q8;M zVGcvL-m`u4iklZ}%lN*V^dnE`p^bKd&m-+EkDY2cLSOQKQ`EYCX@&dFl0&7U0ZltJ zqd)Sk5o%N7UX|o$%>7K3XYI}{4P8fjM5CuY^?%8|cb?5 zdVE^{Pr2z{%hoqvFE^&%F?_wF&}8PLCu07`{)!9Fx${`%xXR(l66%wc=RHt)<^A8; zC?xyo{H}V3#S*1rGd}UeeGPQKne|pQINi#@&%F0|)g^{2ha!&qEN?435O06(h1T7j zjAuT*{LFlMTD`b`fA@Xn7Y>K=J~X{8)wfpiyiy(2nAI5W^J-Gw_7)kw6VYpy1myFG z)K3lIE#mW85w@pGf7vAOOxML3R`-{%7OhHIcc=ZExuBx^Zu6r>N0;>z0y@F;8CbCY<-mJMeYg_v))#r{89Y-28OT+G($q z?o5p`z5ko*?q~a-hd%Sq3q7>)z3sf2&w?kef6Vymo4xJ}_7j(sc$x3E*i@+Y2AnwrtDrhb;SjB|BvxUbF}ou(Dt@gti71N-JN^sxecXr-o93Nw&ZQ& zzb^mR{;xRC9e#E5MbCrZ)i%oMg$w-Nxz(iaT>Uk1iEr~c_FqxitJenCTtEJ;>d9GI z*T#kR!lxQnR&qMt+;HWO=6rtNf6R!~ZG)CQxIx*YATc>LxhOHML?4_UnSp8XKlUsF zN#Gzu!hh%OwFl-8W?&+hM>PbJ)`K&1(GxnzU=T)2=&=)hy_pRK+TQ;Z<+i=8ztKyv zebHJDtw&Yzn@(<#-sO31X6M%b_pYo}*n95xlgg84UYxyg%j2turhE9+q$A5C_6EM1 zctm;i#kQKQ2bV>KY~KC!Pnui*R;i%v|dsbBT8-E2zF=C-Gk=C5pDULIk)?rYAfS#A2CcM82Ru$i5F zYSYKN`~Ph;Hd=DPBiz`iHTV{<* zl!{Yhn_sgdA{SKfK#M&v#RV^TfRO=-TToe}jTr@~h1bl>+tbp4CiDWa7>XGwnMJ9| zCHX~_dMQcpvI}G;T9ihAp4PZ^M~9=DuCco54wd~Hq52m4SE!h(D(D{GxI$y&CH2ia zS{RumW=cqCbxEjPoOywLdb$zUQbLMg3=SIc` zRYn^`(!-X9i8S=+r87Rh9vWwBO80m&fq8L62i{VJw4VUq( RKy3^RTtJu&OaxECJOI-LSm*!% From aa0742af68c6a6a8a1c96a6ccab37ca51705fd26 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 13:58:05 -0600 Subject: [PATCH 55/70] Add files via upload --- spacecraft/PacSatGround_0.46o/PacSatGround.zip | Bin 0 -> 2662 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 spacecraft/PacSatGround_0.46o/PacSatGround.zip diff --git a/spacecraft/PacSatGround_0.46o/PacSatGround.zip b/spacecraft/PacSatGround_0.46o/PacSatGround.zip new file mode 100644 index 0000000000000000000000000000000000000000..900415dcd54bc85e08ddeafaeec93d4cc324e294 GIT binary patch literal 2662 zcmWIWW@h1H00Fbwf*3FZO0YA?Fcg;*=%plOvBbS7 zzcepJub?QuAhoC@Gqo7(BvskEuVf)K}zm6UZ6%PG$Fu%e4^Ru%@yQWLO`_O!G?y3*R3e~q9(q8;M zVGcvL-m`u4iklZ}%lN*V^dnE`p^bKd&m-+EkDY2cLSOQKQ`EYCX@&dFl0&7U0ZltJ zqd)Sk5o%N7UX|o$%>7K3XYI}{4P8fjM5CuY^?%8|cb?5 zdVE^{Pr2z{%hoqvFE^&%F?_wF&}8PLCu07`{)!9Fx${`%xXR(l66%wc=RHt)<^A8; zC?xyo{H}V3#S*1rGd}UeeGPQKne|pQINi#@&%F0|)g^{2ha!&qEN?435O06(h1T7j zjAuT*{LFlMTD`b`fA@Xn7Y>K=J~X{8)wfpiyiy(2nAI5W^J-Gw_7)kw6VYpy1myFG z)K3lIE#mW85w@pGf7vAOOxML3R`-{%7OhHIcc=ZExuBx^Zu6r>N0;>z0y@F;8CbCY<-mJMeYg_v))#r{89Y-28OT+G($q z?o5p`z5ko*?q~a-hd%Sq3q7>)z3sf2&w?kef6Vymo4xJ}_7j(sc$x3E*i@+Y2AnwrtDrhb;SjB|BvxUbF}ou(Dt@gti71N-JN^sxecXr-o93Nw&ZQ& zzb^mR{;xRC9e#E5MbCrZ)i%oMg$w-Nxz(iaT>Uk1iEr~c_FqxitJenCTtEJ;>d9GI z*T#kR!lxQnR&qMt+;HWO=6rtNf6R!~ZG)CQxIx*YATc>LxhOHML?4_UnSp8XKlUsF zN#Gzu!hh%OwFl-8W?&+hM>PbJ)`K&1(GxnzU=T)2=&=)hy_pRK+TQ;Z<+i=8ztKyv zebHJDtw&Yzn@(<#-sO31X6M%b_pYo}*n95xlgg84UYxyg%j2turhE9+q$A5C_6EM1 zctm;i#kQKQ2bV>KY~KC!Pnui*R;i%v|dsbBT8-E2zF=C-Gk=C5pDULIk)?rYAfS#A2CcM82Ru$i5F zYSYKN`~Ph;Hd=DPBiz`iHTV{<* zl!{Yhn_sgdA{SKfK#M&v#RV^TfRO=-TToe}jTr@~h1bl>+tbp4CiDWa7>XGwnMJ9| zCHX~_dMQcpvI}G;T9ihAp4PZ^M~9=DuCco54wd~Hq52m4SE!h(D(D{GxI$y&CH2ia zS{RumW=cqCbxEjPoOywLdb$zUQbLMg3=SIc` zRYn^`(!-X9i8S=+r87Rh9vWwBO80m&fq8L62i{VJw4VUq( RKy3^RTtJu&OaxECJOI-LSm*!% literal 0 HcmV?d00001 From 8e0dcb858034c34b9479e911484aea34cde6962d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 16:04:17 -0400 Subject: [PATCH 56/70] Update pacsat-config.sh add reset ground station with zip file --- groundstation/pacsat-config.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 352396b4..e2b86625 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -154,11 +154,15 @@ sudo killall -9 direwolf &>/dev/null sudo rm -r /home/pi/PacSatGround cd sudo rm PacSatGround.zip - wget https://github.com/alanbjohnston/CubeSatSim/raw/60d11e78d79c7070a1cff5ff98aa622044a9335a/spacecraft/PacSatGround_0.46o/PacSatGround.zip - unzip PacSatGround.zip + wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p-s/spacecraft/PacSatGround_0.46o/PacSatGround.zip + unzip PacSatGround.zip -d PacSatGround sudo rm PacSatGround.zip else sudo rm -r /home/pi/PacSatGroundLoop + sudo rm PacSatGround.zip + wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p-s/spacecraft/PacSatGround_0.46o/PacSatGround.zip + unzip PacSatGround.zip -d PacSatGroundLoop + sudo rm PacSatGround.zip fi else From 3ac84675d2d94376a663d094dd4eec7336d378a3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 16:29:01 -0400 Subject: [PATCH 57/70] Update pacsat-config.sh change properties file for satellite --- groundstation/pacsat-config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index e2b86625..4c6cf617 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -131,9 +131,9 @@ sudo killall -9 direwolf &>/dev/null else if [ "$ANS" = "1" ] ; then - sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/Desktop/PacsatGround/spacecraft/PacSatSim.properties else - sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGroundLoop/spacecraft/PacSatSim.properties + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/Desktop/PacsatGround/spacecraft/PacSatSim.properties fi echo echo "Changing callsign to " From 7e94f40ea9a66196c546449c770e349cae754112 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Mar 2026 16:31:04 -0400 Subject: [PATCH 58/70] Update pacsat-config.sh change old callsign too --- groundstation/pacsat-config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 4c6cf617..65b49fde 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -113,9 +113,9 @@ sudo killall -9 direwolf &>/dev/null echo if [ "$ANS" = "1" ] ; then - oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGround/spacecraft/PacSatSim.properties) + oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/Desktop/PacsatGround/spacecraft/PacSatSim.properties ) else - oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGroundLoop/spacecraft/PacSatSim.properties) + oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/Desktop/PacsatGround/spacecraft/PacSatSim.properties ) fi echo "Current value of remote PacSat callsign is" echo $oldcallsign From 16e78829787583ec6db0b4c66d6a3e341e8a8471 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 11:37:38 -0400 Subject: [PATCH 59/70] Update asound.conf add ipc permissions to everyone --- asound.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/asound.conf b/asound.conf index cf3cc9a0..a752802a 100644 --- a/asound.conf +++ b/asound.conf @@ -22,6 +22,7 @@ pcm.softvol { pcm.shared_speaker { type dmix ipc_key 1024 + ipc_perm 0666 slave { pcm "hw:CARD=Device,DEV=0" rate 48000 @@ -35,6 +36,7 @@ pcm.shared_speaker { pcm.shared_mic { type dsnoop ipc_key 2048 + ipc_perm 0666 slave { pcm "hw:CARD=Device,DEV=0" # channels 1 From 000bf1f9e32effd9ce3d737181833eedd6df8848 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 14:03:02 -0400 Subject: [PATCH 60/70] Update pacsat.sh add safe and fix vox and other modes --- groundstation/pacsat.sh | 58 ++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 215c52a0..d64eacb3 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -4,15 +4,25 @@ loopback=0 vox=0 +safe=0 +card=0 +pwm=0 + if [ "$1" = "l" ] ; then loopback=1 - echo "PacSat Ground Station with Loopback" elif [ "$1" = "v" ] ; then - vox=1 - echo "PacSat Ground Station with Soundcard (VOX)" + vox=1 + +elif [ "$1" = "c" ] ; then + + card=1 + +else + + pwm=1 fi @@ -139,41 +149,35 @@ echo sudo usermod -a -G gpio pi if [ "$loopback" = "1" ]; then -#/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-df.sh" echo "Using Audio Loopback" -# /home/pi/CubeSatSim/groundstation/pacsat-d.sh & + ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1" + PTT="PTT GPIOD gpiochip0 17" -# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 +elif [ "$safe" = "1" ] ; then - ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1" - PTT="PTT GPIOD gpiochip0 17" + echo "Safe mode - battery saver" + ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0" + PTT="PTT GPIOD gpiochip0 17" elif [ "$vox" = "1" ]; then - echo "Using Soundcard Audio TX RX (VOX)" - /home/pi/CubeSatSim/groundstation/pacsat-dj.sh & - -else - - echo "Using TXC FM Transceiver" - pwm=1 -# /home/pi/CubeSatSim/groundstation/pacsat-df.sh & - - if [ "$pwm" = "1" ] ; then + echo "Using Soundcard Audio TX and RX (VOX, no PTT)" + ADEVICE="ADEVICE plughw:CARD=Device,DEV=0" + PTT="PTT GPIOD gpiochip0 17" -# direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf -t 0 & - - echo "FM TXC using Soundcard input (JP13), PWM output" - ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0" - PTT="PTT GPIOD gpiochip0 -20" +elif [ "$pwm" = "1" ] ; then + + echo "FM TXC using Soundcard input (JP13), PWM output" + ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0" + PTT="PTT GPIOD gpiochip0 -20" - else +else - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 & + echo "FM TXC using Soundcard input (JP13) and output (JP14)" + ADEVICE="ADEVICE shared_mic plughw:CARD=Device,DEV=0" + PTT="PTT GPIOD gpiochip0 -20" - fi - fi DIREWOLF_CONF="/home/pi/CubeSatSim/groundstation/direwolf-pacsat-tmp.conf" From 2a3d546fef6b9bed3a63508fe7b11c2bce73f131 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 17:59:20 -0400 Subject: [PATCH 61/70] Update config remove commented out code --- config | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/config b/config index 9be7c3e1..c4ab7d94 100755 --- a/config +++ b/config @@ -1158,22 +1158,13 @@ elif [ "$1" = "-o" ]; then echo "Turn beacon telemetry ON" sudo rm /home/pi/CubeSatSim/beacon_off > /dev/null 2>&1 sudo systemctl restart transmit -# if [ "$MODE" = "p" ]; then -# sudo systemctl restart pacsatsim -# fi - else echo "Transmit beacon telemetry is on" echo echo "Turn beacon telemetry OFF" touch /home/pi/CubeSatSim/beacon_off -# if [ "$MODE" = "p" ]; then -# sudo systemctl stop pacsatsim -# sudo systemctl stop transmit -# else - sudo systemctl restart transmit -# fi + sudo systemctl restart transmit fi sleep 3 fi From e9edb14d331389cab7aabc38a71751ae0c43be62 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 18:11:04 -0400 Subject: [PATCH 62/70] Update pacsat.sh add pkill --- groundstation/pacsat.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index d64eacb3..9aac313a 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -1,6 +1,8 @@ #!/bin/bash -# script to auto decode packet using rtl_fm and Direwolf and run Pacsat Ground Station +# script to auto decode packets using Direwolf and FM TXC and run Pacsat Ground Station + +sudo pkill -f "/home/pi/CubeSatSim/groundstation/direwolf-pacsat-tmp.conf" loopback=0 vox=0 From 080f5680744f822e4530dcce19c9fc5d11f37b26 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 19:00:28 -0400 Subject: [PATCH 63/70] Update pacsatsim.sh detect sound card, TXC, and RTL --- pacsatsim.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index 54ef4c89..86836f78 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -33,6 +33,30 @@ if [ -f "$FILE" ]; then fi +if [[ $(arecord -l | grep "USB Audio Device") ]] ; then + echo "USB Sound Card detected" + soundcard=1 +else + echo "No USB Sound Card detected" + soundcard=0 + +gpio -g mode 7 up +if [[ $(gpio -g read 7 | grep 0) ]]; then + echo "TXC is present" + txc=1 +else: + echo "TXC not present" + txc=0 + +timeout 1 rtl_test &> out.txt +if [[ $(grep "No supported" out.txt) ]] ; then + echo "No RTL-SDR detected" + rtl=0 +else + echo "RTL-SDR detected." + rtl=1 +fi + if [ ! -d "/home/pi/PacSat" ]; then echo "Setting up PacSatSim default configuration" From 28c335c9852eed570c78d61c0ee630aab04f485b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 19:10:14 -0400 Subject: [PATCH 64/70] fix missing fi --- pacsatsim.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 86836f78..20bb50f1 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -39,14 +39,16 @@ if [[ $(arecord -l | grep "USB Audio Device") ]] ; then else echo "No USB Sound Card detected" soundcard=0 +fi gpio -g mode 7 up -if [[ $(gpio -g read 7 | grep 0) ]]; then +if [[ $(gpio -g read 7 | grep 0) ]] ; then echo "TXC is present" txc=1 else: echo "TXC not present" txc=0 +fi timeout 1 rtl_test &> out.txt if [[ $(grep "No supported" out.txt) ]] ; then From 86a17ea38e2065a613cca77fdfda70888647debf Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 19:44:03 -0400 Subject: [PATCH 65/70] Update pacsatsim.sh fix else --- pacsatsim.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 20bb50f1..78c952a8 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -43,10 +43,10 @@ fi gpio -g mode 7 up if [[ $(gpio -g read 7 | grep 0) ]] ; then - echo "TXC is present" - txc=1 -else: - echo "TXC not present" + echo "TXC is present" + txc=1 +else + echo "TXC not present" txc=0 fi From 53b7455e2e35fc7d902a20bb5bb9955cee893b1a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 19:49:00 -0400 Subject: [PATCH 66/70] Update pacsat.sh with tests for sound card, txc, and rtl --- groundstation/pacsat.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 9aac313a..61ece654 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -28,6 +28,32 @@ else fi +if [[ $(arecord -l | grep "USB Audio Device") ]] ; then + echo "USB Sound Card detected" + soundcard=1 +else + echo "No USB Sound Card detected" + soundcard=0 +fi + +gpio -g mode 7 up +if [[ $(gpio -g read 7 | grep 0) ]] ; then + echo "TXC is present" + txc=1 +else + echo "TXC not present" + txc=0 +fi + +timeout 1 rtl_test &> out.txt +if [[ $(grep "No supported" out.txt) ]] ; then + echo "No RTL-SDR detected" + rtl=0 +else + echo "RTL-SDR detected." + rtl=1 +fi + FILE=/home/pi/CubeSatSim/battery_saver if [ -f "$FILE" ]; then From 918bff84464af0a338eb9e21dce65e28c691723b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 19:51:20 -0400 Subject: [PATCH 67/70] Update config add to status --- config | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/config b/config index c4ab7d94..861b0624 100755 --- a/config +++ b/config @@ -324,6 +324,32 @@ if [ "$1" = "" ]; then echo "Transmit beacon telemetry is ON" fi + if [[ $(arecord -l | grep "USB Audio Device") ]] ; then + echo "USB Sound Card detected" + soundcard=1 + else + echo "No USB Sound Card detected" + soundcard=0 + fi + + gpio -g mode 7 up + if [[ $(gpio -g read 7 | grep 0) ]] ; then + echo "FM TXC is present" + txc=1 + else + echo "FM TXC not present" + txc=0 + fi + + timeout 1 rtl_test &> out.txt + if [[ $(grep "No supported" out.txt) ]] ; then + echo "No RTL-SDR detected" + rtl=0 + else + echo "RTL-SDR detected" + rtl=1 + fi + echo echo -e "Current sim.cfg configuration file:" # echo From 1fe7a1b57b74cbb61663b59ae71580bd7a9747d2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 22:15:11 -0400 Subject: [PATCH 68/70] Update pacsat.sh print error messages if txc or sound card not present --- groundstation/pacsat.sh | 42 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 61ece654..461d8069 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -184,27 +184,61 @@ if [ "$loopback" = "1" ]; then elif [ "$safe" = "1" ] ; then - echo "Safe mode - battery saver" ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0" PTT="PTT GPIOD gpiochip0 17" + if [ ! "$txc" = "1" ] then + echo "Safe mode - battery saver won't work since no TXC present" + sleep 5 + elif [ ! "$soundcard" = "1" ] ; then + echo "Safe mode - battery saver won't work since no sound card present" + sleep 5 + else + echo "Safe mode - battery saver" + fi + elif [ "$vox" = "1" ]; then - echo "Using Soundcard Audio TX and RX (VOX, no PTT)" ADEVICE="ADEVICE plughw:CARD=Device,DEV=0" PTT="PTT GPIOD gpiochip0 17" + if [ "$soundcard" = "1" ] ; then + echo "Using Soundcard Audio TX and RX (VOX, no PTT)" + else + echo "Soundcard Audio TX and RX (VOX, no PTT) will not work since no sound card present" + sleep 5 + fi + elif [ "$pwm" = "1" ] ; then - echo "FM TXC using Soundcard input (JP13), PWM output" ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0" PTT="PTT GPIOD gpiochip0 -20" + + if [ ! "$txc" = "1" ] then + echo "FM TXC using Soundcard input (JP13), PWM output won't work since no TXC present" + sleep 5 + elif [ ! "$soundcard" = "1" ] ; then + echo "FM TXC using Soundcard input (JP13), PWM output won't work since no sound card present" + sleep 5 + else + echo "FM TXC using Soundcard input (JP13), PWM output" + fi else echo "FM TXC using Soundcard input (JP13) and output (JP14)" ADEVICE="ADEVICE shared_mic plughw:CARD=Device,DEV=0" - PTT="PTT GPIOD gpiochip0 -20" + PTT="PTT GPIOD gpiochip0 -20" + + if [ ! "$txc" = "1" ] then + echo "FM TXC using Soundcard input (JP13) and output (JP14) won't work since no TXC present" + sleep 5 + elif [ ! "$soundcard" = "1" ] ; then + echo "FM TXC using Soundcard input (JP13), output (JP14) won't work since no sound card present" + sleep 5 + else + echo "FM TXC using Soundcard input (JP13), output JP14" + fi fi From 0761ced4ca8074e066a6ab77222fa3657bd3e800 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 22:21:16 -0400 Subject: [PATCH 69/70] Update pacsat.sh missing ; --- groundstation/pacsat.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 461d8069..ad7910aa 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -176,7 +176,7 @@ echo sudo usermod -a -G gpio pi -if [ "$loopback" = "1" ]; then +if [ "$loopback" = "1" ] ; then echo "Using Audio Loopback" ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1" @@ -187,7 +187,7 @@ elif [ "$safe" = "1" ] ; then ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0" PTT="PTT GPIOD gpiochip0 17" - if [ ! "$txc" = "1" ] then + if [ ! "$txc" = "1" ] ; then echo "Safe mode - battery saver won't work since no TXC present" sleep 5 elif [ ! "$soundcard" = "1" ] ; then @@ -197,7 +197,7 @@ elif [ "$safe" = "1" ] ; then echo "Safe mode - battery saver" fi -elif [ "$vox" = "1" ]; then +elif [ "$vox" = "1" ] ; then ADEVICE="ADEVICE plughw:CARD=Device,DEV=0" PTT="PTT GPIOD gpiochip0 17" @@ -214,7 +214,7 @@ elif [ "$pwm" = "1" ] ; then ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0" PTT="PTT GPIOD gpiochip0 -20" - if [ ! "$txc" = "1" ] then + if [ ! "$txc" = "1" ] ; then echo "FM TXC using Soundcard input (JP13), PWM output won't work since no TXC present" sleep 5 elif [ ! "$soundcard" = "1" ] ; then @@ -230,7 +230,7 @@ else ADEVICE="ADEVICE shared_mic plughw:CARD=Device,DEV=0" PTT="PTT GPIOD gpiochip0 -20" - if [ ! "$txc" = "1" ] then + if [ ! "$txc" = "1" ] ; then echo "FM TXC using Soundcard input (JP13) and output (JP14) won't work since no TXC present" sleep 5 elif [ ! "$soundcard" = "1" ] ; then @@ -264,7 +264,7 @@ direwolf -r 48000 -c $DIREWOLF_CONF -t 0 & cd /home/pi/Desktop/PacsatGround/ -if [ "$loopback" = "1" ]; then +if [ "$loopback" = "1" ] ; then setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGroundLoop" # removed & From 7fbfb32309bab1c9814ff4d363a37a90c2e930b1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Mar 2026 22:28:02 -0400 Subject: [PATCH 70/70] Update pacsat.sh cleanup --- groundstation/pacsat.sh | 46 ----------------------------------------- 1 file changed, 46 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index ad7910aa..545dea57 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -135,45 +135,11 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 zenity &>/dev/null -echo - #sudo systemctl restart pacsatsim #sudo /etc/init.d/alsa-utils stop #sudo /etc/init.d/alsa-utils start - -#echo "Waiting 10 seconds for Pacsatsim to start" - -#sleep 10 - -#value=`cat /home/pi/CubeSatSim/sim.cfg` -#echo "$value" > /dev/null -#set -- $value - -#echo "Receive frequency is $8 MHz" -#echo "Transmit frequency is $7 MHz" -#echo -#echo "To change, quit and type CubeSatSim/config -F" -#echo - -#frequency="$8e6" - -#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." - -#echo - -echo -echo "The Pacsat Ground Station is running on this Pi using FM receiver or RTL-SDR" -echo - -#cd /home/pi/Desktop/PacSatGround_0.46m_linux/ - -#setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & - -#direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 # & -#/usr/bin/x-terminal-emulator --geometry=120x40 -e "direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0" - sudo usermod -a -G gpio pi if [ "$loopback" = "1" ] ; then @@ -257,11 +223,6 @@ echo direwolf -r 48000 -c $DIREWOLF_CONF -t 0 & -# 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 & -##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 435045 & - -# echo "Don't close the direwolf window or the Pacsatsim will stop running." - cd /home/pi/Desktop/PacsatGround/ if [ "$loopback" = "1" ] ; then @@ -273,13 +234,6 @@ else setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & fi -#cd /home/pi/Desktop/PacSatGround_0.46m_linux/ - -#sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" - -cd - -#sudo systemctl stop pacsatsim sleep 10