From b4a1714d15f75730ed401462e72c800466182ac6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:14:28 -0500 Subject: [PATCH 001/554] Create pacsat.sh --- groundstation/pacsat.sh | 193 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 groundstation/pacsat.sh diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh new file mode 100644 index 00000000..6e710b25 --- /dev/null +++ b/groundstation/pacsat.sh @@ -0,0 +1,193 @@ +#!/bin/bash + +# script to auto decode packet using rtl_fm and Direwolf and run Pacsat + +sudo modprobe snd-aloop + +sudo systemctl stop openwebrx + +sudo systemctl stop rtl_tcp + +pkill -o chromium &>/dev/null + +sudo killall -9 rtl_fm &>/dev/null + +sudo killall -9 direwolf &>/dev/null + +sudo killall -9 aplay &>/dev/null + +sudo killall -9 qsstv &>/dev/null + +sudo killall -9 rtl_tcp &>/dev/null + +sudo killall -9 java &>/dev/null + +sudo killall -9 CubicSDR &>/dev/null + +sudo killall -9 zenity &>/dev/null + +echo + +frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") + +#echo $frequency + +if [ -z "$frequency" ]; then + +echo "No choice made. Exiting." + +sleep 3 + +exit + +#echo "Choose the number for the packet decoding option:" +#echo +#echo "1. APRS US 2m (144390 kHz)" +#echo "2. CubeSatSim (434900 kHz)" +#echo "3. APRS European 2m (144800 kHz)" +#echo "4. APRS Australian 2m (145175 kHz)" +#echo "5. APRS on another frequency" +#echo "6. APRS on ISS (145825 kHz)" +#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" +#echo "8. Test Serenity CubeSat decoding with WAV file" +#echo "9. Test APRS decoding with CubeSatSim WAV file" +#echo + +#read -r choice + +fi + +if [ "$choice" = "1" ] || [ "$frequency" = "144390" ]; then + + frequency=144390000 + +elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then + + frequency=434900000 + echo + echo "If your CubeSatSim is transmitting in APRS mode (mode 1) then you should see packets." + echo + +elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then + + frequency=144800000 + +elif [ "$choice" = "4" ] || [ "$frequency" = "145175" ]; then + + frequency=145175000 + +elif [ "$choice" = "5" ] || [ "$frequency" = "Other" ] ; then + + echo + + echo "Enter the frequency in kiloHertz" + + echo + + read -r frequency + + frequency=$frequency"000" + + #echo $frequency + +elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then + + frequency=145825000 + echo + echo "If the ISS is overhead and in APRS mode (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then + + frequency=437100000 + echo + echo "If the Serenity CubeSat is overhead and transmitting (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then + + echo "A recorded WAV file will play and you should see some packets decoded" + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + +# aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & +# aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & + aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then + + echo "A recorded APRS WAV file from the CubeSatSim will play and you should see a packet decoded." + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + + #aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + #aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +#fi + +fi + +echo + +echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." + +echo + +if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then + + echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & + +else + + echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & + +fi + +sleep 5 + +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +#rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & + +/home/pi/pi_pacsat/Debug/pi_pacsat -c /home/pi/pi_pacsat/Debug/pacsat.config -d /home/pi/PacSat + +sleep 5 From f42d21a74dfe4ed1314494fbb3e4e46fb29c9850 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:17:44 -0500 Subject: [PATCH 002/554] Create direwolf-pacsat.conf --- groundstation/direwolf/direwolf-pacsat.conf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 groundstation/direwolf/direwolf-pacsat.conf diff --git a/groundstation/direwolf/direwolf-pacsat.conf b/groundstation/direwolf/direwolf-pacsat.conf new file mode 100644 index 00000000..9fe8960b --- /dev/null +++ b/groundstation/direwolf/direwolf-pacsat.conf @@ -0,0 +1,3 @@ +CALLSIGN AMSAT +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=b1,DEV=0 +PTT GPIO 20 From 27b4ffe54b4027cac0b17cee54dc3311f3e2e660 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:22:36 -0500 Subject: [PATCH 003/554] changed permission of pacsat script --- groundstation/pacsat.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 groundstation/pacsat.sh diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh old mode 100644 new mode 100755 From 234c9d747dca1bbf2857a1381abe18bb857ca838 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:27:59 -0500 Subject: [PATCH 004/554] added --- pacsatsim.sh | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100755 pacsatsim.sh diff --git a/pacsatsim.sh b/pacsatsim.sh new file mode 100755 index 00000000..6e710b25 --- /dev/null +++ b/pacsatsim.sh @@ -0,0 +1,193 @@ +#!/bin/bash + +# script to auto decode packet using rtl_fm and Direwolf and run Pacsat + +sudo modprobe snd-aloop + +sudo systemctl stop openwebrx + +sudo systemctl stop rtl_tcp + +pkill -o chromium &>/dev/null + +sudo killall -9 rtl_fm &>/dev/null + +sudo killall -9 direwolf &>/dev/null + +sudo killall -9 aplay &>/dev/null + +sudo killall -9 qsstv &>/dev/null + +sudo killall -9 rtl_tcp &>/dev/null + +sudo killall -9 java &>/dev/null + +sudo killall -9 CubicSDR &>/dev/null + +sudo killall -9 zenity &>/dev/null + +echo + +frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") + +#echo $frequency + +if [ -z "$frequency" ]; then + +echo "No choice made. Exiting." + +sleep 3 + +exit + +#echo "Choose the number for the packet decoding option:" +#echo +#echo "1. APRS US 2m (144390 kHz)" +#echo "2. CubeSatSim (434900 kHz)" +#echo "3. APRS European 2m (144800 kHz)" +#echo "4. APRS Australian 2m (145175 kHz)" +#echo "5. APRS on another frequency" +#echo "6. APRS on ISS (145825 kHz)" +#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" +#echo "8. Test Serenity CubeSat decoding with WAV file" +#echo "9. Test APRS decoding with CubeSatSim WAV file" +#echo + +#read -r choice + +fi + +if [ "$choice" = "1" ] || [ "$frequency" = "144390" ]; then + + frequency=144390000 + +elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then + + frequency=434900000 + echo + echo "If your CubeSatSim is transmitting in APRS mode (mode 1) then you should see packets." + echo + +elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then + + frequency=144800000 + +elif [ "$choice" = "4" ] || [ "$frequency" = "145175" ]; then + + frequency=145175000 + +elif [ "$choice" = "5" ] || [ "$frequency" = "Other" ] ; then + + echo + + echo "Enter the frequency in kiloHertz" + + echo + + read -r frequency + + frequency=$frequency"000" + + #echo $frequency + +elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then + + frequency=145825000 + echo + echo "If the ISS is overhead and in APRS mode (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then + + frequency=437100000 + echo + echo "If the Serenity CubeSat is overhead and transmitting (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then + + echo "A recorded WAV file will play and you should see some packets decoded" + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + +# aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & +# aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & + aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then + + echo "A recorded APRS WAV file from the CubeSatSim will play and you should see a packet decoded." + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + + #aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + #aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +#fi + +fi + +echo + +echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." + +echo + +if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then + + echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & + +else + + echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & + +fi + +sleep 5 + +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +#rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & + +/home/pi/pi_pacsat/Debug/pi_pacsat -c /home/pi/pi_pacsat/Debug/pacsat.config -d /home/pi/PacSat + +sleep 5 From 07b96c781b59d7589a4bbb388c69d28835afd8cb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:34:06 -0500 Subject: [PATCH 005/554] Update pacsatsim.sh changed for sim --- pacsatsim.sh | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 6e710b25..4483d771 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -4,11 +4,11 @@ sudo modprobe snd-aloop -sudo systemctl stop openwebrx +#sudo systemctl stop openwebrx sudo systemctl stop rtl_tcp -pkill -o chromium &>/dev/null +#pkill -o chromium &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -16,44 +16,44 @@ sudo killall -9 direwolf &>/dev/null sudo killall -9 aplay &>/dev/null -sudo killall -9 qsstv &>/dev/null +#sudo killall -9 qsstv &>/dev/null -sudo killall -9 rtl_tcp &>/dev/null +#sudo killall -9 rtl_tcp &>/dev/null -sudo killall -9 java &>/dev/null +#sudo killall -9 java &>/dev/null -sudo killall -9 CubicSDR &>/dev/null +#sudo killall -9 CubicSDR &>/dev/null -sudo killall -9 zenity &>/dev/null +#sudo killall -9 zenity &>/dev/null echo -frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") +#frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") #echo $frequency -if [ -z "$frequency" ]; then +#if [ -z "$frequency" ]; then -echo "No choice made. Exiting." +#echo "No choice made. Exiting." -sleep 3 +#sleep 3 -exit +#exit -#echo "Choose the number for the packet decoding option:" -#echo -#echo "1. APRS US 2m (144390 kHz)" -#echo "2. CubeSatSim (434900 kHz)" -#echo "3. APRS European 2m (144800 kHz)" -#echo "4. APRS Australian 2m (145175 kHz)" -#echo "5. APRS on another frequency" -#echo "6. APRS on ISS (145825 kHz)" -#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" -#echo "8. Test Serenity CubeSat decoding with WAV file" -#echo "9. Test APRS decoding with CubeSatSim WAV file" -#echo +echo "Choose the number for the packet decoding option:" +echo +echo "1. APRS US 2m (144390 kHz)" +echo "2. CubeSatSim (434900 kHz)" +echo "3. APRS European 2m (144800 kHz)" +echo "4. APRS Australian 2m (145175 kHz)" +echo "5. APRS on another frequency" +echo "6. APRS on ISS (145825 kHz)" +echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" +echo "8. Test Serenity CubeSat decoding with WAV file" +echo "9. Test APRS decoding with CubeSatSim WAV file" +echo -#read -r choice +read -r choice fi From a97e2f8ed8a228ac2d25d40d984648e2be0b73b9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:34:49 -0500 Subject: [PATCH 006/554] Update pacsatsim.sh typo --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 4483d771..40d5f809 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -55,7 +55,7 @@ echo read -r choice -fi +#fi if [ "$choice" = "1" ] || [ "$frequency" = "144390" ]; then From 45372ed484368c34022f49b79f6617e77aa3b2c6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:36:41 -0500 Subject: [PATCH 007/554] Update direwolf-pacsat.conf changed to MYCALL --- groundstation/direwolf/direwolf-pacsat.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat.conf b/groundstation/direwolf/direwolf-pacsat.conf index 9fe8960b..03c6a5c4 100644 --- a/groundstation/direwolf/direwolf-pacsat.conf +++ b/groundstation/direwolf/direwolf-pacsat.conf @@ -1,3 +1,3 @@ -CALLSIGN AMSAT +MYCALL AMSAT ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=b1,DEV=0 PTT GPIO 20 From b6cd13087a77f0df6f8c242888c9165a3f1ad863 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:38:23 -0500 Subject: [PATCH 008/554] Update direwolf-pacsat.conf added USB Card --- groundstation/direwolf/direwolf-pacsat.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat.conf b/groundstation/direwolf/direwolf-pacsat.conf index 03c6a5c4..7beb9432 100644 --- a/groundstation/direwolf/direwolf-pacsat.conf +++ b/groundstation/direwolf/direwolf-pacsat.conf @@ -1,3 +1,3 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=b1,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Device,DEV=0 PTT GPIO 20 From 78cb684ae3f07fdded48579842396e995c75641f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:42:44 -0500 Subject: [PATCH 009/554] Create direwolf-pacsatsim.conf --- direwolf/direwolf-pacsatsim.conf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 direwolf/direwolf-pacsatsim.conf diff --git a/direwolf/direwolf-pacsatsim.conf b/direwolf/direwolf-pacsatsim.conf new file mode 100644 index 00000000..c335760a --- /dev/null +++ b/direwolf/direwolf-pacsatsim.conf @@ -0,0 +1,3 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 +PTT GPIO 20 From ede7922fa7ff9dc29efb052207c0503f5191ec4d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 12:43:38 -0500 Subject: [PATCH 010/554] Update pacsatsim.sh commented out rtl-sdr --- pacsatsim.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 40d5f809..2ea4707b 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -175,7 +175,7 @@ else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & + direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim.conf -t 0 & fi @@ -185,8 +185,7 @@ value=`aplay -l | grep "Loopback"` echo "$value" > /dev/null set -- $value -#rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & +#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & /home/pi/pi_pacsat/Debug/pi_pacsat -c /home/pi/pi_pacsat/Debug/pacsat.config -d /home/pi/PacSat From ae07d74c873e56b2cf0264070c728c4ad552422b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 13:47:18 -0500 Subject: [PATCH 011/554] Update direwolf-pacsat.conf change to loopback for now --- groundstation/direwolf/direwolf-pacsat.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat.conf b/groundstation/direwolf/direwolf-pacsat.conf index 7beb9432..455a31b1 100644 --- a/groundstation/direwolf/direwolf-pacsat.conf +++ b/groundstation/direwolf/direwolf-pacsat.conf @@ -1,3 +1,3 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Device,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 PTT GPIO 20 From aaf292db23de9441c7e1af76dde5166a6d4b8677 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 13:49:42 -0500 Subject: [PATCH 012/554] Update pacsat.sh change to passat ground station --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 6e710b25..70cf51fa 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -188,6 +188,6 @@ set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & -/home/pi/pi_pacsat/Debug/pi_pacsat -c /home/pi/pi_pacsat/Debug/pacsat.config -d /home/pi/PacSat +sudo setsid java -Xmx512M -jar PacSatGround.jar sleep 5 From e8e08ef8e460fb1e9f87960ff0f6de79390e1b6a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 13:51:02 -0500 Subject: [PATCH 013/554] Update pacsat.sh fix path --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 70cf51fa..bfaf7235 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -188,6 +188,6 @@ set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & -sudo setsid java -Xmx512M -jar PacSatGround.jar +sudo setsid java -Xmx512M -jar /home/pi/Desktop/PacSatGround_0.46m_linux/PacSatGround.jar sleep 5 From 8348d51484f3272b3908356348eb275f4ff18523 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 13:54:15 -0500 Subject: [PATCH 014/554] Update pacsat.sh added cd --- groundstation/pacsat.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index bfaf7235..2cca3cef 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -188,6 +188,8 @@ set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & -sudo setsid java -Xmx512M -jar /home/pi/Desktop/PacSatGround_0.46m_linux/PacSatGround.jar +cd /home/pi/Desktop/PacSatGround_0.46m_linux/ + +sudo setsid java -Xmx512M -jar PacSatGround.jar sleep 5 From 87f8b2e25adb4ec76b675c1305e4fe3b2a01a102 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 13:56:18 -0500 Subject: [PATCH 015/554] Update direwolf-pacsat.conf changed to Headphones --- groundstation/direwolf/direwolf-pacsat.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat.conf b/groundstation/direwolf/direwolf-pacsat.conf index 455a31b1..c335760a 100644 --- a/groundstation/direwolf/direwolf-pacsat.conf +++ b/groundstation/direwolf/direwolf-pacsat.conf @@ -1,3 +1,3 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 PTT GPIO 20 From 2acdcc69e2e61e2e03e3d27277e45555ce740116 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 14:11:29 -0500 Subject: [PATCH 016/554] Update config add dtmf to -A --- config | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/config b/config index 104a17e3..cee78881 100755 --- a/config +++ b/config @@ -1300,37 +1300,42 @@ elif [ "$1" = "-A" ]; then 1) echo "Mode 1 is APRS" - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=a" + transmit_command_aprs +# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=a" ;; 2) echo "Mode 2 is FSK" - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=f" + transmit_command_fsk +# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=f" ;; 3) echo "Mode 3 is BPSK" - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=b" + transmit_command_bpsk +# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=b" ;; 4) echo "Mode 4 is SSTV" - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=s" + transmit_command_sstv +# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=s" ;; 5) echo "Mode 5 is CW" - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=m" + transmit_command_cw +# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=m" ;; *) echo "Unknown mode" - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=?" +# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=?" ;; - esac - sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 - echo $STRING > /home/pi/CubeSatSim/t.txt - echo - echo -n "Sending APRS packet " - echo $STRING - sudo touch /home/pi/CubeSatSim/ready - sleep 5 - sudo touch /home/pi/CubeSatSim/ready +# esac +# sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 +# echo $STRING > /home/pi/CubeSatSim/t.txt +# echo +# echo -n "Sending APRS packet " +# echo $STRING +# sudo touch /home/pi/CubeSatSim/ready +# sleep 5 +# sudo touch /home/pi/CubeSatSim/ready echo echo "Do you want to send another APRS command packet (y/n) " From 0365075e0080524e0a37c85e717b2247e6d58a55 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 14:12:22 -0500 Subject: [PATCH 017/554] Update config added back in missing esac --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index cee78881..000213f8 100755 --- a/config +++ b/config @@ -1327,7 +1327,7 @@ elif [ "$1" = "-A" ]; then echo "Unknown mode" # STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=?" ;; -# esac + esac # sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 # echo $STRING > /home/pi/CubeSatSim/t.txt # echo From b4c6a34f9214e176b573ed21a71df136ccba4cba Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 14:14:17 -0500 Subject: [PATCH 018/554] Update config don't force aprs mode --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index 000213f8..3d6107e0 100755 --- a/config +++ b/config @@ -1285,7 +1285,7 @@ elif [ "$1" = "-A" ]; then sudo systemctl stop transmit # sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 - sudo python3 -u /home/pi/CubeSatSim/transmit.py x > /dev/null 2>&1 & # Force APRS mode +# sudo python3 -u /home/pi/CubeSatSim/transmit.py x > /dev/null 2>&1 & # Force APRS mode fi sim="y" From 5d6e93b9818bf2061f49f7e4710ecfe3a130af8a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 14:16:28 -0500 Subject: [PATCH 019/554] Update config don't do ptt here --- config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config b/config index 3d6107e0..eea64a4e 100755 --- a/config +++ b/config @@ -9,11 +9,11 @@ function transmit_command_aprs { sudo systemctl stop command echo "Transmit DTMF start" - gpio write 28 0 # ptt +# gpio write 28 0 # ptt gpio write 2 1 # tx LED timeout 3 direwolf -c /home/pi/CubeSatSim/direwolf/direwolf-transmit-dtmf-aprs.conf -t 0l gpio write 2 0 # tx LED - gpio write 28 1 #ptt +# gpio write 28 1 #ptt echo "Transmit stop" echo "Resuming command and control" From c8468e2df52724213dda01b5eb658b5913b362de Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 14:17:13 -0500 Subject: [PATCH 020/554] Update direwolf-transmit-dtmf-aprs.conf add ptt --- direwolf/direwolf-transmit-dtmf-aprs.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/direwolf/direwolf-transmit-dtmf-aprs.conf b/direwolf/direwolf-transmit-dtmf-aprs.conf index 786102cd..37ddbe97 100644 --- a/direwolf/direwolf-transmit-dtmf-aprs.conf +++ b/direwolf/direwolf-transmit-dtmf-aprs.conf @@ -1,4 +1,5 @@ ADEVICE hw:CARD=Loopback,DEV=0 hw:CARD=Headphones,DEV=0 +PTT GPIO 20 MYCALL AMSAT CHANNEL 0 MODEM 1200 From 828939a54e0f2ecaaefa3003e8177409f803f6ca Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 28 Nov 2024 22:17:24 -0500 Subject: [PATCH 021/554] Update direwolf-pacsatsim.conf added channel and modem to config --- direwolf/direwolf-pacsatsim.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim.conf b/direwolf/direwolf-pacsatsim.conf index c335760a..27b58eab 100644 --- a/direwolf/direwolf-pacsatsim.conf +++ b/direwolf/direwolf-pacsatsim.conf @@ -1,3 +1,5 @@ -MYCALL AMSAT ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 PTT GPIO 20 +MYCALL AMSAT +CHANNEL 0 +MODEM 1200 From 184a65da56a98147236dcac42c63d39a65db874f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 10:01:43 -0500 Subject: [PATCH 022/554] Update install add Pacsat installation --- install | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/install b/install index 046ab3c8..e32bdd1d 100755 --- a/install +++ b/install @@ -122,9 +122,30 @@ cd rpitx ./install.sh +cd + +git clone https://github.com/ac2cz/iors_common.git + +cd iors_common/Debug/ + +make all + +sudo ./install.sh cd +git clone https://github.com/ac2cz/pi_pacsat.git + +cd pi_pacsat/Debug + +make all + +mkdir /home/pi/PacSat +mkdir /home/pi/PacSat/pacsat +mkdir /home/pi/PacSat/pacsat/dir + +export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + cd sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service From e5a04b3397c438516446d622100899bd0c87ce26 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 10:21:42 -0500 Subject: [PATCH 023/554] Update pacsatsim.sh added export --- pacsatsim.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index 2ea4707b..68ae50da 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -2,6 +2,8 @@ # script to auto decode packet using rtl_fm and Direwolf and run Pacsat +export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + sudo modprobe snd-aloop #sudo systemctl stop openwebrx From 9ae6394219c65b0c1444d3b10bc7c0a2e2583fa5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 13:41:50 -0500 Subject: [PATCH 024/554] Update install dire wolf invert branch --- install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install b/install index e32bdd1d..2001b3a3 100755 --- a/install +++ b/install @@ -82,6 +82,8 @@ git clone https://github.com/alanbjohnston/direwolf.git cd direwolf +git checkout invert + make -j sudo make install From a7f1928c7c69480cc5b9a1089a4210ada1799808 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 13:48:00 -0500 Subject: [PATCH 025/554] Update pacsatsim.sh turn off cubesat and transmit --- pacsatsim.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index 68ae50da..62f78088 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -4,6 +4,10 @@ export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH +sudo systemctl stop cubesatsim + +sudo systemctl stop transmit + sudo modprobe snd-aloop #sudo systemctl stop openwebrx From 26a816212fa2cc1c438143234b736cdaf7a8d0ab Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 14:12:43 -0500 Subject: [PATCH 026/554] Update direwolf-pacsatsim.conf changed to USB card --- direwolf/direwolf-pacsatsim.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim.conf b/direwolf/direwolf-pacsatsim.conf index 27b58eab..62d1be3d 100644 --- a/direwolf/direwolf-pacsatsim.conf +++ b/direwolf/direwolf-pacsatsim.conf @@ -1,4 +1,4 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 +ADEVICE hw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 PTT GPIO 20 MYCALL AMSAT CHANNEL 0 From 47b1d3b6a2de772bf429686ec52513efa1ed3a3b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:01:41 -0500 Subject: [PATCH 027/554] Update install add passat.config creation --- install | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/install b/install index 2001b3a3..688155ac 100755 --- a/install +++ b/install @@ -150,6 +150,18 @@ export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LI cd +cd PacSat + +echo "bit_rate=9600" > pacsat.config +echo "bbs_callsign=XY2ZZ-12" >> pacsat.config +echo "broadcast_callsign=XY2ZZ-11" >> pacsat.config +echo "digi_callsign=XY2ZZ-1" >> pacsat.config +echo "max_frames_in_tx_buffer=5" >> pacsat.config +echo "pb_open=1" >> pacsat.config +echo "uplink_open=1" >> pacsat.config + +cd + sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service sudo systemctl enable cubesatsim From 8029ce4c55f83448fce8fcee444c7743251534cb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:02:10 -0500 Subject: [PATCH 028/554] Update direwolf-pacsat.conf added KISS port --- groundstation/direwolf/direwolf-pacsat.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/direwolf/direwolf-pacsat.conf b/groundstation/direwolf/direwolf-pacsat.conf index c335760a..fd4983eb 100644 --- a/groundstation/direwolf/direwolf-pacsat.conf +++ b/groundstation/direwolf/direwolf-pacsat.conf @@ -1,3 +1,4 @@ MYCALL AMSAT ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 PTT GPIO 20 +KISSPORT 8100 From 58177965b926838b845457acab9277db133a1fc4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:03:57 -0500 Subject: [PATCH 029/554] Update pacsat.sh add /home/pi/PacSat to script --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 2cca3cef..f063c3eb 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -190,6 +190,6 @@ rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t r cd /home/pi/Desktop/PacSatGround_0.46m_linux/ -sudo setsid java -Xmx512M -jar PacSatGround.jar +sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSat" & sleep 5 From 379bc2c232668fdf8960a2fe87a12761db409218 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:11:17 -0500 Subject: [PATCH 030/554] Create direwolf-fm-pacsat.config --- groundstation/direwolf/direwolf-fm-pacsat.config | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 groundstation/direwolf/direwolf-fm-pacsat.config diff --git a/groundstation/direwolf/direwolf-fm-pacsat.config b/groundstation/direwolf/direwolf-fm-pacsat.config new file mode 100644 index 00000000..770b5422 --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat.config @@ -0,0 +1,4 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=1 plughw:CARD=Headphones,DEV=0 +PTT GPIO 20 +KISSPORT 8100 From 7dc04505f5661d06a1b6b4113678c81af25ee718 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:17:04 -0500 Subject: [PATCH 031/554] Update pacsat.sh check for USB sound card --- groundstation/pacsat.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index f063c3eb..07de1642 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -173,23 +173,33 @@ if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] else - echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" + if [[ $(arecord -l | grep "USB Audio Device") ]] ; then - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & + echo -e "Direwolf using USB Sound Card (FM Transceiver) on $frequency Hz" -fi + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat.conf -t 0 & -sleep 5 + else + + echo -e "Direwolf using RTL-SDR on $frequency Hz" + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & -value=`aplay -l | grep "Loopback"` -echo "$value" > /dev/null -set -- $value + sleep 5 + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & + rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & + + fi cd /home/pi/Desktop/PacSatGround_0.46m_linux/ sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSat" & sleep 5 + +fi From 3d01785a0096c49a2189e8ebd3948887fff820bf Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:18:53 -0500 Subject: [PATCH 032/554] Rename direwolf-fm-pacsat.config to direwolf-fm-pacsat.conf --- .../{direwolf-fm-pacsat.config => direwolf-fm-pacsat.conf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename groundstation/direwolf/{direwolf-fm-pacsat.config => direwolf-fm-pacsat.conf} (100%) diff --git a/groundstation/direwolf/direwolf-fm-pacsat.config b/groundstation/direwolf/direwolf-fm-pacsat.conf similarity index 100% rename from groundstation/direwolf/direwolf-fm-pacsat.config rename to groundstation/direwolf/direwolf-fm-pacsat.conf From c10894e28d5e4abe5fddd24adec62a4988d7f029 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:20:36 -0500 Subject: [PATCH 033/554] Update direwolf-fm-pacsat.conf dev 0 --- groundstation/direwolf/direwolf-fm-pacsat.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat.conf b/groundstation/direwolf/direwolf-fm-pacsat.conf index 770b5422..dab844ae 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat.conf @@ -1,4 +1,4 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Device,DEV=1 plughw:CARD=Headphones,DEV=0 +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 PTT GPIO 20 KISSPORT 8100 From 5a284b9938fdf89860a62950a9dbfc6806dc40c4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:51:00 -0500 Subject: [PATCH 034/554] Create PacSatSim.dat --- spacecraft/PacSatGround_0.46m/PacSatSim.dat | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 spacecraft/PacSatGround_0.46m/PacSatSim.dat diff --git a/spacecraft/PacSatGround_0.46m/PacSatSim.dat b/spacecraft/PacSatGround_0.46m/PacSatSim.dat new file mode 100644 index 00000000..d526f51d --- /dev/null +++ b/spacecraft/PacSatGround_0.46m/PacSatSim.dat @@ -0,0 +1,15 @@ +Pacsat Telemetry Decoder Properties +#Sat Nov 26 18:12:20 EST 2016 +numberOfLookupTables=0 +measurementsFileName=measurements.csv +model=1 +layout0.filename=PACSATSIM_rttelemetry.csv +layout0.name=TLMI_LAYOUT +passMeasurementsFileName=passmeasurements.csv +name=Pacsat +description=PacSatSim +numberOfLayouts=1 +satId=3 +catalogNumber=0 +conversionCoefficients=pacsat-coef.csv +layoutsUseBits=True From a19b591fc8e9e74897b511407097cdba965fa004 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:53:13 -0500 Subject: [PATCH 035/554] Create PacSatSim.properties --- .../PacSatGround_0.46m/PacSatSim.properties | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 spacecraft/PacSatGround_0.46m/PacSatSim.properties diff --git a/spacecraft/PacSatGround_0.46m/PacSatSim.properties b/spacecraft/PacSatGround_0.46m/PacSatSim.properties new file mode 100644 index 00000000..d18ebe5c --- /dev/null +++ b/spacecraft/PacSatGround_0.46m/PacSatSim.properties @@ -0,0 +1,20 @@ +#PacSat Ground Station Properties +#Sun Feb 17 18:25:06 EST 2019 +sequence_num=3 +name=PacSatSim +digiCallsign=W3ZM-1 +description=PacSatSim +broadcastCallsign=W3ZM-11 +DIR_AGE=10 +bbsCallsign=W3ZM-12 +telemLayoutFile=PacSatSim.dat +telem_server=tlm.amsatfox.org +web_site_url=http://CubeSatSim.org +show_system_files_on_dir_tab=false +show_user_files=true +supports_file_upload=true +norad_id=30776 +psf_header_check_sums=false +commandsFile=pacsat.commands +is_command_station=true +secret_key=ScKQLp2ZMvCaCTK5jAmOmKmA0JiSyJ6Y15+Yfg\=\= From ffe5f107ad7ad4891d32a52d633a1a45aa50938a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 16:53:41 -0500 Subject: [PATCH 036/554] Update PacSatSim.dat --- spacecraft/PacSatGround_0.46m/PacSatSim.dat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/PacSatGround_0.46m/PacSatSim.dat b/spacecraft/PacSatGround_0.46m/PacSatSim.dat index d526f51d..92ae8f93 100644 --- a/spacecraft/PacSatGround_0.46m/PacSatSim.dat +++ b/spacecraft/PacSatGround_0.46m/PacSatSim.dat @@ -3,10 +3,10 @@ Pacsat Telemetry Decoder Properties numberOfLookupTables=0 measurementsFileName=measurements.csv model=1 -layout0.filename=PACSATSIM_rttelemetry.csv +layout0.filename=PACSAT_rttelemetry.csv layout0.name=TLMI_LAYOUT passMeasurementsFileName=passmeasurements.csv -name=Pacsat +name=PacSatSim description=PacSatSim numberOfLayouts=1 satId=3 From 21e723d18c03191125d6340569b21c56804b628e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 22:39:54 -0500 Subject: [PATCH 037/554] Update config add -G change to Pacsat --- config | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config b/config index eea64a4e..086b3874 100755 --- a/config +++ b/config @@ -1409,6 +1409,15 @@ elif [ "$1" = "-g" ]; then fi +elif [ "$1" = "-G" ]; then + + echo "Changing to Pacsat mode" + echo + sudo systemctl stop cubesatsim + sudo systemctl stop transmit + + /home/pi/CubeSatSim/pacsat.sh + elif [ "$1" = "-h" ]; then echo "config OPTION" @@ -1445,6 +1454,7 @@ elif [ "$1" = "-h" ]; then echo " -o Change telemetry beacon transmit state" echo " -L Change microphone level for command and control" echo " -g Reset configuration back to default settings" + echo " -G Change to Pacsat mode" echo exit From 84b8b81f2acc4764152f591e0564aa91b55cf1ef Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 22:46:29 -0500 Subject: [PATCH 038/554] Update install download passat ground station --- install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/install b/install index 688155ac..c29ba505 100755 --- a/install +++ b/install @@ -162,6 +162,16 @@ echo "uplink_open=1" >> pacsat.config cd +cd /tmp + +wget https://www.g0kla.com/pacsat/downloads/test/PacSatGround_0.46m_linux.tar.gz + +unzip PacSatGround_0.46m_linux.tar.gz -d /home/pi/Desktop + +rm PacSatGround_0.46m_linux.tar.gz + +cd + sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service sudo systemctl enable cubesatsim From d4d0fb542c87fb604bd290a9abe76cce6eeb07c7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 22:48:41 -0500 Subject: [PATCH 039/554] Update pacsatsim.sh add -qd to dire wolf --- pacsatsim.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 62f78088..5d3713b5 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -175,13 +175,13 @@ if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & + direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim.conf -t 0 & + direwolf -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim.conf -t 0 & fi From fd7dd67663a705f3cb7ef423c773f69d6216283d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 22:53:02 -0500 Subject: [PATCH 040/554] Update pacsat.sh dire wolf -qd and PacSatGround --- groundstation/pacsat.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 07de1642..4695519e 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -4,9 +4,9 @@ sudo modprobe snd-aloop -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null @@ -169,7 +169,7 @@ if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & + direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & else @@ -177,13 +177,13 @@ else echo -e "Direwolf using USB Sound Card (FM Transceiver) on $frequency Hz" - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat.conf -t 0 & + direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat.conf -t 0 & else echo -e "Direwolf using RTL-SDR on $frequency Hz" - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & + direwolf -r 48000 -qd -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & sleep 5 @@ -198,7 +198,7 @@ else cd /home/pi/Desktop/PacSatGround_0.46m_linux/ -sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSat" & +sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" & sleep 5 From 22e20ab6bbfdef5a8373dfe0514b2a15ea4bfd2d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 22:54:08 -0500 Subject: [PATCH 041/554] Update install PacSatGround --- install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install b/install index c29ba505..edea60f8 100755 --- a/install +++ b/install @@ -170,6 +170,8 @@ unzip PacSatGround_0.46m_linux.tar.gz -d /home/pi/Desktop rm PacSatGround_0.46m_linux.tar.gz +mkdir /home/pi/PacSatGround + cd sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service From b97e08cab31b7a61f138c8cf698e1c3cbc28ae0c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 22:59:37 -0500 Subject: [PATCH 042/554] Update install set callsign in pacsat.config --- install | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install b/install index edea60f8..51509ee5 100755 --- a/install +++ b/install @@ -152,10 +152,14 @@ cd cd PacSat +value=`cat /home/pi/CubeSatSim/sim.cfg` +echo "$value" > /dev/null +set -- $value + echo "bit_rate=9600" > pacsat.config -echo "bbs_callsign=XY2ZZ-12" >> pacsat.config -echo "broadcast_callsign=XY2ZZ-11" >> pacsat.config -echo "digi_callsign=XY2ZZ-1" >> pacsat.config +echo "bbs_callsign=$1" >> pacsat.config +echo "broadcast_callsign=$1-11" >> pacsat.config +echo "digi_callsign=$1-1" >> pacsat.config echo "max_frames_in_tx_buffer=5" >> pacsat.config echo "pb_open=1" >> pacsat.config echo "uplink_open=1" >> pacsat.config From b81492ba32f299742218b83200246ae6ed9e0c42 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 29 Nov 2024 23:05:58 -0500 Subject: [PATCH 043/554] Update config change callsign in pacsat config --- config | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config b/config index 086b3874..89727f2c 100755 --- a/config +++ b/config @@ -525,14 +525,16 @@ elif [ "$1" = "-c" ]; then echo "$value" > /dev/null set -- $value + callsign="$1" + echo "Current value of CALLSIGN is" - echo $1 + echo $oldcallsign echo # echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} echo "Enter callsign in all capitals: " - read callsign + read $oldcallsign if [ -z $callsign ] ; then @@ -545,6 +547,8 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg + + sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config fi if [ "$norestart" = "1" ]; then From 81cc1c7348d420e83a07b77be9a3e851fc139f7d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 08:36:26 -0500 Subject: [PATCH 044/554] Update pacsat.sh stop CubeSatSim and transmit --- groundstation/pacsat.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 07de1642..aafc69d0 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -4,9 +4,13 @@ sudo modprobe snd-aloop -sudo systemctl stop openwebrx +sudo systemctl stop cubesatsim &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop transmit &>/dev/null + +sudo systemctl stop openwebrx &>/dev/null + +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null From 46dfb90bd96c2522cc3ce0bb6de848c567e6dcf8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 11:24:11 -0500 Subject: [PATCH 045/554] Update pacsatsim.sh cd to Debug, don't prompt frequency --- pacsatsim.sh | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 5d3713b5..b1c20612 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -46,20 +46,22 @@ echo #exit -echo "Choose the number for the packet decoding option:" -echo -echo "1. APRS US 2m (144390 kHz)" -echo "2. CubeSatSim (434900 kHz)" -echo "3. APRS European 2m (144800 kHz)" -echo "4. APRS Australian 2m (145175 kHz)" -echo "5. APRS on another frequency" -echo "6. APRS on ISS (145825 kHz)" -echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" -echo "8. Test Serenity CubeSat decoding with WAV file" -echo "9. Test APRS decoding with CubeSatSim WAV file" -echo - -read -r choice +#echo "Choose the number for the packet decoding option:" +#echo +#echo "1. APRS US 2m (144390 kHz)" +#echo "2. CubeSatSim (434900 kHz)" +#echo "3. APRS European 2m (144800 kHz)" +#echo "4. APRS Australian 2m (145175 kHz)" +#echo "5. APRS on another frequency" +#echo "6. APRS on ISS (145825 kHz)" +#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" +#echo "8. Test Serenity CubeSat decoding with WAV file" +#echo "9. Test APRS decoding with CubeSatSim WAV file" +#echo + +#read -r choice + +choice=2 #fi @@ -193,6 +195,8 @@ set -- $value #rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & -/home/pi/pi_pacsat/Debug/pi_pacsat -c /home/pi/pi_pacsat/Debug/pacsat.config -d /home/pi/PacSat +cd /home/pi/pi_pacsat/Debug + +./pi_pacsat -c pacsat.config -d /home/pi/PacSat sleep 5 From d726d004eb9a44c1e0e2cdcaa243b4d415f6f423 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 14:36:39 -0500 Subject: [PATCH 046/554] Update install config.txt changes --- install | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/install b/install index 51509ee5..69380167 100755 --- a/install +++ b/install @@ -1,6 +1,6 @@ #!/bin/bash -echo -e "\ninstallation script for CubeSatSim v2.0\n" +echo -e "\ninstallation script for CubeSatSim v2.1\n" FILE=/home/pi/CubeSatSim/sim.cfg if [ -f "$FILE" ]; then @@ -161,11 +161,18 @@ echo "bbs_callsign=$1" >> pacsat.config echo "broadcast_callsign=$1-11" >> pacsat.config echo "digi_callsign=$1-1" >> pacsat.config echo "max_frames_in_tx_buffer=5" >> pacsat.config -echo "pb_open=1" >> pacsat.config -echo "uplink_open=1" >> pacsat.config + +echo "pb_open=1" > pacsat.state +echo "uplink_open=1" >> pacsat.state cd +sudo sed -i 's/#hdmi_group=1/hdmi_group=2/g' /boot/config.txt +sudo sed -i 's/#hdmi_mode=1/hdmi_mode=16/g' /boot/config.txt +sudo sed -i 's/#hdmi_force_hotplug=1/hdmi_force_hotplug=1/g' /boot/config.txt + +sudo raspi-config nonint do_vnc 0 + cd /tmp wget https://www.g0kla.com/pacsat/downloads/test/PacSatGround_0.46m_linux.tar.gz @@ -206,11 +213,10 @@ sudo raspi-config nonint do_legacy 0 ## sudo sed -i 's/console=serial0,115200 //g' /boot/cmdline.txt - sudo sed -i 's/console=serial0,115200 //g' /boot/cmdline.txt - sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2 - + #sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2 + sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/config.txt if [[ $(grep 'dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24' /boot/config.txt) ]]; then From d74b8b7f862c8ad79d14451b4119812de4005a12 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 14:47:53 -0500 Subject: [PATCH 047/554] Update config don't update pacsat callsign --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index 89727f2c..db0100c2 100755 --- a/config +++ b/config @@ -548,7 +548,7 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg - sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config +# sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config fi if [ "$norestart" = "1" ]; then From 4afd9bba1cd1bf5e74bd472dc34934fdeb272ab1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 14:53:53 -0500 Subject: [PATCH 048/554] Update config don't look at output of sed on callsign --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index db0100c2..ed62d2d3 100755 --- a/config +++ b/config @@ -548,7 +548,7 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg -# sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config + sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config > /dev/null 2>&1 fi if [ "$norestart" = "1" ]; then From 384086003796ef6f7885ba2cdfa17168f2a09015 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 15:05:38 -0500 Subject: [PATCH 049/554] Update config fix -c bug --- config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config b/config index ed62d2d3..9c2d5671 100755 --- a/config +++ b/config @@ -525,7 +525,7 @@ elif [ "$1" = "-c" ]; then echo "$value" > /dev/null set -- $value - callsign="$1" + oldcallsign="$1" echo "Current value of CALLSIGN is" echo $oldcallsign @@ -534,7 +534,7 @@ elif [ "$1" = "-c" ]; then # echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} echo "Enter callsign in all capitals: " - read $oldcallsign + read $callsign if [ -z $callsign ] ; then From 1de4e6535869c996897813a04493a4bbd9d47802 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 15:07:56 -0500 Subject: [PATCH 050/554] Update config typo in -c --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index 9c2d5671..e4c41243 100755 --- a/config +++ b/config @@ -534,7 +534,7 @@ elif [ "$1" = "-c" ]; then # echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} echo "Enter callsign in all capitals: " - read $callsign + read callsign if [ -z $callsign ] ; then From c0c23db6b1b51febe02fe2d50762eb7e513dce36 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 15:38:57 -0500 Subject: [PATCH 051/554] Update install --- install | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/install b/install index 69380167..559351ca 100755 --- a/install +++ b/install @@ -148,10 +148,6 @@ mkdir /home/pi/PacSat/pacsat/dir export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH -cd - -cd PacSat - value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null set -- $value @@ -165,8 +161,6 @@ echo "max_frames_in_tx_buffer=5" >> pacsat.config echo "pb_open=1" > pacsat.state echo "uplink_open=1" >> pacsat.state -cd - sudo sed -i 's/#hdmi_group=1/hdmi_group=2/g' /boot/config.txt sudo sed -i 's/#hdmi_mode=1/hdmi_mode=16/g' /boot/config.txt sudo sed -i 's/#hdmi_force_hotplug=1/hdmi_force_hotplug=1/g' /boot/config.txt @@ -177,7 +171,7 @@ cd /tmp wget https://www.g0kla.com/pacsat/downloads/test/PacSatGround_0.46m_linux.tar.gz -unzip PacSatGround_0.46m_linux.tar.gz -d /home/pi/Desktop +tar -xzf PacSatGround_0.46m_linux.tar.gz -C /home/pi/Desktop rm PacSatGround_0.46m_linux.tar.gz From 776aba9511527bde727d48cacd293c3968976750 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 16:22:06 -0500 Subject: [PATCH 052/554] Update install add java install --- install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install b/install index 559351ca..62160b9d 100755 --- a/install +++ b/install @@ -177,6 +177,8 @@ rm PacSatGround_0.46m_linux.tar.gz mkdir /home/pi/PacSatGround +sudo apt-get install default-jdk -y + cd sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service From ac61e44c09be5bb9ea1a1181d556f620ec9e94c9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 16:35:59 -0500 Subject: [PATCH 053/554] Update install copy spacecraft files --- install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install b/install index 62160b9d..2b4048d6 100755 --- a/install +++ b/install @@ -175,6 +175,8 @@ tar -xzf PacSatGround_0.46m_linux.tar.gz -C /home/pi/Desktop rm PacSatGround_0.46m_linux.tar.gz +cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacSatGround_0.46m_linux/spacecraft/ + mkdir /home/pi/PacSatGround sudo apt-get install default-jdk -y From a64c34c41a5f7179550a4d3543c73d71cdb0eb52 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:39:28 -0500 Subject: [PATCH 054/554] Update config Pacsat mode "p" in .mode --- config | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/config b/config index e4c41243..ea596d16 100755 --- a/config +++ b/config @@ -1416,11 +1416,22 @@ elif [ "$1" = "-g" ]; then elif [ "$1" = "-G" ]; then echo "Changing to Pacsat mode" - echo - sudo systemctl stop cubesatsim - sudo systemctl stop transmit + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value - /home/pi/CubeSatSim/pacsat.sh + echo "changing CubeSatSim to Pacsat mode" + sudo echo "p" > /home/pi/CubeSatSim/.mode + if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then + FILE=/home/pi/CubeSatSim/battery_saver + if [ -f "$FILE" ]; then + restart=1 + else + reboot=1 + fi + else + restart=1 + fi elif [ "$1" = "-h" ]; then From 3422b197723e075bbeaaf09ba9cb386456f2f835 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:42:56 -0500 Subject: [PATCH 055/554] Update main.c added PACSAT mode --- main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 36dfce4c..b529a619 100644 --- a/main.c +++ b/main.c @@ -233,7 +233,10 @@ int main(int argc, char * argv[]) { printf("Mode is Repeater\n"); } else if ( mode_string == 'n') { mode = TXCOMMAND; - printf("Mode is Transmit Command\n"); + printf("Mode is Transmit Command\n"); + } else if ( mode_string == 'p') { + mode = PACSAT; + printf("Mode is Pacsat\n"); } else { printf("Mode is BPSK\n"); } @@ -869,7 +872,7 @@ int main(int argc, char * argv[]) { } else if ((mode == FSK) || (mode == BPSK)) {// FSK or BPSK get_tlm_fox(); - } else { // SSTV + } else { // SSTV or PACSAT // fprintf(stderr, "Sleeping\n"); sleep(30); } @@ -2205,7 +2208,7 @@ if (setting == ON) { pclose(command); fprintf(stderr,"Turning Safe Mode ON\n"); fprintf(stderr,"Turning Battery saver mode ON\n"); - if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) { + if ((mode == AFSK) || (mode == SSTV) || (mode == CW) || (mode == PACSAT)) { command = popen("echo 'reboot due to turning ON Safe Mode!' | wall", "r"); pclose(command); command = popen("sudo reboot now", "r"); @@ -2221,7 +2224,7 @@ if (setting == ON) { FILE *command = popen("rm /home/pi/CubeSatSim/battery_saver", "r"); pclose(command); fprintf(stderr,"Turning Battery saver mode OFF\n"); - if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) { + if ((mode == AFSK) || (mode == SSTV) || (mode == CW) || (mode == PACSAT)) { command = popen("echo 'reboot due to turning OFF Safe Mode!' | wall", "r"); pclose(command); command = popen("sudo reboot now", "r"); From e4c2f5f99701ae5e6b9eff1c84d051ab4e242550 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:43:39 -0500 Subject: [PATCH 056/554] Update main.h add PACSAT mode 6 --- main.h | 1 + 1 file changed, 1 insertion(+) diff --git a/main.h b/main.h index 6708d1af..0b794df2 100644 --- a/main.h +++ b/main.h @@ -108,6 +108,7 @@ FILE *telem_file; #define BPSK 3 #define SSTV 4 #define CW 5 +#define PACSAT 6 #define REPEATER 11 #define TXCOMMAND 12 From 739e9706a01fb57502919e2b961c2a84d71be745 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:48:21 -0500 Subject: [PATCH 057/554] Update transmit.py added Pacsat mode --- transmit.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 859892f9..f04d8cd7 100644 --- a/transmit.py +++ b/transmit.py @@ -381,7 +381,7 @@ if __name__ == "__main__": # if (mode != ) and (command_tx == True): # if (command_tx == True): - if ((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's')) and (command_tx == True) and (skip == False): + if ((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'p')) and (command_tx == True) and (skip == False): # battery_saver_mode GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 GPIO.setup(txLed, GPIO.OUT) @@ -415,12 +415,15 @@ if __name__ == "__main__": # if (len(sys.argv)) > 1: # print("There are arguments!") - if (mode == 'a') or (mode == 'x') or (mode == 'n'): + if (mode == 'a') or (mode == 'x') or (mode == 'n') or (mode == 'p'): # command_control_check() output(pd, 1) output(ptt, 1) if (mode == 'a'): print("AFSK") + elif (mode == 'p'): + print("Pacsat") + system('/home/pi/CubeSatSim/pacsat.sh') else: GPIO.output(powerPin, 0) print("Transmit APRS Commands") From a66ebedff922e18ed08349f8d8c0690a31760ed2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:49:46 -0500 Subject: [PATCH 058/554] Update config v2.1 --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index ea596d16..ec62cf75 100755 --- a/config +++ b/config @@ -210,7 +210,7 @@ function transmit_command_beacon { exit } -echo "CubeSatSim v2.0 configuration tool" +echo "CubeSatSim v2.1 configuration tool" echo # echo $1 # echo $2 From fe0791ec6f33860b59ca93d0b557e9a9fcf731bb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:50:08 -0500 Subject: [PATCH 059/554] Update main.c v2.1 --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index b529a619..f642a907 100644 --- a/main.c +++ b/main.c @@ -25,7 +25,7 @@ int main(int argc, char * argv[]) { - printf("\n\nCubeSatSim v2.0 starting...\n\n"); + printf("\n\nCubeSatSim v2.1 starting...\n\n"); wiringPiSetup(); From 7eaf1e284a79379fc79d52a8c939c6d0d122e352 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:50:30 -0500 Subject: [PATCH 060/554] Update transmit.py v2.1 --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index f04d8cd7..a047695b 100644 --- a/transmit.py +++ b/transmit.py @@ -136,7 +136,7 @@ def increment_mode(): print("can't write to .mode file") -print("CubeSatSim v2.0 transmit.py starting...") +print("CubeSatSim v2.1 transmit.py starting...") pd = 21 ptt = 20 From 263fd869813ad8304cc960e451f57be7b0aba036 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:54:18 -0500 Subject: [PATCH 061/554] Update transmit.py fixed pacsat call --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index a047695b..05c4b071 100644 --- a/transmit.py +++ b/transmit.py @@ -423,7 +423,7 @@ if __name__ == "__main__": print("AFSK") elif (mode == 'p'): print("Pacsat") - system('/home/pi/CubeSatSim/pacsat.sh') + system('/home/pi/CubeSatSim/pacsatsim.sh') else: GPIO.output(powerPin, 0) print("Transmit APRS Commands") From d064598d300d0902d938bea0c866d9a83444196d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:55:35 -0500 Subject: [PATCH 062/554] Update config display pacsat --- config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config b/config index ec62cf75..b7c4d3f6 100755 --- a/config +++ b/config @@ -257,6 +257,8 @@ if [ "$1" = "" ]; then else echo -n "APRS" fi + elif [ "$1" = "p" ]; then + echo "Mode is Pacsat" else echo fi From dabca2d79464d73fb84aa8422767e63e2793767e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 21:57:46 -0500 Subject: [PATCH 063/554] Update pacsatsim.sh don't stop CubeSatSim or transmit --- pacsatsim.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index b1c20612..ffe823bf 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -4,15 +4,17 @@ export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH -sudo systemctl stop cubesatsim +#sudo systemctl stop cubesatsim -sudo systemctl stop transmit +#sudo systemctl stop transmit + +sudo systemctl stop command &>/dev/null sudo modprobe snd-aloop #sudo systemctl stop openwebrx -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null #pkill -o chromium &>/dev/null From b729af95f16ba3bde036483888678718a99a24ff Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 30 Nov 2024 22:17:38 -0500 Subject: [PATCH 064/554] Update pacsat.sh stop command --- groundstation/pacsat.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 95c71877..57ebeb58 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -4,11 +4,12 @@ sudo modprobe snd-aloop - sudo systemctl stop cubesatsim &>/dev/null sudo systemctl stop transmit &>/dev/null +sudo systemctl stop command &>/dev/null + sudo systemctl stop openwebrx &>/dev/null sudo systemctl stop rtl_tcp &>/dev/null From 57ddc39f4e9c68a9a15cd6bc3fe96a9953007eef Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 07:33:24 -0500 Subject: [PATCH 065/554] Update update to install pacsat software --- update | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/update b/update index fcef1749..f612f69e 100755 --- a/update +++ b/update @@ -1,6 +1,6 @@ #!/bin/bash -echo -e "\nupdate script for CubeSatSim v2.0\n" +echo -e "\nupdate script for CubeSatSim v2.1\n" if [ "$1" = "n" ] ; then # if [ -z "$2" ] ; then @@ -33,7 +33,7 @@ sudo sed -i 's/more information/more\ninformation/g' /etc/motd sudo sed -i 's/update to/update\nto/g' /etc/motd -sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2 +#sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2 cd /home/pi/CubeSatSim @@ -300,6 +300,81 @@ git checkout master #fi +if [ ! -d "/home/pi/pi_pacsat" ]; then + + cd + + git clone https://github.com/ac2cz/iors_common.git + + cd iors_common/Debug/ + + make all + + sudo ./install.sh + + cd + + git clone https://github.com/ac2cz/pi_pacsat.git + + cd pi_pacsat/Debug + + make all + + mkdir /home/pi/PacSat + mkdir /home/pi/PacSat/pacsat + mkdir /home/pi/PacSat/pacsat/dir + + export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo "bit_rate=9600" > pacsat.config + echo "bbs_callsign=$1" >> pacsat.config + echo "broadcast_callsign=$1-11" >> pacsat.config + echo "digi_callsign=$1-1" >> pacsat.config + echo "max_frames_in_tx_buffer=5" >> pacsat.config + + echo "pb_open=1" > pacsat.state + echo "uplink_open=1" >> pacsat.state + + sudo sed -i 's/#hdmi_group=1/hdmi_group=2/g' /boot/config.txt + sudo sed -i 's/#hdmi_mode=1/hdmi_mode=16/g' /boot/config.txt + sudo sed -i 's/#hdmi_force_hotplug=1/hdmi_force_hotplug=1/g' /boot/config.txt + + sudo raspi-config nonint do_vnc 0 + + cd /tmp + + wget https://www.g0kla.com/pacsat/downloads/test/PacSatGround_0.46m_linux.tar.gz + + tar -xzf PacSatGround_0.46m_linux.tar.gz -C /home/pi/Desktop + + rm PacSatGround_0.46m_linux.tar.gz + + cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacSatGround_0.46m_linux/spacecraft/ + + mkdir /home/pi/PacSatGround + + sudo apt-get install default-jdk -y + +cd + +fi + +cd rpitx + +if [[ ! $(git status | grep 'invert') ]]; then + + echo "updating rpitx to ptt invert branch" + git pull + git checkout invert + ./update.sh + cd + +fi + changed=0 value=`cat /home/pi/CubeSatSim/sim.cfg` # echo "$value" From 55b6bb66a15710f22662faebeaaf064997c24c3d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 10:22:28 -0500 Subject: [PATCH 066/554] Update update fixed direwolf update --- update | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/update b/update index f612f69e..8bfed65e 100755 --- a/update +++ b/update @@ -363,14 +363,18 @@ cd fi -cd rpitx +cd direwolf if [[ ! $(git status | grep 'invert') ]]; then - echo "updating rpitx to ptt invert branch" + echo "updating direwolf to ptt invert version" + git pull git checkout invert - ./update.sh + make clean + make -j + sudo make install + make install-rpi cd fi From e90a0821490b12af2a4cc42a761d5dd7b2d2f711 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 10:25:32 -0500 Subject: [PATCH 067/554] Update update fixed cd --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index 8bfed65e..d1c6eefd 100755 --- a/update +++ b/update @@ -363,7 +363,7 @@ cd fi -cd direwolf +cd /home/pi/direwolf if [[ ! $(git status | grep 'invert') ]]; then From 7fa7aaff6731a608aeed6002677979c99ba330fc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 10:31:23 -0500 Subject: [PATCH 068/554] Update update --- update | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/update b/update index d1c6eefd..16e51b01 100755 --- a/update +++ b/update @@ -365,11 +365,15 @@ fi cd /home/pi/direwolf +git status + +git status | grep 'invert' + if [[ ! $(git status | grep 'invert') ]]; then echo "updating direwolf to ptt invert version" - git pull + git pull --no-rebase git checkout invert make clean make -j From 71d11c64882071fd70da167c0362b940561d4e08 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 10:35:39 -0500 Subject: [PATCH 069/554] Update update remove extra git --- update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update b/update index 16e51b01..4f47510e 100755 --- a/update +++ b/update @@ -365,9 +365,9 @@ fi cd /home/pi/direwolf -git status +#git status -git status | grep 'invert' +#git status | grep 'invert' if [[ ! $(git status | grep 'invert') ]]; then From cd5a39846bf76da6835c5f3c6bec0e5297e10b08 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 10:54:44 -0500 Subject: [PATCH 070/554] Update update remove single cpu --- update | 1 + 1 file changed, 1 insertion(+) diff --git a/update b/update index 4f47510e..4dbbf79f 100755 --- a/update +++ b/update @@ -34,6 +34,7 @@ sudo sed -i 's/more information/more\ninformation/g' /etc/motd sudo sed -i 's/update to/update\nto/g' /etc/motd #sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2 +sudo sed -i 's/console=tty1 maxcpus=1 r/console=tty1 r/g' /boot/cmdline.txt # remove single core cd /home/pi/CubeSatSim From 24c54e6380b776395113d5e1848c769146796738 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 11:35:10 -0500 Subject: [PATCH 071/554] Update update reboot if adding pacsat code --- update | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update b/update index 4dbbf79f..6d74a557 100755 --- a/update +++ b/update @@ -302,6 +302,8 @@ git checkout master #fi if [ ! -d "/home/pi/pi_pacsat" ]; then + + FLAG=1 cd From fa89f12a2f8fa649561e83f633a4bd5c65736f5b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 13:09:34 -0500 Subject: [PATCH 072/554] Update direwolf-pacsatsim.conf set fullduplex off --- direwolf/direwolf-pacsatsim.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/direwolf/direwolf-pacsatsim.conf b/direwolf/direwolf-pacsatsim.conf index 62d1be3d..370e54b0 100644 --- a/direwolf/direwolf-pacsatsim.conf +++ b/direwolf/direwolf-pacsatsim.conf @@ -3,3 +3,4 @@ PTT GPIO 20 MYCALL AMSAT CHANNEL 0 MODEM 1200 +FULLDUP OFF From 9a658b02ed990bfc6752bf2ce47be1f7e798a6ee Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 13:10:15 -0500 Subject: [PATCH 073/554] Update direwolf-fm-pacsat.conf full duplex off --- groundstation/direwolf/direwolf-fm-pacsat.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/direwolf/direwolf-fm-pacsat.conf b/groundstation/direwolf/direwolf-fm-pacsat.conf index dab844ae..fba77b7e 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat.conf @@ -2,3 +2,4 @@ MYCALL AMSAT ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 PTT GPIO 20 KISSPORT 8100 +FULLDUP OFF From 2fb339fd8b6c107c5a1a9e11d6f333470a9724fb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 13:10:32 -0500 Subject: [PATCH 074/554] Update direwolf-pacsat.conf full duplex off --- groundstation/direwolf/direwolf-pacsat.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/direwolf/direwolf-pacsat.conf b/groundstation/direwolf/direwolf-pacsat.conf index fd4983eb..e526e272 100644 --- a/groundstation/direwolf/direwolf-pacsat.conf +++ b/groundstation/direwolf/direwolf-pacsat.conf @@ -2,3 +2,4 @@ MYCALL AMSAT ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 PTT GPIO 20 KISSPORT 8100 +FULLDUP OFF From 7c4c344b0dcb329ec8d67b1af1baa940106f899f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 15:02:17 -0500 Subject: [PATCH 075/554] Update config .mode P is pacsat ground station --- config | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/config b/config index b7c4d3f6..ab80445b 100755 --- a/config +++ b/config @@ -1435,6 +1435,28 @@ elif [ "$1" = "-G" ]; then restart=1 fi +elif [ "$1" = "-H" ]; then + + echo "Changing to Pacsat Ground Station mode" + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + + echo "changing CubeSatSim to Pacsat mode" + sudo echo "P" > /home/pi/CubeSatSim/.mode + if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then + FILE=/home/pi/CubeSatSim/battery_saver + if [ -f "$FILE" ]; then + restart=1 + else + reboot=1 + fi + else + restart=1 + fi + + + elif [ "$1" = "-h" ]; then echo "config OPTION" From 621bcb0fd068d7aed50e952a3e1cebed57e54add Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 15:04:13 -0500 Subject: [PATCH 076/554] Update main.c added PACSATGND --- main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index f642a907..f520add1 100644 --- a/main.c +++ b/main.c @@ -237,7 +237,10 @@ int main(int argc, char * argv[]) { } else if ( mode_string == 'p') { mode = PACSAT; printf("Mode is Pacsat\n"); - } else { + } else if ( mode_string == 'P') { + mode = PACSATGND; + printf("Mode is Pacsat Ground Station\n"); + } else { printf("Mode is BPSK\n"); } } @@ -872,7 +875,7 @@ int main(int argc, char * argv[]) { } else if ((mode == FSK) || (mode == BPSK)) {// FSK or BPSK get_tlm_fox(); - } else { // SSTV or PACSAT + } else { // SSTV or PACSAT or PACSATGND // fprintf(stderr, "Sleeping\n"); sleep(30); } From ccc5c4ff9733ff974c84378734a903e567bb0030 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 15:04:52 -0500 Subject: [PATCH 077/554] Update main.h added PACSATGND --- main.h | 1 + 1 file changed, 1 insertion(+) diff --git a/main.h b/main.h index 0b794df2..83f993ae 100644 --- a/main.h +++ b/main.h @@ -111,6 +111,7 @@ FILE *telem_file; #define PACSAT 6 #define REPEATER 11 #define TXCOMMAND 12 +#define PACSATGND 13 int transmitStatus = -1; From 042670a2316597b94beaa93ff3fbe54ca69ee89a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 15:07:25 -0500 Subject: [PATCH 078/554] Update transmit.py added mode P for Pacsat Gnd Station --- transmit.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 05c4b071..87a616ad 100644 --- a/transmit.py +++ b/transmit.py @@ -415,7 +415,7 @@ if __name__ == "__main__": # if (len(sys.argv)) > 1: # print("There are arguments!") - if (mode == 'a') or (mode == 'x') or (mode == 'n') or (mode == 'p'): + if (mode == 'a') or (mode == 'x') or (mode == 'n') or (mode == 'p') or (mode == 'P': # command_control_check() output(pd, 1) output(ptt, 1) @@ -424,6 +424,10 @@ if __name__ == "__main__": elif (mode == 'p'): print("Pacsat") system('/home/pi/CubeSatSim/pacsatsim.sh') + elif (mode == 'p'): + print("Pacsat Ground Station") + while True: + sleep(30) else: GPIO.output(powerPin, 0) print("Transmit APRS Commands") From 79bd5a787dcbd3898e8ab2d3f2332a4917b79771 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 15:11:02 -0500 Subject: [PATCH 079/554] Update transmit.py typo --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 87a616ad..ba826051 100644 --- a/transmit.py +++ b/transmit.py @@ -381,7 +381,7 @@ if __name__ == "__main__": # if (mode != ) and (command_tx == True): # if (command_tx == True): - if ((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'p')) and (command_tx == True) and (skip == False): + if ((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'p') or (mode == 'P')) and (command_tx == True) and (skip == False): # battery_saver_mode GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 GPIO.setup(txLed, GPIO.OUT) @@ -415,7 +415,7 @@ if __name__ == "__main__": # if (len(sys.argv)) > 1: # print("There are arguments!") - if (mode == 'a') or (mode == 'x') or (mode == 'n') or (mode == 'p') or (mode == 'P': + if (mode == 'a') or (mode == 'x') or (mode == 'n') or (mode == 'p') or (mode == 'P'): # command_control_check() output(pd, 1) output(ptt, 1) From 2e1f2024e7b4d29290f0a37e61fa7b160ab91afa Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 15:13:57 -0500 Subject: [PATCH 080/554] Update config changed to -I --- config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config b/config index ab80445b..800352de 100755 --- a/config +++ b/config @@ -1435,7 +1435,7 @@ elif [ "$1" = "-G" ]; then restart=1 fi -elif [ "$1" = "-H" ]; then +elif [ "$1" = "-I" ]; then echo "Changing to Pacsat Ground Station mode" value=`cat /home/pi/CubeSatSim/.mode` @@ -1494,6 +1494,7 @@ elif [ "$1" = "-h" ]; then echo " -L Change microphone level for command and control" echo " -g Reset configuration back to default settings" echo " -G Change to Pacsat mode" + echo " -I Changing to Pacsat Ground Station mode" echo exit From 2077bfe7f7238a22a2fd8d0cf8e8ddc1cbfc7b37 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 15:16:51 -0500 Subject: [PATCH 081/554] Update pacsat.sh run Config -I --- groundstation/pacsat.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 57ebeb58..e2b3d1ad 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -4,9 +4,11 @@ sudo modprobe snd-aloop -sudo systemctl stop cubesatsim &>/dev/null +#sudo systemctl stop cubesatsim &>/dev/null -sudo systemctl stop transmit &>/dev/null +#sudo systemctl stop transmit &>/dev/null + +/home/pi/CubeSatSim/config -I sudo systemctl stop command &>/dev/null From 8ede3a5c9ef1ab7f47b3452f090b30d6288a5be2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 15:26:41 -0500 Subject: [PATCH 082/554] Update transmit.py don't turn on c2c for p or P mode --- transmit.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/transmit.py b/transmit.py index ba826051..a1250e44 100644 --- a/transmit.py +++ b/transmit.py @@ -326,23 +326,24 @@ if __name__ == "__main__": print("Can't read callsign from sim.cfg file, defaulting to AMSAT") file.close() - try: - f = open("/home/pi/CubeSatSim/command_control", "r") - f.close() - GPIO.setmode(GPIO.BCM) - GPIO.setwarnings(False) - GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected - if GPIO.input(squelch) == False: - print("squelch not set correctly, no command input!") + if (mode != 'p') and (mode != 'P'): + try: + f = open("/home/pi/CubeSatSim/command_control", "r") + f.close() + GPIO.setmode(GPIO.BCM) + GPIO.setwarnings(False) + GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected + if GPIO.input(squelch) == False: + print("squelch not set correctly, no command input!") + no_command = True + else: + print("command and control is activated") + no_command = False + # system("/home/pi/CubeSatSim/command &") + system("sudo systemctl start command") + except: + print("command and control not activated") no_command = True - else: - print("command and control is activated") - no_command = False -# system("/home/pi/CubeSatSim/command &") - system("sudo systemctl start command") - except: - print("command and control not activated") - no_command = True print(callsign) GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 From 64a11849355b7898a30c3f1494f1182f787e8d0d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 15:28:57 -0500 Subject: [PATCH 083/554] Update config add print Pacsat ground station mode --- config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config b/config index 800352de..3764aa86 100755 --- a/config +++ b/config @@ -259,6 +259,8 @@ if [ "$1" = "" ]; then fi elif [ "$1" = "p" ]; then echo "Mode is Pacsat" + elif [ "$1" = "P" ]; then + echo "Mode is Pacsat Ground Station" else echo fi From b00a99649c900c86842b85b37a99506e435e8d27 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 16:29:33 -0500 Subject: [PATCH 084/554] Update pacsat.sh --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index e2b3d1ad..ee56972d 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -206,7 +206,7 @@ else cd /home/pi/Desktop/PacSatGround_0.46m_linux/ -sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" & +sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" sleep 5 From 8433067061fdf11c809cb78f70def84b7d165174 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Dec 2024 16:39:48 -0500 Subject: [PATCH 085/554] Update pacsat.sh no frequency prompt --- groundstation/pacsat.sh | 188 ++++++---------------------------------- 1 file changed, 27 insertions(+), 161 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index ee56972d..8e728541 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -4,10 +4,6 @@ sudo modprobe snd-aloop -#sudo systemctl stop cubesatsim &>/dev/null - -#sudo systemctl stop transmit &>/dev/null - /home/pi/CubeSatSim/config -I sudo systemctl stop command &>/dev/null @@ -36,178 +32,48 @@ sudo killall -9 zenity &>/dev/null echo -frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") - -#echo $frequency - -if [ -z "$frequency" ]; then - -echo "No choice made. Exiting." - -sleep 3 - -exit - -#echo "Choose the number for the packet decoding option:" -#echo -#echo "1. APRS US 2m (144390 kHz)" -#echo "2. CubeSatSim (434900 kHz)" -#echo "3. APRS European 2m (144800 kHz)" -#echo "4. APRS Australian 2m (145175 kHz)" -#echo "5. APRS on another frequency" -#echo "6. APRS on ISS (145825 kHz)" -#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" -#echo "8. Test Serenity CubeSat decoding with WAV file" -#echo "9. Test APRS decoding with CubeSatSim WAV file" -#echo - -#read -r choice - -fi - -if [ "$choice" = "1" ] || [ "$frequency" = "144390" ]; then - - frequency=144390000 - -elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then - - frequency=434900000 - echo - echo "If your CubeSatSim is transmitting in APRS mode (mode 1) then you should see packets." - echo - -elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then - - frequency=144800000 - -elif [ "$choice" = "4" ] || [ "$frequency" = "145175" ]; then - - frequency=145175000 - -elif [ "$choice" = "5" ] || [ "$frequency" = "Other" ] ; then - - echo - - echo "Enter the frequency in kiloHertz" - - echo - - read -r frequency - - frequency=$frequency"000" - - #echo $frequency - -elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then - - frequency=145825000 - echo - echo "If the ISS is overhead and in APRS mode (see tracking application such as Gpredict), you will see packets." - echo - -elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then - - frequency=437100000 - echo - echo "If the Serenity CubeSat is overhead and transmitting (see tracking application such as Gpredict), you will see packets." - echo - -elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then - - echo "A recorded WAV file will play and you should see some packets decoded" - - echo - - value=`aplay -l | grep "Loopback"` - echo "$value" > /dev/null - set -- $value - -# aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & -# aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & - aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & - aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & - - timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 - - echo - - echo "Test complete. This window will close in 10 seconds." - - sleep 5 - - exit - -elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then - - echo "A recorded APRS WAV file from the CubeSatSim will play and you should see a packet decoded." - - echo - - value=`aplay -l | grep "Loopback"` - echo "$value" > /dev/null - set -- $value - - #aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav & - (while true; do (sleep 2 && aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & - - #aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav & - (while true; do (sleep 2 && aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & - - timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 - - echo - - echo "Test complete. This window will close in 10 seconds." - - sleep 5 - - exit - -#fi - -fi +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 -if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then +if [[ $(arecord -l | grep "USB Audio Device") ]] ; then - echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" - - direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & + echo -e "Direwolf using USB Sound Card (FM Transceiver) on $frequency Hz" + + direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat.conf -t 0 & else - if [[ $(arecord -l | grep "USB Audio Device") ]] ; then - - echo -e "Direwolf using USB Sound Card (FM Transceiver) on $frequency Hz" - - direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat.conf -t 0 & - - else - - echo -e "Direwolf using RTL-SDR on $frequency Hz" - - direwolf -r 48000 -qd -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & + echo -e "Direwolf using RTL-SDR on $frequency Hz" + + direwolf -r 48000 -qd -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & + + sleep 5 + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + + #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 + rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & - sleep 5 - - value=`aplay -l | grep "Loopback"` - echo "$value" > /dev/null - set -- $value - -#rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 - rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & - - fi +fi cd /home/pi/Desktop/PacSatGround_0.46m_linux/ sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" -sleep 5 -fi + From 7c9b16a3a99c1f0d384ebdc59b938c8e39d80fc6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 17:42:35 -0500 Subject: [PATCH 086/554] added for JP14 audio out --- direwolf/direwolf-pacsatsim-jp14.conf | 6 ++++++ groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 5 +++++ groundstation/pacsat.sh | 2 +- pacsatsim.sh | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 direwolf/direwolf-pacsatsim-jp14.conf create mode 100644 groundstation/direwolf/direwolf-fm-pacsat-jp14.conf diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf new file mode 100644 index 00000000..6b28d029 --- /dev/null +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -0,0 +1,6 @@ +ADEVICE hw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +PTT GPIO 20 +MYCALL AMSAT +CHANNEL 0 +MODEM 1200 +FULLDUP OFF diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf new file mode 100644 index 00000000..b698b1ca --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -0,0 +1,5 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +PTT GPIO 20 +KISSPORT 8100 +FULLDUP OFF diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 8e728541..f3ff484f 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -52,7 +52,7 @@ if [[ $(arecord -l | grep "USB Audio Device") ]] ; then echo -e "Direwolf using USB Sound Card (FM Transceiver) on $frequency Hz" - direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat.conf -t 0 & + direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 & else diff --git a/pacsatsim.sh b/pacsatsim.sh index ffe823bf..71d45328 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -185,7 +185,7 @@ else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - direwolf -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim.conf -t 0 & + direwolf -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & fi From 22917da1812f923a303d146acd262e360e67bec1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 19:24:02 -0500 Subject: [PATCH 087/554] Update direwolf-fm-pacsat-jp14.conf added TXDELAY --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index b698b1ca..bcf67f4a 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -3,3 +3,4 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO 20 KISSPORT 8100 FULLDUP OFF +TXDELAY 30 From bfa12ec67197e568930a0357c980466b26204d69 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 19:24:24 -0500 Subject: [PATCH 088/554] Update direwolf-pacsatsim-jp14.conf added TXDELAY --- direwolf/direwolf-pacsatsim-jp14.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 6b28d029..94862393 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,3 +4,4 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF +TXDELAY 30 From 06917939ae4017da6fef7f49f4e1818b052228c9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 19:43:53 -0500 Subject: [PATCH 089/554] Update direwolf-pacsatsim-jp14.conf TXDELAY 1 --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 94862393..4a3b0e55 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,4 +4,4 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -TXDELAY 30 +TXDELAY 1 From 94c56d5a238db245a9be27774c187218d49b2f7d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 19:44:17 -0500 Subject: [PATCH 090/554] Update direwolf-fm-pacsat-jp14.conf TXDELAY 1 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index bcf67f4a..c480ee60 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -3,4 +3,4 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO 20 KISSPORT 8100 FULLDUP OFF -TXDELAY 30 +TXDELAY 1 From 390b6fecc7e5aa610ea7b180840f45604c52f036 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 19:52:03 -0500 Subject: [PATCH 091/554] Update direwolf-fm-pacsat-jp14.conf try 5 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index c480ee60..ac342354 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -3,4 +3,4 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO 20 KISSPORT 8100 FULLDUP OFF -TXDELAY 1 +TXDELAY 5 From 1492df7d1b7e8190957d32d7f1f9d263156bd8a4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 19:52:18 -0500 Subject: [PATCH 092/554] Update direwolf-pacsatsim-jp14.conf --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 4a3b0e55..475a8453 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,4 +4,4 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -TXDELAY 1 +TXDELAY 5 From 58da647eeac517f7c436ef26afdbff36cea3fbe7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 20:07:29 -0500 Subject: [PATCH 093/554] Update direwolf-pacsatsim-jp14.conf try 2400 --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 475a8453..b75fc802 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -2,6 +2,6 @@ ADEVICE hw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO 20 MYCALL AMSAT CHANNEL 0 -MODEM 1200 +MODEM 2400 FULLDUP OFF TXDELAY 5 From caab43c884ea44dda98058d919113b278f278b4a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 20:08:30 -0500 Subject: [PATCH 094/554] Update direwolf-fm-pacsat-jp14.conf try 2400, added MODEM and CHANNEL --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index ac342354..a6ee92cd 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -1,6 +1,8 @@ MYCALL AMSAT ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 -PTT GPIO 20 +PTT GPIO 20 +CHANNEL 0 +MODEM 2400 KISSPORT 8100 FULLDUP OFF TXDELAY 5 From 4e3e6421a21ea8ce89b629e2a2e2d1460549ce3f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 20:08:55 -0500 Subject: [PATCH 095/554] Update direwolf-fm-pacsat.conf added CHANNEL and MODEM --- groundstation/direwolf/direwolf-fm-pacsat.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/direwolf/direwolf-fm-pacsat.conf b/groundstation/direwolf/direwolf-fm-pacsat.conf index fba77b7e..53524acb 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat.conf @@ -3,3 +3,5 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 PTT GPIO 20 KISSPORT 8100 FULLDUP OFF +CHANNEL 0 +MODEM 1200 From 5983fe4a55c1aefc39be79bd3addb399db6736b7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 20:10:40 -0500 Subject: [PATCH 096/554] Update direwolf-pacsatsim-jp14.conf change to plight --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index b75fc802..9f8e1ea5 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,4 +1,4 @@ -ADEVICE hw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO 20 MYCALL AMSAT CHANNEL 0 From b00f8d69b29c321ae02c4bb983adf4cb96cacc18 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 20:11:03 -0500 Subject: [PATCH 097/554] Update direwolf-pacsatsim.conf change to plight --- direwolf/direwolf-pacsatsim.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim.conf b/direwolf/direwolf-pacsatsim.conf index 370e54b0..87f09de1 100644 --- a/direwolf/direwolf-pacsatsim.conf +++ b/direwolf/direwolf-pacsatsim.conf @@ -1,4 +1,4 @@ -ADEVICE hw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 PTT GPIO 20 MYCALL AMSAT CHANNEL 0 From cebe77c634d16d8fa878cec7f19fdfbd34fe1ed4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 20:16:32 -0500 Subject: [PATCH 098/554] Update direwolf-pacsatsim-jp14.conf try 9600 --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 9f8e1ea5..30829ad6 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -2,6 +2,6 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO 20 MYCALL AMSAT CHANNEL 0 -MODEM 2400 +MODEM 9600 FULLDUP OFF TXDELAY 5 From ad4a68f8384d364ce5949710b76b4975e8835b0d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 20:16:54 -0500 Subject: [PATCH 099/554] Update direwolf-fm-pacsat-jp14.conf try 9600 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index a6ee92cd..4fd24b6f 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -2,7 +2,7 @@ MYCALL AMSAT ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO 20 CHANNEL 0 -MODEM 2400 +MODEM 9600 KISSPORT 8100 FULLDUP OFF TXDELAY 5 From 60e99a36a491f5bd803b45e1850d360fd9cae15f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 20:25:16 -0500 Subject: [PATCH 100/554] Update direwolf-fm-pacsat-jp14.conf back to 1200 and delay 10 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index 4fd24b6f..d7ed9a00 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -2,7 +2,7 @@ MYCALL AMSAT ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO 20 CHANNEL 0 -MODEM 9600 +MODEM 1200 KISSPORT 8100 FULLDUP OFF -TXDELAY 5 +TXDELAY 10 From 763a84b5aeef38e9bd37c8c714585d0987a9de7c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Dec 2024 20:25:38 -0500 Subject: [PATCH 101/554] Update direwolf-pacsatsim-jp14.conf 1200 and delay 10 --- direwolf/direwolf-pacsatsim-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 30829ad6..10e28f6b 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -2,6 +2,6 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO 20 MYCALL AMSAT CHANNEL 0 -MODEM 9600 +MODEM 1200 FULLDUP OFF -TXDELAY 5 +TXDELAY 10 From a463f6fe062116f5c79f64e04e0b9f8a27fd8319 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Dec 2024 09:54:04 -0500 Subject: [PATCH 102/554] Update install added GPIO to user pi --- install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install b/install index 2b4048d6..450f10a1 100755 --- a/install +++ b/install @@ -179,6 +179,8 @@ cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacSatGr mkdir /home/pi/PacSatGround +sudo usermod -a -G gpio pi + sudo apt-get install default-jdk -y cd From 98e56c286fd8335d599a067146879cefe5f48194 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Dec 2024 09:54:32 -0500 Subject: [PATCH 103/554] Update update add GPIO to pi user --- update | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update b/update index 6d74a557..f15dcf4c 100755 --- a/update +++ b/update @@ -359,6 +359,8 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacSatGround_0.46m_linux/spacecraft/ mkdir /home/pi/PacSatGround + + sudo usermod -a -G gpio pi sudo apt-get install default-jdk -y From 742b5bd2055b6315ca907d3b19e540e9c25a545d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Dec 2024 17:18:08 -0500 Subject: [PATCH 104/554] Update transmit.py change to USB Soundcard instead of Headphones (PWM) --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index a1250e44..b82cbf6c 100644 --- a/transmit.py +++ b/transmit.py @@ -351,8 +351,8 @@ if __name__ == "__main__": print(txLedOn) GPIO.setup(txLed, GPIO.OUT) - card = "Headphones" # default using pcm audio output of Pi Zero -# card = "Device" # using USB sound card for audio output +# card = "Headphones" # default using pcm audio output of Pi Zero + card = "Device" # using USB sound card for audio output print("Programming FM module!\n"); output(pd, 1) From 0a71470ce697d65660123d44e3ba1bd8d6a2d4b1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Dec 2024 17:40:50 -0500 Subject: [PATCH 105/554] Update direwolf-pacsatsim-jp14.conf --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 10e28f6b..88d20bb6 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,4 +4,4 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -TXDELAY 10 +TXDELAY 0 From e222728e840edc6dc7d3ad57e286718d9119c124 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Dec 2024 17:06:29 -0500 Subject: [PATCH 106/554] Update direwolf-cc.conf add other params --- direwolf-cc.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/direwolf-cc.conf b/direwolf-cc.conf index 8419355f..00eddffa 100644 --- a/direwolf-cc.conf +++ b/direwolf-cc.conf @@ -1,2 +1,7 @@ ADEVICE hw:CARD=Device,DEV=0 default DTMF +MYCALL AMSAT +CHANNEL 0 +MODEM 1200 +FULLDUP OFF +TXDELAY 0 From 4b0126a97559e93562c27e143239fed6afe20131 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Dec 2024 17:07:41 -0500 Subject: [PATCH 107/554] Update command add -r 48000 --- command | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command b/command index 1349f45a..50460c30 100755 --- a/command +++ b/command @@ -48,11 +48,11 @@ if [[ $(arecord -l | grep "USB Audio Device") ]] && [ -f "$FILE" ]; then echo "debug mode" - direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d + direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d else - direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py + direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py fi else From c564eb494f103b6bafdcbe29188d54acfacbdb34 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Dec 2024 17:13:16 -0500 Subject: [PATCH 108/554] Update command add -P+ -D1 --- command | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command b/command index 50460c30..989c71f5 100755 --- a/command +++ b/command @@ -48,11 +48,11 @@ if [[ $(arecord -l | grep "USB Audio Device") ]] && [ -f "$FILE" ]; then echo "debug mode" - direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d + direwolf -P+ -D1 -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d else - direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py + direwolf -P+ -D1 -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py fi else From 4e003ebe144d221bf2fba5b2474ca8723d281a5e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Dec 2024 22:36:39 -0500 Subject: [PATCH 109/554] Update transmit.py rx sq off if pacsat mode --- transmit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transmit.py b/transmit.py index b82cbf6c..fbf2f309 100644 --- a/transmit.py +++ b/transmit.py @@ -285,6 +285,8 @@ if __name__ == "__main__": callsign = config[0] if len(config) > 5: sq = config[5] + if (mode == 'p') or (mode == 'P'): + sq = 0 # turn off squelch for Pacsat print(sq) if len(config) > 6: txf = float(config[6]) From 39319af6e86568e4b6e7b1a731875d2cb60d1b85 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Dec 2024 22:38:02 -0500 Subject: [PATCH 110/554] Update direwolf-fm-pacsat-jp14.conf tx delay 0 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index d7ed9a00..7b4d87d8 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -5,4 +5,4 @@ CHANNEL 0 MODEM 1200 KISSPORT 8100 FULLDUP OFF -TXDELAY 10 +TXDELAY 0 From 53515b0839660e417e1461cd2d44de1703b85c04 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 07:46:08 -0500 Subject: [PATCH 111/554] Update transmit.py fix zero squelch for pacsat --- transmit.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/transmit.py b/transmit.py index fbf2f309..f765bcd5 100644 --- a/transmit.py +++ b/transmit.py @@ -274,7 +274,7 @@ if __name__ == "__main__": tx_value = '0' rx_value = '0' - sq = '0' + '0' tx = '434.9000' rx = '435.0000' @@ -283,11 +283,10 @@ if __name__ == "__main__": # callsign = file.readline().split(" ")[0] config = file.readline().split() callsign = config[0] - if len(config) > 5: - sq = config[5] - if (mode == 'p') or (mode == 'P'): - sq = 0 # turn off squelch for Pacsat - print(sq) + if len(config) > 5: + if (mode != 'p') and (mode != 'P'): # squelch off for Pacsat + sq = config[5] + print(f'squelch: {sq}') if len(config) > 6: txf = float(config[6]) # print(txf) From ba35790cb27c0dfd4eb8141cd6ba5019df0249dc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 07:49:08 -0500 Subject: [PATCH 112/554] Update transmit.py typo --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index f765bcd5..76e3c40d 100644 --- a/transmit.py +++ b/transmit.py @@ -274,7 +274,7 @@ if __name__ == "__main__": tx_value = '0' rx_value = '0' - '0' + sq = '0' tx = '434.9000' rx = '435.0000' From 41171daade779ee4edadb5c0dc5aba82bd3f00a5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 08:12:00 -0500 Subject: [PATCH 113/554] Update direwolf-pacsatsim-jp14.conf tx delay 10 needed --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 88d20bb6..10e28f6b 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,4 +4,4 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -TXDELAY 0 +TXDELAY 10 From 3ec34c2f739d74b62a979872e529a5f5f6a3575e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 08:12:24 -0500 Subject: [PATCH 114/554] Update direwolf-fm-pacsat-jp14.conf txdelay 10 needed --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index 7b4d87d8..d7ed9a00 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -5,4 +5,4 @@ CHANNEL 0 MODEM 1200 KISSPORT 8100 FULLDUP OFF -TXDELAY 0 +TXDELAY 10 From 87b0404c39b358e006d5e5a4669144a34d03e1ad Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 08:18:07 -0500 Subject: [PATCH 115/554] Update direwolf-fm-pacsat-jp14.conf try delay 20 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index d7ed9a00..6c0c65b9 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -5,4 +5,4 @@ CHANNEL 0 MODEM 1200 KISSPORT 8100 FULLDUP OFF -TXDELAY 10 +TXDELAY 20 From 241031396ad51b7a4f1d751f04f0012c0b73c55d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 08:18:26 -0500 Subject: [PATCH 116/554] Update direwolf-pacsatsim-jp14.conf try 20 --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 10e28f6b..52b5cfd6 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,4 +4,4 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -TXDELAY 10 +TXDELAY 20 From 73dafbedecd8b6e73cc3a63168670764c6004133 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 09:03:59 -0500 Subject: [PATCH 117/554] Update direwolf-pacsatsim-jp14.conf try delay 30 --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 52b5cfd6..6a8b1a46 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,4 +4,4 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -TXDELAY 20 +TXDELAY 30 From f67036ca017e2e1fa03bc76503b8b340abd0a37a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 09:04:26 -0500 Subject: [PATCH 118/554] Update direwolf-fm-pacsat-jp14.conf try 30 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index 6c0c65b9..9c1d1b5f 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -5,4 +5,4 @@ CHANNEL 0 MODEM 1200 KISSPORT 8100 FULLDUP OFF -TXDELAY 20 +TXDELAY 30 From 631a6912052cd4ebc005799338ac624ffe239efc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 09:09:25 -0500 Subject: [PATCH 119/554] Update pacsat.sh added -P+ -D3 --- groundstation/pacsat.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index f3ff484f..e12d15f4 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -44,21 +44,21 @@ echo frequency="$8e6" -echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." +#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." -echo +#echo if [[ $(arecord -l | grep "USB Audio Device") ]] ; then echo -e "Direwolf using USB Sound Card (FM Transceiver) on $frequency Hz" - direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 & + direwolf -P+ -D3 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 & else echo -e "Direwolf using RTL-SDR on $frequency Hz" - direwolf -r 48000 -qd -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & + direwolf -P+ -D3 -r 48000 -qd -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & sleep 5 From 4b1b5326e8ebc56629475b525f446ce4d7ef46e4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 09:11:26 -0500 Subject: [PATCH 120/554] Update pacsatsim.sh added -P+ -D3 --- pacsatsim.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 71d45328..8fb23c12 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -75,7 +75,7 @@ elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then frequency=434900000 echo - echo "If your CubeSatSim is transmitting in APRS mode (mode 1) then you should see packets." + echo "If your Pacsat Ground Station is transmitting packets, you will see them here" echo elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then @@ -169,9 +169,9 @@ elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then fi -echo +#echo -echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." +#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." echo @@ -179,13 +179,13 @@ if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" - direwolf -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - direwolf -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & + direwolf -P+ -D3 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & fi From d37729eb711f4ec25f08158fb47b9193faece78d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 09:16:01 -0500 Subject: [PATCH 121/554] Update pacsatsim.sh D1 --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 8fb23c12..6588240e 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -185,7 +185,7 @@ else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - direwolf -P+ -D3 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & + direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & fi From 030e194c4e6c6ec37dce6ffa2df4ffe61660d3e2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 09:16:31 -0500 Subject: [PATCH 122/554] Update pacsat.sh D1 --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index e12d15f4..6cd4ab0d 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -52,7 +52,7 @@ if [[ $(arecord -l | grep "USB Audio Device") ]] ; then echo -e "Direwolf using USB Sound Card (FM Transceiver) on $frequency Hz" - direwolf -P+ -D3 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 & + direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 & else From 21368acaf3626ea0149b3efce48f1b9acccd62ab Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 16:38:39 -0500 Subject: [PATCH 123/554] Update direwolf-pacsatsim-jp14.conf added FIX_BITS --- direwolf/direwolf-pacsatsim-jp14.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 6a8b1a46..045b64d1 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -5,3 +5,4 @@ CHANNEL 0 MODEM 1200 FULLDUP OFF TXDELAY 30 +FIX_BITS 1 AX25 From 6d99ed98f5576fa1e6999e17f1cd7d17c85b132e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 16:38:58 -0500 Subject: [PATCH 124/554] Update direwolf-fm-pacsat-jp14.conf FIX_BITS --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index 9c1d1b5f..f13c3ced 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -6,3 +6,4 @@ MODEM 1200 KISSPORT 8100 FULLDUP OFF TXDELAY 30 +FIX_BITS 1 AX25 From 03cc387dc0796cf5e7ef43063b824dc4738e9721 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 17:33:52 -0500 Subject: [PATCH 125/554] Create pacsatsim.service --- systemd/pacsatsim.service | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 systemd/pacsatsim.service diff --git a/systemd/pacsatsim.service b/systemd/pacsatsim.service new file mode 100644 index 00000000..e65044af --- /dev/null +++ b/systemd/pacsatsim.service @@ -0,0 +1,14 @@ +[Unit] +Description=PacsatSim + +[Service] +TimeoutStopSec=5 +ExecStart=/home/pi/CubeSatSim/pacsatsim.sh +WorkingDirectory=/home/pi/CubeSatSim +StandardOutput=inherit +StandardError=inherit +Restart=always +User=root + +[Install] +WantedBy=default.target From e4e9ef04cabf6d417a36fb90d50cbec7b4048eef Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 17:36:32 -0500 Subject: [PATCH 126/554] Update transmit.py start pacsatsim.service --- transmit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 76e3c40d..c85d10aa 100644 --- a/transmit.py +++ b/transmit.py @@ -425,7 +425,10 @@ if __name__ == "__main__": print("AFSK") elif (mode == 'p'): print("Pacsat") - system('/home/pi/CubeSatSim/pacsatsim.sh') +# system('/home/pi/CubeSatSim/pacsatsim.sh') + system('sudo systectl start pacsatsim') + While True: + sleep(30) elif (mode == 'p'): print("Pacsat Ground Station") while True: From ec415ab928f2d0ba1dde4ddf949f896ecb8a9238 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 17:38:12 -0500 Subject: [PATCH 127/554] Update transmit.py lowercase --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index c85d10aa..0c4137e4 100644 --- a/transmit.py +++ b/transmit.py @@ -427,7 +427,7 @@ if __name__ == "__main__": print("Pacsat") # system('/home/pi/CubeSatSim/pacsatsim.sh') system('sudo systectl start pacsatsim') - While True: + while True: sleep(30) elif (mode == 'p'): print("Pacsat Ground Station") From 7f5e890fda663f35cdda2bd1e818ffbc9dd275c4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 17:39:11 -0500 Subject: [PATCH 128/554] Update transmit.py typo systemctl --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 0c4137e4..0ab0c67d 100644 --- a/transmit.py +++ b/transmit.py @@ -426,7 +426,7 @@ if __name__ == "__main__": elif (mode == 'p'): print("Pacsat") # system('/home/pi/CubeSatSim/pacsatsim.sh') - system('sudo systectl start pacsatsim') + system('sudo systemctl start pacsatsim') while True: sleep(30) elif (mode == 'p'): From 7a94bdf6ab5fe493a265ec15c356357f03477b14 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 17:41:40 -0500 Subject: [PATCH 129/554] Update log added -p for pacsatsim --- log | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/log b/log index 2a3ce9d7..9c69874c 100755 --- a/log +++ b/log @@ -10,6 +10,10 @@ elif [ "$1" = "-c" ]; then sudo journalctl -a -u command > /home/pi/CubeSatSim/logc.txt cat /home/pi/CubeSatSim/logc.txt echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" +elif [ "$1" = "-p" ]; then + sudo journalctl -a -u pacsatsim > /home/pi/CubeSatSim/logp.txt + cat /home/pi/CubeSatSim/logp.txt + echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" else sudo journalctl -a -u cubesatsim > /home/pi/CubeSatSim/log.txt cat /home/pi/CubeSatSim/log.txt From b5c9caf3d32bae7494ead99dcc5f47a1d151b587 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Dec 2024 17:51:08 -0500 Subject: [PATCH 130/554] Update transmit.py restart pacsatsim --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 0ab0c67d..32d970b3 100644 --- a/transmit.py +++ b/transmit.py @@ -426,7 +426,7 @@ if __name__ == "__main__": elif (mode == 'p'): print("Pacsat") # system('/home/pi/CubeSatSim/pacsatsim.sh') - system('sudo systemctl start pacsatsim') + system('sudo systemctl restart pacsatsim') while True: sleep(30) elif (mode == 'p'): From e85a6f52c58d847a47b6f854edd5d14eab4a5af0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 8 Dec 2024 08:46:00 -0500 Subject: [PATCH 131/554] Update log journalctl -af for real-time log --- log | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/log b/log index 9c69874c..f5b301c5 100755 --- a/log +++ b/log @@ -2,20 +2,26 @@ echo -e "\nLog file script for CubeSatSim\n" +echo "To exit, type Control-C" + +echo + +sleep 2 + if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then - sudo journalctl -a -u transmit > /home/pi/CubeSatSim/logt.txt - cat /home/pi/CubeSatSim/logt.txt - echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" + sudo journalctl -af -u transmit # > /home/pi/CubeSatSim/logt.txt +# cat /home/pi/CubeSatSim/logt.txt +# echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" elif [ "$1" = "-c" ]; then - sudo journalctl -a -u command > /home/pi/CubeSatSim/logc.txt + sudo journalctl -af -u command # > /home/pi/CubeSatSim/logc.txt cat /home/pi/CubeSatSim/logc.txt - echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" +# echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" elif [ "$1" = "-p" ]; then - sudo journalctl -a -u pacsatsim > /home/pi/CubeSatSim/logp.txt + sudo journalctl -af -u pacsatsim # > /home/pi/CubeSatSim/logp.txt cat /home/pi/CubeSatSim/logp.txt - echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" +# echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" else - sudo journalctl -a -u cubesatsim > /home/pi/CubeSatSim/log.txt - cat /home/pi/CubeSatSim/log.txt - echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" + sudo journalctl -af -u cubesatsim # > /home/pi/CubeSatSim/log.txt +# cat /home/pi/CubeSatSim/log.txt +# echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" fi From 6265b59dc4e0c39193f6895691fcb0de56750f96 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 8 Dec 2024 16:17:31 -0500 Subject: [PATCH 132/554] Update direwolf-fm-pacsat-jp14.conf comment out TXDELAY and FIX_BITS --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index f13c3ced..9bff5e66 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -5,5 +5,5 @@ CHANNEL 0 MODEM 1200 KISSPORT 8100 FULLDUP OFF -TXDELAY 30 -FIX_BITS 1 AX25 +#TXDELAY 30 +#FIX_BITS 1 AX25 From 8e086e02e8d79cb537a84ef1b2866567f7871995 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 8 Dec 2024 22:38:06 -0500 Subject: [PATCH 133/554] Update direwolf-pacsatsim-jp14.conf remove TXDELAY and FIX_BITS --- direwolf/direwolf-pacsatsim-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 045b64d1..fecf24f1 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,5 +4,5 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -TXDELAY 30 -FIX_BITS 1 AX25 +#TXDELAY 30 +#FIX_BITS 1 AX25 From 8c66982e2298ba9165d0b07434e843dde0c34fd9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 10 Dec 2024 16:08:00 -0500 Subject: [PATCH 134/554] Update install add pacsatsim.service --- install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install b/install index 450f10a1..b2c06ecc 100755 --- a/install +++ b/install @@ -197,6 +197,8 @@ sudo cp ~/CubeSatSim/systemd/command.service /etc/systemd/system/command.service sudo systemctl enable command +sudo cp ~/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + sudo cp /boot/config.txt /boot/config.txt.0 sudo cp /boot/cmdline.txt /boot/cmdline.txt.0 From f7631d9ab91271eeaf105ab38a602bfa023f3358 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Dec 2024 13:31:52 -0500 Subject: [PATCH 135/554] Update direwolf-pacsatsim-jp14.conf turn off PTT no tx --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index fecf24f1..cd88c58e 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,5 +1,5 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 -PTT GPIO 20 +#PTT GPIO 20 MYCALL AMSAT CHANNEL 0 MODEM 1200 From 263093feba5a87247e4359a304b50827608da10c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Dec 2024 13:32:19 -0500 Subject: [PATCH 136/554] Update direwolf-fm-pacsat-jp14.conf no PTT no tx --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index 9bff5e66..2903fc24 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -1,6 +1,6 @@ MYCALL AMSAT ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 -PTT GPIO 20 +#PTT GPIO 20 CHANNEL 0 MODEM 1200 KISSPORT 8100 From ff0dc0079a2a53c2cc5983c41d231a89883d4441 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Dec 2024 13:55:47 -0500 Subject: [PATCH 137/554] Update direwolf-pacsatsim-jp14.conf txdelay and fix bits --- direwolf/direwolf-pacsatsim-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index cd88c58e..59009a53 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,5 +4,5 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -#TXDELAY 30 -#FIX_BITS 1 AX25 +TXDELAY 30 +FIX_BITS 1 AX25 From 735245e14821b1b5110e387242dde7a2babb9967 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Dec 2024 13:56:12 -0500 Subject: [PATCH 138/554] Update direwolf-fm-pacsat-jp14.conf txdelay and fix bits --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index 2903fc24..2419285d 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -5,5 +5,5 @@ CHANNEL 0 MODEM 1200 KISSPORT 8100 FULLDUP OFF -#TXDELAY 30 -#FIX_BITS 1 AX25 +TXDELAY 30 +FIX_BITS 1 AX25 From 3a5d23767a5e2f48ec0c59ea58beb7255e3afdec Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Dec 2024 20:39:19 -0500 Subject: [PATCH 139/554] Update direwolf-pacsatsim-jp14.conf remove ax25 fix bits --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 59009a53..51ab8c9f 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -5,4 +5,4 @@ CHANNEL 0 MODEM 1200 FULLDUP OFF TXDELAY 30 -FIX_BITS 1 AX25 +#FIX_BITS 1 AX25 From ba05da8f37613abe408c956a1b29e3dc744b07e2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Dec 2024 20:39:42 -0500 Subject: [PATCH 140/554] Update direwolf-fm-pacsat-jp14.conf remove ax25 fix bits --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index 2419285d..ad591599 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -6,4 +6,4 @@ MODEM 1200 KISSPORT 8100 FULLDUP OFF TXDELAY 30 -FIX_BITS 1 AX25 +#FIX_BITS 1 AX25 From ab446d1b714581518dea8c251ea66e4c213a0570 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Dec 2024 20:41:24 -0500 Subject: [PATCH 141/554] Update install added missing -12 --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index b2c06ecc..ecb3f1d8 100755 --- a/install +++ b/install @@ -153,7 +153,7 @@ echo "$value" > /dev/null set -- $value echo "bit_rate=9600" > pacsat.config -echo "bbs_callsign=$1" >> pacsat.config +echo "bbs_callsign=$1-12" >> pacsat.config echo "broadcast_callsign=$1-11" >> pacsat.config echo "digi_callsign=$1-1" >> pacsat.config echo "max_frames_in_tx_buffer=5" >> pacsat.config From 5fcc3e11001d3d8285e03b0c9971e21ab1606493 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 04:53:46 -0500 Subject: [PATCH 142/554] Create direwolf-pacsat-loopback.conf with Loopback --- groundstation/direwolf/direwolf-pacsat-loopback.conf | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 groundstation/direwolf/direwolf-pacsat-loopback.conf diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf new file mode 100644 index 00000000..74a7fb1e --- /dev/null +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -0,0 +1,9 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=0 +#PTT GPIO 20 +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +FULLDUP OFF +TXDELAY 30 +#FIX_BITS 1 AX25 From 9c179c55234f8131969ced77f7336317621bd8f4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 04:58:42 -0500 Subject: [PATCH 143/554] Update direwolf-pacsatsim-jp14.conf change to Loopback 1 0 --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 51ab8c9f..f30407cc 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,4 +1,4 @@ -ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 #PTT GPIO 20 MYCALL AMSAT CHANNEL 0 From 08420193dadc08ec428b901f5df9b07fc7d16cc4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 04:59:26 -0500 Subject: [PATCH 144/554] Update direwolf-fm-pacsat-jp14.conf change to Loopback 0 1 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index ad591599..c815b866 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -1,5 +1,5 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=1 #PTT GPIO 20 CHANNEL 0 MODEM 1200 From 00354d02df42b715be335484e0b971753631b8cb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 05:01:35 -0500 Subject: [PATCH 145/554] Update pacsat.sh restart pacsatsim in ground station --- groundstation/pacsat.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 6cd4ab0d..d2197312 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -32,6 +32,8 @@ sudo killall -9 zenity &>/dev/null echo +sudo systemctl restart pacsatsim + value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null set -- $value From 862c0812997e1710aea62f20cd67fa63a3de60a4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 05:09:08 -0500 Subject: [PATCH 146/554] Update direwolf-fm-pacsat-jp14.conf add KISSPORT 8001 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index c815b866..6e4fc073 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -7,3 +7,4 @@ KISSPORT 8100 FULLDUP OFF TXDELAY 30 #FIX_BITS 1 AX25 +KISSPORT 8001 From c8b73f9f90ed16caffcd5e2d85f4c7a39f6eede3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 05:17:41 -0500 Subject: [PATCH 147/554] Update direwolf-pacsatsim-jp14.conf TXDELAY 75 --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index f30407cc..803920ff 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -4,5 +4,5 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -TXDELAY 30 +TXDELAY 75 #FIX_BITS 1 AX25 From 49bf55484c0e2010eb7bef7644a83f8210ec8b28 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 06:00:24 -0500 Subject: [PATCH 148/554] Update pacsat.sh stop CubeSatSim, transmit, command --- groundstation/pacsat.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index d2197312..3846ea26 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -4,6 +4,12 @@ sudo modprobe snd-aloop +sudo systemctl stop cubesatsim + +sudo systemctl stop transmit + +sudo systemctl stop command + /home/pi/CubeSatSim/config -I sudo systemctl stop command &>/dev/null From d4d6b37829c05901dfd72dbcefa104ee96429ac8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 06:02:31 -0500 Subject: [PATCH 149/554] Update install my fork of pi_pacsat --- install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install b/install index ecb3f1d8..b335178c 100755 --- a/install +++ b/install @@ -138,7 +138,11 @@ cd git clone https://github.com/ac2cz/pi_pacsat.git -cd pi_pacsat/Debug +cd pi_pacsat + +git checkout master-debug + +cd Debug make all From 7092c7aa67ab883e105f9ef1f50c2bfb4a527fb0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 06:42:12 -0500 Subject: [PATCH 150/554] Update install changed pi_pacsat to my repo --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index b335178c..3a4297a4 100755 --- a/install +++ b/install @@ -136,7 +136,7 @@ sudo ./install.sh cd -git clone https://github.com/ac2cz/pi_pacsat.git +git clone https://github.com/alanbjohnston/pi_pacsat.git cd pi_pacsat From aa0e48aca2f74196dc17c8fe4878d33f550b43ca Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 06:52:29 -0500 Subject: [PATCH 151/554] Update pacsat.sh don't set CubeSatSim mode --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 3846ea26..b68dbec9 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -10,7 +10,7 @@ sudo systemctl stop transmit sudo systemctl stop command -/home/pi/CubeSatSim/config -I +#/home/pi/CubeSatSim/config -I sudo systemctl stop command &>/dev/null From 002c3dbd6b6c603d3dadd7d09931b3aa5f622b46 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 11:04:01 -0500 Subject: [PATCH 152/554] Update install fix pacsat install --- install | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/install b/install index 3a4297a4..87881db0 100755 --- a/install +++ b/install @@ -152,18 +152,20 @@ mkdir /home/pi/PacSat/pacsat/dir export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH -value=`cat /home/pi/CubeSatSim/sim.cfg` -echo "$value" > /dev/null -set -- $value +#value=`cat /home/pi/CubeSatSim/sim.cfg` +#echo "$value" > /dev/null +#set -- $value echo "bit_rate=9600" > pacsat.config -echo "bbs_callsign=$1-12" >> pacsat.config -echo "broadcast_callsign=$1-11" >> pacsat.config -echo "digi_callsign=$1-1" >> pacsat.config +echo "bbs_callsign=W3ZM-12" >> pacsat.config +echo "broadcast_callsign=W3ZM-11" >> pacsat.config +echo "digi_callsign=W3ZM-1" >> pacsat.config echo "max_frames_in_tx_buffer=5" >> pacsat.config echo "pb_open=1" > pacsat.state echo "uplink_open=1" >> pacsat.state +echo "pb_max_period_for_client_in_seconds=60" >> pacsat.state +echo "uplink_max_period_for_client_in_seconds=60" >> pacsat.state sudo sed -i 's/#hdmi_group=1/hdmi_group=2/g' /boot/config.txt sudo sed -i 's/#hdmi_mode=1/hdmi_mode=16/g' /boot/config.txt From 41d47740a3fe28c27184f8ef5cbbc5828341e2d5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 12:54:22 -0500 Subject: [PATCH 153/554] Create pacsat.desktop --- groundstation/pacsat.desktop | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 groundstation/pacsat.desktop diff --git a/groundstation/pacsat.desktop b/groundstation/pacsat.desktop new file mode 100644 index 00000000..539c0e1d --- /dev/null +++ b/groundstation/pacsat.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Pacsat +GenericName=Pacsat Loopback +Comment=Pacsat +Exec=/home/pi/CubeSatSim/groundstation/pacsat.sh +Icon=/home/pi/Icons/pacsat.png +Terminal=true +Type=Application +Categories=HamRadio; +Keywords=APRS; From 9ca2860de8a214e1e743b1127af7044cc58a5513 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 12:55:29 -0500 Subject: [PATCH 154/554] Create pacsatlog.desktop --- groundstation/pacsatlog.desktop | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 groundstation/pacsatlog.desktop diff --git a/groundstation/pacsatlog.desktop b/groundstation/pacsatlog.desktop new file mode 100644 index 00000000..b3032884 --- /dev/null +++ b/groundstation/pacsatlog.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Pacsat Log +GenericName=Pacsat Loopback +Comment=Pacsat +Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/log -p" +Icon=/home/pi/Icons/pacsat.png +Terminal=true +Type=Application +Categories=HamRadio; +Keywords=APRS; From e574937c7aac87611d2529c53702889c3ad71db0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 30 Dec 2024 13:36:56 -0500 Subject: [PATCH 155/554] Update pacsat.sh remove frequency comments --- groundstation/pacsat.sh | 43 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index b68dbec9..b0b1e952 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -40,44 +40,27 @@ echo sudo systemctl restart pacsatsim -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 +#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" +#frequency="$8e6" #echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." #echo -if [[ $(arecord -l | grep "USB Audio Device") ]] ; then - echo -e "Direwolf using USB Sound Card (FM Transceiver) on $frequency Hz" - - direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 & - -else - - echo -e "Direwolf using RTL-SDR on $frequency Hz" - - direwolf -P+ -D3 -r 48000 -qd -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf -t 0 & - - sleep 5 - - value=`aplay -l | grep "Loopback"` - echo "$value" > /dev/null - set -- $value - - #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 - rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & +echo +echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback." +echo -fi cd /home/pi/Desktop/PacSatGround_0.46m_linux/ From 9f7d7e8334d43d3a7b20675b6e74695036e37b52 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 1 Jan 2025 09:43:40 -0500 Subject: [PATCH 156/554] Update transmit.py repeater mode CARD --- transmit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/transmit.py b/transmit.py index 32d970b3..baa1419d 100644 --- a/transmit.py +++ b/transmit.py @@ -802,7 +802,7 @@ if __name__ == "__main__": ## system("arecord -D plughw:CARD=Device,DEV=0 -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 " + tx + "e3 &") system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 &") sleep(1) - system("sudo arecord -D plughw:1 -r48000 -fS16_LE -c1 | nc localhost 8011 &") + system("sudo arecord -D plughw:CARD -r48000 -fS16_LE -c1 | nc localhost 8011 &") GPIO.output(powerPin, 1) sleep(0.5) GPIO.output(powerPin, 0) @@ -810,9 +810,9 @@ if __name__ == "__main__": sleep(1) print("No carrier detected, stopping repeater") output(txLed, txLedOff) - system("sudo killall -9 arecord") - system("sudo killall -9 nc") - system("sudo killall -9 rpitx") + system("sudo killall -9 arecord > /dev/null 2>&1") + system("sudo killall -9 nc > /dev/null 2>&1") + system("sudo killall -9 rpitx > /dev/null 2>&1") else: print("FSK") From 087eab06256fba579360b3ae1a1a4af10535c861 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 1 Jan 2025 09:47:36 -0500 Subject: [PATCH 157/554] Update transmit.py fixed CARD=Device --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index baa1419d..7d47f19a 100644 --- a/transmit.py +++ b/transmit.py @@ -802,7 +802,7 @@ if __name__ == "__main__": ## system("arecord -D plughw:CARD=Device,DEV=0 -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 " + tx + "e3 &") system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 &") sleep(1) - system("sudo arecord -D plughw:CARD -r48000 -fS16_LE -c1 | nc localhost 8011 &") + system("sudo arecord -D plughw:CARD=Device,DEV=0 -r48000 -fS16_LE -c1 | nc localhost 8011 &") GPIO.output(powerPin, 1) sleep(0.5) GPIO.output(powerPin, 0) From 976ac018166a9be5048dffce1f2a74c73e5f33b9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 07:11:49 -0500 Subject: [PATCH 158/554] Update install switch pi_pacsat back to ac2cz --- install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install b/install index 87881db0..eed5aef2 100755 --- a/install +++ b/install @@ -136,11 +136,12 @@ sudo ./install.sh cd -git clone https://github.com/alanbjohnston/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 +#git checkout master-debug cd Debug From 54bcd77317cfd20287c7005872bdfb80dcf68248 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 10:59:07 -0500 Subject: [PATCH 159/554] Update sstv_decode_prompt.sh remove hw:0.0 on play --- groundstation/sstv_decode_prompt.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index 76eb611f..5e3b5e2d 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -128,7 +128,9 @@ set -- $value #rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 #rtl_fm -M fm -f 434.9M -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 + +#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -r 48000 -t raw -f S16_LE -c 1 sleep 5 From d2cf9213369d173592fd1b48b88b6a6a85000ee0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 11:03:37 -0500 Subject: [PATCH 160/554] Update sstv_decode_prompt.sh remove tee --- groundstation/sstv_decode_prompt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index 5e3b5e2d..da80f1d4 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -130,7 +130,7 @@ set -- $value #rtl_fm -M fm -f 434.9M -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 #rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From 4c7f4d5e172645792c6b264d6ebc25415898e0bc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:14:03 -0500 Subject: [PATCH 161/554] Update fox-profile.desktop --- groundstation/fox-profile.desktop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/fox-profile.desktop b/groundstation/fox-profile.desktop index c03f40d4..8b7aaabe 100644 --- a/groundstation/fox-profile.desktop +++ b/groundstation/fox-profile.desktop @@ -2,8 +2,8 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/fox-profile.sh Name=Change FoxTelem Profile -Comment=FIAB-v3 -Icon=/home/pi/Downloads/foxtelem.png +Comment=FIAB-v4 +Icon=/home/pi/Icons/foxtelem.png Path=/home/pi Terminal=true Categories=HamRadio From 3a4373ea1432279a1eb7ecd8e1075b847f72badd Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:15:37 -0500 Subject: [PATCH 162/554] Update gpredict.desktop --- groundstation/gpredict.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/gpredict.desktop b/groundstation/gpredict.desktop index 20a6ab49..69d11ecb 100644 --- a/groundstation/gpredict.desktop +++ b/groundstation/gpredict.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/usr/bin/gpredict Name=Gpredict Comment=ISS and Satellite Tracking for ARISS Radio Pi -Icon=/home/pi/Downloads/gpredict.png +Icon=/home/pi/Icons/gpredict.png Path=/home/pi Terminal=false Categories=HamRadio From 6d0a9fa82d218759caa64cf3bef25edbf77299ae Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:17:02 -0500 Subject: [PATCH 163/554] Update rtl-tcp.desktop --- groundstation/rtl-tcp.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/rtl-tcp.desktop b/groundstation/rtl-tcp.desktop index 117acb9c..7ae3c038 100644 --- a/groundstation/rtl-tcp.desktop +++ b/groundstation/rtl-tcp.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/rtl-tcp.sh Name=RTL-TCP Comment=RTL-TCP for SDR# -Icon=/home/pi/Downloads/SDRSharp.png +Icon=/home/pi/Icons/SDRSharp.png Path=/home/pi Terminal=true Categories=HamRadio From 5dc9c1b18d83802c280747ca431a4ec5b94eed3a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:18:35 -0500 Subject: [PATCH 164/554] Update set location.desktop --- groundstation/set location.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/set location.desktop b/groundstation/set location.desktop index e2b80016..9adc6f66 100644 --- a/groundstation/set location.desktop +++ b/groundstation/set location.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/loc.sh Name=Set My Location Comment=Set Location for Gpredict -Icon=/home/pi/Downloads/gpredict.png +Icon=/home/pi/Icons/gpredict.png Path=/home/pi Terminal=true Categories=HamRadio From 5d2f5ada8d4e08c61edbd7c745ba71136ec97d3a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:20:40 -0500 Subject: [PATCH 165/554] Create SDRpp.desktop --- groundstation/SDRpp.desktop | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 groundstation/SDRpp.desktop diff --git a/groundstation/SDRpp.desktop b/groundstation/SDRpp.desktop new file mode 100644 index 00000000..f4f4ba38 --- /dev/null +++ b/groundstation/SDRpp.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Exec=/home/pi/CubeSatSim/groundstation/sdrpp.sh +Name=SDRpp +Comment=SDRpp +Icon=/home/pi/Icons/sdrpp.png +Path=/home/pi +Terminal=true +Categories=HamRadio +Keywords=Ham Radio;SDR From cbe338671ae6233250610ee24c965594738fdbd3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:24:47 -0500 Subject: [PATCH 166/554] Update cubicsdr.desktop --- groundstation/cubicsdr.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/cubicsdr.desktop b/groundstation/cubicsdr.desktop index 1599f5df..2cf19759 100644 --- a/groundstation/cubicsdr.desktop +++ b/groundstation/cubicsdr.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/cubicsdr.sh Name=SDR FM Broadcast Comment=CubicSDR FM Broadcast -Icon=/home/pi/Downloads/cubicsdr.png +Icon=/home/pi/Icons/cubicsdr.png Path=/home/pi Terminal=true Categories=HamRadio From 1190ebca96629ec22b9b53d64a690080568d069c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:32:27 -0500 Subject: [PATCH 167/554] Update aprs.sh --- groundstation/aprs.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index 2e1c6873..dd88ba5d 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -3,12 +3,14 @@ sudo modprobe snd-aloop -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 rtl_fm &>/dev/null sudo killall -9 direwolf &>/dev/null From 2ceeb9c62571b616d05bab9eb9059dc70dd84f97 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:34:18 -0500 Subject: [PATCH 168/554] Update fox.sh --- groundstation/fox.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 3c1daf1a..233644ef 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -5,12 +5,14 @@ echo "Script to run FoxTelem for ARISS Radio Pi" echo -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 rtl_tcp &>/dev/null sudo killall -9 rtl_fm &>/dev/null From 324731eef74382126920512a14e6688abbe551c8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:35:27 -0500 Subject: [PATCH 169/554] Update sstv_decode_prompt.sh --- groundstation/sstv_decode_prompt.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index da80f1d4..6b6e5dbc 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -4,10 +4,12 @@ echo "Script to decode SSTV using QSSTV with rtl_fm" echo -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null sudo modprobe snd-aloop +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 qsstv &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -16,7 +18,7 @@ sudo killall -9 aplay &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null From 42857a18cf894859e138b16dd93696395ce37e33 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:36:58 -0500 Subject: [PATCH 170/554] Update sdr.sh --- groundstation/sdr.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh index 0783d9ca..1ad01092 100755 --- a/groundstation/sdr.sh +++ b/groundstation/sdr.sh @@ -24,6 +24,8 @@ echo "Note: you need to be on the Wifi network: $ssid" echo +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 java &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -42,13 +44,13 @@ sudo killall -9 direwolf &>/dev/null sudo killall -9 zenity &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null -sudo systemctl restart openwebrx +sudo systemctl restart openwebrx &>/dev/null sleep 10 -setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8073 &>/dev/null & +setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://localhost:8073 &>/dev/null & sleep 10 From 3b85b6e6b52f62a8f6cc249771e925296264b305 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:37:55 -0500 Subject: [PATCH 171/554] Update rtl-tcp.sh --- groundstation/rtl-tcp.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index c8af8906..bcf8e154 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -23,13 +23,15 @@ echo "Note: you need to be on the Wifi network: $ssid" echo -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null sleep 2 pkill -o chromium &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null + +sudo killall -9 sdrpp &>/dev/null sudo killall -9 java &>/dev/null From 6f81e7d9075c22e9854a12fe4df1461ea192caeb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:39:07 -0500 Subject: [PATCH 172/554] Update cubicsdr.sh --- groundstation/cubicsdr.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/cubicsdr.sh b/groundstation/cubicsdr.sh index 3f4b6b62..f9c3146c 100755 --- a/groundstation/cubicsdr.sh +++ b/groundstation/cubicsdr.sh @@ -9,14 +9,16 @@ echo "Note: Select Generic RTL2832 device then click Start to begin" echo -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null sudo killall -9 java &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 rtl_fm &>/dev/null sudo killall -9 direwolf &>/dev/null From 30a48e2dd2f23c4e893df65dd90eb7dd19ef79d1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:55:32 -0500 Subject: [PATCH 173/554] Update aprs.sh remove tee --- groundstation/aprs.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index dd88ba5d..10917a3c 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -80,7 +80,7 @@ echo -e "Auto decoding APRS packets on $frequency Hz" #sudo rtl_fm -f 144.39M -s 22050 -g 48 - | multimon-ng -a AFSK1200 -A -t raw - -direwolf -r 48000 -t 0 & +direwolf -c direwolf.conf -r 48000 -t 0 & sleep 5 @@ -89,6 +89,7 @@ echo "$value" > /dev/null set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From 28ab2a86885214337f1a413f361f0c0fb040cdd6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:56:05 -0500 Subject: [PATCH 174/554] Update direwolf.conf changed speaker to default --- groundstation/direwolf.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf.conf b/groundstation/direwolf.conf index ce8b6823..d70427b9 100644 --- a/groundstation/direwolf.conf +++ b/groundstation/direwolf.conf @@ -1 +1 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=b1,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 default From 061845cdfe4d0e1e6cb8412b86078eeb49d364d8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 2 Jan 2025 12:57:44 -0500 Subject: [PATCH 175/554] Update aprs.sh full path for direwolf conf --- groundstation/aprs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index 10917a3c..427c36cb 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -80,7 +80,7 @@ echo -e "Auto decoding APRS packets on $frequency Hz" #sudo rtl_fm -f 144.39M -s 22050 -g 48 - | multimon-ng -a AFSK1200 -A -t raw - -direwolf -c direwolf.conf -r 48000 -t 0 & +direwolf -c /home/pi/CubeSatSim/groundstation/direwolf.conf -r 48000 -t 0 & sleep 5 From 0e590a838ef743f7f0459605bc04120f40614ae0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 03:11:05 -0500 Subject: [PATCH 176/554] Update bookmarks.json --- groundstation/bookmarks.json | 191 ++++++++++------------------------- 1 file changed, 55 insertions(+), 136 deletions(-) diff --git a/groundstation/bookmarks.json b/groundstation/bookmarks.json index f8bae496..09f1be52 100644 --- a/groundstation/bookmarks.json +++ b/groundstation/bookmarks.json @@ -1,137 +1,56 @@ [ - { - "name": "ISS APRS", - "frequency": 145825000, - "modulation": "nfm" - }, - { - "name": "ISS SSTV/Voice", - "frequency": 145800000, - "modulation": "nfm" - }, - { - "name": "ARISS Repeater Downlink", - "frequency": 437800000, - "modulation": "nfm" - }, - { - "name": "AO-27", - "frequency": 436795000, - "modulation": "nfm" - }, - { - "name": "AO-73", - "frequency": 145815000, - "modulation": "usb" - }, - { - "name": "Fox-1B AO-91", - "frequency": 145960000, - "modulation": "nfm" - }, - { - "name": "Fox-1D AO-92", - "frequency": 145880000, - "modulation": "nfm" - }, - { - "name": "HuskySat-1 HO-107", - "frequency": 435800000, - "modulation": "usb" - }, - { - "name": "Fox-1E", - "frequency": 435750000, - "modulation": "usb" - }, - { - "name": "MAX VALIER", - "frequency": 145860000, - "modulation": "usb" - }, - { - "name": "NOAA WX Radio 1", - "frequency": 162400000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 2", - "frequency": 162425000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 3", - "frequency": 162450000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 4", - "frequency": 162475000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 5", - "frequency": 162500000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 6", - "frequency": 162525000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 7", - "frequency": 162550000, - "modulation": "nfm" - }, - { - "name": "CAS-4A", - "frequency": 145855000, - "modulation": "usb" - }, - { - "name": "CAS-4B", - "frequency": 145910000, - "modulation": "usb" - }, - { - "name": "XW-2A", - "frequency": 145660000, - "modulation": "usb" - }, - { - "name": "XW-2B", - "frequency": 145725000, - "modulation": "usb" - }, - { - "name": "XW-2C", - "frequency": 145790000, - "modulation": "usb" - }, - { - "name": "XW-2F", - "frequency": 145975000, - "modulation": "usb" - }, - { - "name": "NOAA-19", - "frequency": 137100000, - "modulation": "nfm" - }, - { - "name": "NOAA-18", - "frequency": 137912500, - "modulation": "nfm" - }, - { - "name": "NOAA-15", - "frequency": 137620000, - "modulation": "nfm" - }, - { - "name": "CubeSatSim", - "frequency": 434900000, - "modulation": "packet" - } -] + { + "name": "NOAA WX Radio 1", + "frequency": 162400000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 2", + "frequency": 162425000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 3", + "frequency": 162450000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 4", + "frequency": 162475000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 5", + "frequency": 162500000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 6", + "frequency": 162525000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 7", + "frequency": 162550000, + "modulation": "nfm" + }, + { + "name": "CubeSatSim", + "frequency": 434900000, + "modulation": "packet" + }, + { + "name": "ISS SSTV/Voice", + "frequency": 145800000, + "modulation": "nfm" + }, + { + "name": "ISS APRS", + "frequency": 145825000, + "modulation": "packet" + }, + { + "name": "ISS Voice Repeater", + "frequency": 437800000, + "modulation": "nfm" + } From 2cd5718e43dd73441c94dc27db7666a9e61a0bff Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 03:19:22 -0500 Subject: [PATCH 177/554] Create settings.json --- groundstation/settings.json | 808 ++++++++++++++++++++++++++++++++++++ 1 file changed, 808 insertions(+) create mode 100644 groundstation/settings.json diff --git a/groundstation/settings.json b/groundstation/settings.json new file mode 100644 index 00000000..69033009 --- /dev/null +++ b/groundstation/settings.json @@ -0,0 +1,808 @@ +{ + "version": 8, + "sdrs": { + "rtlsdr": { + "name": "RTL-SDR", + "type": "rtl_sdr", + "profiles": { + "70cm": { + "name": "70cm Ham Band 435 MHz (CubeSatSim)", + "center_freq": 435000000, + "rf_gain": 10.0, + "samp_rate": 2400000, + "start_freq": 434900000, + "start_mod": "nfm", + "tuning_step": 1000, + "direct_sampling": 0 + }, + "2m": { + "name": "WX Band 161 MHz", + "center_freq": 162400000, + "rf_gain": 29, + "samp_rate": 2048000, + "start_freq": 157000000, + "start_mod": "nfm" + }, + "e59a4765-4139-4ab8-89c5-d8ac3343ba70": { + "name": "2m Ham Band 146 MHz (ISS)", + "center_freq": 145000000, + "samp_rate": 2400000, + "start_freq": 145000000, + "start_mod": "nfm", + "rf_gain": 42.0, + "direct_sampling": 0 + }, + "faf80b0b-1a96-4a9b-96fa-ce40b109c7e0": { + "name": "70cm Ham Band 438 MHz (ISS)", + "rf_gain": 29.0, + "center_freq": 438000000, + "samp_rate": 2400000, + "start_freq": 437800000, + "start_mod": "nfm" + }, + "a4fd4a5d-d2d0-4949-87e2-bda83cd83a37": { + "name": "FM Band 95 MHz", + "rf_gain": 29.0, + "center_freq": 95000000, + "samp_rate": 2400000, + "start_freq": 94000000, + "start_mod": "wfm" + }, + "ce2bca29-78cb-45d8-ab46-8dea3135981c": { + "name": "10m Ham Band 28 MHz", + "rf_gain": 29.0, + "center_freq": 28000000, + "samp_rate": 2400000, + "start_freq": 28000000, + "start_mod": "usb", + "direct_sampling": 0 + }, + "d6cdbf2d-74e4-4cac-aaa8-e793103a8e89": { + "name": "6m Ham Band 51 MHz", + "rf_gain": 29.0, + "center_freq": 51000000, + "samp_rate": 2400000, + "start_freq": 51000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "e2aba387-1d3b-4ca8-b280-e119282b8812": { + "name": "90 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 90000000, + "samp_rate": 2400000, + "start_freq": 90000000, + "start_mod": "wfm" + }, + "f700b99d-3c51-4524-b151-a0809b868ecc": { + "name": "92 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 92000000, + "samp_rate": 2400000, + "start_freq": 92000000, + "start_mod": "wfm" + }, + "dc6af94f-d607-4fee-a522-7f375f66a62c": { + "name": "94 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 94000000, + "samp_rate": 2400000, + "start_freq": 94000000, + "start_mod": "wfm" + }, + "6887e85a-a4dc-4245-810f-99801fc5e824": { + "name": "96 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 96000000, + "samp_rate": 2400000, + "start_freq": 96000000, + "start_mod": "wfm" + }, + "a2182ed6-70a8-4377-b233-ac6f8ccc91d7": { + "name": "98 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 96000000, + "samp_rate": 2400000, + "start_freq": 96000000, + "start_mod": "wfm" + }, + "57e38353-fb86-4935-899b-e365228b8ae5": { + "name": "100 MHz FM Band", + "center_freq": 100000000, + "samp_rate": 2400000, + "start_freq": 100000000, + "start_mod": "wfm" + }, + "5e9ec6dd-905d-4781-bd13-9cb702f58e84": { + "name": "102 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 102000000, + "samp_rate": 2400000, + "start_freq": 102000000, + "start_mod": "wfm" + }, + "ef2c703c-2e22-4e87-82b5-581420d704bd": { + "name": "104 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 104000000, + "samp_rate": 2400000, + "start_freq": 104000000, + "start_mod": "wfm" + }, + "34cc3ddf-8018-4288-acb9-29e6940bc37e": { + "name": "106 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 106000000, + "samp_rate": 2400000, + "start_freq": 106000000, + "start_mod": "wfm" + }, + "b4693683-ccf5-474d-a2d9-9a47b0a18ee2": { + "name": "108 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 108000000, + "samp_rate": 2400000, + "start_freq": 108000000, + "start_mod": "wfm" + }, + "34224d77-7b61-467c-b78f-18c7f3af1a0c": { + "name": "110 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 110000000, + "samp_rate": 2400000, + "start_freq": 110000000, + "start_mod": "wfm" + }, + "8dd82d97-73db-4fa7-ac41-263c3026ea1d": { + "name": "112 MHz", + "rf_gain": 29.0, + "center_freq": 112000000, + "samp_rate": 2400000, + "start_freq": 112000000, + "start_mod": "nfm" + }, + "79304b30-f10d-469e-9617-50a19bfdb435": { + "name": "114 MHz", + "rf_gain": 29.0, + "center_freq": 114000000, + "samp_rate": 2400000, + "start_freq": 114000000, + "start_mod": "nfm" + }, + "c00bf096-27b8-4262-832c-df1a308d7eb9": { + "name": "116 MHz", + "rf_gain": 29.0, + "center_freq": 116000000, + "samp_rate": 2400000, + "start_freq": 116000000, + "start_mod": "nfm" + }, + "669d25a6-6c15-4131-a330-3c33dd2147f0": { + "name": "118 Mhz Air Band", + "rf_gain": 29.0, + "center_freq": 118000000, + "samp_rate": 2400000, + "start_freq": 118000000, + "start_mod": "am" + }, + "948248fa-43d9-4e7d-bf86-afaadd391779": { + "name": "120 MHz Air Band", + "rf_gain": 29.0, + "center_freq": 120000000, + "samp_rate": 2400000, + "start_freq": 120000000, + "start_mod": "am" + }, + "b634273b-8fc8-4e87-b5c4-e6226d4be0ac": { + "name": "122 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 122000000, + "samp_rate": 2400000, + "start_freq": 121000000, + "start_mod": "nfm" + }, + "c55289a2-8286-4a3d-a505-37ba2867571a": { + "name": "124 Mhz Air Band", + "rf_gain": 42.0, + "center_freq": 124000000, + "samp_rate": 2400000, + "start_freq": 124000000, + "start_mod": "am" + }, + "4fe488b7-f369-43ba-bb49-91e1a185be7a": { + "name": "126 MHz Air Band", + "rf_gain": 29.0, + "center_freq": 126000000, + "samp_rate": 2400000, + "start_freq": 126000000, + "start_mod": "am" + }, + "e79639a2-1384-4e92-8e46-f6e5670ec9fd": { + "name": "128 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 128000000, + "samp_rate": 2400000, + "start_freq": 128000000, + "start_mod": "am" + }, + "319f3fb2-b98a-4620-85a7-a99d5a722bd5": { + "name": "130 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 130000000, + "samp_rate": 2400000, + "start_freq": 130000000, + "start_mod": "am" + }, + "63c5c2ce-07de-496c-81f6-b188a7adbf39": { + "name": "132 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 132000000, + "samp_rate": 2400000, + "start_freq": 132000000, + "start_mod": "am" + }, + "386bdc7b-eb10-4e05-972a-69d730a23cd8": { + "name": "134 MHz Air Band", + "rf_gain": 29.0, + "center_freq": 134000000, + "samp_rate": 2400000, + "start_freq": 134000000, + "start_mod": "am" + }, + "ae8ea8b1-23de-45ef-b8c4-3b83a188e65d": { + "name": "136 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 136000000, + "samp_rate": 2400000, + "start_freq": 136000000, + "start_mod": "am" + }, + "c0b1a28c-5e07-400a-a5f3-07c62db27587": { + "name": "138 MHz NOAA Weather Satellite Band", + "rf_gain": 42.0, + "center_freq": 138000000, + "samp_rate": 2400000, + "start_freq": 138000000, + "start_mod": "nfm" + }, + "20f7ce56-fd85-4b3e-8fac-94cbe9ba0e1d": { + "name": "140 MHz ", + "rf_gain": 42.0, + "center_freq": 140000000, + "samp_rate": 2400000, + "start_freq": 140000000, + "start_mod": "nfm" + }, + "882079f8-5697-428a-ae9d-bcc091269c7f": { + "name": "142 MHz ", + "rf_gain": 42.0, + "center_freq": 142000000, + "samp_rate": 2400000, + "start_freq": 142000000, + "start_mod": "nfm" + }, + "da1b3f12-2eba-40e9-8c62-33493adf74b3": { + "name": "144 MHz 2m Ham Band", + "rf_gain": 42.0, + "center_freq": 144000000, + "samp_rate": 2400000, + "start_freq": 144000000, + "start_mod": "nfm" + }, + "8d9cf1e1-44c5-41c4-bcea-7b1c69446e62": { + "name": "146 MHz 2m Ham Band", + "rf_gain": 42.0, + "center_freq": 146000000, + "samp_rate": 2400000, + "start_freq": 146000000, + "start_mod": "nfm" + }, + "eec8aa0d-3485-43d2-baa4-82f7d9e14df6": { + "name": "148 MHz 2m Ham Band", + "rf_gain": 42.0, + "center_freq": 148000000, + "samp_rate": 2400000, + "start_freq": 148000000, + "start_mod": "nfm" + }, + "bf66a908-1988-4aec-b998-06e2bc7d0a84": { + "name": "150 MHz", + "rf_gain": 42.0, + "center_freq": 150000000, + "samp_rate": 2400000, + "start_freq": 150000000, + "start_mod": "nfm" + }, + "0389f270-b919-4aae-a313-f73697059f70": { + "name": "152 MHz", + "rf_gain": 42.0, + "center_freq": 152000000, + "samp_rate": 2400000, + "start_freq": 152000000, + "start_mod": "nfm" + }, + "6ef9d955-76aa-46c0-8463-2c23def5e37b": { + "name": "154 MHz", + "rf_gain": 42.0, + "center_freq": 154000000, + "samp_rate": 2400000, + "start_freq": 154000000, + "start_mod": "nfm" + }, + "5d0a64c7-3bce-408e-94d9-c8315bef7540": { + "name": "156 MHz", + "rf_gain": 42.0, + "center_freq": 156000000, + "samp_rate": 2400000, + "start_freq": 156000000, + "start_mod": "nfm" + }, + "5b869cae-ffa7-4554-96af-7acd497bbaf3": { + "name": "158 MHz", + "rf_gain": 42.0, + "center_freq": 158000000, + "samp_rate": 2400000, + "start_freq": 158000000, + "start_mod": "nfm" + }, + "0de7c5d4-14fc-4655-9a81-2bcebb2f4147": { + "name": "160 MHz", + "rf_gain": 42.0, + "center_freq": 160000000, + "samp_rate": 2400000, + "start_freq": 160000000, + "start_mod": "nfm" + }, + "8ca54821-8b80-4938-a35c-9fe25e2320d1": { + "name": "162 MHz", + "rf_gain": 42.0, + "center_freq": 162000000, + "samp_rate": 2400000, + "start_freq": 162000000, + "start_mod": "nfm" + }, + "f74d262d-9e98-4030-86b2-45676121ff1e": { + "name": "164 MHz", + "rf_gain": 42.0, + "center_freq": 164000000, + "samp_rate": 2400000, + "start_freq": 164000000, + "start_mod": "nfm" + }, + "bfc9c686-6c06-4de2-b1d5-c8f012131042": { + "name": "168 MHz", + "rf_gain": 42.0, + "center_freq": 168000000, + "samp_rate": 2400000, + "start_freq": 167000000, + "start_mod": "nfm" + }, + "5468e597-d529-42fe-9fcf-0ff4fa9e2d06": { + "name": "170 MHz", + "rf_gain": 42.0, + "center_freq": 170000000, + "samp_rate": 2400000, + "start_freq": 170000000, + "start_mod": "nfm" + }, + "e124cc6e-7177-4d5f-ae5b-2ec6a6fa2956": { + "name": "172 MHz", + "rf_gain": 42.0, + "center_freq": 172000000, + "samp_rate": 2400000, + "start_freq": 172000000, + "start_mod": "nfm" + }, + "1ce0f3ed-4763-4f00-916a-4f72d29ba410": { + "name": "174 MHz ", + "rf_gain": 42.0, + "center_freq": 174000000, + "samp_rate": 2400000, + "start_freq": 174000000, + "start_mod": "nfm" + }, + "639b1496-a2b9-4a42-ad28-3cda89fbe2fb": { + "name": "420 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 420000000, + "samp_rate": 2400000, + "start_freq": 420000000, + "start_mod": "nfm" + }, + "bbc9b57e-ea86-43ef-be65-cb2337615ae5": { + "name": "422 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 422000000, + "samp_rate": 2400000, + "start_freq": 422000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "3aed286d-7d13-4338-8621-d1c0dfdf3ac6": { + "name": "424 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 424000000, + "samp_rate": 2400000, + "start_freq": 424000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "9ae664b4-48f3-410a-8995-edc60127d746": { + "name": "426 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 426000000, + "samp_rate": 2400000, + "start_freq": 426000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "24d2467b-6740-42b5-8d3f-8f389fc0860b": { + "name": "428 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 428000000, + "samp_rate": 2400000, + "start_freq": 428000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "debbc3ab-081d-41e7-80fe-7d564838154e": { + "name": "430 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 430000000, + "samp_rate": 2400000, + "start_freq": 430000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "649233e0-fc85-415d-b88e-94750f49ca4b": { + "name": "432 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 432000000, + "samp_rate": 2400000, + "start_freq": 432000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "bed3b482-fd3b-45ee-b924-200aa4223ace": { + "name": "434 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 434000000, + "samp_rate": 2400000, + "start_freq": 434000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "58dfac9e-6030-4bb3-ba28-465285baa25e": { + "name": "436 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 436000000, + "samp_rate": 2400000, + "start_freq": 436000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "4c293b84-cd43-495f-95a5-1fcabfe4e4c7": { + "name": "438 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 438000000, + "samp_rate": 2400000, + "start_freq": 438000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "0e763161-a0e8-411a-abe6-c1af13045f27": { + "name": "440 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 440000000, + "samp_rate": 2400000, + "start_freq": 440000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "6dda77d3-e859-41b7-9b0b-22c2dee47472": { + "name": "442 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 442000000, + "samp_rate": 2400000, + "start_freq": 442000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "285813ef-aa6d-433f-a316-074f47e02073": { + "name": "444 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 444000000, + "samp_rate": 2400000, + "start_freq": 444000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "e0842b63-6857-4554-874b-fad99e4db03a": { + "name": "446 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 446000000, + "samp_rate": 2400000, + "start_freq": 446000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "c7b21c80-cfef-42e8-a6fe-c5eea4556c7e": { + "name": "448 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 448000000, + "samp_rate": 2400000, + "start_freq": 448000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "d98b4d4a-8247-4a99-9fc7-89780e5e1fef": { + "name": "450 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 450000000, + "samp_rate": 2400000, + "start_freq": 450000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "a09a546f-c56f-41b5-ae34-c5511afbcef5": { + "name": "460 MHz", + "rf_gain": 42.0, + "center_freq": 460000000, + "samp_rate": 2400000, + "start_freq": 460000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "232b2ae6-88dd-4e58-b489-37f310e5e204": { + "name": "462 MHz FRS/GMRS", + "rf_gain": 42.0, + "center_freq": 462000000, + "samp_rate": 2400000, + "start_freq": 462000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "41db9b38-87d7-40a0-9f90-1f0c77c054d9": { + "name": "464 MHz FRS/GMRS", + "rf_gain": 42.0, + "center_freq": 464000000, + "samp_rate": 2400000, + "start_freq": 464000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "e9bb7781-eb9b-4314-b399-2d96c52716f0": { + "name": "466 MHz FRS/GMRS", + "rf_gain": 42.0, + "center_freq": 466000000, + "samp_rate": 2400000, + "start_freq": 466000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "5d9e07e8-eb42-4832-82c9-016f05d89027": { + "name": "468 MHz FRS/GMRS", + "rf_gain": 42.0, + "center_freq": 468000000, + "samp_rate": 2400000, + "start_freq": 468000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "20m": { + "name": "20m", + "center_freq": 14150000, + "samp_rate": 384000, + "start_freq": 14070000, + "start_mod": "usb", + "tuning_step": "500", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "30m": { + "name": "30m", + "center_freq": 10125000, + "samp_rate": 192000, + "start_freq": 10142000, + "start_mod": "usb", + "tuning_step": "500", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "40m": { + "name": "40m", + "center_freq": 7100000, + "samp_rate": 256000, + "start_freq": 7070000, + "start_mod": "lsb", + "tuning_step": "500", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "80m": { + "name": "80m", + "center_freq": 3650000, + "samp_rate": 384000, + "start_freq": 3570000, + "start_mod": "lsb", + "tuning_step": "500", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "49m": { + "name": "49m Broadcast", + "center_freq": 6050000, + "samp_rate": 384000, + "start_freq": 6070000, + "start_mod": "am", + "tuning_step": "1000", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "c1982ce1-7504-455e-908c-dc097fa031a8": { + "name": "1090 MHz ADS-B Band", + "rf_gain": 42.0, + "center_freq": 1090000000, + "samp_rate": 2400000, + "start_freq": 1090000000, + "start_mod": "adsb", + "tuning_step": 1, + "direct_sampling": 0 + }, + "cb7f2f8e-e317-4a5e-9504-826dd3781791": { + "name": "978 MHz ADS-B Band", + "rf_gain": 42.0, + "center_freq": 978000000, + "samp_rate": 2400000, + "start_freq": 978000000, + "start_mod": "adsb", + "tuning_step": 1 + } + } + }, + "airspy": { + "name": "Airspy HF+", + "type": "airspyhf", + "rf_gain": "auto", + "profiles": { + "20m": { + "name": "20m", + "center_freq": 14150000, + "samp_rate": 384000, + "start_freq": 14070000, + "start_mod": "usb", + "tuning_step": "500" + }, + "30m": { + "name": "30m", + "center_freq": 10125000, + "samp_rate": 192000, + "start_freq": 10142000, + "start_mod": "usb", + "tuning_step": "500" + }, + "40m": { + "name": "40m", + "center_freq": 7100000, + "samp_rate": 256000, + "start_freq": 7070000, + "start_mod": "lsb", + "tuning_step": "500" + }, + "80m": { + "name": "80m", + "center_freq": 3650000, + "samp_rate": 384000, + "start_freq": 3570000, + "start_mod": "lsb", + "tuning_step": "500" + }, + "49m": { + "name": "49m Broadcast", + "center_freq": 6050000, + "samp_rate": 384000, + "start_freq": 6070000, + "start_mod": "am", + "tuning_step": "1000" + } + } + }, + "sdrplay": { + "name": "SDRPlay device", + "type": "sdrplay", + "antenna": "Antenna A", + "rf_gain": "auto", + "profiles": { + "20m": { + "name": "20m", + "center_freq": 14150000, + "samp_rate": 500000, + "start_freq": 14070000, + "start_mod": "usb", + "tuning_step": "500" + }, + "30m": { + "name": "30m", + "center_freq": 10125000, + "samp_rate": 250000, + "start_freq": 10142000, + "start_mod": "usb", + "tuning_step": "500" + }, + "40m": { + "name": "40m", + "center_freq": 7100000, + "samp_rate": 500000, + "start_freq": 7070000, + "start_mod": "lsb", + "tuning_step": "500" + }, + "80m": { + "name": "80m", + "center_freq": 3650000, + "samp_rate": 500000, + "start_freq": 3570000, + "start_mod": "lsb", + "tuning_step": "500" + }, + "49m": { + "name": "49m Broadcast", + "center_freq": 6000000, + "samp_rate": 500000, + "start_freq": 6070000, + "start_mod": "am", + "tuning_step": "1000" + } + } + } + }, + "receiver_name": "ARISS Radio Pi", + "receiver_location": "Budapest, Hungary", + "receiver_asl": 200, + "receiver_admin": "example@example.com", + "receiver_gps": { + "lat": 39.95233, + "lon": -75.16379 + }, + "photo_title": "Panorama of Budapest from Sch\u00f6nherz Zolt\u00e1n Dormitory", + "photo_desc": "", + "max_clients": 20, + "keep_files": 20, + "session_timeout": 0, + "usage_policy_url": "policy", + "allow_chat": true, + "allow_audio_recording": true, + "allow_center_freq_changes": false, + "magic_key": "memagic", + "receiver_keys": [], + "waterfall_scheme": "GoogleTurboWaterfall", + "fft_fps": 9, + "fft_size": 4096, + "fft_voverlap_factor": 0.3, + "waterfall_levels": { + "min": -88.0, + "max": -20.0 + }, + "waterfall_auto_levels": { + "min": 3.0, + "max": 10.0 + }, + "waterfall_auto_level_default_mode": false, + "waterfall_auto_min_range": 50, + "audio_compression": "adpcm", + "fft_compression": "adpcm", + "tuning_precision": 2, + "eibi_bookmarks_range": 0, + "repeater_range": 0, + "map_type": "google", + "google_maps_api_key": "", + "openweathermap_api_key": "", + "map_position_retention_time": 7200, + "map_ignore_indirect_reports": false, + "map_prefer_recent_reports": true, + "callsign_url": "https://www.qrzcq.com/call/{}", + "vessel_url": "https://www.vesselfinder.com/vessels/details/{}", + "flight_url": "https://flightaware.com/live/flight/{}", + "modes_url": "https://flightaware.com/live/modes/{}/redirect" +} + From be3af7add803873995882d436051f0d6810a5d39 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 04:01:51 -0500 Subject: [PATCH 178/554] Update bookmarks.json --- groundstation/bookmarks.json | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/bookmarks.json b/groundstation/bookmarks.json index 09f1be52..b3c55a2c 100644 --- a/groundstation/bookmarks.json +++ b/groundstation/bookmarks.json @@ -54,3 +54,4 @@ "frequency": 437800000, "modulation": "nfm" } +] From 0185e522fb0ca2ce634b4b33ea7c829a707b4662 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 04:19:01 -0500 Subject: [PATCH 179/554] Update loc.sh add venv --- groundstation/loc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/loc.sh b/groundstation/loc.sh index 5a1b6881..06096323 100755 --- a/groundstation/loc.sh +++ b/groundstation/loc.sh @@ -5,7 +5,7 @@ sudo killall -9 java &>/dev/null sudo killall -9 gpredict &>/dev/null -python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py +/home/pi/venv/bin/python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py #/usr/bin/gpredict From 8925b52b6aa0a7735c0f1bfaf89cafe645f93c93 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 04:58:55 -0500 Subject: [PATCH 180/554] Update sdr.sh get rid of Restore pages popup --- groundstation/sdr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh index 1ad01092..8dfd5e64 100755 --- a/groundstation/sdr.sh +++ b/groundstation/sdr.sh @@ -50,7 +50,7 @@ sudo systemctl restart openwebrx &>/dev/null sleep 10 -setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://localhost:8073 &>/dev/null & +setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars --app=http://localhost:8073 &>/dev/null & sleep 10 From ca2a06d119860982af6f2e3659aaca22d2475e9b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 06:59:49 -0500 Subject: [PATCH 181/554] Update sstv_decode_prompt.sh changed play device --- groundstation/sstv_decode_prompt.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index 6b6e5dbc..1a065791 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -132,7 +132,8 @@ set -- $value #rtl_fm -M fm -f 434.9M -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 #rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 +#rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | aplay -D plughw:${2:0:1},0 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From 46a2dfd578ea2e5a8790c737c47ce7acf83a0135 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 10:32:38 -0500 Subject: [PATCH 182/554] Update packet.sh remove tee --- groundstation/packet.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/packet.sh b/groundstation/packet.sh index 87620bdc..28a9e2de 100755 --- a/groundstation/packet.sh +++ b/groundstation/packet.sh @@ -187,5 +187,6 @@ set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From 6826e558b34e08e88863ea50a061330352882b76 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 10:33:04 -0500 Subject: [PATCH 183/554] Update direwolf.conf change speaker to default --- groundstation/direwolf/direwolf.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf.conf b/groundstation/direwolf/direwolf.conf index ce8b6823..d70427b9 100644 --- a/groundstation/direwolf/direwolf.conf +++ b/groundstation/direwolf/direwolf.conf @@ -1 +1 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=b1,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 default From 869107baf273982335de9874f743496bd904b8f1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 10:37:20 -0500 Subject: [PATCH 184/554] Update direwolf.conf change speaker to loopback --- groundstation/direwolf/direwolf.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf.conf b/groundstation/direwolf/direwolf.conf index d70427b9..701d80b4 100644 --- a/groundstation/direwolf/direwolf.conf +++ b/groundstation/direwolf/direwolf.conf @@ -1 +1 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 default +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 From 17437ecc58c49c5e88b774eb39b5cc9fea155120 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 13:42:52 -0500 Subject: [PATCH 185/554] Update packet.sh changed subchannel --- groundstation/packet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/packet.sh b/groundstation/packet.sh index 28a9e2de..87ff253b 100755 --- a/groundstation/packet.sh +++ b/groundstation/packet.sh @@ -186,7 +186,7 @@ echo "$value" > /dev/null set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From b3ef984e542de0dc971e7e9f2a15e2556334d7b3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 14:01:32 -0500 Subject: [PATCH 186/554] Update aprs.desktop --- groundstation/aprs.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/aprs.desktop b/groundstation/aprs.desktop index b9ee2512..5f360f7b 100644 --- a/groundstation/aprs.desktop +++ b/groundstation/aprs.desktop @@ -2,7 +2,7 @@ Name=APRS Decode using Direwolf GenericName=Decodes APRS using rtl_fm and Direwolf Comment=APRS signals -Exec=/home/pi/CubeSatSim/groundstation/aprs.sh +Exec=/home/pi/CubeSatSim/groundstation/packet.sh Icon=/home/pi/Icons/aprs.png Terminal=true Type=Application From 8ccc7040bcb9b858122dac21fb820efcbe574524 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 14:03:49 -0500 Subject: [PATCH 187/554] Update sstv_decode_prompt.sh --- groundstation/sstv_decode_prompt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index 1a065791..9845c3bf 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -133,7 +133,7 @@ set -- $value #rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 #rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | aplay -D plughw:${2:0:1},0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | aplay -D plughw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From 961c80d8ecda8482300a66f5b53fc54d8f82cf9d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 14:13:20 -0500 Subject: [PATCH 188/554] Update sstv_decode_prompt.sh added also stop/start --- groundstation/sstv_decode_prompt.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index 9845c3bf..3c343732 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -30,6 +30,9 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 zenity &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + #echo "s" >> .mode frequency=$(zenity --list 2>/dev/null --width=410 --height=220 --title="SSTV Decoding using QSSTV" --text="Choose the frequency for SSTV decoding:" --column="kHz" --column="Use" 145800 "ISS" 434900 "CubeSatSim" Other "Choose another frequency" SSTV "Test SSTV decoding with WAV file") From 9b5fb214283407e0aa2702499d4cc73342576bc0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 14:16:15 -0500 Subject: [PATCH 189/554] Update sstv_decode_prompt.sh --- groundstation/sstv_decode_prompt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index 3c343732..ab8c9f1f 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -135,8 +135,8 @@ set -- $value #rtl_fm -M fm -f 434.9M -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 #rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 -#rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | aplay -D plughw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 +#rtl_fm -M fm -f $frequency -s 48k | aplay -D plughw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From 84e5a7c2d695f6b279db42e3c7e779d202194eb6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 3 Jan 2025 14:18:58 -0500 Subject: [PATCH 190/554] Update packet.sh added alsa stop/start --- groundstation/packet.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/groundstation/packet.sh b/groundstation/packet.sh index 87ff253b..3f68fe6e 100755 --- a/groundstation/packet.sh +++ b/groundstation/packet.sh @@ -26,6 +26,9 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 zenity &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + echo frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") From 757430adfc93416fd8fa7672f3601f59edd25ee0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 03:32:19 -0500 Subject: [PATCH 191/554] Update webSDR.desktop --- groundstation/webSDR.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/webSDR.desktop b/groundstation/webSDR.desktop index 277bbae2..f660c2ea 100644 --- a/groundstation/webSDR.desktop +++ b/groundstation/webSDR.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/sdr.sh Name=Web SDR Comment=openwebrx for Web SDR -Icon=/home/pi/Downloads/openwebrx.png +Icon=/home/pi/Iconss/openwebrx.png Path=/home/pi Terminal=true Categories=HamRadio From 389870d5b723ce97ff9b54f3484af2ff500bb1b8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 03:34:00 -0500 Subject: [PATCH 192/554] Update chromium.desktop changed to myurl --- groundstation/autostart/chromium.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/autostart/chromium.desktop b/groundstation/autostart/chromium.desktop index fc57834e..5fd6bef0 100644 --- a/groundstation/autostart/chromium.desktop +++ b/groundstation/autostart/chromium.desktop @@ -2,4 +2,4 @@ [Desktop Entry] Type=Application Name=Chromium with WebSDR -Exec=chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8073 +Exec=chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars --app=http://localhost:8073 From 9c5dc8bd2f608d4933c84344798d76d09b9336df Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 07:53:17 -0500 Subject: [PATCH 193/554] Update and rename rtl_tcp.service to rtltcp.service from niclashoyer/rtltcp --- groundstation/rtl_tcp.service | 14 -------------- groundstation/rtltcp.service | 10 ++++++++++ 2 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 groundstation/rtl_tcp.service create mode 100644 groundstation/rtltcp.service diff --git a/groundstation/rtl_tcp.service b/groundstation/rtl_tcp.service deleted file mode 100644 index 403425a3..00000000 --- a/groundstation/rtl_tcp.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=RTL-TCP - -[Service] -TimeoutStopSec = 5 -ExecStart=/bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I)' -WorkingDirectory=/home/pi -StandardOutput=inherit -StandardError=inherit -Restart=always -User=root - -[Install] -WantedBy=default.target diff --git a/groundstation/rtltcp.service b/groundstation/rtltcp.service new file mode 100644 index 00000000..f9d2405f --- /dev/null +++ b/groundstation/rtltcp.service @@ -0,0 +1,10 @@ +[Unit] +Description=RTL TCP Service +After=network.target +Requires=rtltcp.socket + +[Service] +Type=notify +User=pi +ExecStart=/usr/local/bin/rtltcp +TimeoutStopSec=5 From a259419e2d5112cfad4b4146ec46d09247968bd8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 07:54:57 -0500 Subject: [PATCH 194/554] Create rtltcp.socket from niclashoyer/rtltcp --- groundstation/rtltcp.socket | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 groundstation/rtltcp.socket diff --git a/groundstation/rtltcp.socket b/groundstation/rtltcp.socket new file mode 100644 index 00000000..d8a67a14 --- /dev/null +++ b/groundstation/rtltcp.socket @@ -0,0 +1,9 @@ +[Unit] +Description=RTL TCP Socket +PartOf=rtltcp.service + +[Socket] +ListenStream=[::]:1234 + +[Install] +WantedBy=sockets.target From 03be3471e06a531e8de423e3105854bc160e347f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 08:15:57 -0500 Subject: [PATCH 195/554] Update and rename rtltcp.service to rtl_tcp.service revert --- groundstation/rtl_tcp.service | 14 ++++++++++++++ groundstation/rtltcp.service | 10 ---------- 2 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 groundstation/rtl_tcp.service delete mode 100644 groundstation/rtltcp.service diff --git a/groundstation/rtl_tcp.service b/groundstation/rtl_tcp.service new file mode 100644 index 00000000..403425a3 --- /dev/null +++ b/groundstation/rtl_tcp.service @@ -0,0 +1,14 @@ +[Unit] +Description=RTL-TCP + +[Service] +TimeoutStopSec = 5 +ExecStart=/bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I)' +WorkingDirectory=/home/pi +StandardOutput=inherit +StandardError=inherit +Restart=always +User=root + +[Install] +WantedBy=default.target diff --git a/groundstation/rtltcp.service b/groundstation/rtltcp.service deleted file mode 100644 index f9d2405f..00000000 --- a/groundstation/rtltcp.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=RTL TCP Service -After=network.target -Requires=rtltcp.socket - -[Service] -Type=notify -User=pi -ExecStart=/usr/local/bin/rtltcp -TimeoutStopSec=5 From 3aeed04e4144360a94ac74d28f95a09606a7490f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 08:17:46 -0500 Subject: [PATCH 196/554] Update rtl_tcp.service removed path --- groundstation/rtl_tcp.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/rtl_tcp.service b/groundstation/rtl_tcp.service index 403425a3..e2c3b3b7 100644 --- a/groundstation/rtl_tcp.service +++ b/groundstation/rtl_tcp.service @@ -3,7 +3,7 @@ Description=RTL-TCP [Service] TimeoutStopSec = 5 -ExecStart=/bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I)' +ExecStart=/bin/sh -c 'rtl_tcp -a $(hostname -I)' WorkingDirectory=/home/pi StandardOutput=inherit StandardError=inherit From b43aa9da609786a2b5f3b6cd8f0d914483ea885a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 08:33:39 -0500 Subject: [PATCH 197/554] add sdrpp script --- groundstation/sdrpp.sh | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 groundstation/sdrpp.sh diff --git a/groundstation/sdrpp.sh b/groundstation/sdrpp.sh new file mode 100755 index 00000000..73f520e7 --- /dev/null +++ b/groundstation/sdrpp.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# script to run sdrpp + +echo "Script to run SDRpp for ARISS Radio Pi" + +echo + +sudo systemctl stop openwebrx + +sudo killall -9 java &>/dev/null + +sudo killall -9 sdrpp &>/dev/null + +sudo systemctl stop rtl_tcp + +pkill -o chromium &>/dev/null + +sudo killall -9 rtl_fm &>/dev/null + +sudo killall -9 direwolf &>/dev/null + +sudo killall -9 aplay &>/dev/null + +sudo killall -9 qsstv &>/dev/null + +sudo killall -9 rtl_tcp &>/dev/null + +sudo killall -9 CubicSDR &>/dev/null + +#sudo kill `ps -aux | grep cubicsdr-packet | grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null + +#sudo kill `ps -aux | grep packet | grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null + +#sudo kill `ps -aux | grep sstv_decode_prompt| grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null + +sudo killall -9 zenity &>/dev/null + +sleep 5 + +setsid sdrpp + +sleep 10 + +#$SHELL From 15ebacf05b528ef293d534041af28573067acc15 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 08:40:47 -0500 Subject: [PATCH 198/554] Update rtl-tcp.sh use systemd --- groundstation/rtl-tcp.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index bcf8e154..47853aaf 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -50,7 +50,8 @@ sudo killall -9 aplay &>/dev/null sudo killall -9 zenity &>/dev/null -sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")' +#sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")' +sudo systemctl start rtl_tcp &>/dev/null sleep 5 From a991cf979de7009f40142220f2937ad4b47286d4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 08:41:48 -0500 Subject: [PATCH 199/554] Update rtl_tcp.service changed to IP address not host name --- groundstation/rtl_tcp.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/rtl_tcp.service b/groundstation/rtl_tcp.service index e2c3b3b7..ff899e9b 100644 --- a/groundstation/rtl_tcp.service +++ b/groundstation/rtl_tcp.service @@ -3,7 +3,7 @@ Description=RTL-TCP [Service] TimeoutStopSec = 5 -ExecStart=/bin/sh -c 'rtl_tcp -a $(hostname -I)' +ExecStart=/bin/sh -c 'rtl_tcp -a $(hostname -I|cut -f1 -d " ")' WorkingDirectory=/home/pi StandardOutput=inherit StandardError=inherit From f224a0ede08f5e878715632f498bd56e8ed33ee7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 08:44:07 -0500 Subject: [PATCH 200/554] Update rtl-tcp.sh add journalctl messages --- groundstation/rtl-tcp.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index 47853aaf..4a18c89f 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -49,10 +49,11 @@ sudo killall -9 aplay &>/dev/null sudo killall -9 zenity &>/dev/null - #sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")' sudo systemctl start rtl_tcp &>/dev/null +sudo journalctl -af -u rtl_tcp + sleep 5 #$SHELL From 84d090747cbab6f223d1b0c5922fb07b0f60be71 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 08:54:18 -0500 Subject: [PATCH 201/554] Update rtl-tcp.sh add while to close window --- groundstation/rtl-tcp.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index 4a18c89f..0378909a 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -52,8 +52,9 @@ sudo killall -9 zenity &>/dev/null #sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")' sudo systemctl start rtl_tcp &>/dev/null -sudo journalctl -af -u rtl_tcp - -sleep 5 +while [[ sudo systemctl status rtl_tcp | grep "Active: active (running)" ]] +do + sleep 5 +done #$SHELL From 0df2108bda38e847a7ca1aabdbd15eca883b4518 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 08:56:44 -0500 Subject: [PATCH 202/554] Update rtl-tcp.sh fixed typo --- groundstation/rtl-tcp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index 0378909a..185d8b6a 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -52,7 +52,7 @@ sudo killall -9 zenity &>/dev/null #sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")' sudo systemctl start rtl_tcp &>/dev/null -while [[ sudo systemctl status rtl_tcp | grep "Active: active (running)" ]] +while [[ $(sudo systemctl status rtl_tcp | grep "Active: active (running)") ]] do sleep 5 done From 4de35d79776cb895866472fa00c9052c1ed23c91 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 08:58:14 -0500 Subject: [PATCH 203/554] Update rtl-tcp.sh add back in journalctl log --- groundstation/rtl-tcp.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index 185d8b6a..caf5ff2c 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -52,6 +52,8 @@ sudo killall -9 zenity &>/dev/null #sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")' sudo systemctl start rtl_tcp &>/dev/null +sudo journalctl -af -u rtl_tcp & + while [[ $(sudo systemctl status rtl_tcp | grep "Active: active (running)") ]] do sleep 5 From 861fe223d8069cd16f1fe1f03c89bd2566c30a30 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 4 Jan 2025 09:01:02 -0500 Subject: [PATCH 204/554] Update rtl-tcp.sh add sleep at end --- groundstation/rtl-tcp.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index caf5ff2c..e16c6e9a 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -59,4 +59,6 @@ do sleep 5 done +sleep 5 + #$SHELL From 100560015959ba3edf62acd842265cda40940477 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 05:00:17 -0500 Subject: [PATCH 205/554] Update fox-profile.sh --- groundstation/fox-profile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-profile.sh b/groundstation/fox-profile.sh index d51e7ccb..1610e293 100755 --- a/groundstation/fox-profile.sh +++ b/groundstation/fox-profile.sh @@ -1,7 +1,7 @@ #!/bin/bash # script to change FoxTelem default profile -echo "Script to change your default FoxTelem profile for FIAB v3" +echo "Script to change your default FoxTelem profile for FIAB v4" echo From c0653b5b1d03c7e6baf6cad88c818ac6d994dd1d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 05:00:47 -0500 Subject: [PATCH 206/554] Update fox-startup.sh --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index cb035116..cf6a6282 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -1,7 +1,7 @@ #!/bin/bash # script to run FoxTelem -echo "Startup script to run FoxTelem for FIAB v3" +echo "Startup script to run FoxTelem for FIAB v4" echo From d8c40c6b57cb02a29e8f9f0f820cf033e93bfc60 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 05:01:13 -0500 Subject: [PATCH 207/554] Update fox-run.sh --- groundstation/fox-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-run.sh b/groundstation/fox-run.sh index c680b47a..d8fe4fe5 100755 --- a/groundstation/fox-run.sh +++ b/groundstation/fox-run.sh @@ -1,7 +1,7 @@ #!/bin/bash # script to run FoxTelem -echo "Startup script to run FoxTelem for FIAB v3" +echo "Startup script to run FoxTelem for FIAB v4" echo From 5f09c5a73ca33a714599fcf5b56cff4f567d64d5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 05:01:44 -0500 Subject: [PATCH 208/554] Update fox-download.desktop --- groundstation/fox-download.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-download.desktop b/groundstation/fox-download.desktop index d58827d0..4e4bcf40 100644 --- a/groundstation/fox-download.desktop +++ b/groundstation/fox-download.desktop @@ -2,7 +2,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/fox-download.sh Name=FoxTelem Download -Comment=FIAB-v3 +Comment=FIAB-v4 Icon=/home/pi/Icons/FoxTelemDownload.png Path=/home/pi Terminal=true From 577d0f93edc99d753a6970d5430ceea07e1461cc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 05:02:19 -0500 Subject: [PATCH 209/554] Update foxtelem.desktop --- groundstation/foxtelem.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/foxtelem.desktop b/groundstation/foxtelem.desktop index 9dc42ab9..87fe00a1 100644 --- a/groundstation/foxtelem.desktop +++ b/groundstation/foxtelem.desktop @@ -2,7 +2,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/fox-run.sh Name=FoxTelem -Comment=FIAB-v3 +Comment=FIAB-v4 Icon=/home/pi/Downloads/foxtelem.png Path=/home/pi Terminal=true From b3eeaaa8687061f7bae94f0ed3f9ec145cd113a5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 05:10:36 -0500 Subject: [PATCH 210/554] Update loc.sh activate venv --- groundstation/loc.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/groundstation/loc.sh b/groundstation/loc.sh index 06096323..8aa8cd9f 100755 --- a/groundstation/loc.sh +++ b/groundstation/loc.sh @@ -5,7 +5,10 @@ sudo killall -9 java &>/dev/null sudo killall -9 gpredict &>/dev/null -/home/pi/venv/bin/python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py +source /home/pi/venv/bin/activate + + +python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py #/usr/bin/gpredict From 7db82fff14ddd1ef35c66a1c06321662cec7d3a1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 05:33:21 -0500 Subject: [PATCH 211/554] Update fox-run.sh add venv activate --- groundstation/fox-run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/fox-run.sh b/groundstation/fox-run.sh index d8fe4fe5..aa21578b 100755 --- a/groundstation/fox-run.sh +++ b/groundstation/fox-run.sh @@ -5,6 +5,8 @@ echo "Startup script to run FoxTelem for FIAB v4" echo +source /home/pi/venv/bin/activate + sudo killall -9 FoxTelem &>/dev/null sudo killall -9 zenity &>/dev/null From a8692efe42719658ecc7df9ebeedb0ca2af92eb8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 05:40:03 -0500 Subject: [PATCH 212/554] Update fox-run.sh removed fox --- groundstation/fox-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-run.sh b/groundstation/fox-run.sh index aa21578b..3f1ec4c5 100755 --- a/groundstation/fox-run.sh +++ b/groundstation/fox-run.sh @@ -14,7 +14,7 @@ sudo killall -9 zenity &>/dev/null FILE=/home/pi/FoxTelemetryData/.foxprofile if [ ! -f "$FILE" ]; then - profile=$(zenity --text="Choose your default FoxTelem profile:" --list 2>/dev/null --width=410 --height=120 --title="Set FoxTelem Profile" --column="Profile" --column="Receive and decode telemetry from" Fox-in-a-Box "AMSAT Fox satellites" "CubeSatSim" "AMSAT CubeSat Simulator") + profile=$(zenity --text="Choose your default FoxTelem profile:" --list 2>/dev/null --width=410 --height=120 --title="Set FoxTelem Profile" --column="Profile" --column="Receive and decode telemetry from" Fox-in-a-Box "AMSAT Satellites" "CubeSatSim" "AMSAT CubeSat Simulator") echo $profile From ca6b036ea897b3cb2d0a49604ab2f54bbf8c4952 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 05:40:46 -0500 Subject: [PATCH 213/554] Update sstv_decode_prompt.sh mode 4 --- groundstation/sstv_decode_prompt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index ab8c9f1f..fbc55895 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -70,7 +70,7 @@ elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ]; then frequency=434900000 echo "Frequency is" $frequency echo -echo "If your CubeSatSim is transmitting in SSTV mode (mode 5) you should get images." +echo "If your CubeSatSim is transmitting in SSTV mode (mode 4) you should get images." echo "Note: if you see and hear an SSTV signal but don't get any images, the CubeSatSim signal might have a frequency offset. Try rebooting the CubeSatSim to fix." elif [ "$choice" = "3" ] || [ "$frequency" = "Other" ]; then From 69c2f9457ad283e6d147378c106a3471e8cad6c5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 06:18:07 -0500 Subject: [PATCH 214/554] Update packet.sh add kill sdrpp --- groundstation/packet.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/packet.sh b/groundstation/packet.sh index 3f68fe6e..4b65bdef 100755 --- a/groundstation/packet.sh +++ b/groundstation/packet.sh @@ -12,6 +12,8 @@ pkill -o chromium &>/dev/null sudo killall -9 rtl_fm &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 direwolf &>/dev/null sudo killall -9 aplay &>/dev/null From 993848e641c7b85eb8db4bbc94f8caf2b508a7fa Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 5 Jan 2025 06:20:01 -0500 Subject: [PATCH 215/554] Update packet.sh dire wolf with colors --- groundstation/packet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/packet.sh b/groundstation/packet.sh index 4b65bdef..f669afda 100755 --- a/groundstation/packet.sh +++ b/groundstation/packet.sh @@ -180,7 +180,7 @@ else echo -e "Auto decoding APRS packets on $frequency Hz" - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -t 0 & + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf & # -t 0 & fi From 65b69f64fdbf74c3697487eb5527d39dd6f408ba Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 6 Jan 2025 14:21:29 -0500 Subject: [PATCH 216/554] Update pacsat.sh add missing direwolf --- groundstation/pacsat.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index b0b1e952..d70aa07f 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -56,6 +56,7 @@ sudo systemctl restart pacsatsim #echo +direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 & echo echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback." From 81be0e9b3c70ea24809d346eb1bca2c7c8623dc3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 6 Jan 2025 14:40:34 -0500 Subject: [PATCH 217/554] Update direwolf-pacsat-loopback.conf to 0 1 --- groundstation/direwolf/direwolf-pacsat-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf index 74a7fb1e..c815b866 100644 --- a/groundstation/direwolf/direwolf-pacsat-loopback.conf +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -1,5 +1,5 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=1 #PTT GPIO 20 CHANNEL 0 MODEM 1200 From c26743c59f3844d74d4c1cbfb1989ee012bf9c10 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 6 Jan 2025 14:45:39 -0500 Subject: [PATCH 218/554] Update direwolf-pacsat-loopback.conf 0 0 --- groundstation/direwolf/direwolf-pacsat-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf index c815b866..74a7fb1e 100644 --- a/groundstation/direwolf/direwolf-pacsat-loopback.conf +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -1,5 +1,5 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=1 +ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=0 #PTT GPIO 20 CHANNEL 0 MODEM 1200 From 0556866021d4cf2055e181713279e35303a044a7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 6 Jan 2025 14:46:17 -0500 Subject: [PATCH 219/554] Update direwolf-pacsatsim-jp14.conf 1 1 --- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 803920ff..64c7bfe5 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,4 +1,4 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 #PTT GPIO 20 MYCALL AMSAT CHANNEL 0 From ec1e6fafabe11df51b5ea1e817ce2b103563be71 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 6 Jan 2025 14:57:13 -0500 Subject: [PATCH 220/554] Update pacsatsim.sh don't kill direwolf --- pacsatsim.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 6588240e..94a07850 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -14,15 +14,15 @@ sudo modprobe snd-aloop #sudo systemctl stop openwebrx -sudo systemctl stop rtl_tcp &>/dev/null +#sudo systemctl stop rtl_tcp &>/dev/null #pkill -o chromium &>/dev/null -sudo killall -9 rtl_fm &>/dev/null +#sudo killall -9 rtl_fm &>/dev/null -sudo killall -9 direwolf &>/dev/null +#sudo killall -9 direwolf &>/dev/null -sudo killall -9 aplay &>/dev/null +#udo killall -9 aplay &>/dev/null #sudo killall -9 qsstv &>/dev/null From d37400dd318b909df295d29ec2a543fdcff50d1b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 02:35:06 -0500 Subject: [PATCH 221/554] Update pacsatsim.sh direwolf loopback --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 94a07850..2bc9bcc6 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -185,7 +185,7 @@ else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 & + direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & fi From ed93dbc59aaeb006135744f08a97305a38e1cb4a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 02:35:57 -0500 Subject: [PATCH 222/554] Create direwolf-pacsatsim-loopback.conf --- direwolf/direwolf-pacsatsim-loopback.conf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 direwolf/direwolf-pacsatsim-loopback.conf diff --git a/direwolf/direwolf-pacsatsim-loopback.conf b/direwolf/direwolf-pacsatsim-loopback.conf new file mode 100644 index 00000000..64c7bfe5 --- /dev/null +++ b/direwolf/direwolf-pacsatsim-loopback.conf @@ -0,0 +1,8 @@ +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 +#PTT GPIO 20 +MYCALL AMSAT +CHANNEL 0 +MODEM 1200 +FULLDUP OFF +TXDELAY 75 +#FIX_BITS 1 AX25 From 8007aa4530cd0d6021862502f3e198b0dd522699 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 02:39:00 -0500 Subject: [PATCH 223/554] Update pacsatsim.sh comment on direwolf --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 2bc9bcc6..33c1a8cd 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -185,7 +185,7 @@ else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & +# direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & fi From 47a6a89fb9e8b2833d27422ea09d112d1939dd48 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 02:40:23 -0500 Subject: [PATCH 224/554] Update pacsat.sh comment out direwolf --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index d70aa07f..5564d8cd 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -56,7 +56,7 @@ sudo systemctl restart pacsatsim #echo -direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 & +#direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 & echo echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback." From fa11e21422739745096d432287656030db20c1e4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 02:43:37 -0500 Subject: [PATCH 225/554] Update pacsat.sh remove direwolf killall --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 5564d8cd..01fa7515 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -22,7 +22,7 @@ pkill -o chromium &>/dev/null sudo killall -9 rtl_fm &>/dev/null -sudo killall -9 direwolf &>/dev/null +#sudo killall -9 direwolf &>/dev/null sudo killall -9 aplay &>/dev/null From 2219931cec652b11ba3ac3522d8618cb569545e8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 03:35:16 -0500 Subject: [PATCH 226/554] adding reset_pacsat --- groundstation/reset_pacsat.sh | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 groundstation/reset_pacsat.sh diff --git a/groundstation/reset_pacsat.sh b/groundstation/reset_pacsat.sh new file mode 100755 index 00000000..34e153a3 --- /dev/null +++ b/groundstation/reset_pacsat.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# script to clear Pacsat Ground Station and Pacsatsim state + +echo "Clearing all Pacsat Ground Station and Pacsatsim state" + +echo + +sudo systemctl stop pacsatsim + +#sudo killall -9 direwolf &>/dev/null + +sudo killall -9 java &>/dev/null + +cd + +cd pi_pacsat + +cd Debug + +sudo rm -r /home/pi/PacSat + +mkdir /home/pi/PacSat +mkdir /home/pi/PacSat/pacsat +mkdir /home/pi/PacSat/pacsat/dir + +#value=`cat /home/pi/CubeSatSim/sim.cfg` +#echo "$value" > /dev/null +#set -- $value + +echo "bit_rate=9600" > pacsat.config +echo "bbs_callsign=AMSAT-12" >> pacsat.config +echo "broadcast_callsign=AMSAT-11" >> pacsat.config +echo "digi_callsign=AMSAT-1" >> pacsat.config +echo "max_frames_in_tx_buffer=5" >> pacsat.config + +sudo rm pacsat_last_command_time.dat +sudo rm pacsat_upload_table.dat +sudo rm pacsat.state + +echo "pb_open=1" > pacsat.state +echo "uplink_open=1" >> pacsat.state +echo "pb_max_period_for_client_in_seconds=60" >> pacsat.state +echo "uplink_max_period_for_client_in_seconds=60" >> pacsat.state + +touch /home/pi/pi_pacsat/Debug/pacsat_upload_table.dat + +sudo rm -r /home/pi/PacSatGround + +mkdir /home/pi/PacSatGround + +echo + +echo "You will need to install the Pacsatsim spacecraft file and set the Delay to 750ms and Port to 8100 and restart the Pacsat Ground Station" + From 8a8c09814ada6c466ab9e7f9df725a04484f8f19 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 03:38:45 -0500 Subject: [PATCH 227/554] Update pacsatsim.sh direwolf back in --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 33c1a8cd..2bc9bcc6 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -185,7 +185,7 @@ else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" -# direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & fi From f6053fc6ba53862bf141fa8280923e1e0a60e5af Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 03:39:15 -0500 Subject: [PATCH 228/554] Update pacsat.sh run direwolf back in --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 01fa7515..46293689 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -56,7 +56,7 @@ sudo systemctl restart pacsatsim #echo -#direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 & +direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 & echo echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback." From 0bc9b97a720f627e9c9eee7419a402c9c1999e08 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 04:14:45 -0500 Subject: [PATCH 229/554] Update pacsat.sh add 30 second delay --- groundstation/pacsat.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 46293689..0e916410 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -40,6 +40,11 @@ echo sudo systemctl restart pacsatsim + +echo "Waiting 30 seconds for Pacsatsim to start" + +sleep 30 + #value=`cat /home/pi/CubeSatSim/sim.cfg` #echo "$value" > /dev/null #set -- $value From d22bbc222d328ffede96bf909c71d81c7eb98c68 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 06:07:20 -0500 Subject: [PATCH 230/554] Update pacsat.sh change to 10 second delay --- groundstation/pacsat.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 0e916410..56be5a59 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -41,9 +41,9 @@ echo sudo systemctl restart pacsatsim -echo "Waiting 30 seconds for Pacsatsim to start" +echo "Waiting 10 seconds for Pacsatsim to start" -sleep 30 +sleep 10 #value=`cat /home/pi/CubeSatSim/sim.cfg` #echo "$value" > /dev/null From 4b3e527419986a34db28357ea952a6c021fe0254 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 06:32:23 -0500 Subject: [PATCH 231/554] Update direwolf-pacsat-loopback.conf set AGW port --- groundstation/direwolf/direwolf-pacsat-loopback.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf index 74a7fb1e..6058c722 100644 --- a/groundstation/direwolf/direwolf-pacsat-loopback.conf +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -4,6 +4,7 @@ ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=0 CHANNEL 0 MODEM 1200 KISSPORT 8100 +AGWPORT 8002 FULLDUP OFF TXDELAY 30 #FIX_BITS 1 AX25 From 1c67dbdbb36cfaac6131b59f5386cff1843a850e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 06:57:37 -0500 Subject: [PATCH 232/554] Update install changed from W3ZM to AMSAT --- install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install b/install index eed5aef2..216dd74f 100755 --- a/install +++ b/install @@ -158,9 +158,9 @@ export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LI #set -- $value echo "bit_rate=9600" > pacsat.config -echo "bbs_callsign=W3ZM-12" >> pacsat.config -echo "broadcast_callsign=W3ZM-11" >> pacsat.config -echo "digi_callsign=W3ZM-1" >> pacsat.config +echo "bbs_callsign=AMSAT-12" >> pacsat.config +echo "broadcast_callsign=AMSAT-11" >> pacsat.config +echo "digi_callsign=AMSAT-1" >> pacsat.config echo "max_frames_in_tx_buffer=5" >> pacsat.config echo "pb_open=1" > pacsat.state From a2797e17b9942cc9a2981a0f4eba2221c55a1066 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 07:17:30 -0500 Subject: [PATCH 233/554] Update pacsatsim.sh try -du --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 2bc9bcc6..e7ca6ba8 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -185,7 +185,7 @@ else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + direwolf -P+ -D1 -qd -du -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & fi From d660f6451583be55ba3acbc6105a6005ce85c253 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 07:21:27 -0500 Subject: [PATCH 234/554] Update pacsatsim.sh try -dp --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index e7ca6ba8..5f2e717e 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -185,7 +185,7 @@ else echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - direwolf -P+ -D1 -qd -du -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & fi From 0d954f7f3d5998bbd5658130908dfc5cd580ab00 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 07:24:38 -0500 Subject: [PATCH 235/554] Update pacsat.sh add direwolf -dp for packet dump --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 56be5a59..f187e1ca 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -61,7 +61,7 @@ sleep 10 #echo -direwolf -P+ -D1 -qd -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 & +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 & echo echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback." From 3cce953b8c9c6b3c3ed856218bafb9be86f8c857 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 7 Jan 2025 09:58:56 -0500 Subject: [PATCH 236/554] Update direwolf-pacsatsim-loopback.conf upload better with txdelay 15 --- direwolf/direwolf-pacsatsim-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-loopback.conf b/direwolf/direwolf-pacsatsim-loopback.conf index 64c7bfe5..3fc85671 100644 --- a/direwolf/direwolf-pacsatsim-loopback.conf +++ b/direwolf/direwolf-pacsatsim-loopback.conf @@ -4,5 +4,5 @@ MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF -TXDELAY 75 +TXDELAY 15 #FIX_BITS 1 AX25 From d8c8cfe3fa5197570cc6f513b21495f25bb0fefe Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 06:54:09 -0500 Subject: [PATCH 237/554] Update cubicsdr.sh add also stop/start --- groundstation/cubicsdr.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/groundstation/cubicsdr.sh b/groundstation/cubicsdr.sh index f9c3146c..2bfb65dc 100755 --- a/groundstation/cubicsdr.sh +++ b/groundstation/cubicsdr.sh @@ -23,7 +23,7 @@ sudo killall -9 rtl_fm &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 qsstv &>/dev/null @@ -39,9 +39,10 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 zenity &>/dev/null -zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen click on a signal in the watefall to listen." & - +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start +zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen click on a signal in the watefall to listen." & sleep 5 From 29acb25334f94f8f09d2fffdcdd03e796acc34af Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 06:55:42 -0500 Subject: [PATCH 238/554] Update fox.sh add alsa stop/start --- groundstation/fox.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 233644ef..36e241e0 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -23,12 +23,15 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 qsstv &>/dev/null sudo killall -9 zenity &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + sleep 5 #/home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim From e676205c3cab60490bc7b6915d934e3fe69da0f2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 06:57:51 -0500 Subject: [PATCH 239/554] Update pacsat.sh add alsa stop/start --- groundstation/pacsat.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index f187e1ca..056ff0ca 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -24,7 +24,7 @@ sudo killall -9 rtl_fm &>/dev/null #sudo killall -9 direwolf &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 qsstv &>/dev/null @@ -40,6 +40,9 @@ 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" From 15986706d87d9c328063400b56bae3bf7c2c32c3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 06:58:35 -0500 Subject: [PATCH 240/554] Update rtl-tcp.sh add alsa stop/start --- groundstation/rtl-tcp.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index e16c6e9a..d5d541b1 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -45,10 +45,13 @@ sudo killall -9 qsstv &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 zenity &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + #sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")' sudo systemctl start rtl_tcp &>/dev/null From d25bbf7dc08e6cd79ff9a2e6fc8390c519ddf827 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 06:59:20 -0500 Subject: [PATCH 241/554] Update sdr.sh add alsa stop/start --- groundstation/sdr.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh index 8dfd5e64..66983556 100755 --- a/groundstation/sdr.sh +++ b/groundstation/sdr.sh @@ -38,7 +38,7 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 qsstv &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 direwolf &>/dev/null @@ -46,6 +46,9 @@ sudo killall -9 zenity &>/dev/null sudo systemctl stop rtl_tcp &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + sudo systemctl restart openwebrx &>/dev/null sleep 10 From 3ef21390e3e16ff629aae7b9b6fba5fc48e22b4a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 06:59:55 -0500 Subject: [PATCH 242/554] Update sdrpp.sh add alsa stop/start --- groundstation/sdrpp.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/groundstation/sdrpp.sh b/groundstation/sdrpp.sh index 73f520e7..08736032 100755 --- a/groundstation/sdrpp.sh +++ b/groundstation/sdrpp.sh @@ -19,7 +19,7 @@ sudo killall -9 rtl_fm &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 qsstv &>/dev/null @@ -35,6 +35,9 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 zenity &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + sleep 5 setsid sdrpp From aeec194e8d91ab376b86e076d2a2e0244c1a7de8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 07:14:20 -0500 Subject: [PATCH 243/554] Update loc-add-foxtelem.py added Pacsat location setting --- groundstation/loc-add-foxtelem.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 64c47bbd..1f4279cc 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -118,6 +118,16 @@ if (latitude != 0) and (longitude != 0): system(longSedStr) print("\nKLAtracker configuration updated with your latitude and longitude") + + latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/PacSatGround/PacSatGround.properties' + #print (latSedStr) + system(latSedStr) + + longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/PacSatGround/PacSatGround.properties' + #print (longSedStr) + system(longSedStr) + + print("\nPacsat configuration updated with your latitude and longitude") receiver_gpsSedStr = 'sudo sed -i "s/ ' + dquote + 'lat' + dquote + ': .*/ ' + dquote + 'lat' + dquote + ': ' + str(latitude) + ',/g" /var/lib/openwebrx/settings.json' #print (receiver_gpsSedStr) From 00fff29dc664577348bc6386327a547cc8fc6308 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 07:20:30 -0500 Subject: [PATCH 244/554] Update config change callsign in Pacsat Ground Station --- config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config b/config index 3764aa86..a38e55a9 100755 --- a/config +++ b/config @@ -553,6 +553,8 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config > /dev/null 2>&1 + sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g' /home/pi/PacSatGround/PacSatGround.properties' + sudo sed -i "s/$oldcallsign/$callsign/g' /home/pi/PacSatGround/spacecraft/PacSatSim.properties' fi if [ "$norestart" = "1" ]; then From 2c25bbf453768a9dd7ae6325b8c86ff962098398 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 07:27:32 -0500 Subject: [PATCH 245/554] Update config remove dev null --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index a38e55a9..4e2e3406 100755 --- a/config +++ b/config @@ -552,7 +552,7 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg - sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config > /dev/null 2>&1 + sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g' /home/pi/PacSatGround/PacSatGround.properties' sudo sed -i "s/$oldcallsign/$callsign/g' /home/pi/PacSatGround/spacecraft/PacSatSim.properties' fi From 0fb005db3b894c19dcc864cec5c29bd1f3f551ca Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 07:36:30 -0500 Subject: [PATCH 246/554] Update config sed typos --- config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config b/config index 4e2e3406..936ddad0 100755 --- a/config +++ b/config @@ -553,8 +553,8 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config - sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g' /home/pi/PacSatGround/PacSatGround.properties' - sudo sed -i "s/$oldcallsign/$callsign/g' /home/pi/PacSatGround/spacecraft/PacSatSim.properties' + sudo sed -i 's/callsign=$oldcallsign/callsign=$callsign/g' /home/pi/PacSatGround/PacSatGround.properties + sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/PacSatGround/spacecraft/PacSatSim.properties fi if [ "$norestart" = "1" ]; then From 1a7e2f8fdd5ac68abf60917543c73ad4b73cf4b0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 07:38:56 -0500 Subject: [PATCH 247/554] Update pacsat.sh add back kill direwolf --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 056ff0ca..0ab6acb9 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -22,7 +22,7 @@ pkill -o chromium &>/dev/null sudo killall -9 rtl_fm &>/dev/null -#sudo killall -9 direwolf &>/dev/null +sudo killall -9 direwolf &>/dev/null #sudo killall -9 aplay &>/dev/null From d814dc1788e04a28878f0afdaf789cd8c3afa92f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 07:52:01 -0500 Subject: [PATCH 248/554] Update config stop pacsatsim and java for callsign change --- config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config b/config index 936ddad0..59e752a8 100755 --- a/config +++ b/config @@ -552,6 +552,9 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg + sudo systemctl stop pacsatsim + sudo killall -9 java &>/dev/null + sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config sudo sed -i 's/callsign=$oldcallsign/callsign=$callsign/g' /home/pi/PacSatGround/PacSatGround.properties sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/PacSatGround/spacecraft/PacSatSim.properties From 38121edbbb20bec20947a52b397bb51d252301db Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 07:57:03 -0500 Subject: [PATCH 249/554] Update config fix sed --- config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config b/config index 59e752a8..1929eee1 100755 --- a/config +++ b/config @@ -555,9 +555,9 @@ elif [ "$1" = "-c" ]; then sudo systemctl stop pacsatsim sudo killall -9 java &>/dev/null - sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/pi_pacsat/Debug/pacsat.config - sudo sed -i 's/callsign=$oldcallsign/callsign=$callsign/g' /home/pi/PacSatGround/PacSatGround.properties - sudo sed -i 's/$oldcallsign/$callsign/g' /home/pi/PacSatGround/spacecraft/PacSatSim.properties + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config + sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties fi if [ "$norestart" = "1" ]; then From b3d34ca70fc2171c4fd7e3ade5f7645b7982fd50 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:00:40 -0500 Subject: [PATCH 250/554] Update pacsat.sh added pacsatsim stop at the end --- groundstation/pacsat.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 0ab6acb9..dcc80fd3 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -75,5 +75,9 @@ cd /home/pi/Desktop/PacSatGround_0.46m_linux/ sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" +sudo systemctl stop pacsatsim + +sleep 10 + From e99b9d0bb0998346b03f6a81c6c43ebf869c12b6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:03:49 -0500 Subject: [PATCH 251/554] Update pacsat.sh --- groundstation/pacsat.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index dcc80fd3..df4d9edf 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -79,5 +79,7 @@ sudo systemctl stop pacsatsim sleep 10 +echo "Stopping Pacsatsim" + From 53dfb22cceb422e4ac2324c926a1acb7071593dc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:08:10 -0500 Subject: [PATCH 252/554] Update pacsat.sh added >/dev/null 2>&1 --- groundstation/pacsat.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index df4d9edf..e2f2913c 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -4,19 +4,19 @@ sudo modprobe snd-aloop -sudo systemctl stop cubesatsim +sudo systemctl stop cubesatsim >/dev/null 2>&1 -sudo systemctl stop transmit +sudo systemctl stop transmit >/dev/null 2>&1 -sudo systemctl stop command +sudo systemctl stop command >/dev/null 2>&1 #/home/pi/CubeSatSim/config -I -sudo systemctl stop command &>/dev/null +sudo systemctl stop command >/dev/null 2>&1 -sudo systemctl stop openwebrx &>/dev/null +sudo systemctl stop openwebrx >/dev/null 2>&1 -sudo systemctl stop rtl_tcp &>/dev/null +sudo systemctl stop rtl_tcp >/dev/null 2>&1 pkill -o chromium &>/dev/null @@ -75,7 +75,7 @@ cd /home/pi/Desktop/PacSatGround_0.46m_linux/ sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" -sudo systemctl stop pacsatsim +sudo systemctl stop pacsatsim sleep 10 From c14d2189ebee014d16d7d46595068a23fba16282 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:29:33 -0500 Subject: [PATCH 253/554] Update pacsat.sh add #$SHELL --- groundstation/pacsat.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index e2f2913c..acf59fc2 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -81,5 +81,7 @@ sleep 10 echo "Stopping Pacsatsim" +$SHELL + From 8be415e59b946a89a8a73d9de8c04217439811ee Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:33:28 -0500 Subject: [PATCH 254/554] Update pacsat.sh remove stop pacsatsim at end --- groundstation/pacsat.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index acf59fc2..e846f248 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -75,11 +75,13 @@ cd /home/pi/Desktop/PacSatGround_0.46m_linux/ sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" -sudo systemctl stop pacsatsim +cd + +#sudo systemctl stop pacsatsim sleep 10 -echo "Stopping Pacsatsim" +#echo "Stopping Pacsatsim" $SHELL From 978eb8b4ebfa05c1208978410c359cdf537fcd15 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:40:04 -0500 Subject: [PATCH 255/554] Update pacsat.sh launch direwolf in separate window --- groundstation/pacsat.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index e846f248..acc304cd 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -64,10 +64,11 @@ sleep 10 #echo -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 & +#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" echo -echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback." +echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback" echo From cfa1f66324bea05bf6e5707942b7e94da72bd687 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:41:17 -0500 Subject: [PATCH 256/554] Update pacsat.sh remove SHELL at end --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index acc304cd..b8deafc7 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -84,7 +84,7 @@ sleep 10 #echo "Stopping Pacsatsim" -$SHELL +#$SHELL From ff3230b0c311740fffef86fc5dfac60dd3518451 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:46:24 -0500 Subject: [PATCH 257/554] Update pacsat.sh back to SHELL --- groundstation/pacsat.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index b8deafc7..2c4e8aa5 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -64,8 +64,8 @@ sleep 10 #echo -#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" +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" echo echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback" @@ -84,7 +84,7 @@ sleep 10 #echo "Stopping Pacsatsim" -#$SHELL +$SHELL From 87d2ec4b9cb6f53110bcc3367551a192fd7b802e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:47:45 -0500 Subject: [PATCH 258/554] Update pacsat.sh remove & --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 2c4e8aa5..c7a09c84 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -64,7 +64,7 @@ sleep 10 #echo -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 & +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" echo From c04e9e7263d2806aee4f2b949f7d2b97b283bed6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:49:23 -0500 Subject: [PATCH 259/554] Update pacsat.sh change order of pacsat and direwolf --- groundstation/pacsat.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index c7a09c84..644306fa 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -64,18 +64,24 @@ sleep 10 #echo -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" - echo echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback" echo - cd /home/pi/Desktop/PacSatGround_0.46m_linux/ sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" +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" + + + + +#cd /home/pi/Desktop/PacSatGround_0.46m_linux/ + +#sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" + cd #sudo systemctl stop pacsatsim From 1b20bff48a6bca6475a80348f43fc1a8d6b6e3ff Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:50:25 -0500 Subject: [PATCH 260/554] Update pacsat.sh add kill sdrpp --- groundstation/pacsat.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 644306fa..d601d114 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -24,6 +24,8 @@ sudo killall -9 rtl_fm &>/dev/null sudo killall -9 direwolf &>/dev/null +sudo killall -9 sdrpp &>/dev/null + #sudo killall -9 aplay &>/dev/null sudo killall -9 qsstv &>/dev/null From 75e12ce363a14807ecdf1c5aec5436825d8a7f0f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:54:39 -0500 Subject: [PATCH 261/554] Update pacsat.sh back to separate wndow --- groundstation/pacsat.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index d601d114..895b3a46 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -74,11 +74,11 @@ cd /home/pi/Desktop/PacSatGround_0.46m_linux/ sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" -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" - +#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" +echo "Don't close the direwolf-pacsat-loopback window or the Pacsatsim will stop running." #cd /home/pi/Desktop/PacSatGround_0.46m_linux/ @@ -92,7 +92,7 @@ sleep 10 #echo "Stopping Pacsatsim" -$SHELL +#$SHELL From 26774c7db3280d05f8a256afaa1058c5da8f4c2a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 08:57:39 -0500 Subject: [PATCH 262/554] Update sdrpp.sh add & --- groundstation/sdrpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sdrpp.sh b/groundstation/sdrpp.sh index 08736032..2dd97fd1 100755 --- a/groundstation/sdrpp.sh +++ b/groundstation/sdrpp.sh @@ -40,7 +40,7 @@ sudo /etc/init.d/alsa-utils start sleep 5 -setsid sdrpp +setsid sdrpp & sleep 10 From e41fd1e58c6aaa5e2fb1408f0f60ced9acfcf4c2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 09:00:55 -0500 Subject: [PATCH 263/554] Update sstv_decode_prompt.sh add & --- groundstation/sstv_decode_prompt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index fbc55895..7ae8cd9b 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -135,7 +135,7 @@ set -- $value #rtl_fm -M fm -f 434.9M -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 #rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 & #rtl_fm -M fm -f $frequency -s 48k | aplay -D plughw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From 46a20c7840f61ae8e2e6d11756ad88c9c3a64d1d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 09:04:17 -0500 Subject: [PATCH 264/554] Update sstv_decode_prompt.sh remove & --- groundstation/sstv_decode_prompt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index 7ae8cd9b..fbc55895 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -135,7 +135,7 @@ set -- $value #rtl_fm -M fm -f 434.9M -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 #rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 & +rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 #rtl_fm -M fm -f $frequency -s 48k | aplay -D plughw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From d49477f0ec72d644733c819001da16d4e5e868ed Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 8 Jan 2025 09:10:38 -0500 Subject: [PATCH 265/554] Update pacsat.desktop make window large --- groundstation/pacsat.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.desktop b/groundstation/pacsat.desktop index 539c0e1d..d1be6bbf 100644 --- a/groundstation/pacsat.desktop +++ b/groundstation/pacsat.desktop @@ -2,7 +2,7 @@ Name=Pacsat GenericName=Pacsat Loopback Comment=Pacsat -Exec=/home/pi/CubeSatSim/groundstation/pacsat.sh +Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/packet.sh" Icon=/home/pi/Icons/pacsat.png Terminal=true Type=Application From e24b1a46c6a3024ba69689fee875dbe4e0246cb6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 10 Jan 2025 21:58:58 -0500 Subject: [PATCH 266/554] Update pacsat.desktop --- groundstation/pacsat.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.desktop b/groundstation/pacsat.desktop index d1be6bbf..7fef68f8 100644 --- a/groundstation/pacsat.desktop +++ b/groundstation/pacsat.desktop @@ -2,7 +2,7 @@ Name=Pacsat GenericName=Pacsat Loopback Comment=Pacsat -Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/packet.sh" +Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat.sh" Icon=/home/pi/Icons/pacsat.png Terminal=true Type=Application From 95dd40dbead88f4186810f5c5d58350d48c778df Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 10 Jan 2025 22:21:15 -0500 Subject: [PATCH 267/554] Update aprs.desktop --- groundstation/aprs.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/aprs.desktop b/groundstation/aprs.desktop index 5f360f7b..a7d0062a 100644 --- a/groundstation/aprs.desktop +++ b/groundstation/aprs.desktop @@ -2,7 +2,7 @@ Name=APRS Decode using Direwolf GenericName=Decodes APRS using rtl_fm and Direwolf Comment=APRS signals -Exec=/home/pi/CubeSatSim/groundstation/packet.sh +Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/packet.sh" Icon=/home/pi/Icons/aprs.png Terminal=true Type=Application From 1eadb145b9e47ef09a2b3b9694e309355d02ef09 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 10 Jan 2025 22:23:21 -0500 Subject: [PATCH 268/554] Update direwolf.conf --- groundstation/direwolf/direwolf.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf.conf b/groundstation/direwolf/direwolf.conf index 701d80b4..3b372144 100644 --- a/groundstation/direwolf/direwolf.conf +++ b/groundstation/direwolf/direwolf.conf @@ -1 +1 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 From b7b91a97dab9f970ea196ba09b30884bde1a97ee Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 11 Jan 2025 16:28:53 -0500 Subject: [PATCH 269/554] Update webSDR.desktop typo --- groundstation/webSDR.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/webSDR.desktop b/groundstation/webSDR.desktop index f660c2ea..387dfd95 100644 --- a/groundstation/webSDR.desktop +++ b/groundstation/webSDR.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/sdr.sh Name=Web SDR Comment=openwebrx for Web SDR -Icon=/home/pi/Iconss/openwebrx.png +Icon=/home/pi/Icons/openwebrx.png Path=/home/pi Terminal=true Categories=HamRadio From 948252c22e01e6403fb4f8e5c0989de0c5f340c7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 11 Jan 2025 16:36:03 -0500 Subject: [PATCH 270/554] Update foxtelem.desktop --- groundstation/foxtelem.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/foxtelem.desktop b/groundstation/foxtelem.desktop index 87fe00a1..c01913be 100644 --- a/groundstation/foxtelem.desktop +++ b/groundstation/foxtelem.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/fox-run.sh Name=FoxTelem Comment=FIAB-v4 -Icon=/home/pi/Downloads/foxtelem.png +Icon=/home/pi/Icons/foxtelem.png Path=/home/pi Terminal=true Categories=HamRadio From 04107c25616cdc5a33cca3fe74c289411689be70 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 11 Jan 2025 19:50:21 -0500 Subject: [PATCH 271/554] Update pacsat.sh remove sudo --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 895b3a46..5a7c54e7 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -72,7 +72,7 @@ echo cd /home/pi/Desktop/PacSatGround_0.46m_linux/ -sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" +setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" #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" From f311960426af201be083b402de4308401061ac3a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 11 Jan 2025 22:27:31 -0500 Subject: [PATCH 272/554] Update pacsat.sh add & to pacsat --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 5a7c54e7..0b27f7c0 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -72,7 +72,7 @@ echo cd /home/pi/Desktop/PacSatGround_0.46m_linux/ -setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" +setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" & #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" From 0ca435040e8be342cd9151b25595cb9e5a3bc920 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 11 Jan 2025 22:31:29 -0500 Subject: [PATCH 273/554] Update PacSatSim.properties changed to AMSAT callsign --- spacecraft/PacSatGround_0.46m/PacSatSim.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacecraft/PacSatGround_0.46m/PacSatSim.properties b/spacecraft/PacSatGround_0.46m/PacSatSim.properties index d18ebe5c..e4ccad24 100644 --- a/spacecraft/PacSatGround_0.46m/PacSatSim.properties +++ b/spacecraft/PacSatGround_0.46m/PacSatSim.properties @@ -2,11 +2,11 @@ #Sun Feb 17 18:25:06 EST 2019 sequence_num=3 name=PacSatSim -digiCallsign=W3ZM-1 +digiCallsign=AMSAT-1 description=PacSatSim -broadcastCallsign=W3ZM-11 +broadcastCallsign=AMSAT-11 DIR_AGE=10 -bbsCallsign=W3ZM-12 +bbsCallsign=AMSAT-12 telemLayoutFile=PacSatSim.dat telem_server=tlm.amsatfox.org web_site_url=http://CubeSatSim.org From b010b4389390d2031634c17c977f0a59c0aaed35 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 12 Jan 2025 09:05:38 -0500 Subject: [PATCH 274/554] Update CubeSatSim_rttelemetry.csv --- .../FoxTelem_1.13e/CubeSatSim_rttelemetry.csv | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/spacecraft/FoxTelem_1.13e/CubeSatSim_rttelemetry.csv b/spacecraft/FoxTelem_1.13e/CubeSatSim_rttelemetry.csv index e69de29b..9dc17ff6 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSatSim_rttelemetry.csv +++ b/spacecraft/FoxTelem_1.13e/CubeSatSim_rttelemetry.csv @@ -0,0 +1,48 @@ +47,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,RT,Sensor 2,12,integer,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +1,RT,Sensor 3,12,integer,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +2,RT,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage +3,RT,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +4,RT,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +5,RT,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +6,RT,BATT_I,12,mA,cubesatsim_current,Battery,4,2,3,Battery Current,INA219 Battery Current +7,RT,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,BME280 Temp,STEM Payload Sensor BME280 Temperature +8,RT,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,INA219 +X Panel Voltage +9,RT,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,INA219 -X Panel Voltage +10,RT,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,INA219 +Y Panel Voltage +11,RT,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,INA219 -Y Panel Voltage +12,RT,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,INA219 +Z Panel Voltage +13,RT,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,INA219 -Z Panel Voltage +14,RT,PANEL_PLUS_X_I,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,INA219 +X Panel Current +15,RT,PANEL_MINUS_X_I,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,INA219 -X Panel Current +16,RT,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,INA219 +Y Panel Current +17,RT,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,INA219 -Y Panel Current +18,RT,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,INA219 +Z Panel Current +19,RT,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,INA219 -Z Panel Current +20,RT,BATT2_V,12,V,cubesatsim_voltage|FLOAT2,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage +21,RT,SPIN,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,RT,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,BME280 Pressure,STEM Payload Sensor BME280 Pressure +23,RT,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,BME280 Altitude,STEM Payload Sensor BME280 Altitude +24,RT,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,RT,RSSI,12,dBm,cubesatsim_rssi|INT,Radio,1,1,3,RSSI,Received Signal Strength Indication +26,RT,IHUTemperature,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,IHU Temp (Pi),Internal Temperature of Pi IHU +27,RT,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular Veolcity around X Axis +28,RT,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular Veolcity around Y Axis +29,RT,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular Veolcity around Z Axis +30,RT,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,BME280 Humidity,STEM Payload Sensor BME280 Humidity +31,RT,BATT2_I,12,mA,cubesatsim_current,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current +32,RT,DiodeTemp,12,C,cubesatsim_rpm,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature +33,RT,Sensor 1,12,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +34,RT,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload Status,STEM Payload Board Status +35,RT,SafeMode,1,-,STATUS_ON_OFF,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +36,RT,SimulatedTelemetry,1,-,STATUS_ON_OFF,Computer Software,3,4,0,Simulated Telemetry, Simulated Telemetry Indicator +37,RT,PayloadStatus1,1,-,17,NONE,0,0,0,Exp 3,STEM Payload status 1 failure indicator +38,RT,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,RT,I2CBus1Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +40,RT,I2CBus3Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +41,RT,CameraFailure,1,-,17,Computer Hardware,2,4,0,Camera,Camera failure indicator +42,RT,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received +43,RT,RXAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status +44,RT,TXAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status +45,RT,C2CStatus,2,-,COMMAND_STATUS,Computer Software,3,5,0,Command Control, Command & Control Status +46,RT,Pad,56,-,0,NONE,0,0,0,NONE,NONE From 5feee9a4c233ae1fc9c3dfdbba618c64758b1120 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 18 Jan 2025 10:04:09 -0500 Subject: [PATCH 275/554] Update packet.sh --- groundstation/packet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/packet.sh b/groundstation/packet.sh index f669afda..24c04f0b 100755 --- a/groundstation/packet.sh +++ b/groundstation/packet.sh @@ -191,7 +191,7 @@ echo "$value" > /dev/null set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From dcc6eb488aabf127eab50bf00b1f5927f0a03143 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 19 Feb 2025 03:39:18 -0500 Subject: [PATCH 276/554] Update direwolf-pacsatsim-loopback.conf add -12 to callsign --- direwolf/direwolf-pacsatsim-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-loopback.conf b/direwolf/direwolf-pacsatsim-loopback.conf index 3fc85671..581d30cb 100644 --- a/direwolf/direwolf-pacsatsim-loopback.conf +++ b/direwolf/direwolf-pacsatsim-loopback.conf @@ -1,6 +1,6 @@ ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 #PTT GPIO 20 -MYCALL AMSAT +MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 FULLDUP OFF From b42985527a1a4ce84998c1a2488c5df591e4b0d2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 08:40:32 -0500 Subject: [PATCH 277/554] Update pacsat.sh don't restart pacsatsim --- groundstation/pacsat.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 0b27f7c0..aed65770 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -40,15 +40,15 @@ sudo killall -9 zenity &>/dev/null echo -sudo systemctl restart pacsatsim +#sudo systemctl restart pacsatsim -sudo /etc/init.d/alsa-utils stop -sudo /etc/init.d/alsa-utils start +#sudo /etc/init.d/alsa-utils stop +#sudo /etc/init.d/alsa-utils start -echo "Waiting 10 seconds for Pacsatsim to start" +#echo "Waiting 10 seconds for Pacsatsim to start" -sleep 10 +#sleep 10 #value=`cat /home/pi/CubeSatSim/sim.cfg` #echo "$value" > /dev/null From 586e22b1baac5a32855561b8d50705ec453efbec Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 08:55:15 -0500 Subject: [PATCH 278/554] Update pacsat.sh don't kill direwolf --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index aed65770..59551eb3 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -22,7 +22,7 @@ pkill -o chromium &>/dev/null sudo killall -9 rtl_fm &>/dev/null -sudo killall -9 direwolf &>/dev/null +#sudo killall -9 direwolf &>/dev/null sudo killall -9 sdrpp &>/dev/null From c45674512e4088eeb4c92a58eb6d338c01e419a9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 09:07:06 -0500 Subject: [PATCH 279/554] separate direwolf windows --- groundstation/pacsat-d.sh | 98 ++++++++++++++++++ pacsatsim-d.sh | 204 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 302 insertions(+) create mode 100755 groundstation/pacsat-d.sh create mode 100755 pacsatsim-d.sh diff --git a/groundstation/pacsat-d.sh b/groundstation/pacsat-d.sh new file mode 100755 index 00000000..59551eb3 --- /dev/null +++ b/groundstation/pacsat-d.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +# script to auto decode packet using rtl_fm and Direwolf and run Pacsat + +sudo modprobe snd-aloop + +sudo systemctl stop cubesatsim >/dev/null 2>&1 + +sudo systemctl stop transmit >/dev/null 2>&1 + +sudo systemctl stop command >/dev/null 2>&1 + +#/home/pi/CubeSatSim/config -I + +sudo systemctl stop command >/dev/null 2>&1 + +sudo systemctl stop openwebrx >/dev/null 2>&1 + +sudo systemctl stop rtl_tcp >/dev/null 2>&1 + +pkill -o chromium &>/dev/null + +sudo killall -9 rtl_fm &>/dev/null + +#sudo killall -9 direwolf &>/dev/null + +sudo killall -9 sdrpp &>/dev/null + +#sudo killall -9 aplay &>/dev/null + +sudo killall -9 qsstv &>/dev/null + +sudo killall -9 rtl_tcp &>/dev/null + +sudo killall -9 java &>/dev/null + +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 and Pacsat Ground Station are running on this Pi using audio loopback" +echo + +cd /home/pi/Desktop/PacSatGround_0.46m_linux/ + +setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" & + +#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" + + +echo "Don't close the direwolf-pacsat-loopback window or the Pacsatsim will stop running." + +#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 + +#echo "Stopping Pacsatsim" + +#$SHELL + + + diff --git a/pacsatsim-d.sh b/pacsatsim-d.sh new file mode 100755 index 00000000..5f2e717e --- /dev/null +++ b/pacsatsim-d.sh @@ -0,0 +1,204 @@ +#!/bin/bash + +# script to auto decode packet using rtl_fm and Direwolf and run Pacsat + +export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + +#sudo systemctl stop cubesatsim + +#sudo systemctl stop transmit + +sudo systemctl stop command &>/dev/null + +sudo modprobe snd-aloop + +#sudo systemctl stop openwebrx + +#sudo systemctl stop rtl_tcp &>/dev/null + +#pkill -o chromium &>/dev/null + +#sudo killall -9 rtl_fm &>/dev/null + +#sudo killall -9 direwolf &>/dev/null + +#udo killall -9 aplay &>/dev/null + +#sudo killall -9 qsstv &>/dev/null + +#sudo killall -9 rtl_tcp &>/dev/null + +#sudo killall -9 java &>/dev/null + +#sudo killall -9 CubicSDR &>/dev/null + +#sudo killall -9 zenity &>/dev/null + +echo + +#frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") + +#echo $frequency + +#if [ -z "$frequency" ]; then + +#echo "No choice made. Exiting." + +#sleep 3 + +#exit + +#echo "Choose the number for the packet decoding option:" +#echo +#echo "1. APRS US 2m (144390 kHz)" +#echo "2. CubeSatSim (434900 kHz)" +#echo "3. APRS European 2m (144800 kHz)" +#echo "4. APRS Australian 2m (145175 kHz)" +#echo "5. APRS on another frequency" +#echo "6. APRS on ISS (145825 kHz)" +#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" +#echo "8. Test Serenity CubeSat decoding with WAV file" +#echo "9. Test APRS decoding with CubeSatSim WAV file" +#echo + +#read -r choice + +choice=2 + +#fi + +if [ "$choice" = "1" ] || [ "$frequency" = "144390" ]; then + + frequency=144390000 + +elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then + + frequency=434900000 + echo + echo "If your Pacsat Ground Station is transmitting packets, you will see them here" + echo + +elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then + + frequency=144800000 + +elif [ "$choice" = "4" ] || [ "$frequency" = "145175" ]; then + + frequency=145175000 + +elif [ "$choice" = "5" ] || [ "$frequency" = "Other" ] ; then + + echo + + echo "Enter the frequency in kiloHertz" + + echo + + read -r frequency + + frequency=$frequency"000" + + #echo $frequency + +elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then + + frequency=145825000 + echo + echo "If the ISS is overhead and in APRS mode (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then + + frequency=437100000 + echo + echo "If the Serenity CubeSat is overhead and transmitting (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then + + echo "A recorded WAV file will play and you should see some packets decoded" + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + +# aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & +# aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & + aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then + + echo "A recorded APRS WAV file from the CubeSatSim will play and you should see a packet decoded." + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + + #aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + #aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +#fi + +fi + +#echo + +#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." + +echo + +if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then + + echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & + +else + + echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" + + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + +fi + +sleep 5 + +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & + +cd /home/pi/pi_pacsat/Debug + +./pi_pacsat -c pacsat.config -d /home/pi/PacSat + +sleep 5 From cb6d5ea73a7e4db93bebdd95a3236d6267e1f0c3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 09:08:52 -0500 Subject: [PATCH 280/554] Update pacsat-d.sh just run direwolf --- groundstation/pacsat-d.sh | 92 --------------------------------------- 1 file changed, 92 deletions(-) diff --git a/groundstation/pacsat-d.sh b/groundstation/pacsat-d.sh index 59551eb3..8c58dd73 100755 --- a/groundstation/pacsat-d.sh +++ b/groundstation/pacsat-d.sh @@ -1,98 +1,6 @@ #!/bin/bash -# script to auto decode packet using rtl_fm and Direwolf and run Pacsat - -sudo modprobe snd-aloop - -sudo systemctl stop cubesatsim >/dev/null 2>&1 - -sudo systemctl stop transmit >/dev/null 2>&1 - -sudo systemctl stop command >/dev/null 2>&1 - -#/home/pi/CubeSatSim/config -I - -sudo systemctl stop command >/dev/null 2>&1 - -sudo systemctl stop openwebrx >/dev/null 2>&1 - -sudo systemctl stop rtl_tcp >/dev/null 2>&1 - -pkill -o chromium &>/dev/null - -sudo killall -9 rtl_fm &>/dev/null - -#sudo killall -9 direwolf &>/dev/null - -sudo killall -9 sdrpp &>/dev/null - -#sudo killall -9 aplay &>/dev/null - -sudo killall -9 qsstv &>/dev/null - -sudo killall -9 rtl_tcp &>/dev/null - -sudo killall -9 java &>/dev/null - -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 and Pacsat Ground Station are running on this Pi using audio loopback" -echo - -cd /home/pi/Desktop/PacSatGround_0.46m_linux/ - -setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" & - -#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" -echo "Don't close the direwolf-pacsat-loopback window or the Pacsatsim will stop running." - -#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 - -#echo "Stopping Pacsatsim" - -#$SHELL - - From cef6daf1d7a8baf9490f7233fa59b0e62efe4706 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 09:10:13 -0500 Subject: [PATCH 281/554] Update pacsatsim-d.sh just run direwolf --- pacsatsim-d.sh | 201 +------------------------------------------------ 1 file changed, 1 insertion(+), 200 deletions(-) diff --git a/pacsatsim-d.sh b/pacsatsim-d.sh index 5f2e717e..7480af0c 100755 --- a/pacsatsim-d.sh +++ b/pacsatsim-d.sh @@ -1,204 +1,5 @@ #!/bin/bash -# script to auto decode packet using rtl_fm and Direwolf and run Pacsat - -export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH - -#sudo systemctl stop cubesatsim - -#sudo systemctl stop transmit - -sudo systemctl stop command &>/dev/null - sudo modprobe snd-aloop -#sudo systemctl stop openwebrx - -#sudo systemctl stop rtl_tcp &>/dev/null - -#pkill -o chromium &>/dev/null - -#sudo killall -9 rtl_fm &>/dev/null - -#sudo killall -9 direwolf &>/dev/null - -#udo killall -9 aplay &>/dev/null - -#sudo killall -9 qsstv &>/dev/null - -#sudo killall -9 rtl_tcp &>/dev/null - -#sudo killall -9 java &>/dev/null - -#sudo killall -9 CubicSDR &>/dev/null - -#sudo killall -9 zenity &>/dev/null - -echo - -#frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") - -#echo $frequency - -#if [ -z "$frequency" ]; then - -#echo "No choice made. Exiting." - -#sleep 3 - -#exit - -#echo "Choose the number for the packet decoding option:" -#echo -#echo "1. APRS US 2m (144390 kHz)" -#echo "2. CubeSatSim (434900 kHz)" -#echo "3. APRS European 2m (144800 kHz)" -#echo "4. APRS Australian 2m (145175 kHz)" -#echo "5. APRS on another frequency" -#echo "6. APRS on ISS (145825 kHz)" -#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" -#echo "8. Test Serenity CubeSat decoding with WAV file" -#echo "9. Test APRS decoding with CubeSatSim WAV file" -#echo - -#read -r choice - -choice=2 - -#fi - -if [ "$choice" = "1" ] || [ "$frequency" = "144390" ]; then - - frequency=144390000 - -elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then - - frequency=434900000 - echo - echo "If your Pacsat Ground Station is transmitting packets, you will see them here" - echo - -elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then - - frequency=144800000 - -elif [ "$choice" = "4" ] || [ "$frequency" = "145175" ]; then - - frequency=145175000 - -elif [ "$choice" = "5" ] || [ "$frequency" = "Other" ] ; then - - echo - - echo "Enter the frequency in kiloHertz" - - echo - - read -r frequency - - frequency=$frequency"000" - - #echo $frequency - -elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then - - frequency=145825000 - echo - echo "If the ISS is overhead and in APRS mode (see tracking application such as Gpredict), you will see packets." - echo - -elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then - - frequency=437100000 - echo - echo "If the Serenity CubeSat is overhead and transmitting (see tracking application such as Gpredict), you will see packets." - echo - -elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then - - echo "A recorded WAV file will play and you should see some packets decoded" - - echo - - value=`aplay -l | grep "Loopback"` - echo "$value" > /dev/null - set -- $value - -# aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & -# aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & - aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & - aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & - - timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 - - echo - - echo "Test complete. This window will close in 10 seconds." - - sleep 5 - - exit - -elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then - - echo "A recorded APRS WAV file from the CubeSatSim will play and you should see a packet decoded." - - echo - - value=`aplay -l | grep "Loopback"` - echo "$value" > /dev/null - set -- $value - - #aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav & - (while true; do (sleep 2 && aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & - - #aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav & - (while true; do (sleep 2 && aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & - - timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 - - echo - - echo "Test complete. This window will close in 10 seconds." - - sleep 5 - - exit - -#fi - -fi - -#echo - -#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." - -echo - -if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then - - echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" - - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & - -else - - echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - - direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & - -fi - -sleep 5 - -value=`aplay -l | grep "Loopback"` -echo "$value" > /dev/null -set -- $value - -#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & - -cd /home/pi/pi_pacsat/Debug - -./pi_pacsat -c pacsat.config -d /home/pi/PacSat - -sleep 5 +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 From 7c2cfc9b8ba9568897601decc36d60addbaf69f5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 09:13:24 -0500 Subject: [PATCH 282/554] Update pacsat.sh don't start direwolf --- groundstation/pacsat.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 59551eb3..57f98fd9 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -75,10 +75,10 @@ cd /home/pi/Desktop/PacSatGround_0.46m_linux/ setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" & #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" +#/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" -echo "Don't close the direwolf-pacsat-loopback window or the Pacsatsim will stop running." +#echo "Don't close the direwolf-pacsat-loopback window or the Pacsatsim will stop running." #cd /home/pi/Desktop/PacSatGround_0.46m_linux/ From 034ffeec911cb0338155e873a06474bb237775e1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 09:14:23 -0500 Subject: [PATCH 283/554] Update pacsatsim.sh don't start direwolf --- pacsatsim.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 5f2e717e..a1998cb0 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -183,10 +183,10 @@ if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] else - echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" - - direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & +# echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + echo fi sleep 5 From 25da37ea525dd04f834d0ef27a6fd53b81501615 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 09:19:15 -0500 Subject: [PATCH 284/554] Update direwolf-pacsatsim-loopback.conf change full duplex on --- direwolf/direwolf-pacsatsim-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-loopback.conf b/direwolf/direwolf-pacsatsim-loopback.conf index 581d30cb..d1bcf78d 100644 --- a/direwolf/direwolf-pacsatsim-loopback.conf +++ b/direwolf/direwolf-pacsatsim-loopback.conf @@ -3,6 +3,6 @@ ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 -FULLDUP OFF +FULLDUP ON TXDELAY 15 #FIX_BITS 1 AX25 From 76d8323dc0638eb6c94aa81e63ad75cfff389bf8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 12:31:32 -0500 Subject: [PATCH 285/554] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ec10273..bdac8141 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ There are several hardware versions and software branches to go with them - see See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/2.-Software-Install. The software runs on any Raspberry Pi including the Raspberry Pi 4B, 3B, 3B+, Pi Zero, Pi Zero W, or Pi Zero 2 W. -There are two ways to get the CubeSatSim software for your Pi. +There are two ways to get the CubeSatSim(TM) software for your Pi. One option is to download the disk image file and write it to a 16GB micro SD card or larger. The image is based on Raspberry Pi OS (Rasbian) Lite, dated December 2020. All software is installed, you just need to login to change your password and set your amateur radio callsign if you have one. You can run the ./update.sh script to update all packages and update and compile the latest CubeSatSim software. From 259419573f949dc3eb5b6e1e18fbcc4d39a46637 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 19:04:23 -0500 Subject: [PATCH 286/554] test script to launch 4 windows --- pacsat-test.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 pacsat-test.sh diff --git a/pacsat-test.sh b/pacsat-test.sh new file mode 100755 index 00000000..8c58dd73 --- /dev/null +++ b/pacsat-test.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +/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" + + + From 509fa014c50c1462b58ff5ac46b27bbd3c5b229a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 19:07:43 -0500 Subject: [PATCH 287/554] Update pacsat-test.sh add 4 windows --- pacsat-test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pacsat-test.sh b/pacsat-test.sh index 8c58dd73..1943056f 100755 --- a/pacsat-test.sh +++ b/pacsat-test.sh @@ -1,6 +1,17 @@ #!/bin/bash +/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-d.sh" + +sleep 1 + +/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim.sh" + +sleep 1 + /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" +sleep 1 + +/usr/bin/x-terminal-emulator --geometry=120x40 -e /home/pi/CubeSatSim/groundstation/pacsat.sh" From ff7846985878b5c556599033e45a2c541b916d48 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 19:09:15 -0500 Subject: [PATCH 288/554] Update pacsat-test.sh add bash --- pacsat-test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pacsat-test.sh b/pacsat-test.sh index 1943056f..0957c4a0 100755 --- a/pacsat-test.sh +++ b/pacsat-test.sh @@ -1,10 +1,10 @@ #!/bin/bash -/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-d.sh" +/usr/bin/x-terminal-emulator --geometry=120x40 -e "bash /home/pi/CubeSatSim/pacsatsim-d.sh" sleep 1 -/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim.sh" +/usr/bin/x-terminal-emulator --geometry=120x40 -e "bash /home/pi/CubeSatSim/pacsatsim.sh" sleep 1 @@ -12,6 +12,6 @@ sleep 1 sleep 1 -/usr/bin/x-terminal-emulator --geometry=120x40 -e /home/pi/CubeSatSim/groundstation/pacsat.sh" +/usr/bin/x-terminal-emulator --geometry=120x40 -e "bash /home/pi/CubeSatSim/groundstation/pacsat.sh" From 95eb85e88df4d54ef3c96e88770a2a5cb9ca6690 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Feb 2025 19:11:40 -0500 Subject: [PATCH 289/554] Update pacsat.sh removed & --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 57f98fd9..4daff914 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -72,7 +72,7 @@ echo cd /home/pi/Desktop/PacSatGround_0.46m_linux/ -setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" & +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" From 1d6d13814958b9525809e13e79f41ac2d1e05ee2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 25 Feb 2025 15:44:41 -0500 Subject: [PATCH 290/554] Update direwolf-pacsatsim-jp14.conf making the same as loopback but with Device --- direwolf/direwolf-pacsatsim-jp14.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 64c7bfe5..36891485 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,8 +1,8 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 #PTT GPIO 20 -MYCALL AMSAT +MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 -FULLDUP OFF -TXDELAY 75 +FULLDUP ON +TXDELAY 15 #FIX_BITS 1 AX25 From e735f7487fe9c2a78907248fb15a146062f04cc9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 25 Feb 2025 15:47:00 -0500 Subject: [PATCH 291/554] Update direwolf-fm-pacsat-jp14.conf making same as loopback but with Device --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index 6e4fc073..df741a62 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -1,10 +1,10 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=1 +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 #PTT GPIO 20 CHANNEL 0 MODEM 1200 KISSPORT 8100 +AGWPORT 8002 FULLDUP OFF TXDELAY 30 #FIX_BITS 1 AX25 -KISSPORT 8001 From b0ed82ded4b2b5e5033cd3d6018d206303680f89 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 25 Feb 2025 16:05:12 -0500 Subject: [PATCH 292/554] adding direwolf jp14 script --- groundstation/pacsat-dj.sh | 6 ++++++ pacsatsim-dj.sh | 5 +++++ 2 files changed, 11 insertions(+) create mode 100755 groundstation/pacsat-dj.sh create mode 100755 pacsatsim-dj.sh diff --git a/groundstation/pacsat-dj.sh b/groundstation/pacsat-dj.sh new file mode 100755 index 00000000..b4fec439 --- /dev/null +++ b/groundstation/pacsat-dj.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +/usr/bin/x-terminal-emulator --geometry=120x40 -e "direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-jp14.conf -t 0" + + + diff --git a/pacsatsim-dj.sh b/pacsatsim-dj.sh new file mode 100755 index 00000000..3999eb8d --- /dev/null +++ b/pacsatsim-dj.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo modprobe snd-aloop + +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 From 4ae4f08851a65768696c923ab63ec412c2980f2c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 25 Feb 2025 16:19:30 -0500 Subject: [PATCH 293/554] Update pacsat-dj.sh add fm --- groundstation/pacsat-dj.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat-dj.sh b/groundstation/pacsat-dj.sh index b4fec439..c7b4ea04 100755 --- a/groundstation/pacsat-dj.sh +++ b/groundstation/pacsat-dj.sh @@ -1,6 +1,6 @@ #!/bin/bash -/usr/bin/x-terminal-emulator --geometry=120x40 -e "direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-jp14.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-fm-jp14.conf -t 0" From 105d1312ddf6b08dee0241b041ce90d20ec14480 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 25 Feb 2025 16:19:54 -0500 Subject: [PATCH 294/554] Update pacsat-test.sh add fm --- pacsat-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsat-test.sh b/pacsat-test.sh index 0957c4a0..71d0b036 100755 --- a/pacsat-test.sh +++ b/pacsat-test.sh @@ -8,7 +8,7 @@ sleep 1 sleep 1 -/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" +/usr/bin/x-terminal-emulator --geometry=120x40 -e "direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-fm-loopback.conf -t 0" sleep 1 From 06fd0e6955643a95fe7e2cc7b9a7f5ee955e173d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 25 Feb 2025 16:21:21 -0500 Subject: [PATCH 295/554] Update pacsat-test.sh add fm --- pacsat-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsat-test.sh b/pacsat-test.sh index 71d0b036..dd43979c 100755 --- a/pacsat-test.sh +++ b/pacsat-test.sh @@ -8,7 +8,7 @@ sleep 1 sleep 1 -/usr/bin/x-terminal-emulator --geometry=120x40 -e "direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-fm-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-fm-pacsat-loopback.conf -t 0" sleep 1 From c0ebd632c6558952b6a959ce24d0b503ba83a902 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 25 Feb 2025 16:21:59 -0500 Subject: [PATCH 296/554] Update pacsat-dj.sh add fm --- groundstation/pacsat-dj.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat-dj.sh b/groundstation/pacsat-dj.sh index c7b4ea04..7a49576e 100755 --- a/groundstation/pacsat-dj.sh +++ b/groundstation/pacsat-dj.sh @@ -1,6 +1,6 @@ #!/bin/bash -/usr/bin/x-terminal-emulator --geometry=120x40 -e "direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-fm-jp14.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-fm-pacsat-jp14.conf -t 0" From 1e9fb2e6d612ac571de97a3cd1c405528265dd22 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 10:50:43 -0400 Subject: [PATCH 297/554] update to use USB device --- .../direwolf/direwolf-fm-pacsat-jp14-device.conf | 10 ++++++++++ pacsatsim-djf.sh | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 groundstation/direwolf/direwolf-fm-pacsat-jp14-device.conf create mode 100755 pacsatsim-djf.sh diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14-device.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14-device.conf new file mode 100644 index 00000000..df741a62 --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14-device.conf @@ -0,0 +1,10 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +#PTT GPIO 20 +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +FULLDUP OFF +TXDELAY 30 +#FIX_BITS 1 AX25 diff --git a/pacsatsim-djf.sh b/pacsatsim-djf.sh new file mode 100755 index 00000000..1d0c3036 --- /dev/null +++ b/pacsatsim-djf.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo modprobe snd-aloop + +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 From 065e8be4d8bab44a808d092075f654382872bbf7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 10:59:49 -0400 Subject: [PATCH 298/554] from pacsatsim half duplex --- direwolf/direwolf-pacsatsim-jp14-half.conf | 9 +++++++++ .../direwolf/direwolf-fm-pacsat-jp14-ptt.conf | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 direwolf/direwolf-pacsatsim-jp14-half.conf create mode 100644 groundstation/direwolf/direwolf-fm-pacsat-jp14-ptt.conf diff --git a/direwolf/direwolf-pacsatsim-jp14-half.conf b/direwolf/direwolf-pacsatsim-jp14-half.conf new file mode 100644 index 00000000..d6a05876 --- /dev/null +++ b/direwolf/direwolf-pacsatsim-jp14-half.conf @@ -0,0 +1,9 @@ +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +#PTT GPIO 20 +MYCALL AMSAT-12 +CHANNEL 0 +MODEM 1200 +#FULLDUP ON +FULLDUP OFF +TXDELAY 15 +#FIX_BITS 1 AX25 diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14-ptt.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14-ptt.conf new file mode 100644 index 00000000..279b7e0e --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14-ptt.conf @@ -0,0 +1,10 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +PTT GPIO 20 +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +FULLDUP OFF +TXDELAY 30 +#FIX_BITS 1 AX25 From 227c88a893cd7635070f06e6dc9a678d8142c508 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 11:10:36 -0400 Subject: [PATCH 299/554] Update pacsatsim-djf.sh change to half duplex --- pacsatsim-djf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim-djf.sh b/pacsatsim-djf.sh index 1d0c3036..fdd358bb 100755 --- a/pacsatsim-djf.sh +++ b/pacsatsim-djf.sh @@ -2,4 +2,4 @@ sudo modprobe snd-aloop -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14-half.conf -t 0 From b3df13961419b2be641a841d5b55a138ae91ae69 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 11:12:08 -0400 Subject: [PATCH 300/554] Update pacsatsim-djf.sh revert --- pacsatsim-djf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim-djf.sh b/pacsatsim-djf.sh index fdd358bb..1d0c3036 100755 --- a/pacsatsim-djf.sh +++ b/pacsatsim-djf.sh @@ -2,4 +2,4 @@ sudo modprobe snd-aloop -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14-half.conf -t 0 +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 From dd3346792d9758436856e37472190002d13e3e8c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 11:12:39 -0400 Subject: [PATCH 301/554] Update pacsatsim-dj.sh changed pacsatsim to half duplex --- pacsatsim-dj.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim-dj.sh b/pacsatsim-dj.sh index 3999eb8d..888124e6 100755 --- a/pacsatsim-dj.sh +++ b/pacsatsim-dj.sh @@ -2,4 +2,4 @@ sudo modprobe snd-aloop -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14-half.conf -t 0 From 4210c9ad4ab9de6a35fd4065b09f3d474518a387 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 16:37:15 -0400 Subject: [PATCH 302/554] Create direwolf-pacsatsim-jp14-loop.conf --- direwolf/direwolf-pacsatsim-jp14-loop.conf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 direwolf/direwolf-pacsatsim-jp14-loop.conf diff --git a/direwolf/direwolf-pacsatsim-jp14-loop.conf b/direwolf/direwolf-pacsatsim-jp14-loop.conf new file mode 100644 index 00000000..6b1b9b34 --- /dev/null +++ b/direwolf/direwolf-pacsatsim-jp14-loop.conf @@ -0,0 +1,8 @@ +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Loopback,DEV=0 +#PTT GPIO 20 +MYCALL AMSAT-12 +CHANNEL 0 +MODEM 1200 +FULLDUP ON +TXDELAY 15 +#FIX_BITS 1 AX25 From 0089231f42c352e272b27298ea8bb46076234ef4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 16:40:06 -0400 Subject: [PATCH 303/554] Update pacsatsim-d.sh fm and loopback --- pacsatsim-d.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim-d.sh b/pacsatsim-d.sh index 7480af0c..33ea4ad5 100755 --- a/pacsatsim-d.sh +++ b/pacsatsim-d.sh @@ -2,4 +2,4 @@ sudo modprobe snd-aloop -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-j14-loopback.conf -t 0 From 03fe5a278fe2e1fcf749dffe4d1a105f62b46050 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 16:42:15 -0400 Subject: [PATCH 304/554] Update pacsatsim-d.sh change to loop --- pacsatsim-d.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim-d.sh b/pacsatsim-d.sh index 33ea4ad5..bc3bd322 100755 --- a/pacsatsim-d.sh +++ b/pacsatsim-d.sh @@ -2,4 +2,4 @@ sudo modprobe snd-aloop -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-j14-loopback.conf -t 0 +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-j14-loop.conf -t 0 From c52a6f3e0ca968513aabd1efcca3de4ba0fdeb44 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 16:44:03 -0400 Subject: [PATCH 305/554] Update pacsatsim-d.sh fix filename --- pacsatsim-d.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim-d.sh b/pacsatsim-d.sh index bc3bd322..f7c3e84e 100755 --- a/pacsatsim-d.sh +++ b/pacsatsim-d.sh @@ -2,4 +2,4 @@ sudo modprobe snd-aloop -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-j14-loop.conf -t 0 +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14-loop.conf -t 0 From 4fcb86904f2d19e881b677b3c0f7d8cf465dd0cb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 16:56:46 -0400 Subject: [PATCH 306/554] Create direwolf-fm-pacsat-jp14-loop.conf --- .../direwolf/direwolf-fm-pacsat-jp14-loop.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 groundstation/direwolf/direwolf-fm-pacsat-jp14-loop.conf diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14-loop.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14-loop.conf new file mode 100644 index 00000000..cac3fffe --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14-loop.conf @@ -0,0 +1,10 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Loopback,DEV=0 +#PTT GPIO 20 +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +FULLDUP OFF +TXDELAY 30 +#FIX_BITS 1 AX25 From 1265d27020cc437a4f7669cd4a6c16174ddd0eb7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 31 Oct 2025 16:59:17 -0400 Subject: [PATCH 307/554] Update pacsat-d.sh update with j14-loop --- groundstation/pacsat-d.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat-d.sh b/groundstation/pacsat-d.sh index 8c58dd73..e1569ce7 100755 --- a/groundstation/pacsat-d.sh +++ b/groundstation/pacsat-d.sh @@ -1,6 +1,6 @@ #!/bin/bash -/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 modprobe snd-aloop +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14-loop.conf -t 0 From 489e2eab1ec9eba8461de369034c443b6219f1a5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 1 Nov 2025 22:53:28 -0400 Subject: [PATCH 308/554] Update pacsat.sh added rpitx transmit and direwolf --- groundstation/pacsat.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 4daff914..38799d49 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -67,18 +67,26 @@ echo #echo echo -echo "The Pacsat and Pacsat Ground Station are running on this Pi using audio loopback" +echo "The Pacsat Ground Station are running on this Pi using FM receiver and rpitx transmitter" echo -cd /home/pi/Desktop/PacSatGround_0.46m_linux/ +#cd /home/pi/Desktop/PacSatGround_0.46m_linux/ -setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & +#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" +/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-d.sh" + +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 & + +echo "Don't close the direwolf window or the Pacsatsim will stop running." + +cd /home/pi/Desktop/PacSatGround_0.46m_linux/ + +setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & -#echo "Don't close the direwolf-pacsat-loopback window or the Pacsatsim will stop running." #cd /home/pi/Desktop/PacSatGround_0.46m_linux/ From 53a05e66e9fcaf15477c304c6a1ac87204501193 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 1 Nov 2025 23:01:01 -0400 Subject: [PATCH 309/554] Update pacsatsim.sh add pacsatsim-d.sh and rpitx --- pacsatsim.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index a1998cb0..d0bf0fc8 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -186,6 +186,13 @@ else # echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" # direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + + /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-d.sh" + + 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 & + + echo "Don't close the direwolf window or the Pacsatsim will stop running." + echo fi From 94041dac3e149b4cd59e5163d81582ee9d107931 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 2 Nov 2025 08:46:23 -0500 Subject: [PATCH 310/554] fix pacsatsim direwolf configs --- direwolf/direwolf-pacsatsim-jp14-loop.conf | 2 +- direwolf/direwolf-pacsatsim-jp14.conf | 2 +- direwolf/direwolf-pacsatsim-loopback.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14-loop.conf b/direwolf/direwolf-pacsatsim-jp14-loop.conf index 6b1b9b34..b2a5fb9e 100644 --- a/direwolf/direwolf-pacsatsim-jp14-loop.conf +++ b/direwolf/direwolf-pacsatsim-jp14-loop.conf @@ -1,5 +1,5 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Loopback,DEV=0 -#PTT GPIO 20 +PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 36891485..da583428 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,5 +1,5 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 -#PTT GPIO 20 +PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 diff --git a/direwolf/direwolf-pacsatsim-loopback.conf b/direwolf/direwolf-pacsatsim-loopback.conf index d1bcf78d..e96bd980 100644 --- a/direwolf/direwolf-pacsatsim-loopback.conf +++ b/direwolf/direwolf-pacsatsim-loopback.conf @@ -1,5 +1,5 @@ ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 -#PTT GPIO 20 +PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 From dc697a83068547f0c02fe6b81b39787ca93e923a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 2 Nov 2025 08:47:54 -0500 Subject: [PATCH 311/554] add fm scripts --- pacsatsim-df.sh | 5 ++ pacsatsim-f.sh | 211 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 216 insertions(+) create mode 100755 pacsatsim-df.sh create mode 100755 pacsatsim-f.sh diff --git a/pacsatsim-df.sh b/pacsatsim-df.sh new file mode 100755 index 00000000..3999eb8d --- /dev/null +++ b/pacsatsim-df.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo modprobe snd-aloop + +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 diff --git a/pacsatsim-f.sh b/pacsatsim-f.sh new file mode 100755 index 00000000..2a8bb965 --- /dev/null +++ b/pacsatsim-f.sh @@ -0,0 +1,211 @@ +#!/bin/bash + +# script to auto decode packet using rtl_fm and Direwolf and run Pacsat + +export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + +#sudo systemctl stop cubesatsim + +#sudo systemctl stop transmit + +sudo systemctl stop command &>/dev/null + +sudo modprobe snd-aloop + +#sudo systemctl stop openwebrx + +#sudo systemctl stop rtl_tcp &>/dev/null + +#pkill -o chromium &>/dev/null + +#sudo killall -9 rtl_fm &>/dev/null + +#sudo killall -9 direwolf &>/dev/null + +#udo killall -9 aplay &>/dev/null + +#sudo killall -9 qsstv &>/dev/null + +#sudo killall -9 rtl_tcp &>/dev/null + +#sudo killall -9 java &>/dev/null + +#sudo killall -9 CubicSDR &>/dev/null + +#sudo killall -9 zenity &>/dev/null + +echo + +#frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") + +#echo $frequency + +#if [ -z "$frequency" ]; then + +#echo "No choice made. Exiting." + +#sleep 3 + +#exit + +#echo "Choose the number for the packet decoding option:" +#echo +#echo "1. APRS US 2m (144390 kHz)" +#echo "2. CubeSatSim (434900 kHz)" +#echo "3. APRS European 2m (144800 kHz)" +#echo "4. APRS Australian 2m (145175 kHz)" +#echo "5. APRS on another frequency" +#echo "6. APRS on ISS (145825 kHz)" +#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" +#echo "8. Test Serenity CubeSat decoding with WAV file" +#echo "9. Test APRS decoding with CubeSatSim WAV file" +#echo + +#read -r choice + +choice=2 + +#fi + +if [ "$choice" = "1" ] || [ "$frequency" = "144390" ]; then + + frequency=144390000 + +elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then + + frequency=434900000 + echo + echo "If your Pacsat Ground Station is transmitting packets, you will see them here" + echo + +elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then + + frequency=144800000 + +elif [ "$choice" = "4" ] || [ "$frequency" = "145175" ]; then + + frequency=145175000 + +elif [ "$choice" = "5" ] || [ "$frequency" = "Other" ] ; then + + echo + + echo "Enter the frequency in kiloHertz" + + echo + + read -r frequency + + frequency=$frequency"000" + + #echo $frequency + +elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then + + frequency=145825000 + echo + echo "If the ISS is overhead and in APRS mode (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then + + frequency=437100000 + echo + echo "If the Serenity CubeSat is overhead and transmitting (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then + + echo "A recorded WAV file will play and you should see some packets decoded" + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + +# aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & +# aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & + aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then + + echo "A recorded APRS WAV file from the CubeSatSim will play and you should see a packet decoded." + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + + #aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + #aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +#fi + +fi + +#echo + +#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." + +echo + +if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then + + echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & + +else + +# echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" + +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + + /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-df.sh" + +### 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 & + + echo "Don't close the direwolf window or the Pacsatsim will stop running." + + echo +fi + +sleep 5 + +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & + +cd /home/pi/pi_pacsat/Debug + +./pi_pacsat -c pacsat.config -d /home/pi/PacSat + +sleep 5 From 3f2c43fb3e89eb646964bd24786a74ab2be37b32 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 2 Nov 2025 13:18:23 -0500 Subject: [PATCH 312/554] Update transmit.py fixed pacsatsim and pacsat modes --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 7d47f19a..c9e1450d 100644 --- a/transmit.py +++ b/transmit.py @@ -426,10 +426,10 @@ if __name__ == "__main__": elif (mode == 'p'): print("Pacsat") # system('/home/pi/CubeSatSim/pacsatsim.sh') - system('sudo systemctl restart pacsatsim') +# system('sudo systemctl restart pacsatsim') while True: sleep(30) - elif (mode == 'p'): + elif (mode == 'P'): print("Pacsat Ground Station") while True: sleep(30) From 6129d0c237af02d98b3cd48076904b4de7b30373 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 14:57:03 -0500 Subject: [PATCH 313/554] gs edits to make working --- .../direwolf/direwolf-fm-pacsat-jp14.conf | 17 +++++++++++++---- groundstation/pacsat-df.sh | 10 ++++++++++ groundstation/pacsat.sh | 9 +++++---- 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100755 groundstation/pacsat-df.sh diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index df741a62..1b9d9a15 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -1,10 +1,19 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 -#PTT GPIO 20 +ADEVICE hw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +PTT GPIO -20 CHANNEL 0 MODEM 1200 KISSPORT 8100 AGWPORT 8002 -FULLDUP OFF -TXDELAY 30 +#FULLDUP OFF +#TXDELAY 30 #FIX_BITS 1 AX25 + +#DWAIT 0 +DWAIT 20 +SLOTTIME 300 +PERSIST 63 +#TXDELAY 1000 +TXDELAY 150 +#TXTAIL 10 +FULLDUP OFF diff --git a/groundstation/pacsat-df.sh b/groundstation/pacsat-df.sh new file mode 100755 index 00000000..2c0af411 --- /dev/null +++ b/groundstation/pacsat-df.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +sudo modprobe snd-aloop + +#gpio -g mode 20 out + +#gpio -g write 20 1 + +direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 + diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 38799d49..4e65f2d5 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -4,9 +4,9 @@ sudo modprobe snd-aloop -sudo systemctl stop cubesatsim >/dev/null 2>&1 +#sudo systemctl stop cubesatsim >/dev/null 2>&1 -sudo systemctl stop transmit >/dev/null 2>&1 +#sudo systemctl stop transmit >/dev/null 2>&1 sudo systemctl stop command >/dev/null 2>&1 @@ -77,9 +77,10 @@ echo #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" -/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-d.sh" +/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-df.sh" -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 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." From c43ca730b058f22009a3efb6c10754b936bc5864 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 15:01:00 -0500 Subject: [PATCH 314/554] changes to pi_pacsat to work over fm --- direwolf/direwolf-pacsatsim-jp14-loop.conf | 11 +++++++++-- direwolf/direwolf-pacsatsim-jp14.conf | 17 ++++++++++++++--- pacsatsim.sh | 5 +++-- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14-loop.conf b/direwolf/direwolf-pacsatsim-jp14-loop.conf index b2a5fb9e..bd04ddbc 100644 --- a/direwolf/direwolf-pacsatsim-jp14-loop.conf +++ b/direwolf/direwolf-pacsatsim-jp14-loop.conf @@ -1,8 +1,15 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Loopback,DEV=0 -PTT GPIO -20 +#PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 -FULLDUP ON +#FULLDUP ON TXDELAY 15 #FIX_BITS 1 AX25 +# +DWAIT 0 +SLOTTIME 10 +PERSIST 63 +TXDELAY 1000 +TXTAIL 10 +FULLDUP OFF diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index da583428..8b42f6c7 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,8 +1,19 @@ -ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +ADEVICE plughw:2,0 PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 -FULLDUP ON -TXDELAY 15 +##FULLDUP ON +##TXDELAY 15 #FIX_BITS 1 AX25 + +# +DWAIT 0 +SLOTTIME 10 +PERSIST 63 +#TXDELAY 1000 +TXDELAY 100 +#TXTAIL 10 +TXTAIL 1 +FULLDUP OFF diff --git a/pacsatsim.sh b/pacsatsim.sh index d0bf0fc8..5a044360 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -187,9 +187,10 @@ else # direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & - /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-d.sh" + /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-df.sh" - 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 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 & echo "Don't close the direwolf window or the Pacsatsim will stop running." From 303ed89d4a69ad1c75f7779341c9071cc2aa59fb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 16:30:00 -0500 Subject: [PATCH 315/554] Update update change iors to alanbjohnston --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index f15dcf4c..e2220d82 100755 --- a/update +++ b/update @@ -307,7 +307,7 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then cd - git clone https://github.com/ac2cz/iors_common.git + git clone https://github.com/alanbjohnston/iors_common.git cd iors_common/Debug/ From 6e4e41478d32e4f504dc9ad62ea65ac834719466 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 16:40:51 -0500 Subject: [PATCH 316/554] Update install change ions and add peripheral --- install | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/install b/install index 216dd74f..b2169009 100755 --- a/install +++ b/install @@ -126,7 +126,7 @@ cd rpitx cd -git clone https://github.com/ac2cz/iors_common.git +git clone https://github.com/alanbjohnston/iors_common.git cd iors_common/Debug/ @@ -250,10 +250,17 @@ sudo raspi-config nonint do_legacy 0 fi if [[ $(grep 'dtoverlay=dwc2' /boot/config.txt) ]]; then - echo "dtoverlay=dwc2 aalready in /boot/config.txt" + + if [[ $(grep 'dtoverlay=dwc2,dr_mode=peripheral' /boot/config.txt) ]]; then + echo "dtoverlay=dwc2,dr_mode=peripheral aalready in /boot/config.txt" + else + sudo sed -i 's/dtoverlay=dwc2/dtoverlay=dwc2,dr_mode=peripheral/g' /boot/config.txt + echo " adding dr_mode=peripheral to /boot/config.txt" + fi + else - echo "adding dtoverlay=dwc2 to /boot/config.txt" - sudo sh -c 'echo "\ndtoverlay=dwc2" >> /boot/config.txt' + echo "adding dtoverlay=dwc2,dr_mode=peripheral to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=dwc2,dr_mode=peripheral" >> /boot/config.txt' fi if [[ $(grep 'modules-load=dwc2,g_ether' /boot/cmdline.txt) ]]; then From 1b962d320f2d7b84f0f3c316ab424806fcc9f22c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 16:58:35 -0500 Subject: [PATCH 317/554] Update install change pacsat from m to n --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index b2169009..2a1396dd 100755 --- a/install +++ b/install @@ -176,7 +176,7 @@ sudo raspi-config nonint do_vnc 0 cd /tmp -wget https://www.g0kla.com/pacsat/downloads/test/PacSatGround_0.46m_linux.tar.gz +wget https://www.g0kla.com/pacsat/downloads/test/PacSatGround_0.46n_linux.tar.gz tar -xzf PacSatGround_0.46m_linux.tar.gz -C /home/pi/Desktop From a6dc350ddde7aba3a521d8f9fdd0214fc9ca1d37 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 17:02:33 -0500 Subject: [PATCH 318/554] Update update update pacsatground to 46n --- update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update b/update index e2220d82..9c5180ae 100755 --- a/update +++ b/update @@ -350,13 +350,13 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then cd /tmp - wget https://www.g0kla.com/pacsat/downloads/test/PacSatGround_0.46m_linux.tar.gz + wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46n.tar.gz - tar -xzf PacSatGround_0.46m_linux.tar.gz -C /home/pi/Desktop + tar -xzf PacsatGround_unix_0_46n.tar.gz -C /home/pi/Desktop - rm PacSatGround_0.46m_linux.tar.gz + rm PacSatGround_0.46n_linux.tar.gz - cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacSatGround_0.46m_linux/spacecraft/ + cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround_unix_0_46n/spacecraft/ mkdir /home/pi/PacSatGround From 4051bc0d691e4a41e044fdbfdf3ebb2d14bd1ff8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 17:03:24 -0500 Subject: [PATCH 319/554] Update install change pacsat ground to 46n --- install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install b/install index 2a1396dd..b3ecfe98 100755 --- a/install +++ b/install @@ -176,14 +176,14 @@ sudo raspi-config nonint do_vnc 0 cd /tmp -wget https://www.g0kla.com/pacsat/downloads/test/PacSatGround_0.46n_linux.tar.gz +wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46n.tar.gz -tar -xzf PacSatGround_0.46m_linux.tar.gz -C /home/pi/Desktop +tar -xzf PacsatGround_unix_0_46n.tar.gz -C /home/pi/Desktop -rm PacSatGround_0.46m_linux.tar.gz - -cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacSatGround_0.46m_linux/spacecraft/ +rm PacSatGround_0.46n_linux.tar.gz +cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround_unix_0_46n/spacecraft/ + mkdir /home/pi/PacSatGround sudo usermod -a -G gpio pi From 2accb21066b67ac667eab1a0c118f58a1fed8bcd Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 17:10:51 -0500 Subject: [PATCH 320/554] Update install fix pacsat install --- install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install b/install index b3ecfe98..40c70f12 100755 --- a/install +++ b/install @@ -180,9 +180,9 @@ wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46n.tar.gz tar -xzf PacsatGround_unix_0_46n.tar.gz -C /home/pi/Desktop -rm PacSatGround_0.46n_linux.tar.gz +rm PacsatGround_unix_0_46n.tar.gz -cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround_unix_0_46n/spacecraft/ +cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround/spacecraft/ mkdir /home/pi/PacSatGround From 90920a243793092ccde246a78717a6819e696e23 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 17:11:33 -0500 Subject: [PATCH 321/554] Update update fix pacsat gs install --- update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update b/update index 9c5180ae..c6435169 100755 --- a/update +++ b/update @@ -354,10 +354,10 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then tar -xzf PacsatGround_unix_0_46n.tar.gz -C /home/pi/Desktop - rm PacSatGround_0.46n_linux.tar.gz - - cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround_unix_0_46n/spacecraft/ + rm PacsatGround_unix_0_46n.tar.gz + cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround/spacecraft/ + mkdir /home/pi/PacSatGround sudo usermod -a -G gpio pi From 7f0814211da62deaf31a473252ddcf3d1a400eed Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 17:12:46 -0500 Subject: [PATCH 322/554] Update pacsat.sh change for version 46n --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 4e65f2d5..633e6612 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -84,7 +84,7 @@ echo echo "Don't close the direwolf window or the Pacsatsim will stop running." -cd /home/pi/Desktop/PacSatGround_0.46m_linux/ +cd /home/pi/Desktop/PacSatGround/ setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & From 36533e538b14d98cc8225f888b6ff78381b2b441 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 17:14:55 -0500 Subject: [PATCH 323/554] Update pacsat.sh fix dir name --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 633e6612..6a00522a 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -84,7 +84,7 @@ echo echo "Don't close the direwolf window or the Pacsatsim will stop running." -cd /home/pi/Desktop/PacSatGround/ +cd /home/pi/Desktop/PacsatGround/ setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & From 2eb2fac9814d18f8640812479399030279bfc66b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 17:31:04 -0500 Subject: [PATCH 324/554] Update transmit.py change from card to headphones --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index c9e1450d..d0301441 100644 --- a/transmit.py +++ b/transmit.py @@ -352,8 +352,8 @@ if __name__ == "__main__": print(txLedOn) GPIO.setup(txLed, GPIO.OUT) -# card = "Headphones" # default using pcm audio output of Pi Zero - card = "Device" # using USB sound card for audio output + card = "Headphones" # default using pcm audio output of Pi Zero +# card = "Device" # using USB sound card for audio output print("Programming FM module!\n"); output(pd, 1) From fb0776dda8e5dd0410fb15e42e6cf8776b30afe9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 17:38:25 -0500 Subject: [PATCH 325/554] Update update add cmake and direwolf v1.8 --- update | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/update b/update index c6435169..306e71ac 100755 --- a/update +++ b/update @@ -23,7 +23,7 @@ if [ "$1" = "u" ]; then fi -sudo apt-get install -y python3-smbus +sudo apt-get install -y python3-smbus cmake sudo sed -i 's/update.sh/update /g' /etc/motd @@ -374,16 +374,18 @@ cd /home/pi/direwolf #git status | grep 'invert' -if [[ ! $(git status | grep 'invert') ]]; then +if [[ ! $(git status | grep 'master-sync-invert') ]]; then - echo "updating direwolf to ptt invert version" + echo "updating direwolf to master-sync-invert version" git pull --no-rebase - git checkout invert - make clean - make -j + git checkout master-sync-invert + mkdir build + cd build + cmake .. + make -j4 sudo make install - make install-rpi + make install-conf cd fi From 427b53bee7663af50e4b82f0743417bae6123846 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 21:51:35 -0500 Subject: [PATCH 326/554] Create direwolf-pacsat-pwm.conf for pwm audio out --- direwolf/direwolf-pacsat-pwm.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 direwolf/direwolf-pacsat-pwm.conf diff --git a/direwolf/direwolf-pacsat-pwm.conf b/direwolf/direwolf-pacsat-pwm.conf new file mode 100644 index 00000000..839bd4a4 --- /dev/null +++ b/direwolf/direwolf-pacsat-pwm.conf @@ -0,0 +1,18 @@ +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +PTT GPIO -20 +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 From 67fde490cfbfa41682789db282d506bf8dc7d33d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 21:53:59 -0500 Subject: [PATCH 327/554] Update pacsatsim-df.sh add pwm variable --- pacsatsim-df.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pacsatsim-df.sh b/pacsatsim-df.sh index 3999eb8d..5abc76d1 100755 --- a/pacsatsim-df.sh +++ b/pacsatsim-df.sh @@ -1,5 +1,15 @@ #!/bin/bash +pwm=1 + sudo modprobe snd-aloop -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 +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 From bf572cc9bccba0cee2e5d46ccb8c249506b95349 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 21:55:25 -0500 Subject: [PATCH 328/554] Update pacsat-df.sh add pwm variable --- groundstation/pacsat-df.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/groundstation/pacsat-df.sh b/groundstation/pacsat-df.sh index 2c0af411..99ffc988 100755 --- a/groundstation/pacsat-df.sh +++ b/groundstation/pacsat-df.sh @@ -1,10 +1,21 @@ #!/bin/bash +pwm=1 + sudo modprobe snd-aloop #gpio -g mode 20 out #gpio -g write 20 1 -direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 +#direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 + +if [ "$pwm" = "1" ] ; then + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf -t 0 + +else + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 + +fi From 7d1aeae4708b9da46ac3a248452d5f62516642ca Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 21:57:09 -0500 Subject: [PATCH 329/554] Create direwolf-fm-pacsat-pwm.conf add PWM --- .../direwolf/direwolf-fm-pacsat-pwm.conf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 groundstation/direwolf/direwolf-fm-pacsat-pwm.conf diff --git a/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf new file mode 100644 index 00000000..ce5b6db6 --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf @@ -0,0 +1,19 @@ +MYCALL AMSAT +ADEVICE hw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +PTT GPIO -20 +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +#FULLDUP OFF +#TXDELAY 30 +#FIX_BITS 1 AX25 + +#DWAIT 0 +DWAIT 20 +SLOTTIME 300 +PERSIST 63 +#TXDELAY 1000 +TXDELAY 150 +#TXTAIL 10 +FULLDUP OFF From 7f9d85add375cd8b5b3b65b6b06bab46d5a6b168 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 22:21:54 -0500 Subject: [PATCH 330/554] Update update pi_pacsat to my repo --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index 306e71ac..86f72c22 100755 --- a/update +++ b/update @@ -317,7 +317,7 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then cd - git clone https://github.com/ac2cz/pi_pacsat.git + git clone https://github.com/alanbjohnston/pi_pacsat.git cd pi_pacsat/Debug From c04e411b6416076c98f6e1df951025025537eb69 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 22:29:44 -0500 Subject: [PATCH 331/554] Rename direwolf-pacsat-pwm.conf to direwolf-pacsatsim-pwm.conf --- .../{direwolf-pacsat-pwm.conf => direwolf-pacsatsim-pwm.conf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename direwolf/{direwolf-pacsat-pwm.conf => direwolf-pacsatsim-pwm.conf} (100%) diff --git a/direwolf/direwolf-pacsat-pwm.conf b/direwolf/direwolf-pacsatsim-pwm.conf similarity index 100% rename from direwolf/direwolf-pacsat-pwm.conf rename to direwolf/direwolf-pacsatsim-pwm.conf From a21b17e9010e6291371a2f6165f07a72765c175e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 1 Dec 2025 22:39:49 -0500 Subject: [PATCH 332/554] Update direwolf-pacsatsim-jp14.conf change to card names --- direwolf/direwolf-pacsatsim-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 8b42f6c7..976f2d03 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,5 +1,5 @@ -#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 -ADEVICE plughw:2,0 +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +#ADEVICE plughw:2,0 PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 From 4efcc75f0a39bd7f4e1877aba9d586729343b9c5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Feb 2026 09:52:23 -0500 Subject: [PATCH 333/554] Update update to g0kla_common, pacsat version o --- update | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/update b/update index 86f72c22..bc2d029a 100755 --- a/update +++ b/update @@ -1,6 +1,6 @@ #!/bin/bash -echo -e "\nupdate script for CubeSatSim v2.1\n" +echo -e "\nupdate script for CubeSatSim v2.2\n" if [ "$1" = "n" ] ; then # if [ -z "$2" ] ; then @@ -307,9 +307,9 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then cd - git clone https://github.com/alanbjohnston/iors_common.git + git clone https://github.com/alanbjohnston/g0kla_common.git - cd iors_common/Debug/ + cd g0kla_common/Debug/ make all @@ -327,7 +327,9 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then mkdir /home/pi/PacSat/pacsat mkdir /home/pi/PacSat/pacsat/dir - export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH +# export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + + export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null @@ -350,13 +352,13 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then cd /tmp - wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46n.tar.gz + wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46o.tar.gz - tar -xzf PacsatGround_unix_0_46n.tar.gz -C /home/pi/Desktop + tar -xzf PacsatGround_unix_0_46o.tar.gz -C /home/pi/Desktop - rm PacsatGround_unix_0_46n.tar.gz + rm PacsatGround_unix_0_46o.tar.gz - cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround/spacecraft/ + cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/* /home/pi/Desktop/PacsatGround/spacecraft/ mkdir /home/pi/PacSatGround From 777146d05380aea290929d5238da2686847f7b8e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Feb 2026 10:11:47 -0500 Subject: [PATCH 334/554] Update update check for PacSat Ground and check for Desktop --- update | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/update b/update index bc2d029a..c8c35716 100755 --- a/update +++ b/update @@ -349,22 +349,38 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then sudo sed -i 's/#hdmi_force_hotplug=1/hdmi_force_hotplug=1/g' /boot/config.txt sudo raspi-config nonint do_vnc 0 + +fi + +if [ ! -d "/home/pi/Desktop/PacsatGround" ]; then + + echo "Installing PacSat Ground Station!" + + if [ ! -d "/home/pi/Desktop" ]; then + + echo + echo "You won't be able to run the PacSat Ground Station as this Pi OS does not seem to have the Desktop GUI installed." + echo + + else - cd /tmp - - wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46o.tar.gz - - tar -xzf PacsatGround_unix_0_46o.tar.gz -C /home/pi/Desktop - - rm PacsatGround_unix_0_46o.tar.gz + cd /tmp + + wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46o.tar.gz + + tar -xzf PacsatGround_unix_0_46o.tar.gz -C /home/pi/Desktop + + rm PacsatGround_unix_0_46o.tar.gz + + cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/* /home/pi/Desktop/PacsatGround/spacecraft/ + + mkdir /home/pi/PacSatGround - cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/* /home/pi/Desktop/PacsatGround/spacecraft/ + sudo usermod -a -G gpio pi - mkdir /home/pi/PacSatGround + sudo apt-get install default-jdk -y - sudo usermod -a -G gpio pi - - sudo apt-get install default-jdk -y + fi cd From 6a421e79514039f29e17e230dcde79d3925732e1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Feb 2026 10:18:10 -0500 Subject: [PATCH 335/554] Update update fix copy of PacSat spacecraft files --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index c8c35716..cc452af9 100755 --- a/update +++ b/update @@ -372,7 +372,7 @@ if [ ! -d "/home/pi/Desktop/PacsatGround" ]; then rm PacsatGround_unix_0_46o.tar.gz - cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/* /home/pi/Desktop/PacsatGround/spacecraft/ + cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround/spacecraft/ mkdir /home/pi/PacSatGround From 554c0b12e69713217f0e049f9d9ee115b816de2c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Feb 2026 10:28:29 -0500 Subject: [PATCH 336/554] update library path --- pacsatsim.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 5a044360..eb122c82 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -2,7 +2,9 @@ # script to auto decode packet using rtl_fm and Direwolf and run Pacsat -export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH +# export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + +export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH #sudo systemctl stop cubesatsim From b6c77b2c2901289271160af4f75a115229a5e33b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Feb 2026 10:32:01 -0500 Subject: [PATCH 337/554] Update update change pi_pacsat to latest ac2cz --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index cc452af9..88918ed9 100755 --- a/update +++ b/update @@ -317,7 +317,7 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then cd - git clone https://github.com/alanbjohnston/pi_pacsat.git + git clone https://github.com/ac2cz/pi_pacsat.git cd pi_pacsat/Debug From fcf760d6f2daf9ec5c29e137f48d95b9eb890739 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Feb 2026 10:44:25 -0500 Subject: [PATCH 338/554] Update pacsatsim.sh run dire wolf in same window --- pacsatsim.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index eb122c82..76e37d1c 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -189,12 +189,14 @@ else # direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & - /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-df.sh" + # /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-df.sh" + + /home/pi/CubeSatSim/pacsatsim-df.sh & # 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 & - echo "Don't close the direwolf window or the Pacsatsim will stop running." +## echo "Don't close the direwolf window or the Pacsatsim will stop running." echo fi From ec674a80c0efbbb2daca49dae0df0e55fe165986 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Feb 2026 14:20:38 -0500 Subject: [PATCH 339/554] Update update change BBS callsign to -12 --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index 88918ed9..a9188a67 100755 --- a/update +++ b/update @@ -336,7 +336,7 @@ if [ ! -d "/home/pi/pi_pacsat" ]; then set -- $value echo "bit_rate=9600" > pacsat.config - echo "bbs_callsign=$1" >> pacsat.config + echo "bbs_callsign=$1-12" >> pacsat.config echo "broadcast_callsign=$1-11" >> pacsat.config echo "digi_callsign=$1-1" >> pacsat.config echo "max_frames_in_tx_buffer=5" >> pacsat.config From b5c2b1cc04b7dc336a804fcee55c05ab19e0ff36 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Feb 2026 16:57:33 -0500 Subject: [PATCH 340/554] Update direwolf-fm-pacsat-jp14.conf change to plughw and txdelay 1000 --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index 1b9d9a15..eb0bf0a2 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -1,5 +1,5 @@ MYCALL AMSAT -ADEVICE hw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 PTT GPIO -20 CHANNEL 0 MODEM 1200 @@ -13,7 +13,7 @@ AGWPORT 8002 DWAIT 20 SLOTTIME 300 PERSIST 63 -#TXDELAY 1000 -TXDELAY 150 +TXDELAY 1000 +#TXDELAY 150 #TXTAIL 10 FULLDUP OFF From d202c27855d675bc453c3d25dea309c186e74dc4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Feb 2026 16:59:35 -0500 Subject: [PATCH 341/554] Update direwolf-fm-pacsat-pwm.conf change to plughw and txdelay 1000 --- groundstation/direwolf/direwolf-fm-pacsat-pwm.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf index ce5b6db6..b8a4929c 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf @@ -1,5 +1,5 @@ MYCALL AMSAT -ADEVICE hw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 PTT GPIO -20 CHANNEL 0 MODEM 1200 @@ -13,7 +13,7 @@ AGWPORT 8002 DWAIT 20 SLOTTIME 300 PERSIST 63 -#TXDELAY 1000 -TXDELAY 150 +TXDELAY 1000 +#TXDELAY 150 #TXTAIL 10 FULLDUP OFF From bb0d8a3a6fc6e1d6a0e8586e2a0067801031a377 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Feb 2026 17:04:24 -0500 Subject: [PATCH 342/554] Update direwolf-pacsatsim-jp14.conf txdelay 1000 txtail 10 --- direwolf/direwolf-pacsatsim-jp14.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 976f2d03..cb0a1ce8 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -12,8 +12,8 @@ MODEM 1200 DWAIT 0 SLOTTIME 10 PERSIST 63 -#TXDELAY 1000 -TXDELAY 100 -#TXTAIL 10 -TXTAIL 1 +TXDELAY 1000 +#TXDELAY 100 +TXTAIL 10 +#TXTAIL 1 FULLDUP OFF From aafd9419e109b72dac1c19e5687104aa21567bf2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Feb 2026 17:05:00 -0500 Subject: [PATCH 343/554] Update direwolf-pacsatsim-pwm.conf txdelay 1000 txtail 10 --- direwolf/direwolf-pacsatsim-pwm.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-pwm.conf b/direwolf/direwolf-pacsatsim-pwm.conf index 839bd4a4..c0890790 100644 --- a/direwolf/direwolf-pacsatsim-pwm.conf +++ b/direwolf/direwolf-pacsatsim-pwm.conf @@ -11,8 +11,8 @@ MODEM 1200 DWAIT 0 SLOTTIME 10 PERSIST 63 -#TXDELAY 1000 -TXDELAY 100 -#TXTAIL 10 -TXTAIL 1 +TXDELAY 1000 +#TXDELAY 100 +TXTAIL 10 +#TXTAIL 1 FULLDUP OFF From 927b3ea288ea3c8e24a38832b47971043c18e882 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 11:54:46 -0500 Subject: [PATCH 344/554] Update direwolf-pacsatsim-pwm.conf add transmit LED --- direwolf/direwolf-pacsatsim-pwm.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/direwolf/direwolf-pacsatsim-pwm.conf b/direwolf/direwolf-pacsatsim-pwm.conf index c0890790..d0649d2f 100644 --- a/direwolf/direwolf-pacsatsim-pwm.conf +++ b/direwolf/direwolf-pacsatsim-pwm.conf @@ -1,5 +1,6 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 PTT GPIO -20 +PTT GPIO 27 #Transmit LED MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 From 80dd6054aac275408efe098d5306c1e68b79855b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 11:55:02 -0500 Subject: [PATCH 345/554] Update direwolf-fm-pacsat-pwm.conf add transmit LED --- groundstation/direwolf/direwolf-fm-pacsat-pwm.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf index b8a4929c..7e2a6ffa 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf @@ -1,6 +1,7 @@ MYCALL AMSAT ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 PTT GPIO -20 +PTT GPIO 27 #Transmit LED CHANNEL 0 MODEM 1200 KISSPORT 8100 From 51a6f6b3d2ce5abd72caebf3c4aaf64ed1e368b1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 11:57:13 -0500 Subject: [PATCH 346/554] Update direwolf-fm-pacsat-pwm.conf put transmit LED ptt on same line --- groundstation/direwolf/direwolf-fm-pacsat-pwm.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf index 7e2a6ffa..c1d5f5f9 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf @@ -1,7 +1,6 @@ MYCALL AMSAT ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 -PTT GPIO -20 -PTT GPIO 27 #Transmit LED +PTT GPIO -20 27 #Transmit LED CHANNEL 0 MODEM 1200 KISSPORT 8100 From 28dc67fd50495d9f20341322b0c6d0a2d735a407 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 17:30:06 -0500 Subject: [PATCH 347/554] Create PacSatSim.dat --- spacecraft/acSatGround_0.46o/PacSatSim.dat | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 spacecraft/acSatGround_0.46o/PacSatSim.dat diff --git a/spacecraft/acSatGround_0.46o/PacSatSim.dat b/spacecraft/acSatGround_0.46o/PacSatSim.dat new file mode 100644 index 00000000..92ae8f93 --- /dev/null +++ b/spacecraft/acSatGround_0.46o/PacSatSim.dat @@ -0,0 +1,15 @@ +Pacsat Telemetry Decoder Properties +#Sat Nov 26 18:12:20 EST 2016 +numberOfLookupTables=0 +measurementsFileName=measurements.csv +model=1 +layout0.filename=PACSAT_rttelemetry.csv +layout0.name=TLMI_LAYOUT +passMeasurementsFileName=passmeasurements.csv +name=PacSatSim +description=PacSatSim +numberOfLayouts=1 +satId=3 +catalogNumber=0 +conversionCoefficients=pacsat-coef.csv +layoutsUseBits=True From aa3c303990b6d6019ec860845049c8ddc35865e4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 17:31:27 -0500 Subject: [PATCH 348/554] Delete spacecraft/acSatGround_0.46o directory --- spacecraft/acSatGround_0.46o/PacSatSim.dat | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 spacecraft/acSatGround_0.46o/PacSatSim.dat diff --git a/spacecraft/acSatGround_0.46o/PacSatSim.dat b/spacecraft/acSatGround_0.46o/PacSatSim.dat deleted file mode 100644 index 92ae8f93..00000000 --- a/spacecraft/acSatGround_0.46o/PacSatSim.dat +++ /dev/null @@ -1,15 +0,0 @@ -Pacsat Telemetry Decoder Properties -#Sat Nov 26 18:12:20 EST 2016 -numberOfLookupTables=0 -measurementsFileName=measurements.csv -model=1 -layout0.filename=PACSAT_rttelemetry.csv -layout0.name=TLMI_LAYOUT -passMeasurementsFileName=passmeasurements.csv -name=PacSatSim -description=PacSatSim -numberOfLayouts=1 -satId=3 -catalogNumber=0 -conversionCoefficients=pacsat-coef.csv -layoutsUseBits=True From 71c285371b66d5b04b8ba9a4908eef05c1058b45 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 17:32:15 -0500 Subject: [PATCH 349/554] Create PacSatSim.dat --- spacecraft/PacSatGround_0.46o/PacSatSim.dat | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim.dat diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.dat b/spacecraft/PacSatGround_0.46o/PacSatSim.dat new file mode 100644 index 00000000..92ae8f93 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.dat @@ -0,0 +1,15 @@ +Pacsat Telemetry Decoder Properties +#Sat Nov 26 18:12:20 EST 2016 +numberOfLookupTables=0 +measurementsFileName=measurements.csv +model=1 +layout0.filename=PACSAT_rttelemetry.csv +layout0.name=TLMI_LAYOUT +passMeasurementsFileName=passmeasurements.csv +name=PacSatSim +description=PacSatSim +numberOfLayouts=1 +satId=3 +catalogNumber=0 +conversionCoefficients=pacsat-coef.csv +layoutsUseBits=True From 84d823a5bdfb54554d58763525ef534b201956e1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 17:32:59 -0500 Subject: [PATCH 350/554] Create PacSatSim.properties --- .../PacSatGround_0.46o/PacSatSim.properties | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim.properties diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.properties b/spacecraft/PacSatGround_0.46o/PacSatSim.properties new file mode 100644 index 00000000..e4ccad24 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.properties @@ -0,0 +1,20 @@ +#PacSat Ground Station Properties +#Sun Feb 17 18:25:06 EST 2019 +sequence_num=3 +name=PacSatSim +digiCallsign=AMSAT-1 +description=PacSatSim +broadcastCallsign=AMSAT-11 +DIR_AGE=10 +bbsCallsign=AMSAT-12 +telemLayoutFile=PacSatSim.dat +telem_server=tlm.amsatfox.org +web_site_url=http://CubeSatSim.org +show_system_files_on_dir_tab=false +show_user_files=true +supports_file_upload=true +norad_id=30776 +psf_header_check_sums=false +commandsFile=pacsat.commands +is_command_station=true +secret_key=ScKQLp2ZMvCaCTK5jAmOmKmA0JiSyJ6Y15+Yfg\=\= From 89e8991aad6e4647f3b5bb070e826b6511fd2769 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 17:36:00 -0500 Subject: [PATCH 351/554] Update PacSatSim.properties add command file --- spacecraft/PacSatGround_0.46o/PacSatSim.properties | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.properties b/spacecraft/PacSatGround_0.46o/PacSatSim.properties index e4ccad24..f719eb84 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim.properties +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.properties @@ -1,5 +1,5 @@ #PacSat Ground Station Properties -#Sun Feb 17 18:25:06 EST 2019 +#Fri Feb 6 18:25:06 EST 2026 sequence_num=3 name=PacSatSim digiCallsign=AMSAT-1 @@ -17,4 +17,6 @@ norad_id=30776 psf_header_check_sums=false commandsFile=pacsat.commands is_command_station=true -secret_key=ScKQLp2ZMvCaCTK5jAmOmKmA0JiSyJ6Y15+Yfg\=\= +secret_key=Not-required +commandsFile=PacSatSim.commands +echo_to_stdout=true From 103a98c3e5d88882de1f366f79116c4fa69e4d60 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 22:38:30 -0500 Subject: [PATCH 352/554] Create PacSatSim.commands --- .../PacSatGround_0.46o/PacSatSim.commands | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim.commands diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.commands b/spacecraft/PacSatGround_0.46o/PacSatSim.commands new file mode 100644 index 00000000..4e7a8073 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.commands @@ -0,0 +1,37 @@ +# This is a list of commands that can be sent to the spacecraft +# args are 16 bit except the special code 99099099 which is replaced with the unix time, or when special code MSB32BIT is used to combine two fields +LIST, namespaces, None, Operations, Telem, File System +LIST, IMAGE FOLDER, sstv_queue 1, sstv_queue 2, sstv_queue 3, sstv_queue 4, sstv_queue 5, sstv_queue 6, sstv_queue 7, sstv_queue 8, sstv_queue 9 +LIST, FOLDER, bin, lib, config, PACSAT dir, upload queue, wod queue, log queue, text queue, sensor wod queue, data1, data2, data3, data4, data5, data6, data7, data8, data9 +LIST, ENABLE, false, true +LIST, ROLL AT STARTUP, false, true +LIST, OVERWRITE, false, true +LIST, FSK, false, true +LIST, REMOVE ORPHAN FILES, false, true +LIST, STATE, stop, start +LIST, UPLINK MODE, Off, All stations, Command Stations Only +LIST, FILENAME, use id for file name, user file name +LIST, SHUTDOWN, reboot, shutdown +LIST, RESET, reboot +LIST, RATE, 1200, 9600 +LIST, FEC, Off, On +LIST, FULL DUPLEX, false, true +LIST, LOG NAME, Log, WOD +LIST, LOG LEVEL, None, Error, Warnings, Info +# Name, Name space, cmd, arg0, arg1, arg2, arg3, argName0, argName1, argName2, argName3, confirm, use reset/uptime, description +# +# PACSAT +# +Pacsat Broadcast,3,1,0,0,0,0,State,Period(sec),Timeout(sec),NONE,false,false,Enable or disable the Pacsat Broadcast module. The directory entries and individual files will be broadcast based on commands from ground stations. +File Uploads,3,2,0,0,0,0,Uplink Mode,Period(sec),Timeout(sec),NONE,false,false,Enable or disable File Uploads. Limit file uploads to command stations that authenticate with a secret key. +Install File,3,3,0,0,0,0,FileId,MSB32BIT,Folder,NONE,false,false,Copy a file from the PACSAT Directory to a folder and name it with a 4 byte hex name that matches the id or the user filename. +Execute File,3,13,0,0,0,0,FileId,MSB32BIT,Arg1,Arg2,true,false,Execute a file on the ARISS-PI. The file must already be installed in the bin folder +Delete File,3,4,0,0,0,0,FileId,MSB32BIT,Folder,NONE,true,false,Delete a file on the ARISS-PI. Typically this leaves the original copy in the PACSAT dir. To delete the original copy specify the PACSAT Dir folder +Delete Folder Contents,3,5,0,0,0,0,Folder,Remove Orphan Files,NONE,NONE,true,false,Remove all files from the folder. The original files will remain in the PACSAT Directory unless deleted seperately. Orphan files are files in a folder without a corresponding Pacsat Dir file. NB: Deleting the entire Pacsat Dir is a desperate measure perhaps only useful in testing! +Default File Expiry Period,3,6,0,0,0,0,Period(days),NONE,NONE,NONE,false,false,Set the default expiry period for files without a specific expiry time. The new value will be applied to all files. +File Expiry Period,3,7,0,0,0,0,FileId,MSB32BIT,Date,MSB32BIT,false,false,Set the expiry date for a specific file`. +Directory Maintenence Period,3,8,0,0,0,0,Period(s),NONE,NONE,NONE,false,false,Period between checks to each node in the directory for file expiry. +Uplink queue maintenance Period,3,9,0,0,0,0,Period(s),NONE,NONE,NONE,false,false,Period to check the entire uplink queue for expired files. +Int File Que Check Period,3,10,0,0,0,0,Period(s),NONE,NONE,NONE,false,false,Period to check the ingestion queues for newly generated internal files. +Max File Size,3,11,0,0,0,0,Size(kb),NONE,NONE,NONE,false,false,Maximum size for an uploaded file +Max Upload File Age,3,12,0,0,0,0,Age(days),NONE,NONE,NONE,false,false,Partially uploaded files not modified for more than this period will be removed from the upload queue. From d3f8697120116ba513f27809b152d3e2e551e5ef Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 23:20:41 -0500 Subject: [PATCH 353/554] Add renamed BPSK telem files from FoxTelem --- .../PacSatSim_Type1_HEALTH.frame | 13 ++++ .../PacSatSim_Type2_MINMAX.frame | 13 ++++ .../PacSatSim_conversion_curves.csv | 13 ++++ .../PacSatSim_maxtelemetry.csv | 62 +++++++++++++++++++ .../PacSatSim_mintelemetry.csv | 62 +++++++++++++++++++ .../PacSatSim_rttelemetry.csv | 62 +++++++++++++++++++ .../PacSatSim_wodtelemetry.csv | 62 +++++++++++++++++++ 7 files changed, 287 insertions(+) create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim_Type1_HEALTH.frame create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim_Type2_MINMAX.frame create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim_conversion_curves.csv create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim_mintelemetry.csv create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim_wodtelemetry.csv diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_Type1_HEALTH.frame b/spacecraft/PacSatGround_0.46o/PacSatSim_Type1_HEALTH.frame new file mode 100644 index 00000000..050ff88a --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_Type1_HEALTH.frame @@ -0,0 +1,13 @@ +number_of_payloads=6 +payload0.name=rttelemetry +payload0.length=78 +payload1.name=rttelemetry +payload1.length=78 +payload2.name=rttelemetry +payload2.length=78 +payload3.name=rttelemetry +payload3.length=78 +payload4.name=rttelemetry +payload4.length=78 +payload5.name=wodtelemetry +payload5.length=78 diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_Type2_MINMAX.frame b/spacecraft/PacSatGround_0.46o/PacSatSim_Type2_MINMAX.frame new file mode 100644 index 00000000..a69be045 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_Type2_MINMAX.frame @@ -0,0 +1,13 @@ +number_of_payloads=6 +payload0.name=rttelemetry +payload0.length=78 +payload1.name=rttelemetry +payload1.length=78 +payload2.name=rttelemetry +payload2.length=78 +payload3.name=maxtelemetry +payload3.length=78 +payload4.name=mintelemetry +payload4.length=78 +payload5.name=wodtelemetry +payload5.length=78 diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_conversion_curves.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_conversion_curves.csv new file mode 100644 index 00000000..30f05985 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_conversion_curves.csv @@ -0,0 +1,13 @@ +CurveName,a,bx,cx^2,dx^3,ex^4,fx^5,Description +cubesatsim_voltage,0,0.01,0,0,0,0,Converts voltages read from the INA219 sensors +cubesatsim_current,-2048,1,0,0,0,0,Converts positive and negative currents read from the INA219 sensors +cubesatsim_temperature,0,0.1,0,0,0,0,Converts temperature of Pi +cubesatsim_rotation,-2048,1,0,0,0,0,Converts positive and negative dps rotation +cubesatsim_acceleration,-20.48,0.01,0,0,0,0,Converts positive and negative g acceleration +cubesatsim_altitude,0,0.1,0,0,0,0,Converts altitude +cubesatsim_pressure,0,1,0,0,0,0,Converts pressure +cubesatsim_sensor1,0,1,0,0,0,0,Conversion of Sensor 1 +cubesatsim_sensor2,-2048,1,0,0,0,0,Conversion of Sensor 2 +cubesatsim_sensor3,-20.48,0.01,0,0,0,0,Conversion of Sensor 3 +cubesatsim_rpm,-204.8,0.1,0,0,0,0,Conversion of calculated RPM +cubesatsim_rssi,-2048,1,0,0,0,0,Conversion of Received Signal Strength diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv new file mode 100644 index 00000000..9bf2f291 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv @@ -0,0 +1,62 @@ +61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,MAX,Sensor 2,12,integer,1,NONE,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +1,MAX,Sensor 3,12,integer,1,NONE,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +2,MAX,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Battery Voltage,INA219 Battery Voltage +3,MAX,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +4,MAX,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +5,MAX,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +6,MAX,BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Battery Current,INA219 Battery Current +7,MAX,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature +8,MAX,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,INA219 +X solar panel Voltage +9,MAX,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,INA219 +Y solar panel Voltage +10,MAX,posZv,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,INA219 +Z solar panel Voltage +11,MAX,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,INA219 -X solar panel Voltage +12,MAX,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,INA219 -Y solar panel Voltage +13,MAX,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,INA219 -Z solar panel Voltage +14,MAX,posXi,12,mA,cubesatsim_current,NONE,7,2,3,Current,INA219 +X solar panel Current +15,MAX,posYi,12,mA,cubesatsim_current,NONE,8,2,3,Current,INA219 +Y solar panel Current +16,MAX,posZi,12,mA,cubesatsim_current,NONE,9,2,3,Current,INA219 +Z solar panel Current +17,MAX,negXi,12,mA,cubesatsim_current,NONE,10,2,3,Current,INA219 -X solar panel Current +18,MAX,negYi,12,mA,cubesatsim_current,NONE,11,2,3,Current,INA219 -Y solar panel Current +19,MAX,negZi,12,mA,cubesatsim_current,NONE,12,2,3,Current,INA219 -Z solar panel Current +20,MAX,BATT2_V,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Battery 2 Voltage,INA219 Battery 2 Voltage +21,MAX,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,MAX,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +23,MAX,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude +24,MAX,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,MAX,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +26,MAX,IHUcpuTemp,12,C,cubesatsim_temperature,NONE,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi +27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +30,MAX,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,BME280 Humidity,BME280 Humidity +31,MAX,BAT2_I,12,mA,cubesatsim_current,NONE,5,2,3,Battery 2 Current,INA219 Battery 2 Current +32,MAX,DiodeTemp,12,C,cubesatsim_rpm,NONE,6,6,3,Diode Temp,STEM Payload Diode Temperature +33,MAX,Sensor 1,12,integer,1,NONE,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +34,MAX,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator +35,MAX,SafeMode,1,-,STATUS_ON_OFF,NONE,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +36,MAX,SimulatedTelemetry,1,-,STATUS_ON_OFF,NONE,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator +37,MAX,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator +38,MAX,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,MAX,I2CBus1Failure,1,-,17,NONE,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +40,MAX,I2CBus3Failure,1,-,17,NONE,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +41,MAX,CameraFailure,1,-,17,NONE,2,4,0,Camera,Camera failure indicator +42,MAX,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received +43,MAX,RxAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status +44,MAX,TxAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status +45,MAX,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status +46,MAX,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +47,MAX,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +48,MAX,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +49,MAX,rf6,12,-,0,NONE,0,0,0,None,None +50,MAX,rf7,12,-,0,NONE,0,0,0,None,None +51,MAX,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +52,MAX,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +53,MAX,pad,4,-,34,NONE,0,0,0,None,Unused +54,MAX,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +55,MAX,pad1,1,-,0,NONE,0,0,0,NONE,Filler +56,MAX,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +57,MAX,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +58,MAX,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +59,MAX,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +60,MAX,pad2,27,-,0,NONE,0,0,0,NONE,Filler diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_mintelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_mintelemetry.csv new file mode 100644 index 00000000..adf24a04 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_mintelemetry.csv @@ -0,0 +1,62 @@ +61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,MIN,Sensor 2,12,integer,1,NONE,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +1,MIN,Sensor 3,12,integer,1,NONE,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +2,MIN,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Battery Voltage,INA219 Battery Voltage +3,MIN,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +4,MIN,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +5,MIN,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +6,MIN,BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Battery Current,INA219 Battery Current +7,MIN,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature +8,MIN,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,INA219 +X solar panel Voltage +9,MIN,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,INA219 +Y solar panel Voltage +10,MIN,posZv,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,INA219 +Z solar panel Voltage +11,MIN,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,INA219 -X solar panel Voltage +12,MIN,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,INA219 -Y solar panel Voltage +13,MIN,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,INA219 -Z solar panel Voltage +14,MIN,posXi,12,mA,cubesatsim_current,NONE,7,2,3,Current,INA219 +X solar panel Current +15,MIN,posYi,12,mA,cubesatsim_current,NONE,8,2,3,Current,INA219 +Y solar panel Current +16,MIN,posZi,12,mA,cubesatsim_current,NONE,9,2,3,Current,INA219 +Z solar panel Current +17,MIN,negXi,12,mA,cubesatsim_current,NONE,10,2,3,Current,INA219 -X solar panel Current +18,MIN,negYi,12,mA,cubesatsim_current,NONE,11,2,3,Current,INA219 -Y solar panel Current +19,MIN,negZi,12,mA,cubesatsim_current,NONE,12,2,3,Current,INA219 -Z solar panel Current +20,MIN,BATT2_V,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Battery 2 Voltage,INA219 Battery 2 Voltage +21,MIN,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,MIN,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +23,MIN,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude +24,MIN,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,MIN,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +26,MIN,IHUcpuTemp,12,C,cubesatsim_temperature,NONE,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi +27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +30,MIN,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,BME280 Humidity,BME280 Humidity +31,MIN,BAT2_I,12,mA,cubesatsim_current,NONE,5,2,3,Battery 2 Current,INA219 Battery 2 Current +32,MIN,DiodeTemp,12,C,cubesatsim_rpm,NONE,6,6,3,Diode Temp,STEM Payload Diode Temperature +33,MIN,Sensor 1,12,integer,1,NONE,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +34,MIN,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator +35,MIN,SafeMode,1,-,STATUS_ON_OFF,NONE,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +36,MIN,SimulatedTelemetry,1,-,STATUS_ON_OFF,NONE,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator +37,MIN,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator +38,MIN,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,MIN,I2CBus1Failure,1,-,17,NONE,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +40,MIN,I2CBus3Failure,1,-,17,NONE,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +41,MIN,CameraFailure,1,-,17,NONE,2,4,0,Camera,Camera failure indicator +42,MIN,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received +43,MIN,RxAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status +44,MIN,TxAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status +45,MIN,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status +46,MIN,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +47,MIN,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +48,MIN,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +49,MIN,rf6,12,-,0,NONE,0,0,0,None,None +50,MIN,rf7,12,-,0,NONE,0,0,0,None,None +51,MIN,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +52,MIN,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +53,MIN,pad,4,-,34,NONE,0,0,0,None,Unused +54,MIN,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +55,MIN,pad1,1,-,0,NONE,0,0,0,NONE,Filler +56,MIN,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +57,MIN,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +58,MIN,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +59,MIN,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +60,MIN,pad2,27,-,0,NONE,0,0,0,NONE,Filler diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv new file mode 100644 index 00000000..f9301dbe --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -0,0 +1,62 @@ +61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,realTime,Sensor 2,12,integer,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +1,realTime,Sensor 3,12,integer,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +2,realTime,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage +3,realTime,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +4,realTime,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +5,realTime,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +6,realTime,BATT_I,12,mA,cubesatsim_current,Battery,4,2,3,Battery Current,INA219 Battery Current +7,realTime,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature +8,realTime,posXv,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage +9,realTime,posYv,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage +10,realTime,posZv,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage +11,realTime,negXv,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage +12,realTime,negYv,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage +13,realTime,negZv,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage +14,realTime,posXi,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,INA219 +X solar panel Current +15,realTime,posYi,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current +16,realTime,posZi,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current +17,realTime,negXi,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,INA219 -X solar panel Current +18,realTime,negYi,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current +19,realTime,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current +20,realTime,BATT2_V,12,V,cubesatsim_voltage|FLOAT2,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage +21,realTime,spin,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,realTime,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +23,realTime,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude +24,realTime,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,realTime,rssi,12,dBm,cubesatsim_rssi|INT,Radio,1,1,3,RSSI,Received Signal Strength Indication +26,realTime,IHUcpuTemp,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi +27,realTime,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +28,realTime,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +29,realTime,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +30,realTime,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,BME280 Humidity,BME280 Humidity +31,realTime,BAT2_I,12,mA,cubesatsim_current,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current +32,realTime,DiodeTemp,12,C,cubesatsim_rpm,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature +33,realTime,Sensor 1,12,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +34,realTime,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator +35,realTime,SafeMode,1,-,STATUS_ON_OFF,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +36,realTime,SimulatedTelemetry,1,-,STATUS_ON_OFF,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator +37,realTime,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator +38,realTime,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,realTime,I2CBus1Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +40,realTime,I2CBus3Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +41,realTime,CameraFailure,1,-,17,Computer Hardware,2,4,0,Camera,Camera failure indicator +42,realTime,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received +43,realTime,RxAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status +44,realTime,TxAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status +45,realTime,C2CStatus,2,-,COMMAND_STATUS,Computer Software,3,5,0,Command Control, Command & Control Status +46,realTime,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +47,realTime,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +48,realTime,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +49,realTime,rf6,12,-,0,NONE,0,0,0,None,None +50,realTime,rf7,12,-,0,NONE,0,0,0,None,None +51,realTime,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +52,realTime,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +53,realTime,pad,4,-,34,NONE,0,0,0,None,Unused +54,realTime,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +55,realTime,pad1,1,-,0,NONE,0,0,0,NONE,Filler +56,realTime,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +57,realTime,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +58,realTime,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +59,realTime,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +60,realTime,pad2,27,-,0,NONE,0,0,0,NONE,Filler diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_wodtelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_wodtelemetry.csv new file mode 100644 index 00000000..d1b53340 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_wodtelemetry.csv @@ -0,0 +1,62 @@ +61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,WOD,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A,Battery A voltage (0-2.5V scale) +1,WOD,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,2,3,Cell A+B,Battery A+B voltage (0-3.3V scale) +2,WOD,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,WOD,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,Acceleration around X Axis +4,WOD,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,Acceleration around Y Axis +5,WOD,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,Acceleration around Z Axis +6,WOD,battCurr,12,mA,cubesatsim_current,Battery,4,2,4,Current,Total Battery DC current +7,WOD,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,Temperature,STEM Payload Sensor Temperature +8,WOD,posXv,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,+X solar Panel voltage +9,WOD,posYv,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,+Y solar Panel voltage +10,WOD,posZv,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,+Z solar Panel voltage +11,WOD,negXv,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,-X solar Panel voltage +12,WOD,negYv,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,-Y solar Panel voltage +13,WOD,negZv,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,-Z solar Panel voltage +14,WOD,posXi,12,mA,cubesatsim_current,+X Panel,7,2,4,Current,+X solar Panel current +15,WOD,posYi,12,mA,cubesatsim_current,+Y Panel,8,2,4,Current,+Y solar Panel current +16,WOD,posZi,12,mA,cubesatsim_current,+Z Panel,9,2,4,Current,+Z solar Panel current +17,WOD,negXi,12,mA,cubesatsim_current,-X Panel,10,2,4,Current,-X solar Panel current +18,WOD,negYi,12,mA,cubesatsim_current,-Y Panel,11,2,4,Current,-Y solar Panel current +19,WOD,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,4,Current,-Z solar Panel current +20,WOD,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,PSU,5,1,3,Voltage,Power Supply Voltage +21,WOD,spin,12,rpm,12,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,WOD,Pressure,12,bar,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload Sensor Pressure +23,WOD,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,Altitude,STEM Payload Sensor Altitude +24,WOD,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,WOD,rssi,12,dBm,14,Radio,1,1,3,RSSI,Received Signal Strength Indication +26,WOD,IHUcpuTemp,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,Temperature,Internal Temperature of IHU +27,WOD,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular Veolcity around X Axis +28,WOD,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular Veolcity around Y Axis +29,WOD,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular Veolcity around Z Axis +30,WOD,Sensor1,12,raw,cubesatsim_sensor1|INT,Experiments,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +31,WOD,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current +32,WOD,Sensor2,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 +33,WOD,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +34,WOD,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload Board Failure Indicator +35,WOD,Nominal Mode,1,-,17,Computer Software,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +36,WOD,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator +37,WOD,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator +38,WOD,I2CBus0Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,WOD,I2CBus1Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 1,I2C bus 1 failure indicator +40,WOD,I2CBus3Failure,1,-,17,Computer Hardware,2,4,0,I2C Bus 3,I2C bus 3 failure indicator +41,WOD,CameraFailure,1,-,17,Computer Hardware,2,5,0,Camera,Camera failure indicator +42,WOD,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received +43,WOD,RxAntDeploy,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status +44,WOD,TxAntDeploy,2,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status +45,WOD,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +46,WOD,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +47,WOD,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +48,WOD,rf6,12,-,0,NONE,0,0,0,None,None +49,WOD,rf7,12,-,0,NONE,0,0,0,None,None +50,WOD,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +51,WOD,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +52,WOD,pad,4,-,34,NONE,0,0,0,None,Unused +53,WOD,WODTimeStampReset,16,-,1,NONE,0,0,0,MAX Timestamp Uptime, Time Whole Orbit Data was collected +54,WOD,pad1,17,-,0,NONE,0,0,0,NONE,Filler +55,WOD,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +56,WOD,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +57,WOD,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +58,WOD,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +59,WOD,WODTimeStampUpTime,25,s,1,NONE,0,0,0,MAX Timestamp Uptime, Time Whole Orbit Data was collected +60,WOD,pad2,3,-,0,NONE,0,0,0,NONE,Filler From 54cb74d30bcab55634041f664f15ee7a51f56a62 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 23:26:19 -0500 Subject: [PATCH 354/554] Update PacSatSim.dat change to PacSatSim_ filenames --- spacecraft/PacSatGround_0.46m/PacSatSim.dat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/PacSatGround_0.46m/PacSatSim.dat b/spacecraft/PacSatGround_0.46m/PacSatSim.dat index 92ae8f93..f7e30e65 100644 --- a/spacecraft/PacSatGround_0.46m/PacSatSim.dat +++ b/spacecraft/PacSatGround_0.46m/PacSatSim.dat @@ -3,7 +3,7 @@ Pacsat Telemetry Decoder Properties numberOfLookupTables=0 measurementsFileName=measurements.csv model=1 -layout0.filename=PACSAT_rttelemetry.csv +layout0.filename=PacSatSim_rttelemetry.csv layout0.name=TLMI_LAYOUT passMeasurementsFileName=passmeasurements.csv name=PacSatSim @@ -11,5 +11,5 @@ description=PacSatSim numberOfLayouts=1 satId=3 catalogNumber=0 -conversionCoefficients=pacsat-coef.csv +conversionCoefficients=PacSatSim_conversion_curves.csv layoutsUseBits=True From 98d1f69a3c09260ffaee67e3e0016532e73ff573 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 23:32:17 -0500 Subject: [PATCH 355/554] Update PacSatSim.dat updated for PacSatSim_ file names --- spacecraft/PacSatGround_0.46o/PacSatSim.dat | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.dat b/spacecraft/PacSatGround_0.46o/PacSatSim.dat index 92ae8f93..8db7d5ae 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim.dat +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.dat @@ -1,15 +1,18 @@ -Pacsat Telemetry Decoder Properties -#Sat Nov 26 18:12:20 EST 2016 +#Pacsat Telemetry Decoder Properties +#Fri Feb 6 18:12:20 EST 2026 numberOfLookupTables=0 measurementsFileName=measurements.csv model=1 -layout0.filename=PACSAT_rttelemetry.csv -layout0.name=TLMI_LAYOUT +layoutsUseToCallsignAsType=true +numberOfLayouts=2 +layout0.filename=PacSatSim_rttelemetry.csv +layout0.name=TLMP1 +layout1.filename=PacSatSim_rttelemetry.csv +layout1.name=WOD passMeasurementsFileName=passmeasurements.csv -name=PacSatSim -description=PacSatSim -numberOfLayouts=1 +name=ISS +description=PacSatSim satId=3 catalogNumber=0 -conversionCoefficients=pacsat-coef.csv +conversionCoefficients=PacSatSim_conversion_curves.csv layoutsUseBits=True From f9a59597a5b92e1002224610bcfbf3e9ddbf75ab Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 6 Feb 2026 23:33:23 -0500 Subject: [PATCH 356/554] Update PacSatSim.dat revert --- spacecraft/PacSatGround_0.46m/PacSatSim.dat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/PacSatGround_0.46m/PacSatSim.dat b/spacecraft/PacSatGround_0.46m/PacSatSim.dat index f7e30e65..92ae8f93 100644 --- a/spacecraft/PacSatGround_0.46m/PacSatSim.dat +++ b/spacecraft/PacSatGround_0.46m/PacSatSim.dat @@ -3,7 +3,7 @@ Pacsat Telemetry Decoder Properties numberOfLookupTables=0 measurementsFileName=measurements.csv model=1 -layout0.filename=PacSatSim_rttelemetry.csv +layout0.filename=PACSAT_rttelemetry.csv layout0.name=TLMI_LAYOUT passMeasurementsFileName=passmeasurements.csv name=PacSatSim @@ -11,5 +11,5 @@ description=PacSatSim numberOfLayouts=1 satId=3 catalogNumber=0 -conversionCoefficients=PacSatSim_conversion_curves.csv +conversionCoefficients=pacsat-coef.csv layoutsUseBits=True From 6ae0a0dbbd61ae5048946d152dafa4f0a568a7aa Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 08:42:50 -0500 Subject: [PATCH 357/554] Update PacSatSim_rttelemetry.csv remove FLOAT2 and INT --- .../PacSatSim_rttelemetry.csv | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index f9301dbe..cca6a65f 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -1,34 +1,34 @@ 61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION 0,realTime,Sensor 2,12,integer,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 1,realTime,Sensor 3,12,integer,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 -2,realTime,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage -3,realTime,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis -4,realTime,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis -5,realTime,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +2,realTime,BATT_V,12,V,cubesatsim_voltage,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage +3,realTime,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +4,realTime,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +5,realTime,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis 6,realTime,BATT_I,12,mA,cubesatsim_current,Battery,4,2,3,Battery Current,INA219 Battery Current 7,realTime,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature -8,realTime,posXv,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage -9,realTime,posYv,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage -10,realTime,posZv,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage -11,realTime,negXv,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage -12,realTime,negYv,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage -13,realTime,negZv,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage +8,realTime,posXv,12,V,cubesatsim_voltage,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage +9,realTime,posYv,12,V,cubesatsim_voltage,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage +10,realTime,posZv,12,V,cubesatsim_voltage,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage +11,realTime,negXv,12,V,cubesatsim_voltage,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage +12,realTime,negYv,12,V,cubesatsim_voltage,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage +13,realTime,negZv,12,V,cubesatsim_voltage,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage 14,realTime,posXi,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,INA219 +X solar panel Current 15,realTime,posYi,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current 16,realTime,posZi,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current 17,realTime,negXi,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,INA219 -X solar panel Current 18,realTime,negYi,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current 19,realTime,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current -20,realTime,BATT2_V,12,V,cubesatsim_voltage|FLOAT2,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage +20,realTime,BATT2_V,12,V,cubesatsim_voltage,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage 21,realTime,spin,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells 22,realTime,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure 23,realTime,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude 24,realTime,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count -25,realTime,rssi,12,dBm,cubesatsim_rssi|INT,Radio,1,1,3,RSSI,Received Signal Strength Indication +25,realTime,rssi,12,dBm,cubesatsim_rssi,Radio,1,1,3,RSSI,Received Signal Strength Indication 26,realTime,IHUcpuTemp,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi -27,realTime,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis -28,realTime,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis -29,realTime,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +27,realTime,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +28,realTime,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +29,realTime,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis 30,realTime,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,BME280 Humidity,BME280 Humidity 31,realTime,BAT2_I,12,mA,cubesatsim_current,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current 32,realTime,DiodeTemp,12,C,cubesatsim_rpm,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature @@ -60,3 +60,4 @@ 58,realTime,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 59,realTime,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset 60,realTime,pad2,27,-,0,NONE,0,0,0,NONE,Filler + From 048c8a8a92e2960291db67db895d26e7ed66f075 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 08:47:32 -0500 Subject: [PATCH 358/554] Create PacSatSim-coef.csv --- .../PacSatGround_0.46o/PacSatSim-coef.csv | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv new file mode 100644 index 00000000..c76d5b42 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv @@ -0,0 +1,32 @@ +0,-,NONE,0,1,0,0,0,0,None,0,4096,None +1,-,Boolean,0,1,0,0,0,0,Boolean,0,1,A Boolean value that prints TRUE or FALSE +2,-,Counts,0,1,0,0,0,0,Counts,0,4096,An integer count value +3,-,Date,0,1,0,0,0,0,Date,0,4096,A Unix epoch date time integer +4,-,TXPower,0,1,0,0,0,0,None,0,4096,None +5,-,IHUSpeed,0,0.1,0,0,0,0,None,0,4096,None +6,-,RSSI_1,0,-1,0,0,0,0,Counts,0,4096,Signed 8 bit +7,-,Mode,0,0,0,0,0,0,Enum,0,4096,SAFE:CREW:TELEM:X BAND RPT:APRS:SSTV:FS +8,-,Battery,0,0.001,0,0,0,0,None,0,4096,Battery Voltage +9,-,IHUTemp,0,0.1,0,0,0,0,None,0,4096,None +10,-,Mode,0,1,0,0,0,0,None,0,4096,The spacecraft Mode +11,-,FS_BYTES_PER_BLK,0,128,0,0,0,0,Counts,0,4096,The number of bytes per block in RED FS +12,-,FS_FILE_NUMBER,-4,1,0,0,0,0,Counts,0,4096,The number of files in the FS excluding core OS folders +13,-,SHTC3Temp,-45,0.002670288,0,0,0,0,None,0,4096,SHTC3 Temperature sensor +14,-,SHTC3Humidity,0,0.001525879,0,0,0,0,None,0,4096,SHTC3 Humidity sensor +15,-,LPS22Pressure,0,0.000244141,0,0,0,0,None,0,4096,LPS22 Pressure sensor +16,-,LPS22Temp,0,0.01,0,0,0,0,None,0,4096,LPS22 Temperature of sensor +17,-,IMUTemp,0,0.00390625,0,0,0,0,None,0,4096,Temperature of IMU = raw/256 +18,-,Acc,0,6.10E-05,0,0,0,0,Sint16,0,4096,Accelerometer is 2g full scale +19,-,Gyro,0,0.000976563,0,0,0,0,Sint16,0,4096,Gyro scale for 32dps +20,-,Mag,0,0.149975574,0,0,0,0,Sint16,0,4096,Mag is 4912 full scale +21,-,AntMode,0,0,0,0,0,0,Enum,0,4096,MANUAL:AUTO:ORBIT +22,-,ResetReason,0,0,0,0,0,0,Enum,0,4096,NONE:SHUTDOWN:REBOOT:RADIO:TNC:TNC LISTEN:RUN TWICE:RADIO REBOOT:TNC PS REBOOT:TNC REBOOT:SOFT:THERMAL +23,-,LogLevel,0,0,0,0,0,0,Enum,0,4096,NONE:ERROR:WARN:INFO +24,-,O2FromVolts,86.434,-0.0354,0,0,0,0,None,0,4096,O2 Conc from raw voltage as a percentage +25,-,SensorState,0,0,0,0,0,0,Enum,0,4096,OFF:ON:ERR +26,-,SPARE2,0,0,0,0,0,0,Counts,0,4096,SPARE +27,-,O2Conc,0,0.01,0,0,0,0,Sint16,0,4096,O2 concentration as percentage +28,-,SSTVMode,0,0,0,0,0,0,Enum,0,4096,MartinM1:MartinM2:ScottieS1:ScottieS2:Robot36:PasokonP3:PasokonP5:PasokonP7:PD90:PD120:PD160:PD180:PD240:PD290:Robot8BW:Robot24BW +NOTES:,,,,,,,,,,,, +Serial,Ignore,name,a,b,c,d,e,f,format,low limit,high limit,Comment +Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,,,,,,,,,,, From 2fe1fc6e7e96ad27e89895c1591be8c6ba489713 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 11:49:02 -0500 Subject: [PATCH 359/554] Update PacSatSim-coef.csv add divide by 100 field --- spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv index c76d5b42..cea11ef8 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv @@ -27,6 +27,7 @@ 26,-,SPARE2,0,0,0,0,0,0,Counts,0,4096,SPARE 27,-,O2Conc,0,0.01,0,0,0,0,Sint16,0,4096,O2 concentration as percentage 28,-,SSTVMode,0,0,0,0,0,0,Enum,0,4096,MartinM1:MartinM2:ScottieS1:ScottieS2:Robot36:PasokonP3:PasokonP5:PasokonP7:PD90:PD120:PD160:PD180:PD240:PD290:Robot8BW:Robot24BW +29,-,DivideBy100,0,0.01,0,0,0,0,None,0,4096,Divide by 100 NOTES:,,,,,,,,,,,, Serial,Ignore,name,a,b,c,d,e,f,format,low limit,high limit,Comment Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,,,,,,,,,,, From 1fbee01b9dfa0ff0fec4ca015eab257e963b6d92 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 11:50:28 -0500 Subject: [PATCH 360/554] Update PacSatSim.dat change to PacSatSim-coef.csv --- spacecraft/PacSatGround_0.46o/PacSatSim.dat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.dat b/spacecraft/PacSatGround_0.46o/PacSatSim.dat index 8db7d5ae..1e5abfff 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim.dat +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.dat @@ -14,5 +14,5 @@ name=ISS description=PacSatSim satId=3 catalogNumber=0 -conversionCoefficients=PacSatSim_conversion_curves.csv +conversionCoefficients=PacSatSim-coef.csv layoutsUseBits=True From 21ab4e1f1877a841e7dfa9718db05c1195c7171e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 11:56:14 -0500 Subject: [PATCH 361/554] Update PacSatSim_rttelemetry.csv changed voltage to 29 --- .../PacSatSim_rttelemetry.csv | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index cca6a65f..39187d50 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -1,25 +1,25 @@ 61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION 0,realTime,Sensor 2,12,integer,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 1,realTime,Sensor 3,12,integer,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 -2,realTime,BATT_V,12,V,cubesatsim_voltage,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage +2,realTime,BATT_V,12,V,29,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage 3,realTime,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis 4,realTime,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis 5,realTime,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis 6,realTime,BATT_I,12,mA,cubesatsim_current,Battery,4,2,3,Battery Current,INA219 Battery Current 7,realTime,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature -8,realTime,posXv,12,V,cubesatsim_voltage,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage -9,realTime,posYv,12,V,cubesatsim_voltage,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage -10,realTime,posZv,12,V,cubesatsim_voltage,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage -11,realTime,negXv,12,V,cubesatsim_voltage,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage -12,realTime,negYv,12,V,cubesatsim_voltage,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage -13,realTime,negZv,12,V,cubesatsim_voltage,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage +8,realTime,posXv,12,V,29,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage +9,realTime,posYv,12,V,29,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage +10,realTime,posZv,12,V,29,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage +11,realTime,negXv,12,V,29,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage +12,realTime,negYv,12,V,29,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage +13,realTime,negZv,12,V,29,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage 14,realTime,posXi,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,INA219 +X solar panel Current 15,realTime,posYi,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current 16,realTime,posZi,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current 17,realTime,negXi,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,INA219 -X solar panel Current 18,realTime,negYi,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current 19,realTime,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current -20,realTime,BATT2_V,12,V,cubesatsim_voltage,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage +20,realTime,BATT2_V,12,V,29,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage 21,realTime,spin,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells 22,realTime,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure 23,realTime,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude @@ -61,3 +61,4 @@ 59,realTime,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset 60,realTime,pad2,27,-,0,NONE,0,0,0,NONE,Filler + From 36feace03a32b125a7b4a78f4388d54dedc7ae8e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 12:09:03 -0500 Subject: [PATCH 362/554] Update PacSatSim_rttelemetry.csv replace rest of cubesatsim_ conversations --- .../PacSatSim_rttelemetry.csv | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index 39187d50..251badf4 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -2,36 +2,36 @@ 0,realTime,Sensor 2,12,integer,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 1,realTime,Sensor 3,12,integer,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 2,realTime,BATT_V,12,V,29,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage -3,realTime,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis -4,realTime,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis -5,realTime,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis -6,realTime,BATT_I,12,mA,cubesatsim_current,Battery,4,2,3,Battery Current,INA219 Battery Current -7,realTime,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature +3,realTime,SatelliteXAxisAcceleration,12,g,30,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +4,realTime,SatelliteYAxisAcceleration,12,g,30,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +5,realTime,SatelliteZAxisAcceleration,12,g,30,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +6,realTime,BATT_I,12,mA,31,Battery,4,2,3,Battery Current,INA219 Battery Current +7,realTime,Temperature,12,C,5,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature 8,realTime,posXv,12,V,29,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage 9,realTime,posYv,12,V,29,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage 10,realTime,posZv,12,V,29,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage 11,realTime,negXv,12,V,29,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage 12,realTime,negYv,12,V,29,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage 13,realTime,negZv,12,V,29,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage -14,realTime,posXi,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,INA219 +X solar panel Current -15,realTime,posYi,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current -16,realTime,posZi,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current -17,realTime,negXi,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,INA219 -X solar panel Current -18,realTime,negYi,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current -19,realTime,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current +14,realTime,posXi,12,mA,31,+X Panel,7,2,3,Current,INA219 +X solar panel Current +15,realTime,posYi,12,mA,31,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current +16,realTime,posZi,12,mA,31,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current +17,realTime,negXi,12,mA,31,-X Panel,10,2,3,Current,INA219 -X solar panel Current +18,realTime,negYi,12,mA,31,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current +19,realTime,negZi,12,mA,31,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current 20,realTime,BATT2_V,12,V,29,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage -21,realTime,spin,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -22,realTime,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure -23,realTime,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude +21,realTime,spin,12,rpm,32,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,realTime,Pressure,12,hPa,0,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +23,realTime,Altitude,12,m,12,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude 24,realTime,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count -25,realTime,rssi,12,dBm,cubesatsim_rssi,Radio,1,1,3,RSSI,Received Signal Strength Indication -26,realTime,IHUcpuTemp,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi -27,realTime,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis -28,realTime,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis -29,realTime,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis -30,realTime,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,BME280 Humidity,BME280 Humidity -31,realTime,BAT2_I,12,mA,cubesatsim_current,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current -32,realTime,DiodeTemp,12,C,cubesatsim_rpm,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature +25,realTime,rssi,12,dBm,31,Radio,1,1,3,RSSI,Received Signal Strength Indication +26,realTime,IHUcpuTemp,12,C,5,Computer Hardware,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi +27,realTime,SatelliteXAxisAngularVelocity,12,dps,31,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +28,realTime,SatelliteYAxisAngularVelocity,12,dps,31,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +29,realTime,SatelliteZAxisAngularVelocity,12,dps,31,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +30,realTime,Humidity,12,%,5,Experiments,6,5,3,BME280 Humidity,BME280 Humidity +31,realTime,BAT2_I,12,mA,31,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current +32,realTime,DiodeTemp,12,C,32,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature 33,realTime,Sensor 1,12,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 34,realTime,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator 35,realTime,SafeMode,1,-,STATUS_ON_OFF,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) @@ -62,3 +62,4 @@ 60,realTime,pad2,27,-,0,NONE,0,0,0,NONE,Filler + From 4863d08f8486315a9f4acbfbd7a73daa7e43e7a8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 12:09:18 -0500 Subject: [PATCH 363/554] Update PacSatSim-coef.csv add rest of conversions --- spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv index cea11ef8..854d2b56 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv @@ -28,6 +28,9 @@ 27,-,O2Conc,0,0.01,0,0,0,0,Sint16,0,4096,O2 concentration as percentage 28,-,SSTVMode,0,0,0,0,0,0,Enum,0,4096,MartinM1:MartinM2:ScottieS1:ScottieS2:Robot36:PasokonP3:PasokonP5:PasokonP7:PD90:PD120:PD160:PD180:PD240:PD290:Robot8BW:Robot24BW 29,-,DivideBy100,0,0.01,0,0,0,0,None,0,4096,Divide by 100 +30,-,DivideBy100Offset,-20.48,0.01,0,0,0,0,None,0,4096,Divide by 100 with Offset +31,-,Offset,-2048,1,0,0,0,0,None,0,4096,Offset +32,-,DivideBy10Offset,-204.8,0.1,0,0,0,0,None,0,4096,Divide by 10 with Offset NOTES:,,,,,,,,,,,, Serial,Ignore,name,a,b,c,d,e,f,format,low limit,high limit,Comment Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,,,,,,,,,,, From 437d65a4243a76d1bbacc2c7b9301b73cee9851d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 12:18:39 -0500 Subject: [PATCH 364/554] Update PacSatSim-coef.csv add Status enum 33 --- spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv index 854d2b56..0c6fd915 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv @@ -31,6 +31,7 @@ 30,-,DivideBy100Offset,-20.48,0.01,0,0,0,0,None,0,4096,Divide by 100 with Offset 31,-,Offset,-2048,1,0,0,0,0,None,0,4096,Offset 32,-,DivideBy10Offset,-204.8,0.1,0,0,0,0,None,0,4096,Divide by 10 with Offset +33,-,Status,0,0,0,0,0,0,Enum,0,4096,ON:OFF NOTES:,,,,,,,,,,,, Serial,Ignore,name,a,b,c,d,e,f,format,low limit,high limit,Comment Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,,,,,,,,,,, From db20b27839e5195761d7d1ae3b128c22d61750cb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 12:19:21 -0500 Subject: [PATCH 365/554] Update PacSatSim_rttelemetry.csv add Status 33 --- spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index 251badf4..a8d345d9 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -34,8 +34,8 @@ 32,realTime,DiodeTemp,12,C,32,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature 33,realTime,Sensor 1,12,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 34,realTime,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator -35,realTime,SafeMode,1,-,STATUS_ON_OFF,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) -36,realTime,SimulatedTelemetry,1,-,STATUS_ON_OFF,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator +35,realTime,SafeMode,1,-,33,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +36,realTime,SimulatedTelemetry,1,-,33,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator 37,realTime,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator 38,realTime,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator 39,realTime,I2CBus1Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator @@ -63,3 +63,4 @@ + From a4f2c665c59bb46e0d9e77dd114b4c8bf61d496f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 12:24:09 -0500 Subject: [PATCH 366/554] Update PacSatSim_rttelemetry.csv add rest of enums --- spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index a8d345d9..e37be32a 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -44,7 +44,7 @@ 42,realTime,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received 43,realTime,RxAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status 44,realTime,TxAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status -45,realTime,C2CStatus,2,-,COMMAND_STATUS,Computer Software,3,5,0,Command Control, Command & Control Status +45,realTime,C2CStatus,2,-,34,Computer Software,3,5,0,Command Control, Command & Control Status 46,realTime,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted 47,realTime,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V 48,realTime,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected @@ -64,3 +64,4 @@ + From 3d26d214526f812f0d89cb1d6a1cc3b6c4a61d12 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 12:24:17 -0500 Subject: [PATCH 367/554] Update PacSatSim-coef.csv add rest of enums --- spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv index 0c6fd915..46902f05 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv @@ -32,6 +32,7 @@ 31,-,Offset,-2048,1,0,0,0,0,None,0,4096,Offset 32,-,DivideBy10Offset,-204.8,0.1,0,0,0,0,None,0,4096,Divide by 10 with Offset 33,-,Status,0,0,0,0,0,0,Enum,0,4096,ON:OFF +34,-,CommandStatus,0,0,0,0,0,0,Enum,0,4096,OFF:Carrier:DTMF/APRS NOTES:,,,,,,,,,,,, Serial,Ignore,name,a,b,c,d,e,f,format,low limit,high limit,Comment Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,,,,,,,,,,, From 5a7f1d9c0fcaa4f59e8a4a2187742a2633818a09 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 12:34:37 -0500 Subject: [PATCH 368/554] Update PacSatSim_rttelemetry.csv remove 42 and 43 --- .../PacSatGround_0.46o/PacSatSim_rttelemetry.csv | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index e37be32a..62f4b01f 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -45,13 +45,13 @@ 43,realTime,RxAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status 44,realTime,TxAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status 45,realTime,C2CStatus,2,-,34,Computer Software,3,5,0,Command Control, Command & Control Status -46,realTime,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted -47,realTime,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V -48,realTime,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +46,realTime,ICR3VProt,12,V,0,NONE,7,2,3,3V Prot,ICR 3V Proteted +47,realTime,ICR2dot5V,12,V,0,NONE,7,3,3,2.5V,ICR 2.5V +48,realTime,ICR2dot5VProt,12,V,0,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected 49,realTime,rf6,12,-,0,NONE,0,0,0,None,None 50,realTime,rf7,12,-,0,NONE,0,0,0,None,None -51,realTime,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR -52,realTime,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +51,realTime,MuxTest,12,V,0,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +52,realTime,LtVGACtl,12,V,0,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) 53,realTime,pad,4,-,34,NONE,0,0,0,None,Unused 54,realTime,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance 55,realTime,pad1,1,-,0,NONE,0,0,0,NONE,Filler @@ -65,3 +65,4 @@ + From 7358da25e7631281c519856e553be0fef233272f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 12:40:42 -0500 Subject: [PATCH 369/554] Update PacSatSim.properties --- spacecraft/PacSatGround_0.46o/PacSatSim.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.properties b/spacecraft/PacSatGround_0.46o/PacSatSim.properties index f719eb84..8ff5be50 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim.properties +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.properties @@ -15,7 +15,6 @@ show_user_files=true supports_file_upload=true norad_id=30776 psf_header_check_sums=false -commandsFile=pacsat.commands is_command_station=true secret_key=Not-required commandsFile=PacSatSim.commands From f526b10e7b63d4e752d3db599d2a82ededc77dea Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 15:34:29 -0500 Subject: [PATCH 370/554] Create txLED.py --- txLED.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 txLED.py diff --git a/txLED.py b/txLED.py new file mode 100644 index 00000000..af9b6d51 --- /dev/null +++ b/txLED.py @@ -0,0 +1,25 @@ +import RPi.GPIO as GPIO +import subprocess +import time +import os +from time import sleep + +txPin = 27 +pttPin = 20 + +GPIO.setmode(GPIO.BCM) +GPIO.setwarnings(False) +GPIO.setup(txPin, GPIO.OUT) +GPIO.output(txPin, 0) +print("0") +GPIO.setup(pttPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) + +while (True): + sleep(0.1) + GPIO.wait_for_edge(pttPin, GPIO.FALLING) + GPIO.output(txPin, 1) + sleep(0.1) + print("1") + GPIO.wait_for_edge(pttPin, GPIO.RISING) + GPIO.output(txPin, 0) + print("0") From c341d5a3b46ae92207e6d538dd54555bd25da879 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 15:44:34 -0500 Subject: [PATCH 371/554] Update transmit.py add txLed control by PTT --- transmit.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/transmit.py b/transmit.py index d0301441..8a535fa7 100644 --- a/transmit.py +++ b/transmit.py @@ -423,16 +423,28 @@ if __name__ == "__main__": output(ptt, 1) if (mode == 'a'): print("AFSK") - elif (mode == 'p'): - print("Pacsat") -# system('/home/pi/CubeSatSim/pacsatsim.sh') -# system('sudo systemctl restart pacsatsim') - while True: - sleep(30) - elif (mode == 'P'): - print("Pacsat Ground Station") - while True: - sleep(30) + elif (mode == 'p') or (mode == 'P'): + if (mode == 'P'): + print("Pacsat Ground Station") + else: + print("Pacsat") +# txPin = 27 + pttPin = 20 + + GPIO.setmode(GPIO.BCM) + GPIO.setwarnings(False) + GPIO.setup(txLed, GPIO.OUT) + GPIO.output(txLed, 0) + + GPIO.setup(pttPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) + + while (True): + sleep(0.1) + GPIO.wait_for_edge(pttPin, GPIO.FALLING) + GPIO.output(txLed, 1) + sleep(0.1) + GPIO.wait_for_edge(pttPin, GPIO.RISING) + GPIO.output(txLed, 1) else: GPIO.output(powerPin, 0) print("Transmit APRS Commands") From 61cec95c9733572abefe38bbb5f48bd56197e9a6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 15:54:29 -0500 Subject: [PATCH 372/554] Update transmit.py change pttPin from 1 to 0 --- transmit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 8a535fa7..6fe0bae4 100644 --- a/transmit.py +++ b/transmit.py @@ -435,6 +435,7 @@ if __name__ == "__main__": GPIO.setwarnings(False) GPIO.setup(txLed, GPIO.OUT) GPIO.output(txLed, 0) + print("0") GPIO.setup(pttPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) @@ -442,9 +443,11 @@ if __name__ == "__main__": sleep(0.1) GPIO.wait_for_edge(pttPin, GPIO.FALLING) GPIO.output(txLed, 1) + print("1") sleep(0.1) GPIO.wait_for_edge(pttPin, GPIO.RISING) - GPIO.output(txLed, 1) + GPIO.output(txLed, 0) + print("0") else: GPIO.output(powerPin, 0) print("Transmit APRS Commands") From 398fc71782eaf62fcbaab5bdbef3c3ec4ade53ec Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 15:57:04 -0500 Subject: [PATCH 373/554] Update transmit.py remove pttPin set --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 6fe0bae4..60036a26 100644 --- a/transmit.py +++ b/transmit.py @@ -437,7 +437,7 @@ if __name__ == "__main__": GPIO.output(txLed, 0) print("0") - GPIO.setup(pttPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) +# GPIO.setup(pttPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) while (True): sleep(0.1) From 7ae10fdbc5ea956bad80a69e7d58b84892660a91 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 17:17:41 -0500 Subject: [PATCH 374/554] Update transmit.service change to user pi --- systemd/transmit.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd/transmit.service b/systemd/transmit.service index ab6dd815..0b77ff50 100644 --- a/systemd/transmit.service +++ b/systemd/transmit.service @@ -8,7 +8,7 @@ WorkingDirectory=/home/pi/CubeSatSim StandardOutput=inherit StandardError=inherit Restart=always -User=root +User=pi [Install] WantedBy=default.target From 5c29fffe057d5a145494730c6c19e0b559050f1e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 17:19:47 -0500 Subject: [PATCH 375/554] Update transmit.py remove pull-up on pttPin --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 60036a26..13d2bc1a 100644 --- a/transmit.py +++ b/transmit.py @@ -437,8 +437,8 @@ if __name__ == "__main__": GPIO.output(txLed, 0) print("0") -# GPIO.setup(pttPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) - + GPIO.setup(pttPin, GPIO.IN) + while (True): sleep(0.1) GPIO.wait_for_edge(pttPin, GPIO.FALLING) From 6f65d5efa57f9c9a0e7cfb129ea8333f8b5ce02d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 22:29:47 -0500 Subject: [PATCH 376/554] Update direwolf-pacsatsim-pwm.conf remove txled ptt --- direwolf/direwolf-pacsatsim-pwm.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-pwm.conf b/direwolf/direwolf-pacsatsim-pwm.conf index d0649d2f..c0890790 100644 --- a/direwolf/direwolf-pacsatsim-pwm.conf +++ b/direwolf/direwolf-pacsatsim-pwm.conf @@ -1,6 +1,5 @@ ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 PTT GPIO -20 -PTT GPIO 27 #Transmit LED MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 From 6532c062840569ccdb33481f42aa0856c9deafc9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 7 Feb 2026 22:46:08 -0500 Subject: [PATCH 377/554] Update pacsat.sh add pi user to gpio --- groundstation/pacsat.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 6a00522a..5151e803 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -77,6 +77,8 @@ echo #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 + /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-df.sh" # 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 & From e1b916e4dea9b93608938be4931055e22b9cbac2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 8 Feb 2026 13:14:00 -0500 Subject: [PATCH 378/554] Update pacsatsim.service change user to pi --- systemd/pacsatsim.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd/pacsatsim.service b/systemd/pacsatsim.service index e65044af..d5163bd6 100644 --- a/systemd/pacsatsim.service +++ b/systemd/pacsatsim.service @@ -8,7 +8,7 @@ WorkingDirectory=/home/pi/CubeSatSim StandardOutput=inherit StandardError=inherit Restart=always -User=root +User=pi [Install] WantedBy=default.target From 9302ac01b9619bab5ef5d8e1026567cef606bfd9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 8 Feb 2026 13:15:54 -0500 Subject: [PATCH 379/554] Update update add pacsatsim.service installation --- update | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/update b/update index a9188a67..3ae8add9 100755 --- a/update +++ b/update @@ -105,6 +105,22 @@ else FLAG=1 fi +FILE=/etc/systemd/system/pacsatsim.service +if [ -f "$FILE" ]; then + if [[ $(diff systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service) ]]; then + echo "changed command.service." + sudo cp /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + FLAG=1 + else + echo "no change to pacsatsim.service." + fi +else + echo "creating pacsatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + sudo systemctl enable pacsatsim + FLAG=1 +fi + FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg if [ ! -f "$FILE" ]; then echo "Copying SSTV image 1." From 65cd80f7f2608c802a3a7a26e7421bdb94aa90d8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 8 Feb 2026 13:19:16 -0500 Subject: [PATCH 380/554] Update transmit.py start and stop pacsatsim.service --- transmit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transmit.py b/transmit.py index 13d2bc1a..e1c6aa77 100644 --- a/transmit.py +++ b/transmit.py @@ -245,6 +245,7 @@ if __name__ == "__main__": print("Can't open .mode file, defaulting to FSK") print("Mode is: ") print(mode) + system("sudo systemctl stop pacsatsim") try: file = open("/home/pi/CubeSatSim/beacon_off") @@ -428,6 +429,7 @@ if __name__ == "__main__": print("Pacsat Ground Station") else: print("Pacsat") + system("sudo systemctl restart pacsatsim") # txPin = 27 pttPin = 20 From 24d4b6c743492e44bcec91e68029595552a1362b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 8 Feb 2026 13:24:38 -0500 Subject: [PATCH 381/554] Update config add pacsat text --- config | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config b/config index 1929eee1..7759faed 100755 --- a/config +++ b/config @@ -1424,12 +1424,12 @@ elif [ "$1" = "-g" ]; then elif [ "$1" = "-G" ]; then - echo "Changing to Pacsat mode" + echo "Changing to PacSatSim mode" value=`cat /home/pi/CubeSatSim/.mode` echo "$value" > /dev/null set -- $value - echo "changing CubeSatSim to Pacsat mode" +# echo "changing CubeSatSim to Pacsat mode" sudo echo "p" > /home/pi/CubeSatSim/.mode if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then FILE=/home/pi/CubeSatSim/battery_saver @@ -1444,12 +1444,14 @@ elif [ "$1" = "-G" ]; then elif [ "$1" = "-I" ]; then - echo "Changing to Pacsat Ground Station mode" - value=`cat /home/pi/CubeSatSim/.mode` + echo "Changing to PacSat Ground Station mode" + echo + echo "Run the Pacsat Ground Station in the Desktop" + value=`cat /home/pi/CubeSatSim/.mode` echo "$value" > /dev/null set -- $value - echo "changing CubeSatSim to Pacsat mode" +# echo "changing CubeSatSim to Pacsat mode" sudo echo "P" > /home/pi/CubeSatSim/.mode if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then FILE=/home/pi/CubeSatSim/battery_saver @@ -1462,8 +1464,6 @@ elif [ "$1" = "-I" ]; then restart=1 fi - - elif [ "$1" = "-h" ]; then echo "config OPTION" @@ -1500,8 +1500,8 @@ elif [ "$1" = "-h" ]; then echo " -o Change telemetry beacon transmit state" echo " -L Change microphone level for command and control" echo " -g Reset configuration back to default settings" - echo " -G Change to Pacsat mode" - echo " -I Changing to Pacsat Ground Station mode" + echo " -G Change to PacSatSim mode" + echo " -I Changing to PacSat Ground Station mode" echo exit From 99a280a6061d565e58324c4d6c96c4e5e810ff7f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 11 Feb 2026 22:57:33 -0500 Subject: [PATCH 382/554] Update main.h change PACSAT to 8 --- main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.h b/main.h index 83f993ae..068d45d6 100644 --- a/main.h +++ b/main.h @@ -108,7 +108,7 @@ FILE *telem_file; #define BPSK 3 #define SSTV 4 #define CW 5 -#define PACSAT 6 +#define PACSAT 8 #define REPEATER 11 #define TXCOMMAND 12 #define PACSATGND 13 From e14ec3569f179354936368e471dce808a232e7e6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 26 Feb 2026 11:06:05 -0500 Subject: [PATCH 383/554] Refactor telemetry CSV format and remove empty lines Removed unused lines and adjusted telemetry data format. --- spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv | 6 ------ 1 file changed, 6 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index 62f4b01f..cf5b8ff9 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -60,9 +60,3 @@ 58,realTime,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 59,realTime,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset 60,realTime,pad2,27,-,0,NONE,0,0,0,NONE,Filler - - - - - - From 50d07574682d32187c9c4a11e8fae952654217ac Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 09:52:00 -0500 Subject: [PATCH 385/554] Implement telemetry binary file saving for PACSAT mode Added PACSAT mode handling to save telemetry data to a binary file. --- main.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index f520add1..25ae2ed0 100644 --- a/main.c +++ b/main.c @@ -873,9 +873,9 @@ int main(int argc, char * argv[]) { sleep(rand_sleep); // fprintf(stderr, "INFO: Sleeping for extra %d sec\n", rand_sleep); - } else if ((mode == FSK) || (mode == BPSK)) {// FSK or BPSK + } else if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT)) {// FSK or BPSK get_tlm_fox(); - } else { // SSTV or PACSAT or PACSATGND + } else { // SSTV or PACSATGND // fprintf(stderr, "Sleeping\n"); sleep(30); } @@ -1562,7 +1562,22 @@ void get_tlm_fox() { encodeA(b, 63 + head_offset, 0x00); encodeA(b, 62 + head_offset, 0x01); encodeB(b, 74 + head_offset, 0xfff); - } + } + + if (mode == PACSAT) + { + telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); + if (telem_binary != NULL) { + int bytes_written = fwrite(b, 78, 1, telem_binary); + printf("Writing %d bytes to tlm.bin\n", bytes_written); + fclose(telem_binary); + } + else + printf("Error opening tlm.bin\n"); + } + else + + { short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; @@ -1873,7 +1888,8 @@ void get_tlm_fox() { firstTime = 0; // else if (frames_sent > 0) //5) // firstTime = 0; - + + } return; } From d098731eca97ffeab210948a5b5dd0fd02a45257 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 09:52:35 -0500 Subject: [PATCH 386/554] Declare telem_binary variable at the point of use --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 25ae2ed0..6804af68 100644 --- a/main.c +++ b/main.c @@ -1566,7 +1566,7 @@ void get_tlm_fox() { if (mode == PACSAT) { - telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); + FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { int bytes_written = fwrite(b, 78, 1, telem_binary); printf("Writing %d bytes to tlm.bin\n", bytes_written); From a9c574d4ede56e7514d413043a38342ce644e012 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 10:11:13 -0500 Subject: [PATCH 387/554] Fix extra brackets in main.c Removed extra brackets that were unnecessary in the code. --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 6804af68..8d1b7615 100644 --- a/main.c +++ b/main.c @@ -1576,7 +1576,7 @@ void get_tlm_fox() { printf("Error opening tlm.bin\n"); } else - + { // extra bracket for some reason? { short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; @@ -1890,6 +1890,7 @@ void get_tlm_fox() { // firstTime = 0; } + } // extra bracket for some reason? return; } From feab25f51c4cbbfaaa5fad494489b6e872c26e06 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 10:12:51 -0500 Subject: [PATCH 388/554] Fix fwrite call to use sizeof(char) for byte count --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 8d1b7615..3ff0e941 100644 --- a/main.c +++ b/main.c @@ -1568,7 +1568,7 @@ void get_tlm_fox() { { FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { - int bytes_written = fwrite(b, 78, 1, telem_binary); + int bytes_written = fwrite(b, sizeof(char), 78, telem_binary); printf("Writing %d bytes to tlm.bin\n", bytes_written); fclose(telem_binary); } From e82b0fb7b5016c25221c90f1783ecb5e973117a2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 10:39:20 -0500 Subject: [PATCH 389/554] Fix byte count for writing to tlm.bin to 70 --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 3ff0e941..f1d491ac 100644 --- a/main.c +++ b/main.c @@ -1568,7 +1568,7 @@ void get_tlm_fox() { { FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { - int bytes_written = fwrite(b, sizeof(char), 78, telem_binary); + int bytes_written = fwrite(b, sizeof(char), 70, telem_binary); printf("Writing %d bytes to tlm.bin\n", bytes_written); fclose(telem_binary); } From 195f8fac1a89969fca243deab970086cb257299b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 12:31:15 -0500 Subject: [PATCH 390/554] Add timestamp field to telemetry CSV Added a timestamp field to the telemetry data. --- .../PacSatSim_maxtelemetry.csv | 126 +++++++++--------- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv index 9bf2f291..7713c778 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv @@ -1,62 +1,64 @@ -61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION -0,MAX,Sensor 2,12,integer,1,NONE,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 -1,MAX,Sensor 3,12,integer,1,NONE,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 -2,MAX,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Battery Voltage,INA219 Battery Voltage -3,MAX,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis -4,MAX,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis -5,MAX,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis -6,MAX,BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Battery Current,INA219 Battery Current -7,MAX,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature -8,MAX,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,INA219 +X solar panel Voltage -9,MAX,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,INA219 +Y solar panel Voltage -10,MAX,posZv,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,INA219 +Z solar panel Voltage -11,MAX,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,INA219 -X solar panel Voltage -12,MAX,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,INA219 -Y solar panel Voltage -13,MAX,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,INA219 -Z solar panel Voltage -14,MAX,posXi,12,mA,cubesatsim_current,NONE,7,2,3,Current,INA219 +X solar panel Current -15,MAX,posYi,12,mA,cubesatsim_current,NONE,8,2,3,Current,INA219 +Y solar panel Current -16,MAX,posZi,12,mA,cubesatsim_current,NONE,9,2,3,Current,INA219 +Z solar panel Current -17,MAX,negXi,12,mA,cubesatsim_current,NONE,10,2,3,Current,INA219 -X solar panel Current -18,MAX,negYi,12,mA,cubesatsim_current,NONE,11,2,3,Current,INA219 -Y solar panel Current -19,MAX,negZi,12,mA,cubesatsim_current,NONE,12,2,3,Current,INA219 -Z solar panel Current -20,MAX,BATT2_V,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Battery 2 Voltage,INA219 Battery 2 Voltage -21,MAX,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -22,MAX,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure -23,MAX,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude -24,MAX,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count -25,MAX,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication -26,MAX,IHUcpuTemp,12,C,cubesatsim_temperature,NONE,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi -27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis -28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis -29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis -30,MAX,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,BME280 Humidity,BME280 Humidity -31,MAX,BAT2_I,12,mA,cubesatsim_current,NONE,5,2,3,Battery 2 Current,INA219 Battery 2 Current -32,MAX,DiodeTemp,12,C,cubesatsim_rpm,NONE,6,6,3,Diode Temp,STEM Payload Diode Temperature -33,MAX,Sensor 1,12,integer,1,NONE,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 -34,MAX,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator -35,MAX,SafeMode,1,-,STATUS_ON_OFF,NONE,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) -36,MAX,SimulatedTelemetry,1,-,STATUS_ON_OFF,NONE,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator -37,MAX,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator -38,MAX,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator -39,MAX,I2CBus1Failure,1,-,17,NONE,2,2,0,I2C Bus 1,I2C bus 1 failure indicator -40,MAX,I2CBus3Failure,1,-,17,NONE,2,3,0,I2C Bus 3,I2C bus 3 failure indicator -41,MAX,CameraFailure,1,-,17,NONE,2,4,0,Camera,Camera failure indicator -42,MAX,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received -43,MAX,RxAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status -44,MAX,TxAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status -45,MAX,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status -46,MAX,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted -47,MAX,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V -48,MAX,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected -49,MAX,rf6,12,-,0,NONE,0,0,0,None,None -50,MAX,rf7,12,-,0,NONE,0,0,0,None,None -51,MAX,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR -52,MAX,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) -53,MAX,pad,4,-,34,NONE,0,0,0,None,Unused -54,MAX,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance -55,MAX,pad1,1,-,0,NONE,0,0,0,NONE,Filler -56,MAX,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds -57,MAX,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information -58,MAX,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset -59,MAX,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset -60,MAX,pad2,27,-,0,NONE,0,0,0,NONE,Filler +62,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,long,timestamp,32,Sec,0,NONE,0,0,0,timestamp,This is the unix time in seconds +1,MAX,Sensor 2,12,integer,1,NONE,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +2,MAX,Sensor 3,12,integer,1,NONE,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +3,MAX,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Battery Voltage,INA219 Battery Voltage +4,MAX,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +5,MAX,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +6,MAX,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +7,MAX,BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Battery Current,INA219 Battery Current +8,MAX,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature +9,MAX,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,INA219 +X solar panel Voltage +10,MAX,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,INA219 +Y solar panel Voltage +11,MAX,posZv,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,INA219 +Z solar panel Voltage +12,MAX,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,INA219 -X solar panel Voltage +13,MAX,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,INA219 -Y solar panel Voltage +14,MAX,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,INA219 -Z solar panel Voltage +15,MAX,posXi,12,mA,cubesatsim_current,NONE,7,2,3,Current,INA219 +X solar panel Current +16,MAX,posYi,12,mA,cubesatsim_current,NONE,8,2,3,Current,INA219 +Y solar panel Current +17,MAX,posZi,12,mA,cubesatsim_current,NONE,9,2,3,Current,INA219 +Z solar panel Current +18,MAX,negXi,12,mA,cubesatsim_current,NONE,10,2,3,Current,INA219 -X solar panel Current +19,MAX,negYi,12,mA,cubesatsim_current,NONE,11,2,3,Current,INA219 -Y solar panel Current +20,MAX,negZi,12,mA,cubesatsim_current,NONE,12,2,3,Current,INA219 -Z solar panel Current +21,MAX,BATT2_V,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Battery 2 Voltage,INA219 Battery 2 Voltage +22,MAX,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +23,MAX,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +24,MAX,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude +25,MAX,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +26,MAX,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +27,MAX,IHUcpuTemp,12,C,cubesatsim_temperature,NONE,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi +28,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +29,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +30,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +31,MAX,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,BME280 Humidity,BME280 Humidity +32,MAX,BAT2_I,12,mA,cubesatsim_current,NONE,5,2,3,Battery 2 Current,INA219 Battery 2 Current +33,MAX,DiodeTemp,12,C,cubesatsim_rpm,NONE,6,6,3,Diode Temp,STEM Payload Diode Temperature +34,MAX,Sensor 1,12,integer,1,NONE,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +35,MAX,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator +36,MAX,SafeMode,1,-,STATUS_ON_OFF,NONE,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +37,MAX,SimulatedTelemetry,1,-,STATUS_ON_OFF,NONE,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator +38,MAX,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator +39,MAX,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +40,MAX,I2CBus1Failure,1,-,17,NONE,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +41,MAX,I2CBus3Failure,1,-,17,NONE,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +42,MAX,CameraFailure,1,-,17,NONE,2,4,0,Camera,Camera failure indicator +43,MAX,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received +44,MAX,RxAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status +45,MAX,TxAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status +46,MAX,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status +47,MAX,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +48,MAX,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +49,MAX,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +50,MAX,rf6,12,-,0,NONE,0,0,0,None,None +51,MAX,rf7,12,-,0,NONE,0,0,0,None,None +52,MAX,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +53,MAX,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +54,MAX,pad,4,-,34,NONE,0,0,0,None,Unused +55,MAX,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +56,MAX,pad1,1,-,0,NONE,0,0,0,NONE,Filler +57,MAX,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +58,MAX,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +59,MAX,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +60,MAX,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +61,MAX,pad2,27,-,0,NONE,0,0,0,NONE,Filler + From 903c4e1e1a269eef59e0999215199d1575d99a27 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 12:38:13 -0500 Subject: [PATCH 391/554] Modify telemetry CSV to add timestamp and update data types Updated telemetry data format to include timestamp and change data types from integer to float for various sensors. --- .../PacSatSim_rttelemetry.csv | 125 +++++++++--------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index cf5b8ff9..818c8360 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -1,62 +1,63 @@ -61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION -0,realTime,Sensor 2,12,integer,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 -1,realTime,Sensor 3,12,integer,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 -2,realTime,BATT_V,12,V,29,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage -3,realTime,SatelliteXAxisAcceleration,12,g,30,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis -4,realTime,SatelliteYAxisAcceleration,12,g,30,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis -5,realTime,SatelliteZAxisAcceleration,12,g,30,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis -6,realTime,BATT_I,12,mA,31,Battery,4,2,3,Battery Current,INA219 Battery Current -7,realTime,Temperature,12,C,5,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature -8,realTime,posXv,12,V,29,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage -9,realTime,posYv,12,V,29,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage -10,realTime,posZv,12,V,29,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage -11,realTime,negXv,12,V,29,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage -12,realTime,negYv,12,V,29,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage -13,realTime,negZv,12,V,29,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage -14,realTime,posXi,12,mA,31,+X Panel,7,2,3,Current,INA219 +X solar panel Current -15,realTime,posYi,12,mA,31,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current -16,realTime,posZi,12,mA,31,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current -17,realTime,negXi,12,mA,31,-X Panel,10,2,3,Current,INA219 -X solar panel Current -18,realTime,negYi,12,mA,31,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current -19,realTime,negZi,12,mA,31,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current -20,realTime,BATT2_V,12,V,29,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage -21,realTime,spin,12,rpm,32,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -22,realTime,Pressure,12,hPa,0,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure -23,realTime,Altitude,12,m,12,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude -24,realTime,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count -25,realTime,rssi,12,dBm,31,Radio,1,1,3,RSSI,Received Signal Strength Indication -26,realTime,IHUcpuTemp,12,C,5,Computer Hardware,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi -27,realTime,SatelliteXAxisAngularVelocity,12,dps,31,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis -28,realTime,SatelliteYAxisAngularVelocity,12,dps,31,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis -29,realTime,SatelliteZAxisAngularVelocity,12,dps,31,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis -30,realTime,Humidity,12,%,5,Experiments,6,5,3,BME280 Humidity,BME280 Humidity -31,realTime,BAT2_I,12,mA,31,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current -32,realTime,DiodeTemp,12,C,32,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature -33,realTime,Sensor 1,12,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 -34,realTime,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator -35,realTime,SafeMode,1,-,33,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) -36,realTime,SimulatedTelemetry,1,-,33,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator -37,realTime,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator -38,realTime,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator -39,realTime,I2CBus1Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator -40,realTime,I2CBus3Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 3,I2C bus 3 failure indicator -41,realTime,CameraFailure,1,-,17,Computer Hardware,2,4,0,Camera,Camera failure indicator -42,realTime,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received -43,realTime,RxAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status -44,realTime,TxAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status -45,realTime,C2CStatus,2,-,34,Computer Software,3,5,0,Command Control, Command & Control Status -46,realTime,ICR3VProt,12,V,0,NONE,7,2,3,3V Prot,ICR 3V Proteted -47,realTime,ICR2dot5V,12,V,0,NONE,7,3,3,2.5V,ICR 2.5V -48,realTime,ICR2dot5VProt,12,V,0,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected -49,realTime,rf6,12,-,0,NONE,0,0,0,None,None -50,realTime,rf7,12,-,0,NONE,0,0,0,None,None -51,realTime,MuxTest,12,V,0,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR -52,realTime,LtVGACtl,12,V,0,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) -53,realTime,pad,4,-,34,NONE,0,0,0,None,Unused -54,realTime,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance -55,realTime,pad1,1,-,0,NONE,0,0,0,NONE,Filler -56,realTime,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds -57,realTime,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information -58,realTime,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset -59,realTime,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset -60,realTime,pad2,27,-,0,NONE,0,0,0,NONE,Filler +62,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,long,timestamp,32,Sec,0,NONE,0,0,0,timestamp,This is the unix time in seconds +1,float,Sensor 2,12,integer,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +2,float,Sensor 3,12,integer,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +3,float,BATT_V,12,V,29,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage +4,float,SatelliteXAxisAcceleration,12,g,30,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +5,float,SatelliteYAxisAcceleration,12,g,30,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +6,float,SatelliteZAxisAcceleration,12,g,30,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +7,float,BATT_I,12,mA,31,Battery,4,2,3,Battery Current,INA219 Battery Current +8,float,Temperature,12,C,5,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature +9,float,posXv,12,V,29,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage +10,float,posYv,12,V,29,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage +11,float,posZv,12,V,29,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage +12,float,negXv,12,V,29,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage +13,float,negYv,12,V,29,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage +14,float,negZv,12,V,29,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage +15,float,posXi,12,mA,31,+X Panel,7,2,3,Current,INA219 +X solar panel Current +16,float,posYi,12,mA,31,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current +17,float,posZi,12,mA,31,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current +18,float,negXi,12,mA,31,-X Panel,10,2,3,Current,INA219 -X solar panel Current +19,float,negYi,12,mA,31,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current +20,float,negZi,12,mA,31,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current +21,float,BATT2_V,12,V,29,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage +22,float,spin,12,rpm,32,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +23,float,Pressure,12,hPa,0,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +24,float,Altitude,12,m,12,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude +25,float,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +26,float,rssi,12,dBm,31,Radio,1,1,3,RSSI,Received Signal Strength Indication +27,float,IHUcpuTemp,12,C,5,Computer Hardware,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi +28,float,SatelliteXAxisAngularVelocity,12,dps,31,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +29,float,SatelliteYAxisAngularVelocity,12,dps,31,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +30,float,SatelliteZAxisAngularVelocity,12,dps,31,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +31,float,Humidity,12,%,5,Experiments,6,5,3,BME280 Humidity,BME280 Humidity +32,float,BAT2_I,12,mA,31,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current +33,float,DiodeTemp,12,C,32,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature +34,float,Sensor 1,12,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +35,float,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator +36,float,SafeMode,1,-,33,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +37,float,SimulatedTelemetry,1,-,33,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator +38,float,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator +39,float,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +40,float,I2CBus1Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +41,float,I2CBus3Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +42,float,CameraFailure,1,-,17,Computer Hardware,2,4,0,Camera,Camera failure indicator +43,float,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received +44,float,RxAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status +45,float,TxAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status +46,float,C2CStatus,2,-,34,Computer Software,3,5,0,Command Control, Command & Control Status +47,float,ICR3VProt,12,V,0,NONE,7,2,3,3V Prot,ICR 3V Proteted +48,float,ICR2dot5V,12,V,0,NONE,7,3,3,2.5V,ICR 2.5V +49,float,ICR2dot5VProt,12,V,0,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +50,float,rf6,12,-,0,NONE,0,0,0,None,None +51,float,rf7,12,-,0,NONE,0,0,0,None,None +52,float,MuxTest,12,V,0,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +53,float,LtVGACtl,12,V,0,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +54,float,pad,4,-,34,NONE,0,0,0,None,Unused +55,float,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +56,float,pad1,1,-,0,NONE,0,0,0,NONE,Filler +57,float,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +58,float,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +59,float,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +60,float,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +61,float,pad2,27,-,0,NONE,0,0,0,NONE,Filler From 1e484a3beb6d227d1ced3f7fa17cbb736ce5438f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 12:47:05 -0500 Subject: [PATCH 392/554] Add timestamp at start of tlm --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index f1d491ac..2e83cf63 100644 --- a/main.c +++ b/main.c @@ -1568,8 +1568,10 @@ void get_tlm_fox() { { FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { + time_t now = time(0); + fwrite(b, sizeof(how), 1, &now); int bytes_written = fwrite(b, sizeof(char), 70, telem_binary); - printf("Writing %d bytes to tlm.bin\n", bytes_written); + printf("Writing %d bytes to tlm.bin\n", bytes_written + 4); fclose(telem_binary); } else From e686d1bf17787a84152501fc8b73ff12e116ac19 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 12:47:45 -0500 Subject: [PATCH 393/554] Fix fwrite size argument for time variable --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 2e83cf63..aab0a37a 100644 --- a/main.c +++ b/main.c @@ -1569,7 +1569,7 @@ void get_tlm_fox() { FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { time_t now = time(0); - fwrite(b, sizeof(how), 1, &now); + fwrite(b, sizeof(now), 1, &now); int bytes_written = fwrite(b, sizeof(char), 70, telem_binary); printf("Writing %d bytes to tlm.bin\n", bytes_written + 4); fclose(telem_binary); From 19bed2ab7368a7dd65119379abbd129d7e70f2f9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 12:48:42 -0500 Subject: [PATCH 394/554] Update main.c with correct time --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index aab0a37a..216b192e 100644 --- a/main.c +++ b/main.c @@ -1569,7 +1569,7 @@ void get_tlm_fox() { FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { time_t now = time(0); - fwrite(b, sizeof(now), 1, &now); + fwrite(b, sizeof(now), 1, now); int bytes_written = fwrite(b, sizeof(char), 70, telem_binary); printf("Writing %d bytes to tlm.bin\n", bytes_written + 4); fclose(telem_binary); From 5d2b573377c130b2a276cd5e0aa5647a284725ed Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 12:51:13 -0500 Subject: [PATCH 395/554] Update main.c fix timestamp --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 216b192e..b6e8c452 100644 --- a/main.c +++ b/main.c @@ -1568,8 +1568,8 @@ void get_tlm_fox() { { FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { - time_t now = time(0); - fwrite(b, sizeof(now), 1, now); + unsigned int now = (unsigned int)time(0); + fwrite(b, sizeof(now), 1, &now); int bytes_written = fwrite(b, sizeof(char), 70, telem_binary); printf("Writing %d bytes to tlm.bin\n", bytes_written + 4); fclose(telem_binary); From 67d4b97fde3034ec95f29596c9c38bbe63cb3c68 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 12:53:19 -0500 Subject: [PATCH 396/554] Update main.c fix timestamp write --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index b6e8c452..df40ddf3 100644 --- a/main.c +++ b/main.c @@ -1569,7 +1569,7 @@ void get_tlm_fox() { FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { unsigned int now = (unsigned int)time(0); - fwrite(b, sizeof(now), 1, &now); + fwrite(&now, sizeof(now), 1, telem_binary); int bytes_written = fwrite(b, sizeof(char), 70, telem_binary); printf("Writing %d bytes to tlm.bin\n", bytes_written + 4); fclose(telem_binary); From 83ebcba750a1dde9c5ff3546808fd8060d191b38 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 13:06:04 -0500 Subject: [PATCH 397/554] print battery voltage for debugging --- main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/main.c b/main.c index df40ddf3..e9f076ba 100644 --- a/main.c +++ b/main.c @@ -1342,6 +1342,7 @@ void get_tlm_fox() { // encodeA(b, 0 + head_offset, batt_a_v); // replaced by XS2 and XS3 below // encodeB(b, 1 + head_offset, batt_b_v); encodeA(b, 3 + head_offset, batt_c_v); + printf("batt_c_v: %d \n", batt_c_v); encodeB(b, 4 + head_offset, (int)(sensor[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel encodeA(b, 6 + head_offset, (int)(sensor[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel From b6f3537debc4641a52af3dba50763d73b46d2a92 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 13:12:01 -0500 Subject: [PATCH 398/554] Update main.c print b --- main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.c b/main.c index e9f076ba..69f40426 100644 --- a/main.c +++ b/main.c @@ -1569,6 +1569,14 @@ void get_tlm_fox() { { FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { + + int count; + printf("b is: \n"); + for (count = 0; count < 70; count++) { + printf("%02X", b[count]); + } + printf("\n"); + unsigned int now = (unsigned int)time(0); fwrite(&now, sizeof(now), 1, telem_binary); int bytes_written = fwrite(b, sizeof(char), 70, telem_binary); From 3f6dcead9befce80220eb856ba8205836cf5d047 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 13:18:35 -0500 Subject: [PATCH 399/554] Update main.c with index print --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 69f40426..5af47262 100644 --- a/main.c +++ b/main.c @@ -1342,7 +1342,7 @@ void get_tlm_fox() { // encodeA(b, 0 + head_offset, batt_a_v); // replaced by XS2 and XS3 below // encodeB(b, 1 + head_offset, batt_b_v); encodeA(b, 3 + head_offset, batt_c_v); - printf("batt_c_v: %d \n", batt_c_v); + printf("batt_c_v: %d 3+head_offset: %d\n", batt_c_v, 3+head_offset); encodeB(b, 4 + head_offset, (int)(sensor[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel encodeA(b, 6 + head_offset, (int)(sensor[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel From 7ce0510324fe9949826a99b35b8da9ed7b31aca7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 13:29:59 -0500 Subject: [PATCH 400/554] Update main.c print first 5 bytes of b --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index 5af47262..af617292 100644 --- a/main.c +++ b/main.c @@ -1341,7 +1341,9 @@ void get_tlm_fox() { // encodeA(b, 0 + head_offset, batt_a_v); // replaced by XS2 and XS3 below // encodeB(b, 1 + head_offset, batt_b_v); + printf("%02X%02X%02X%02X%02X\n", b[0],b[1],b[2],b[3],b[4]); encodeA(b, 3 + head_offset, batt_c_v); + printf("%02X%02X%02X%02X%02X\n", b[0],b[1],b[2],b[3],b[4]); printf("batt_c_v: %d 3+head_offset: %d\n", batt_c_v, 3+head_offset); encodeB(b, 4 + head_offset, (int)(sensor[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel From 3aee1d6a32287e1d23bd6ec996076718e114b94f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 13:35:39 -0500 Subject: [PATCH 401/554] Fix b declaration bug --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index af617292..27481725 100644 --- a/main.c +++ b/main.c @@ -1175,6 +1175,8 @@ void get_tlm_fox() { smaller = (int) (S_RATE / (2 * freq_Hz)); + if (mode == PACSAT) + dataLen = 78; short int b[dataLen]; short int b_max[dataLen]; short int b_min[dataLen]; @@ -1542,7 +1544,7 @@ void get_tlm_fox() { encodeA(b, 51 + head_offset, status); encodeB(b, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); - if (mode == BPSK) { + if ((mode == BPSK) || (mode == PACSAT)) { encodeA(b_max, 51 + head_offset, status); encodeA(b_min, 51 + head_offset, status); encodeB(b_max, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); From 536e03dd0e4d6ce538b2dd88759bb7433a20968f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 13:51:21 -0500 Subject: [PATCH 402/554] Update main.c print bytes of b[] --- main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 27481725..edd0ae0e 100644 --- a/main.c +++ b/main.c @@ -1574,16 +1574,18 @@ void get_tlm_fox() { FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); if (telem_binary != NULL) { + int bytes_written = 4; + unsigned int now = (unsigned int)time(0); + fwrite(&now, sizeof(now), 1, telem_binary); + int count; printf("b is: \n"); for (count = 0; count < 70; count++) { - printf("%02X", b[count]); + fwrite((char)b[count], 1, 1, telem_binary); + printf("%02X ", b[count]); + bytes_written++; } printf("\n"); - - unsigned int now = (unsigned int)time(0); - fwrite(&now, sizeof(now), 1, telem_binary); - int bytes_written = fwrite(b, sizeof(char), 70, telem_binary); printf("Writing %d bytes to tlm.bin\n", bytes_written + 4); fclose(telem_binary); } From a6beb17b670109d09b455a60813fc9719ab955e0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 13:53:15 -0500 Subject: [PATCH 403/554] Update main.c change to bytes --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index edd0ae0e..5707acae 100644 --- a/main.c +++ b/main.c @@ -1579,10 +1579,12 @@ void get_tlm_fox() { fwrite(&now, sizeof(now), 1, telem_binary); int count; + char byte; printf("b is: \n"); for (count = 0; count < 70; count++) { - fwrite((char)b[count], 1, 1, telem_binary); - printf("%02X ", b[count]); + byte = b[count]; + fwrite(&byte, 1, 1, telem_binary); + printf("%02X ", byte); bytes_written++; } printf("\n"); From 2b82a75a8553aa0a79426a162dc1d4900fc57c00 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 14:43:58 -0500 Subject: [PATCH 404/554] Update PacSatSim_rttelemetry.csv --- .../PacSatSim_rttelemetry.csv | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index 818c8360..6c4c6485 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -1,7 +1,7 @@ 62,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION 0,long,timestamp,32,Sec,0,NONE,0,0,0,timestamp,This is the unix time in seconds -1,float,Sensor 2,12,integer,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 -2,float,Sensor 3,12,integer,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +1,int,Sensor 2,12,1,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +2,int,Sensor 3,12,1,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 3,float,BATT_V,12,V,29,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage 4,float,SatelliteXAxisAcceleration,12,g,30,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis 5,float,SatelliteYAxisAcceleration,12,g,30,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis @@ -14,15 +14,15 @@ 12,float,negXv,12,V,29,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage 13,float,negYv,12,V,29,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage 14,float,negZv,12,V,29,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage -15,float,posXi,12,mA,31,+X Panel,7,2,3,Current,INA219 +X solar panel Current -16,float,posYi,12,mA,31,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current -17,float,posZi,12,mA,31,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current -18,float,negXi,12,mA,31,-X Panel,10,2,3,Current,INA219 -X solar panel Current -19,float,negYi,12,mA,31,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current -20,float,negZi,12,mA,31,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current +15,int,posXi,12,mA,31,+X Panel,7,2,3,Current,INA219 +X solar panel Current +16,int,posYi,12,mA,31,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current +17,int,posZi,12,mA,31,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current +18,int,negXi,12,mA,31,-X Panel,10,2,3,Current,INA219 -X solar panel Current +19,int,negYi,12,mA,31,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current +20,int,negZi,12,mA,31,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current 21,float,BATT2_V,12,V,29,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage 22,float,spin,12,rpm,32,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -23,float,Pressure,12,hPa,0,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +23,int,Pressure,12,hPa,0,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure 24,float,Altitude,12,m,12,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude 25,float,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count 26,float,rssi,12,dBm,31,Radio,1,1,3,RSSI,Received Signal Strength Indication @@ -33,18 +33,18 @@ 31,float,Humidity,12,%,5,Experiments,6,5,3,BME280 Humidity,BME280 Humidity 32,float,BAT2_I,12,mA,31,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current 33,float,DiodeTemp,12,C,32,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature -34,float,Sensor 1,12,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 -35,float,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator +34,int,Sensor 1,1,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +35,float,STEMPayloadStatus,1,-,35,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator 36,float,SafeMode,1,-,33,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) 37,float,SimulatedTelemetry,1,-,33,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator -38,float,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator -39,float,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator -40,float,I2CBus1Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator -41,float,I2CBus3Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 3,I2C bus 3 failure indicator -42,float,CameraFailure,1,-,17,Computer Hardware,2,4,0,Camera,Camera failure indicator -43,float,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received -44,float,RxAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status -45,float,TxAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status +38,float,PayloadStatus1,1,-,35,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator +39,float,I2CBus0Failure,1,-,35,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +40,float,I2CBus1Failure,1,-,35,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +41,float,I2CBus3Failure,1,-,35,Computer Hardware,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +42,float,CameraFailure,1,-,35,Computer Hardware,2,4,0,Camera,Camera failure indicator +43,int,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received +44,float,RxAntenna,1,-,36,Radio,1,3,0,RX Antenna,Receive antenna status +45,float,TxAntenna,1,-,36,Radio,1,2,0,TX Antenna,Transmit antenna status 46,float,C2CStatus,2,-,34,Computer Software,3,5,0,Command Control, Command & Control Status 47,float,ICR3VProt,12,V,0,NONE,7,2,3,3V Prot,ICR 3V Proteted 48,float,ICR2dot5V,12,V,0,NONE,7,3,3,2.5V,ICR 2.5V @@ -61,3 +61,4 @@ 59,float,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 60,float,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset 61,float,pad2,27,-,0,NONE,0,0,0,NONE,Filler + From e9d485cf5111eb3d0aec5047029df6a8c5c57f50 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 14:44:09 -0500 Subject: [PATCH 405/554] Update PacSatSim-coef.csv --- spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv index 46902f05..a683c5cc 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv @@ -31,8 +31,10 @@ 30,-,DivideBy100Offset,-20.48,0.01,0,0,0,0,None,0,4096,Divide by 100 with Offset 31,-,Offset,-2048,1,0,0,0,0,None,0,4096,Offset 32,-,DivideBy10Offset,-204.8,0.1,0,0,0,0,None,0,4096,Divide by 10 with Offset -33,-,Status,0,0,0,0,0,0,Enum,0,4096,ON:OFF +33,-,Status,0,0,0,0,0,0,Enum,0,4096,OFF:OFF 34,-,CommandStatus,0,0,0,0,0,0,Enum,0,4096,OFF:Carrier:DTMF/APRS +35,-,FailStatus,0,0,0,0,0,0,Enum,0,4096,FAIL:OK +36,-,AntStatus,0,0,0,0,0,0,Enum,0,4096,STOWED:DEPLOYED NOTES:,,,,,,,,,,,, Serial,Ignore,name,a,b,c,d,e,f,format,low limit,high limit,Comment Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,,,,,,,,,,, From 836b45a86794828016a7db97e2f61d6f018552b9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 14:49:11 -0500 Subject: [PATCH 406/554] Update PacSatSim_rttelemetry.csv remove blank lines at end --- spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv | 1 - 1 file changed, 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index 6c4c6485..84e00afd 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -61,4 +61,3 @@ 59,float,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 60,float,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset 61,float,pad2,27,-,0,NONE,0,0,0,NONE,Filler - From 501769acea9ba0630a5d4238b6cfd8321d39447a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 15:04:30 -0500 Subject: [PATCH 407/554] Update PacSatSim-coef.csv fix On/Off --- spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv index a683c5cc..16ffe513 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv @@ -31,7 +31,7 @@ 30,-,DivideBy100Offset,-20.48,0.01,0,0,0,0,None,0,4096,Divide by 100 with Offset 31,-,Offset,-2048,1,0,0,0,0,None,0,4096,Offset 32,-,DivideBy10Offset,-204.8,0.1,0,0,0,0,None,0,4096,Divide by 10 with Offset -33,-,Status,0,0,0,0,0,0,Enum,0,4096,OFF:OFF +33,-,Status,0,0,0,0,0,0,Enum,0,4096,OFF:ON 34,-,CommandStatus,0,0,0,0,0,0,Enum,0,4096,OFF:Carrier:DTMF/APRS 35,-,FailStatus,0,0,0,0,0,0,Enum,0,4096,FAIL:OK 36,-,AntStatus,0,0,0,0,0,0,Enum,0,4096,STOWED:DEPLOYED From 03a06b453dd50101a2ead16edd67fe7a40cfc9a6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 15:08:49 -0500 Subject: [PATCH 408/554] Update PacSatSim_rttelemetry.csv fix commands count --- spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index 84e00afd..73c94314 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -42,7 +42,7 @@ 40,float,I2CBus1Failure,1,-,35,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator 41,float,I2CBus3Failure,1,-,35,Computer Hardware,2,3,0,I2C Bus 3,I2C bus 3 failure indicator 42,float,CameraFailure,1,-,35,Computer Hardware,2,4,0,Camera,Camera failure indicator -43,int,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received +43,int,GroundCommands,4,-,2,Computer Software,3,3,0,Ground Commands,Number of ground commands received 44,float,RxAntenna,1,-,36,Radio,1,3,0,RX Antenna,Receive antenna status 45,float,TxAntenna,1,-,36,Radio,1,2,0,TX Antenna,Transmit antenna status 46,float,C2CStatus,2,-,34,Computer Software,3,5,0,Command Control, Command & Control Status @@ -61,3 +61,4 @@ 59,float,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 60,float,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset 61,float,pad2,27,-,0,NONE,0,0,0,NONE,Filler + From 18f67be38d80ea6ec1fa868927de225716050e71 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 15:10:15 -0500 Subject: [PATCH 409/554] Update PacSatSim_rttelemetry.csv remove extra blank lines at end --- spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv | 1 - 1 file changed, 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index 73c94314..df8217cb 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -61,4 +61,3 @@ 59,float,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 60,float,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset 61,float,pad2,27,-,0,NONE,0,0,0,NONE,Filler - From ab26f6f34384a45505d0abbc40cfa50f9d95ea95 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:04:35 -0500 Subject: [PATCH 411/554] cleanup --- main.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/main.c b/main.c index 5707acae..395d67db 100644 --- a/main.c +++ b/main.c @@ -1343,10 +1343,7 @@ void get_tlm_fox() { // encodeA(b, 0 + head_offset, batt_a_v); // replaced by XS2 and XS3 below // encodeB(b, 1 + head_offset, batt_b_v); - printf("%02X%02X%02X%02X%02X\n", b[0],b[1],b[2],b[3],b[4]); encodeA(b, 3 + head_offset, batt_c_v); - printf("%02X%02X%02X%02X%02X\n", b[0],b[1],b[2],b[3],b[4]); - printf("batt_c_v: %d 3+head_offset: %d\n", batt_c_v, 3+head_offset); encodeB(b, 4 + head_offset, (int)(sensor[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel encodeA(b, 6 + head_offset, (int)(sensor[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel @@ -1898,11 +1895,6 @@ void get_tlm_fox() { //transmitStatus = -1; } } - if (!transmit) { - fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n"); - fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); - } - if (socket_open == 1) firstTime = 0; // else if (frames_sent > 0) //5) @@ -1910,6 +1902,12 @@ void get_tlm_fox() { } } // extra bracket for some reason? + + if (!transmit) { + fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n"); + fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); + } + return; } From 9bb0dbac56135556156d01b2867ef50ccd8ce8ed Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:14:37 -0500 Subject: [PATCH 412/554] Update log with -h and r option for realtime --- log | 74 ++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 18 deletions(-) diff --git a/log b/log index f5b301c5..55f3c9c1 100755 --- a/log +++ b/log @@ -2,26 +2,64 @@ echo -e "\nLog file script for CubeSatSim\n" -echo "To exit, type Control-C" +if [ "$1" = "-h" ] ; then + echo "Displays systemd logs for the chose process. The choices are:" + echo " -d cubesatsim (also no choice gives you this)" + echo " -t transmit " + echo " -c command and control" + echo "Default is the log is dumpted to the screen and written to a file." + echo "If an additional r is included, the log is realtime, and exits with a Control-C" + echo + exit +fi + +REALTIME=0 +if [ "$2" = "r" ] ; then + REALTIME=1 +fi -echo +if [ "$REALTIME" = "1" ] ; then -sleep 2 + echo "To exit, type Control-C" + echo + sleep 2 + + if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then + sudo journalctl -af -u transmit # > /home/pi/CubeSatSim/logt.txt + # cat /home/pi/CubeSatSim/logt.txt + # echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" + elif [ "$1" = "-c" ]; then + sudo journalctl -af -u command # > /home/pi/CubeSatSim/logc.txt + cat /home/pi/CubeSatSim/logc.txt + # echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" + elif [ "$1" = "-p" ]; then + sudo journalctl -af -u pacsatsim # > /home/pi/CubeSatSim/logp.txt + cat /home/pi/CubeSatSim/logp.txt + # echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" + else + sudo journalctl -af -u cubesatsim # > /home/pi/CubeSatSim/log.txt + # cat /home/pi/CubeSatSim/log.txt + # echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" + fi -if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then - sudo journalctl -af -u transmit # > /home/pi/CubeSatSim/logt.txt -# cat /home/pi/CubeSatSim/logt.txt -# echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" -elif [ "$1" = "-c" ]; then - sudo journalctl -af -u command # > /home/pi/CubeSatSim/logc.txt - cat /home/pi/CubeSatSim/logc.txt -# echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" -elif [ "$1" = "-p" ]; then - sudo journalctl -af -u pacsatsim # > /home/pi/CubeSatSim/logp.txt - cat /home/pi/CubeSatSim/logp.txt -# echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" else - sudo journalctl -af -u cubesatsim # > /home/pi/CubeSatSim/log.txt -# cat /home/pi/CubeSatSim/log.txt -# echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" + + if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then + sudo journalctl -u transmit > /home/pi/CubeSatSim/logt.txt + cat /home/pi/CubeSatSim/logt.txt + echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" + elif [ "$1" = "-c" ]; then + sudo journalctl -u command > /home/pi/CubeSatSim/logc.txt + cat /home/pi/CubeSatSim/logc.txt + echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" + elif [ "$1" = "-p" ]; then + sudo journalctl -u pacsatsim > /home/pi/CubeSatSim/logp.txt + cat /home/pi/CubeSatSim/logp.txt + echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" + else + sudo journalctl -u cubesatsim > /home/pi/CubeSatSim/log.txt + cat /home/pi/CubeSatSim/log.txt + echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" + fi + fi From ef4627cd76a2dcc58c03c100d0daa48a8df1b59b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:16:49 -0500 Subject: [PATCH 413/554] Update log add back -a --- log | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/log b/log index 55f3c9c1..a516a3c0 100755 --- a/log +++ b/log @@ -5,8 +5,9 @@ echo -e "\nLog file script for CubeSatSim\n" if [ "$1" = "-h" ] ; then echo "Displays systemd logs for the chose process. The choices are:" echo " -d cubesatsim (also no choice gives you this)" - echo " -t transmit " + echo " -t transmit" echo " -c command and control" + echo " -p pacsat" echo "Default is the log is dumpted to the screen and written to a file." echo "If an additional r is included, the log is realtime, and exits with a Control-C" echo @@ -45,19 +46,19 @@ if [ "$REALTIME" = "1" ] ; then else if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then - sudo journalctl -u transmit > /home/pi/CubeSatSim/logt.txt + sudo journalctl -a -u transmit > /home/pi/CubeSatSim/logt.txt cat /home/pi/CubeSatSim/logt.txt echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" elif [ "$1" = "-c" ]; then - sudo journalctl -u command > /home/pi/CubeSatSim/logc.txt + sudo journalctl -a -u command > /home/pi/CubeSatSim/logc.txt cat /home/pi/CubeSatSim/logc.txt echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" elif [ "$1" = "-p" ]; then - sudo journalctl -u pacsatsim > /home/pi/CubeSatSim/logp.txt + sudo journalctl -a -u pacsatsim > /home/pi/CubeSatSim/logp.txt cat /home/pi/CubeSatSim/logp.txt echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" else - sudo journalctl -u cubesatsim > /home/pi/CubeSatSim/log.txt + sudo journalctl -a -u cubesatsim > /home/pi/CubeSatSim/log.txt cat /home/pi/CubeSatSim/log.txt echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" fi From d20b8e625f009c370ca36b44b72779e26053152c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:26:21 -0500 Subject: [PATCH 414/554] Update main.c reset firstTime --- main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.c b/main.c index 395d67db..9eb4fe5d 100644 --- a/main.c +++ b/main.c @@ -1907,6 +1907,9 @@ void get_tlm_fox() { fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n"); fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); } + + if (firstTime && (mode == PACSAT)) + firstTime = 0; return; } From 377f9090d6b3e779c57a706db370a7a817898849 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:32:46 -0500 Subject: [PATCH 415/554] Update main.c print for first time off --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 9eb4fe5d..b848460b 100644 --- a/main.c +++ b/main.c @@ -1909,8 +1909,10 @@ void get_tlm_fox() { } if (firstTime && (mode == PACSAT)) - firstTime = 0; - + { + firstTime = OFF; + fprintf(stderr, "No longer first time\n"); + } return; } From da78c071f19ee39a12902c4a9170ba07f05bd3ba Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:34:10 -0500 Subject: [PATCH 416/554] Update main.c add fflush --- main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/main.c b/main.c index b848460b..8d67227e 100644 --- a/main.c +++ b/main.c @@ -1912,6 +1912,7 @@ void get_tlm_fox() { { firstTime = OFF; fprintf(stderr, "No longer first time\n"); + fflush(stdout); } return; } From 8e8a4b3dee1f881e26af3289c805dd99f2fedfb2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:37:57 -0500 Subject: [PATCH 418/554] Update main.c comment out first time --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 8d67227e..a38404fe 100644 --- a/main.c +++ b/main.c @@ -1908,12 +1908,12 @@ void get_tlm_fox() { fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); } - if (firstTime && (mode == PACSAT)) - { - firstTime = OFF; - fprintf(stderr, "No longer first time\n"); - fflush(stdout); - } +// if (firstTime && (mode == PACSAT)) +// { +// firstTime = OFF; +// fprintf(stderr, "No longer first time\n"); +// fflush(stdout); +// } return; } From 368883dcd97dc456f2523c7e404b0252aca7fed9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:41:32 -0500 Subject: [PATCH 419/554] Update main.c move sampleTime set --- main.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/main.c b/main.c index a38404fe..e0395330 100644 --- a/main.c +++ b/main.c @@ -1883,8 +1883,7 @@ void get_tlm_fox() { printf("socket resend %d in %d ms bytes: %d \n\n",times, millis() - start, sock_ret); } } - sampleTime = (unsigned int) millis(); // resetting time for sleeping - fflush(stdout); + // if (firstTime == 1) // max -= 1; } @@ -1908,12 +1907,16 @@ void get_tlm_fox() { fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); } -// if (firstTime && (mode == PACSAT)) -// { -// firstTime = OFF; -// fprintf(stderr, "No longer first time\n"); -// fflush(stdout); -// } + if (firstTime && (mode == PACSAT)) + { + firstTime = OFF; + fprintf(stderr, "No longer first time\n"); + fflush(stdout); + } + + sampleTime = (unsigned int) millis(); // resetting time for sleeping + fflush(stdout); + return; } From 8d9fb6b481b2731a3840588648276b705385acdb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:43:51 -0500 Subject: [PATCH 420/554] Update main.c revert last change --- main.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/main.c b/main.c index e0395330..a38404fe 100644 --- a/main.c +++ b/main.c @@ -1883,7 +1883,8 @@ void get_tlm_fox() { printf("socket resend %d in %d ms bytes: %d \n\n",times, millis() - start, sock_ret); } } - + sampleTime = (unsigned int) millis(); // resetting time for sleeping + fflush(stdout); // if (firstTime == 1) // max -= 1; } @@ -1907,16 +1908,12 @@ void get_tlm_fox() { fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); } - if (firstTime && (mode == PACSAT)) - { - firstTime = OFF; - fprintf(stderr, "No longer first time\n"); - fflush(stdout); - } - - sampleTime = (unsigned int) millis(); // resetting time for sleeping - fflush(stdout); - +// if (firstTime && (mode == PACSAT)) +// { +// firstTime = OFF; +// fprintf(stderr, "No longer first time\n"); +// fflush(stdout); +// } return; } From 2c7bfa025a53ab229ec02d3cf3e207f1f3b9c644 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:46:09 -0500 Subject: [PATCH 421/554] Update main.c try turning firstTime off a different place --- main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index a38404fe..42ea344c 100644 --- a/main.c +++ b/main.c @@ -1230,9 +1230,12 @@ void get_tlm_fox() { fflush(stdout); sampleTime = (unsigned int) millis(); - } else + } else + { printf("first time - no sleep\n"); - + firstTime = OFF; + } + printf("++++ Loop time: %5.3f sec +++++\n", (millis() - loopTime)/1000.0); fflush(stdout); loopTime = millis(); From 8b8ddc567b8bd499ff411f83759f07e2abbcad8e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:47:59 -0500 Subject: [PATCH 422/554] Update main.c move sampleTime --- main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.c b/main.c index 42ea344c..07af1578 100644 --- a/main.c +++ b/main.c @@ -1228,13 +1228,12 @@ void get_tlm_fox() { /**/ printf("Start sleep %d Sleep period: %d while period: %d\n", startSleep, millis() - startSleep, (unsigned int)frameTime - 750 + pi_zero_2_offset); fflush(stdout); - - sampleTime = (unsigned int) millis(); } else { printf("first time - no sleep\n"); firstTime = OFF; } + sampleTime = (unsigned int) millis(); printf("++++ Loop time: %5.3f sec +++++\n", (millis() - loopTime)/1000.0); fflush(stdout); From 3a805cbfe0fdabcd98c1ccc34975807ef17ecd71 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:49:37 -0500 Subject: [PATCH 423/554] Update main.c again revert --- main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 07af1578..a38404fe 100644 --- a/main.c +++ b/main.c @@ -1228,13 +1228,11 @@ void get_tlm_fox() { /**/ printf("Start sleep %d Sleep period: %d while period: %d\n", startSleep, millis() - startSleep, (unsigned int)frameTime - 750 + pi_zero_2_offset); fflush(stdout); - } else - { + + sampleTime = (unsigned int) millis(); + } else printf("first time - no sleep\n"); - firstTime = OFF; - } - sampleTime = (unsigned int) millis(); - + printf("++++ Loop time: %5.3f sec +++++\n", (millis() - loopTime)/1000.0); fflush(stdout); loopTime = millis(); From d05019609d05268f23a14809b455112f9d7de424 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 18:53:14 -0500 Subject: [PATCH 424/554] Update main.c write b to dataLen --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index a38404fe..f9c42d01 100644 --- a/main.c +++ b/main.c @@ -1578,7 +1578,7 @@ void get_tlm_fox() { int count; char byte; printf("b is: \n"); - for (count = 0; count < 70; count++) { + for (count = 0; count < dataLen; count++) { byte = b[count]; fwrite(&byte, 1, 1, telem_binary); printf("%02X ", byte); From 5d32e76ca90de74dc5b30f8200d90c38d7a8b710 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 19:10:02 -0500 Subject: [PATCH 425/554] Update pacsatsim.sh with pacsat_telem --- pacsatsim.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index 76e37d1c..8e89588d 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -201,6 +201,8 @@ else echo fi +sudo /home/pi/pacsat_telem/Debug/pacsat_telem -v -d /home/pi/PacSat/pacsat & + sleep 5 value=`aplay -l | grep "Loopback"` From 1721b465288d6eca23d017a4c91f869d56d3f751 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 19:32:14 -0500 Subject: [PATCH 426/554] Update install add pacsat_telem install --- install | 87 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/install b/install index 40c70f12..1d4c8926 100755 --- a/install +++ b/install @@ -124,49 +124,54 @@ cd rpitx ./install.sh -cd - -git clone https://github.com/alanbjohnston/iors_common.git - -cd iors_common/Debug/ - -make all - -sudo ./install.sh - -cd - -#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 - -make all - -mkdir /home/pi/PacSat -mkdir /home/pi/PacSat/pacsat -mkdir /home/pi/PacSat/pacsat/dir -export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH - -#value=`cat /home/pi/CubeSatSim/sim.cfg` -#echo "$value" > /dev/null -#set -- $value - -echo "bit_rate=9600" > pacsat.config -echo "bbs_callsign=AMSAT-12" >> pacsat.config -echo "broadcast_callsign=AMSAT-11" >> pacsat.config -echo "digi_callsign=AMSAT-1" >> pacsat.config -echo "max_frames_in_tx_buffer=5" >> pacsat.config +FILE=/home/pi/pi_pacsat/Debug/pi_pacsat # code has already been compiled +if [ -f "$FILE" ]; then + cd + git clone https://github.com/alanbjohnston/iors_common.git + cd iors_common/Debug/ + make all + sudo ./install.sh + + cd + #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 + make all + + mkdir /home/pi/PacSat + mkdir /home/pi/PacSat/pacsat + mkdir /home/pi/PacSat/pacsat/dir + + export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + + #value=`cat /home/pi/CubeSatSim/sim.cfg` + #echo "$value" > /dev/null + #set -- $value + + echo "bit_rate=9600" > pacsat.config + echo "bbs_callsign=AMSAT-12" >> pacsat.config + echo "broadcast_callsign=AMSAT-11" >> pacsat.config + echo "digi_callsign=AMSAT-1" >> pacsat.config + echo "max_frames_in_tx_buffer=5" >> pacsat.config + + echo "pb_open=1" > pacsat.state + echo "uplink_open=1" >> pacsat.state + echo "pb_max_period_for_client_in_seconds=60" >> pacsat.state + echo "uplink_max_period_for_client_in_seconds=60" >> pacsat.state +fi -echo "pb_open=1" > pacsat.state -echo "uplink_open=1" >> pacsat.state -echo "pb_max_period_for_client_in_seconds=60" >> pacsat.state -echo "uplink_max_period_for_client_in_seconds=60" >> pacsat.state +FILE=/home/pi/pacsat_telem/Debug/pacsat_telem # code has already been compiled +if [ -f "$FILE" ]; then + cd + git clone https://github.com/alanbjohnston/pacsat_telem.git + cd pacsat_telem + git checkout master-fox + cd Debug + make all +fi sudo sed -i 's/#hdmi_group=1/hdmi_group=2/g' /boot/config.txt sudo sed -i 's/#hdmi_mode=1/hdmi_mode=16/g' /boot/config.txt From c52a8854199aaff03320f72f3eb822414ae4234f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 19:37:12 -0500 Subject: [PATCH 427/554] Update PacSatSim_rttelemetry.csv fixed sensor 1 size --- spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index df8217cb..f6e7f4c4 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -33,7 +33,7 @@ 31,float,Humidity,12,%,5,Experiments,6,5,3,BME280 Humidity,BME280 Humidity 32,float,BAT2_I,12,mA,31,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current 33,float,DiodeTemp,12,C,32,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature -34,int,Sensor 1,1,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +34,int,Sensor 1,12,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 35,float,STEMPayloadStatus,1,-,35,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator 36,float,SafeMode,1,-,33,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) 37,float,SimulatedTelemetry,1,-,33,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator @@ -61,3 +61,4 @@ 59,float,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 60,float,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset 61,float,pad2,27,-,0,NONE,0,0,0,NONE,Filler + From 3d2836c3acfbca162d490393fd2ade2893e6b7c5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 19:49:39 -0500 Subject: [PATCH 428/554] Update main.c turn firstTime off with sleepTime set --- main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index f9c42d01..9b67d612 100644 --- a/main.c +++ b/main.c @@ -461,7 +461,8 @@ int main(int argc, char * argv[]) { printf("\n FSK Mode, %d bits per frame, %d bits per second, %d ms per frame, %d ms sample period\n", bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod); - } else if (mode == BPSK) { +// } else if (mode == BPSK) { + } else { bitRate = 1200; rsFrames = 3; payloads = 6; @@ -873,7 +874,7 @@ int main(int argc, char * argv[]) { sleep(rand_sleep); // fprintf(stderr, "INFO: Sleeping for extra %d sec\n", rand_sleep); - } else if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT)) {// FSK or BPSK + } else if ((mode == FSK) || (mode == BPSK) || (AT)) {// FSK or BPSK get_tlm_fox(); } else { // SSTV or PACSATGND // fprintf(stderr, "Sleeping\n"); @@ -1175,8 +1176,8 @@ void get_tlm_fox() { smaller = (int) (S_RATE / (2 * freq_Hz)); - if (mode == PACSAT) - dataLen = 78; +// if (mode == PACSAT) +// dataLen = 78; short int b[dataLen]; short int b_max[dataLen]; short int b_min[dataLen]; @@ -1231,7 +1232,10 @@ void get_tlm_fox() { sampleTime = (unsigned int) millis(); } else + { printf("first time - no sleep\n"); + firstTime = OFF; + } printf("++++ Loop time: %5.3f sec +++++\n", (millis() - loopTime)/1000.0); fflush(stdout); From dc9cdb2034d2d33de9c5e1653479af19fa84e816 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 19:51:46 -0500 Subject: [PATCH 429/554] Update main.c fix missing mode == PACSAT --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 9b67d612..2ce98d40 100644 --- a/main.c +++ b/main.c @@ -874,7 +874,7 @@ int main(int argc, char * argv[]) { sleep(rand_sleep); // fprintf(stderr, "INFO: Sleeping for extra %d sec\n", rand_sleep); - } else if ((mode == FSK) || (mode == BPSK) || (AT)) {// FSK or BPSK + } else if ((mode == FSK) || (mode == BPSK) || (mode == PACAT)) {// FSK or BPSK get_tlm_fox(); } else { // SSTV or PACSATGND // fprintf(stderr, "Sleeping\n"); From 74cdc3609a383d24e9fb95d7ce1bfd9cf9cee100 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 19:52:20 -0500 Subject: [PATCH 430/554] Update main.c PACAT typo --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 2ce98d40..42e07e43 100644 --- a/main.c +++ b/main.c @@ -874,7 +874,7 @@ int main(int argc, char * argv[]) { sleep(rand_sleep); // fprintf(stderr, "INFO: Sleeping for extra %d sec\n", rand_sleep); - } else if ((mode == FSK) || (mode == BPSK) || (mode == PACAT)) {// FSK or BPSK + } else if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT)) {// FSK or BPSK get_tlm_fox(); } else { // SSTV or PACSATGND // fprintf(stderr, "Sleeping\n"); From f68ac4909508aece6c8a8285f8498660ff6921d3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 20:23:12 -0500 Subject: [PATCH 431/554] Update main.c start and stop pacsatsim.service --- main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 42e07e43..174a3bbb 100644 --- a/main.c +++ b/main.c @@ -236,7 +236,7 @@ int main(int argc, char * argv[]) { printf("Mode is Transmit Command\n"); } else if ( mode_string == 'p') { mode = PACSAT; - printf("Mode is Pacsat\n"); + printf("Mode is Pacsat\n"); } else if ( mode_string == 'P') { mode = PACSATGND; printf("Mode is Pacsat Ground Station\n"); @@ -246,6 +246,15 @@ int main(int argc, char * argv[]) { } } + if ( mode == PACSAT) { + FILE * pacsat_file = popen("sudo systemctl start cubesatsim", "r"); + pclose(pacsat_file); + } + else { + FILE * pacsat_file = popen("sudo systemctl stop cubesatsim", "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 18ebea9d555765ada81226c8ae6876db2fd03c33 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 20:30:30 -0500 Subject: [PATCH 432/554] Update main.c change to start/stop pacsatsim --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 174a3bbb..6634b079 100644 --- a/main.c +++ b/main.c @@ -247,11 +247,11 @@ int main(int argc, char * argv[]) { } if ( mode == PACSAT) { - FILE * pacsat_file = popen("sudo systemctl start cubesatsim", "r"); + FILE * pacsat_file = popen("sudo systemctl start pacsatsim", "r"); pclose(pacsat_file); } else { - FILE * pacsat_file = popen("sudo systemctl stop cubesatsim", "r"); + FILE * pacsat_file = popen("sudo systemctl stop pacsatsim", "r"); pclose(pacsat_file); } From 62fbf30df797265f7dd937ab49476ac7d652019d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 21:02:15 -0500 Subject: [PATCH 433/554] Update main.c print simulated telemetry mode --- main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/main.c b/main.c index 6634b079..f390000a 100644 --- a/main.c +++ b/main.c @@ -698,6 +698,7 @@ int main(int argc, char * argv[]) { } if (sim_mode) { // simulated telemetry + printf("Simulated telemetry mode\n"); double time = ((long int)millis() - time_start) / 1000.0; From e1b25b9aad53f10744d365ebeb20e77f15189f48 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 21:05:24 -0500 Subject: [PATCH 434/554] Update main.c print simulated currents --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index f390000a..e09eb4b5 100644 --- a/main.c +++ b/main.c @@ -747,7 +747,7 @@ int main(int argc, char * argv[]) { current[map[BAT]] = ((current[map[BAT2]] * voltage[map[BAT2]]) / batt) - charging; - // printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BAT2]], batt, voltage[map[BAT2]]); + printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BAT2]], batt, voltage[map[BAT2]]); batt -= (batt > 3.5) ? current[map[BAT]] / 30000 : current[map[BAT]] / 3000; if (batt < 3.0) { From 50c51e8993db6e730405a3eb49fe32004f1d1a8b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 21:11:15 -0500 Subject: [PATCH 435/554] Update main.c fix simulated current --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index e09eb4b5..3561af56 100644 --- a/main.c +++ b/main.c @@ -745,7 +745,8 @@ int main(int argc, char * argv[]) { // float charging = current[map[PLUS_X]] + current[map[MINUS_X]] + current[map[PLUS_Y]] + current[map[MINUS_Y]] + current[map[PLUS_Z]] + current[map[MINUS_Z]]; float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0)); - current[map[BAT]] = ((current[map[BAT2]] * voltage[map[BAT2]]) / batt) - charging; +// current[map[BAT]] = ((current[map[BAT2]] * voltage[map[BAT2]]) / batt) - charging; + current[map[BAT]] = rnd_float(320, 510) - charging; printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BAT2]], batt, voltage[map[BAT2]]); From 54f2e5eb373152caf955754719a56324a37eb438 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 07:52:29 -0500 Subject: [PATCH 436/554] Update PacSatSim_rttelemetry.csv from pacsat-v2.2-tlm2 --- .../PacSatGround_0.46o/PacSatSim_rttelemetry.csv | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv index f6e7f4c4..ca11e389 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -1,12 +1,12 @@ 62,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION 0,long,timestamp,32,Sec,0,NONE,0,0,0,timestamp,This is the unix time in seconds -1,int,Sensor 2,12,1,1,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 -2,int,Sensor 3,12,1,1,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +1,int,Sensor 2,12,integer,2,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +2,int,Sensor 3,12,integer,2,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 3,float,BATT_V,12,V,29,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage 4,float,SatelliteXAxisAcceleration,12,g,30,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis 5,float,SatelliteYAxisAcceleration,12,g,30,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis 6,float,SatelliteZAxisAcceleration,12,g,30,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis -7,float,BATT_I,12,mA,31,Battery,4,2,3,Battery Current,INA219 Battery Current +7,int,BATT_I,12,mA,31,Battery,4,2,3,Battery Current,INA219 Battery Current 8,float,Temperature,12,C,5,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature 9,float,posXv,12,V,29,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage 10,float,posYv,12,V,29,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage @@ -31,9 +31,9 @@ 29,float,SatelliteYAxisAngularVelocity,12,dps,31,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis 30,float,SatelliteZAxisAngularVelocity,12,dps,31,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis 31,float,Humidity,12,%,5,Experiments,6,5,3,BME280 Humidity,BME280 Humidity -32,float,BAT2_I,12,mA,31,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current +32,int,BAT2_I,12,mA,31,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current 33,float,DiodeTemp,12,C,32,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature -34,int,Sensor 1,12,integer,1,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +34,int,Sensor 1,12,integer,2,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 35,float,STEMPayloadStatus,1,-,35,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator 36,float,SafeMode,1,-,33,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) 37,float,SimulatedTelemetry,1,-,33,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator @@ -61,4 +61,3 @@ 59,float,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 60,float,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset 61,float,pad2,27,-,0,NONE,0,0,0,NONE,Filler - From 3c7dc63dcdc1846252242b9ce00cd5564348cf1f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 07:59:26 -0500 Subject: [PATCH 437/554] Update main.c don't print BPSK config in PACSAT mode --- main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 3561af56..edb162d7 100644 --- a/main.c +++ b/main.c @@ -493,8 +493,11 @@ int main(int argc, char * argv[]) { frameTime = ((float)((float)bufLen / (samples * frameCnt * bitRate))) * 1000; // frame time in ms - printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d ms per frame %d ms sample period\n", - bufLen, bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod); + if (mode == BPSK) + printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d ms per frame %d ms sample period\n", + bufLen, bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod); + else + printf("\n dataLen: %d \n", dataLen); sin_samples = S_RATE/freq_Hz; // printf("Sin map: "); @@ -510,7 +513,7 @@ int main(int argc, char * argv[]) { memset(sensor, 0, sizeof(sensor)); memset(other, 0, sizeof(other)); - if (((mode == FSK) || (mode == BPSK))) // && !sim_mode) + if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT) // && !sim_mode) get_tlm_fox(); // fill transmit buffer with reset count 0 packets that will be ignored firstTime = 1; From 1cf2d7db43c24b8e647f2932ba61a187e31de252 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 08:02:04 -0500 Subject: [PATCH 438/554] Update PacSatSim-coef.csv swap FAIL and OK --- spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv index 16ffe513..48187077 100644 --- a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv +++ b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv @@ -33,7 +33,7 @@ 32,-,DivideBy10Offset,-204.8,0.1,0,0,0,0,None,0,4096,Divide by 10 with Offset 33,-,Status,0,0,0,0,0,0,Enum,0,4096,OFF:ON 34,-,CommandStatus,0,0,0,0,0,0,Enum,0,4096,OFF:Carrier:DTMF/APRS -35,-,FailStatus,0,0,0,0,0,0,Enum,0,4096,FAIL:OK +35,-,FailStatus,0,0,0,0,0,0,Enum,0,4096,OK:FAIL 36,-,AntStatus,0,0,0,0,0,0,Enum,0,4096,STOWED:DEPLOYED NOTES:,,,,,,,,,,,, Serial,Ignore,name,a,b,c,d,e,f,format,low limit,high limit,Comment From e1580b2962725b23de6431f302ac0032ea81ca81 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 08:22:41 -0500 Subject: [PATCH 439/554] Update install --- install | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/install b/install index 1d4c8926..d0f1ff2c 100755 --- a/install +++ b/install @@ -134,9 +134,9 @@ if [ -f "$FILE" ]; then sudo ./install.sh cd - #git clone https://github.com/alanbjohnston/pi_pacsat.git - git clone https://github.com/ac2cz/pi_pacsat.git - cd pi_pacsat + #git clone https://github.com/alanbjohnston/pi_.git + git clone https://github.com/ac2cz/pi_.git + cd pi_ #git checkout master-debug cd Debug make all @@ -166,6 +166,7 @@ fi FILE=/home/pi/pacsat_telem/Debug/pacsat_telem # code has already been compiled if [ -f "$FILE" ]; then cd + sudo apt-get install -y libbsd-dev git clone https://github.com/alanbjohnston/pacsat_telem.git cd pacsat_telem git checkout master-fox @@ -181,13 +182,13 @@ sudo raspi-config nonint do_vnc 0 cd /tmp -wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46n.tar.gz +wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46o.tar.gz -tar -xzf PacsatGround_unix_0_46n.tar.gz -C /home/pi/Desktop +tar -xzf PacsatGround_unix_0_46o.tar.gz -C /home/pi/Desktop -rm PacsatGround_unix_0_46n.tar.gz +rm PacsatGround_unix_0_46o.tar.gz -cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround/spacecraft/ +cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/* /home/pi/Desktop/PacsatGround/spacecraft/ mkdir /home/pi/PacSatGround From 72dca9aa1a3b94016ae552273824785e935a8cef Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 08:24:26 -0500 Subject: [PATCH 440/554] Update install fix pi_pacsat directory --- install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install b/install index d0f1ff2c..76d31542 100755 --- a/install +++ b/install @@ -134,9 +134,9 @@ if [ -f "$FILE" ]; then sudo ./install.sh cd - #git clone https://github.com/alanbjohnston/pi_.git - git clone https://github.com/ac2cz/pi_.git - cd pi_ + #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 make all From 7204051fb6fb68065c073652651165483790dad0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 08:25:19 -0500 Subject: [PATCH 441/554] Update pacsatsim.sh start/stop also --- pacsatsim.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index 8e89588d..68164d9e 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -2,6 +2,9 @@ # script to auto decode packet using rtl_fm and Direwolf and run Pacsat +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + # export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH From 643eaac19ecaa7a81250d23e0a620df0a12f6997 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 08:32:47 -0500 Subject: [PATCH 442/554] Update main.c change to restart pacsatsim --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index edb162d7..678ebb8a 100644 --- a/main.c +++ b/main.c @@ -247,7 +247,7 @@ int main(int argc, char * argv[]) { } if ( mode == PACSAT) { - FILE * pacsat_file = popen("sudo systemctl start pacsatsim", "r"); + FILE * pacsat_file = popen("sudo systemctl restart pacsatsim", "r"); pclose(pacsat_file); } else { From 558765f560056ca4c39900949eec76eda2fff4aa Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 08:33:32 -0500 Subject: [PATCH 443/554] Update main.c missing ) --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 678ebb8a..e0fda7e1 100644 --- a/main.c +++ b/main.c @@ -513,7 +513,7 @@ int main(int argc, char * argv[]) { memset(sensor, 0, sizeof(sensor)); memset(other, 0, sizeof(other)); - if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT) // && !sim_mode) + if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT)) // && !sim_mode) get_tlm_fox(); // fill transmit buffer with reset count 0 packets that will be ignored firstTime = 1; From 91ba8d3a10e3c9f799ed28f4d0fb4c8ac4c961ee Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 08:53:12 -0500 Subject: [PATCH 444/554] Create asound.conf --- asound.conf | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 asound.conf diff --git a/asound.conf b/asound.conf new file mode 100644 index 00000000..cf3cc9a0 --- /dev/null +++ b/asound.conf @@ -0,0 +1,46 @@ +pcm.!default { + type asym + playback.pcm "softvol" + capture.pcm "shared_mic" +} + +ctl.!default { + type hw + card "Device" +} + +# Playback with software volume and mixing +pcm.softvol { + type softvol + slave.pcm "shared_speaker" + control { + name "Master" + card "Device" + } +} + +pcm.shared_speaker { + type dmix + ipc_key 1024 + slave { + pcm "hw:CARD=Device,DEV=0" + rate 48000 + period_time 0 + period_size 1024 + buffer_size 4096 + } +} + +# Recording with input mixing +pcm.shared_mic { + type dsnoop + ipc_key 2048 + slave { + pcm "hw:CARD=Device,DEV=0" +# channels 1 + rate 48000 + period_time 0 + period_size 1024 + buffer_size 4096 + } +} From 3577400f7998f7b29c4cd7dfaf8c40e3abb04667 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 08:54:13 -0500 Subject: [PATCH 445/554] Update install add asound.conf --- install | 1 + 1 file changed, 1 insertion(+) diff --git a/install b/install index 76d31542..459b7abc 100755 --- a/install +++ b/install @@ -124,6 +124,7 @@ cd rpitx ./install.sh +sudo cp /home/pi/CubeSatSim/asound.conf /etc/asound.conf FILE=/home/pi/pi_pacsat/Debug/pi_pacsat # code has already been compiled if [ -f "$FILE" ]; then From 4738ca2550268ce303619150a6157dd234700195 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 09:11:28 -0500 Subject: [PATCH 446/554] Update transmit.py don't do anything with pacsatsim.service --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index e1c6aa77..602dd3cd 100644 --- a/transmit.py +++ b/transmit.py @@ -245,7 +245,7 @@ if __name__ == "__main__": print("Can't open .mode file, defaulting to FSK") print("Mode is: ") print(mode) - system("sudo systemctl stop pacsatsim") +# system("sudo systemctl stop pacsatsim") try: file = open("/home/pi/CubeSatSim/beacon_off") @@ -429,7 +429,7 @@ if __name__ == "__main__": print("Pacsat Ground Station") else: print("Pacsat") - system("sudo systemctl restart pacsatsim") +# system("sudo systemctl restart pacsatsim") # txPin = 27 pttPin = 20 From 6599bf9cd601dad7cdc6c54861e1cb9dd8471105 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 09:17:55 -0500 Subject: [PATCH 447/554] Update direwolf-pacsatsim-pwm.conf with shared_mic --- direwolf/direwolf-pacsatsim-pwm.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-pwm.conf b/direwolf/direwolf-pacsatsim-pwm.conf index c0890790..58667777 100644 --- a/direwolf/direwolf-pacsatsim-pwm.conf +++ b/direwolf/direwolf-pacsatsim-pwm.conf @@ -1,4 +1,5 @@ -ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +ADEVICE shared_mic plughw:CARD=Headphones,DEV=0 PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 From 6e063ee664d567303d2824179b723431fd29745a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 09:18:53 -0500 Subject: [PATCH 448/554] Update direwolf-pacsatsim-jp14.conf with shared_mic --- direwolf/direwolf-pacsatsim-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index cb0a1ce8..58667777 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,5 +1,5 @@ -ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 -#ADEVICE plughw:2,0 +#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +ADEVICE shared_mic plughw:CARD=Headphones,DEV=0 PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 From 414bb00be1f6b798654b6c79c39431fd1ec74443 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 09:20:07 -0500 Subject: [PATCH 449/554] Update direwolf-pacsatsim-jp14.conf fix Device --- direwolf/direwolf-pacsatsim-jp14.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf index 58667777..750c0fee 100644 --- a/direwolf/direwolf-pacsatsim-jp14.conf +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -1,5 +1,5 @@ -#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 -ADEVICE shared_mic plughw:CARD=Headphones,DEV=0 +#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +ADEVICE shared_mic plughw:CARD=Device,DEV=0 PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 From 98d006ddeb61e915249fbf0ede15a92d8b7e8540 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 09:23:09 -0500 Subject: [PATCH 450/554] Update config always reboot for Pacsat mode changes --- config | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/config b/config index 7759faed..5f793cee 100755 --- a/config +++ b/config @@ -1430,17 +1430,19 @@ elif [ "$1" = "-G" ]; then set -- $value # echo "changing CubeSatSim to Pacsat mode" - sudo echo "p" > /home/pi/CubeSatSim/.mode - if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then - FILE=/home/pi/CubeSatSim/battery_saver - if [ -f "$FILE" ]; then - restart=1 - else - reboot=1 - fi - else - restart=1 - fi + + reboot=1 +# sudo echo "p" > /home/pi/CubeSatSim/.mode +# if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then +# FILE=/home/pi/CubeSatSim/battery_saver +# if [ -f "$FILE" ]; then +# restart=1 +# else +# reboot=1 +# fi +# else +# restart=1 +# fi elif [ "$1" = "-I" ]; then @@ -1452,17 +1454,19 @@ elif [ "$1" = "-I" ]; then set -- $value # echo "changing CubeSatSim to Pacsat mode" - sudo echo "P" > /home/pi/CubeSatSim/.mode - if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then - FILE=/home/pi/CubeSatSim/battery_saver - if [ -f "$FILE" ]; then - restart=1 - else - reboot=1 - fi - else - restart=1 - fi + + reboot=1 +# sudo echo "P" > /home/pi/CubeSatSim/.mode +# if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then +# FILE=/home/pi/CubeSatSim/battery_saver +# if [ -f "$FILE" ]; then +# restart=1 +# else +# reboot=1 +# fi +# else +# restart=1 +# fi elif [ "$1" = "-h" ]; then From 891f46ae724e7b3948cfa0b9f38dc809fd985ba8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 09:33:27 -0500 Subject: [PATCH 451/554] Update config add back Pacsat .mode changes --- config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config b/config index 5f793cee..b9c1ba2f 100755 --- a/config +++ b/config @@ -1432,7 +1432,7 @@ elif [ "$1" = "-G" ]; then # echo "changing CubeSatSim to Pacsat mode" reboot=1 -# sudo echo "p" > /home/pi/CubeSatSim/.mode + sudo echo "p" > /home/pi/CubeSatSim/.mode # if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then # FILE=/home/pi/CubeSatSim/battery_saver # if [ -f "$FILE" ]; then @@ -1456,7 +1456,7 @@ elif [ "$1" = "-I" ]; then # echo "changing CubeSatSim to Pacsat mode" reboot=1 -# sudo echo "P" > /home/pi/CubeSatSim/.mode + sudo echo "P" > /home/pi/CubeSatSim/.mode # if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then # FILE=/home/pi/CubeSatSim/battery_saver # if [ -f "$FILE" ]; then From 11045fce4a70fa65b7d6ad7a76221bcb38b12e2e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 10:18:19 -0500 Subject: [PATCH 452/554] Update direwolf-cc.conf with shared_mic and change ports --- direwolf-cc.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/direwolf-cc.conf b/direwolf-cc.conf index 00eddffa..2a3b5ef9 100644 --- a/direwolf-cc.conf +++ b/direwolf-cc.conf @@ -1,7 +1,10 @@ -ADEVICE hw:CARD=Device,DEV=0 default +#ADEVICE hw:CARD=Device,DEV=0 default +ADEVICE shared_mic hw:CARD=Loopback,DEV=1 DTMF MYCALL AMSAT CHANNEL 0 MODEM 1200 FULLDUP OFF TXDELAY 0 +AGWPORT 8200 +KISSPORT 8201 From 66d2dc3471d55005d3af332bd8eb0ea78e98a7d3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 10:21:14 -0500 Subject: [PATCH 453/554] Update dtmf_aprs_cc.py try around stdin read for UTF-8 issue --- dtmf_aprs_cc.py | 346 ++++++++++++++++++++++++------------------------ 1 file changed, 174 insertions(+), 172 deletions(-) diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index befe58c7..fd8bac6f 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -17,183 +17,185 @@ if __name__ == "__main__": # print("There are arguments!") if ('d' == sys.argv[1]): debug_mode = True - - for line in sys.stdin: -# if (debug_mode): - print(line, end =" ") - logging.warning(line) - -# if '^c' == line.rstrip(): -# break - - if ((line.find("MODE=a")) > 0): - system("echo '\nAPRS Mode!!\n'") - mode = 'a' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t1#")) > 0): - system("echo '\nAPRS Mode!!\n'") - mode = 'a' - change_mode = True - if ((line.find("MODE=f")) > 0): - system("echo '\nFSK Mode!!\n'") - mode = 'f' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t2#")) > 0): - system("echo '\nFSK Mode!!\n'") - mode = 'f' - change_mode = True - if ((line.find("MODE=b")) > 0): - system("echo '\nBPSK Mode!!\n'") - mode = 'b' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t3#")) > 0): - system("echo '\nBPSK Mode!!\n'") - mode = 'b' - change_mode = True - if ((line.find("MODE=s")) > 0): - system("echo '\nSSTV Mode!!\n'") - mode = 's' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t4#")) > 0): - system("echo '\nSSTV Mode!!\n'") - mode = 's' - change_mode = True - if ((line.find("MODE=m")) > 0): - system("echo '\nCW Mode!!\n'") - mode = 'm' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t5#")) > 0): - system("echo '\nCW Mode!!\n'") - mode = 'm' - change_mode = True - if ((line.find("MODE=n")) > 0): - system("echo '\nTransmit Commands Mode!!\n'") - mode = 'n' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t11#")) > 0): - system("echo '\nTransmit Commands Mode!!\n'") - mode = 'n' - change_mode = True -# Currently, C2C does not support Repeater mode e - if ((line.find("MODE=o")) > 0): - system("echo '\nBeacon Mode toggle!!\n'") - mode = 'o' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t10#")) > 0): - system("echo '\nBeacon Mode toggle!!\n'") - mode = 'o' - change_mode = True - - if (debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice - GPIO.setmode(GPIO.BCM) - GPIO.setwarnings(False) - GPIO.setup(powerPin, GPIO.OUT) - GPIO.setup(txLed, GPIO.OUT) - if (mode == 'f'): - GPIO.output(powerPin, 0) # blink two times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - - elif (mode == 'b'): - GPIO.output(powerPin, 0) # blink three times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - - elif (mode == 's'): - GPIO.output(powerPin, 0) # blink four times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - - elif (mode == 'm'): - GPIO.output(powerPin, 0) # blink five times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1); - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - elif (mode == 'a'): + try: + for line in sys.stdin: + # if (debug_mode): + print(line, end =" ") + logging.warning(line) + + # if '^c' == line.rstrip(): + # break + + if ((line.find("MODE=a")) > 0): + system("echo '\nAPRS Mode!!\n'") mode = 'a' - GPIO.output(powerPin, 0) # blink one time - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - - try: - file = open("/home/pi/CubeSatSim/command_count.txt", "r") - string = file.read() - file.close() - command_count = int(string) - command_count += 1 - filec = open("/home/pi/CubeSatSim/command_count.txt", "w") - command_count_string = str(command_count) - print(command_count_string) - string = filec.write(command_count_string) - filec.close() - except: - print("Can't write command_count file!") - print("Command_count: ") - print(command_count) + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t1#")) > 0): + system("echo '\nAPRS Mode!!\n'") + mode = 'a' + change_mode = True + if ((line.find("MODE=f")) > 0): + system("echo '\nFSK Mode!!\n'") + mode = 'f' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t2#")) > 0): + system("echo '\nFSK Mode!!\n'") + mode = 'f' + change_mode = True + if ((line.find("MODE=b")) > 0): + system("echo '\nBPSK Mode!!\n'") + mode = 'b' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t3#")) > 0): + system("echo '\nBPSK Mode!!\n'") + mode = 'b' + change_mode = True + if ((line.find("MODE=s")) > 0): + system("echo '\nSSTV Mode!!\n'") + mode = 's' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t4#")) > 0): + system("echo '\nSSTV Mode!!\n'") + mode = 's' + change_mode = True + if ((line.find("MODE=m")) > 0): + system("echo '\nCW Mode!!\n'") + mode = 'm' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t5#")) > 0): + system("echo '\nCW Mode!!\n'") + mode = 'm' + change_mode = True + if ((line.find("MODE=n")) > 0): + system("echo '\nTransmit Commands Mode!!\n'") + mode = 'n' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t11#")) > 0): + system("echo '\nTransmit Commands Mode!!\n'") + mode = 'n' + change_mode = True + # Currently, C2C does not support Repeater mode e + if ((line.find("MODE=o")) > 0): + system("echo '\nBeacon Mode toggle!!\n'") + mode = 'o' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t10#")) > 0): + system("echo '\nBeacon Mode toggle!!\n'") + mode = 'o' + change_mode = True + + if (debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice + GPIO.setmode(GPIO.BCM) + GPIO.setwarnings(False) + GPIO.setup(powerPin, GPIO.OUT) + GPIO.setup(txLed, GPIO.OUT) + + if (mode == 'f'): + GPIO.output(powerPin, 0) # blink two times + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) - GPIO.output(txLed, 0) - GPIO.output(powerPin, 0) - system("sudo systemctl stop rpitx") -# system("sudo systemctl stop cubesatsim") + elif (mode == 'b'): + GPIO.output(powerPin, 0) # blink three times + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) + + elif (mode == 's'): + GPIO.output(powerPin, 0) # blink four times + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) - print("\n/home/pi/CubeSatSim/config -" + mode) - system("/home/pi/CubeSatSim/config -" + mode) - - - change_mode = False + elif (mode == 'm'): + GPIO.output(powerPin, 0) # blink five times + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1); + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) + elif (mode == 'a'): + mode = 'a' + GPIO.output(powerPin, 0) # blink one time + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) + + try: + file = open("/home/pi/CubeSatSim/command_count.txt", "r") + string = file.read() + file.close() + command_count = int(string) + command_count += 1 + filec = open("/home/pi/CubeSatSim/command_count.txt", "w") + command_count_string = str(command_count) + print(command_count_string) + string = filec.write(command_count_string) + filec.close() + except: + print("Can't write command_count file!") + print("Command_count: ") + print(command_count) + + GPIO.output(txLed, 0) + GPIO.output(powerPin, 0) + system("sudo systemctl stop rpitx") + # system("sudo systemctl stop cubesatsim") + + print("\n/home/pi/CubeSatSim/config -" + mode) + system("/home/pi/CubeSatSim/config -" + mode) + + change_mode = False + except: + print("Error reading line (probably due to UTF-8 issue)") print("Waiting 5 seconds to allow unplug and plug of soundcard") sleep(5) print("Done") From a619e554a84bbfe751a47d02d3b7a55c0c4fb973 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 10:23:13 -0500 Subject: [PATCH 454/554] Update dtmf_aprs_cc.py ad while to keep trying --- dtmf_aprs_cc.py | 351 ++++++++++++++++++++++++------------------------ 1 file changed, 176 insertions(+), 175 deletions(-) diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index fd8bac6f..4b8ba472 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -18,184 +18,185 @@ if __name__ == "__main__": if ('d' == sys.argv[1]): debug_mode = True - try: - for line in sys.stdin: - # if (debug_mode): - print(line, end =" ") - logging.warning(line) - - # if '^c' == line.rstrip(): - # break - - if ((line.find("MODE=a")) > 0): - system("echo '\nAPRS Mode!!\n'") - mode = 'a' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t1#")) > 0): - system("echo '\nAPRS Mode!!\n'") - mode = 'a' - change_mode = True - if ((line.find("MODE=f")) > 0): - system("echo '\nFSK Mode!!\n'") - mode = 'f' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t2#")) > 0): - system("echo '\nFSK Mode!!\n'") - mode = 'f' - change_mode = True - if ((line.find("MODE=b")) > 0): - system("echo '\nBPSK Mode!!\n'") - mode = 'b' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t3#")) > 0): - system("echo '\nBPSK Mode!!\n'") - mode = 'b' - change_mode = True - if ((line.find("MODE=s")) > 0): - system("echo '\nSSTV Mode!!\n'") - mode = 's' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t4#")) > 0): - system("echo '\nSSTV Mode!!\n'") - mode = 's' - change_mode = True - if ((line.find("MODE=m")) > 0): - system("echo '\nCW Mode!!\n'") - mode = 'm' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t5#")) > 0): - system("echo '\nCW Mode!!\n'") - mode = 'm' - change_mode = True - if ((line.find("MODE=n")) > 0): - system("echo '\nTransmit Commands Mode!!\n'") - mode = 'n' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t11#")) > 0): - system("echo '\nTransmit Commands Mode!!\n'") - mode = 'n' - change_mode = True - # Currently, C2C does not support Repeater mode e - if ((line.find("MODE=o")) > 0): - system("echo '\nBeacon Mode toggle!!\n'") - mode = 'o' - change_mode = True - counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t10#")) > 0): - system("echo '\nBeacon Mode toggle!!\n'") - mode = 'o' - change_mode = True - - if (debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice - GPIO.setmode(GPIO.BCM) - GPIO.setwarnings(False) - GPIO.setup(powerPin, GPIO.OUT) - GPIO.setup(txLed, GPIO.OUT) - - if (mode == 'f'): - GPIO.output(powerPin, 0) # blink two times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - - elif (mode == 'b'): - GPIO.output(powerPin, 0) # blink three times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - - elif (mode == 's'): - GPIO.output(powerPin, 0) # blink four times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - - elif (mode == 'm'): - GPIO.output(powerPin, 0) # blink five times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1); - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - elif (mode == 'a'): + while True: + try: + for line in sys.stdin: + # if (debug_mode): + print(line, end =" ") + logging.warning(line) + + # if '^c' == line.rstrip(): + # break + + if ((line.find("MODE=a")) > 0): + system("echo '\nAPRS Mode!!\n'") mode = 'a' - GPIO.output(powerPin, 0) # blink one time - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(1) - - try: - file = open("/home/pi/CubeSatSim/command_count.txt", "r") - string = file.read() - file.close() - command_count = int(string) - command_count += 1 - filec = open("/home/pi/CubeSatSim/command_count.txt", "w") - command_count_string = str(command_count) - print(command_count_string) - string = filec.write(command_count_string) - filec.close() - except: - print("Can't write command_count file!") - print("Command_count: ") - print(command_count) + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t1#")) > 0): + system("echo '\nAPRS Mode!!\n'") + mode = 'a' + change_mode = True + if ((line.find("MODE=f")) > 0): + system("echo '\nFSK Mode!!\n'") + mode = 'f' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t2#")) > 0): + system("echo '\nFSK Mode!!\n'") + mode = 'f' + change_mode = True + if ((line.find("MODE=b")) > 0): + system("echo '\nBPSK Mode!!\n'") + mode = 'b' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t3#")) > 0): + system("echo '\nBPSK Mode!!\n'") + mode = 'b' + change_mode = True + if ((line.find("MODE=s")) > 0): + system("echo '\nSSTV Mode!!\n'") + mode = 's' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t4#")) > 0): + system("echo '\nSSTV Mode!!\n'") + mode = 's' + change_mode = True + if ((line.find("MODE=m")) > 0): + system("echo '\nCW Mode!!\n'") + mode = 'm' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t5#")) > 0): + system("echo '\nCW Mode!!\n'") + mode = 'm' + change_mode = True + if ((line.find("MODE=n")) > 0): + system("echo '\nTransmit Commands Mode!!\n'") + mode = 'n' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t11#")) > 0): + system("echo '\nTransmit Commands Mode!!\n'") + mode = 'n' + change_mode = True + # Currently, C2C does not support Repeater mode e + if ((line.find("MODE=o")) > 0): + system("echo '\nBeacon Mode toggle!!\n'") + mode = 'o' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find("DTMF>APDW15:t10#")) > 0): + system("echo '\nBeacon Mode toggle!!\n'") + mode = 'o' + change_mode = True + + if (debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice + GPIO.setmode(GPIO.BCM) + GPIO.setwarnings(False) + GPIO.setup(powerPin, GPIO.OUT) + GPIO.setup(txLed, GPIO.OUT) + + if (mode == 'f'): + GPIO.output(powerPin, 0) # blink two times + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) - GPIO.output(txLed, 0) - GPIO.output(powerPin, 0) - system("sudo systemctl stop rpitx") - # system("sudo systemctl stop cubesatsim") + elif (mode == 'b'): + GPIO.output(powerPin, 0) # blink three times + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) + + elif (mode == 's'): + GPIO.output(powerPin, 0) # blink four times + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) - print("\n/home/pi/CubeSatSim/config -" + mode) - system("/home/pi/CubeSatSim/config -" + mode) - - - change_mode = False - except: - print("Error reading line (probably due to UTF-8 issue)") + elif (mode == 'm'): + GPIO.output(powerPin, 0) # blink five times + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1); + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) + GPIO.output(powerPin, 0) + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) + elif (mode == 'a'): + mode = 'a' + GPIO.output(powerPin, 0) # blink one time + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(1) + + try: + file = open("/home/pi/CubeSatSim/command_count.txt", "r") + string = file.read() + file.close() + command_count = int(string) + command_count += 1 + filec = open("/home/pi/CubeSatSim/command_count.txt", "w") + command_count_string = str(command_count) + print(command_count_string) + string = filec.write(command_count_string) + filec.close() + except: + print("Can't write command_count file!") + print("Command_count: ") + print(command_count) + + GPIO.output(txLed, 0) + GPIO.output(powerPin, 0) + system("sudo systemctl stop rpitx") + # system("sudo systemctl stop cubesatsim") + + print("\n/home/pi/CubeSatSim/config -" + mode) + system("/home/pi/CubeSatSim/config -" + mode) + + + change_mode = False + except: + print("Error reading line (probably due to UTF-8 issue)") print("Waiting 5 seconds to allow unplug and plug of soundcard") sleep(5) print("Done") From 7e1b7e90cc450530eea8e696f2b9152fd8794017 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 10:27:08 -0500 Subject: [PATCH 455/554] Update dtmf_aprs_cc.py remove DTMF>APDW15 --- dtmf_aprs_cc.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index 4b8ba472..094c5188 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -33,7 +33,7 @@ if __name__ == "__main__": mode = 'a' change_mode = True counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t1#")) > 0): + if ((line.find(":t1#")) > 0): system("echo '\nAPRS Mode!!\n'") mode = 'a' change_mode = True @@ -42,7 +42,7 @@ if __name__ == "__main__": mode = 'f' change_mode = True counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t2#")) > 0): + if ((line.find(":t2#")) > 0): system("echo '\nFSK Mode!!\n'") mode = 'f' change_mode = True @@ -51,7 +51,7 @@ if __name__ == "__main__": mode = 'b' change_mode = True counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t3#")) > 0): + if ((line.find(":t3#")) > 0): system("echo '\nBPSK Mode!!\n'") mode = 'b' change_mode = True @@ -60,7 +60,7 @@ if __name__ == "__main__": mode = 's' change_mode = True counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t4#")) > 0): + if ((line.find(":t4#")) > 0): system("echo '\nSSTV Mode!!\n'") mode = 's' change_mode = True @@ -69,7 +69,7 @@ if __name__ == "__main__": mode = 'm' change_mode = True counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t5#")) > 0): + if ((line.find(":t5#")) > 0): system("echo '\nCW Mode!!\n'") mode = 'm' change_mode = True @@ -78,7 +78,7 @@ if __name__ == "__main__": mode = 'n' change_mode = True counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t11#")) > 0): + if ((line.find(":t11#")) > 0): system("echo '\nTransmit Commands Mode!!\n'") mode = 'n' change_mode = True @@ -88,7 +88,7 @@ if __name__ == "__main__": mode = 'o' change_mode = True counter = (counter + 1) % 2 - if ((line.find("DTMF>APDW15:t10#")) > 0): + if ((line.find(":t10#")) > 0): system("echo '\nBeacon Mode toggle!!\n'") mode = 'o' change_mode = True From 8f09364a670585ac381c0335cf7dbb3aaee25182 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 10:34:05 -0500 Subject: [PATCH 456/554] Update command add loopback --- command | 2 ++ 1 file changed, 2 insertions(+) diff --git a/command b/command index 989c71f5..dccd9382 100755 --- a/command +++ b/command @@ -2,6 +2,8 @@ echo -e "\nCommand and Control script for CubeSatSim v2.0\n" +sudo modprobe snd-aloop + FILE=/home/pi/CubeSatSim/command_control if [ -f "$FILE" ]; then echo "Radio command and control is ON" From 5ec12e9d59e2c8d1ca03abb177ed015f46e833c5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 10:41:09 -0500 Subject: [PATCH 457/554] Update pacsatsim.sh don't stop command and control --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 68164d9e..2e5802d1 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -13,7 +13,7 @@ export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH #sudo systemctl stop transmit -sudo systemctl stop command &>/dev/null +#sudo systemctl stop command &>/dev/null sudo modprobe snd-aloop From 384349e67807b8109e989be486c8ea3f05c0b963 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 10:50:17 -0500 Subject: [PATCH 458/554] Update dtmf_aprs_cc.py add PACSAT mode -g --- dtmf_aprs_cc.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index 094c5188..d9eba04a 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -73,6 +73,15 @@ if __name__ == "__main__": system("echo '\nCW Mode!!\n'") mode = 'm' change_mode = True + if ((line.find("MODE=G")) > 0): + system("echo '\nPacSatSim Mode!!\n'") + mode = 'G' + change_mode = True + counter = (counter + 1) % 2 + if ((line.find(":t8#")) > 0): + system("echo '\nPacSatSim Mode!!\n'") + mode = 'G' + change_mode = True if ((line.find("MODE=n")) > 0): system("echo '\nTransmit Commands Mode!!\n'") mode = 'n' From 86763119d6684ef6a326fd882eda4bae5b9ecddc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 10:58:44 -0500 Subject: [PATCH 459/554] Update dtmf_aprs_cc.py change from G to p for Pacsat mode --- dtmf_aprs_cc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index d9eba04a..818ab478 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -75,12 +75,12 @@ if __name__ == "__main__": change_mode = True if ((line.find("MODE=G")) > 0): system("echo '\nPacSatSim Mode!!\n'") - mode = 'G' + mode = 'p' change_mode = True counter = (counter + 1) % 2 if ((line.find(":t8#")) > 0): system("echo '\nPacSatSim Mode!!\n'") - mode = 'G' + mode = 'p' change_mode = True if ((line.find("MODE=n")) > 0): system("echo '\nTransmit Commands Mode!!\n'") From 474e3f618b2be9180add01a9e0cce347a27b079c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 11:08:48 -0500 Subject: [PATCH 460/554] Update config change -a, -f, -b to reboot for pacsat --- config | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/config b/config index b9c1ba2f..4552d516 100755 --- a/config +++ b/config @@ -369,7 +369,7 @@ elif [ "$1" = "-a" ]; then else echo "changing CubeSatSim to AFSK mode" - sudo echo "a" > /home/pi/CubeSatSim/.mode + sudo echo "a" > /home/pi/CubeSatSim/.mode if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then FILE=/home/pi/CubeSatSim/battery_saver if [ -f "$FILE" ]; then @@ -377,6 +377,8 @@ elif [ "$1" = "-a" ]; then else reboot=1 fi + elif [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 else restart=1 fi @@ -422,7 +424,10 @@ elif [ "$1" = "-f" ]; then echo "changing CubeSatSim to FSK mode" sudo echo "f" > /home/pi/CubeSatSim/.mode - restart=1 + if [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 + else + restart=1 fi elif [ "$1" = "-b" ]; then @@ -439,7 +444,10 @@ elif [ "$1" = "-b" ]; then echo "changing CubeSatSim to BPSK mode" sudo echo "b" > /home/pi/CubeSatSim/.mode - restart=1 + if [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 + else + restart=1 fi elif [ "$1" = "-s" ]; then From ca03c998717d41475eb2bd88c4bbe136b1564467 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 11:10:23 -0500 Subject: [PATCH 461/554] Update config fix fi --- config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config b/config index 4552d516..4f479d21 100755 --- a/config +++ b/config @@ -428,6 +428,7 @@ elif [ "$1" = "-f" ]; then reboot=1 else restart=1 + fi fi elif [ "$1" = "-b" ]; then @@ -448,6 +449,7 @@ elif [ "$1" = "-b" ]; then reboot=1 else restart=1 + fi fi elif [ "$1" = "-s" ]; then From de19e5bc0c3da50449f3a445e5d459b4e915277c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 11:22:52 -0500 Subject: [PATCH 462/554] Update config with rest of modes for pacsat reboot --- config | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config b/config index 4f479d21..a9c9e7fc 100755 --- a/config +++ b/config @@ -405,6 +405,8 @@ elif [ "$1" = "-m" ]; then else reboot=1 fi + elif [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 else restart=1 fi @@ -474,6 +476,8 @@ elif [ "$1" = "-s" ]; then else reboot=1 fi + elif [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 else restart=1 fi @@ -1272,7 +1276,11 @@ elif [ "$1" = "-e" ]; then echo "changing CubeSatSim to Repeater mode" sudo echo "e" > /home/pi/CubeSatSim/.mode - restart=1 + if [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 + else + restart=1 + fi elif [ "$1" = "-n" ]; then From ea3a4f07e3a8fd6fd73521831227f68d1cccd421 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 11:26:43 -0500 Subject: [PATCH 463/554] Update dtmf_aprs_cc.py change to "G" --- dtmf_aprs_cc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index 818ab478..d9eba04a 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -75,12 +75,12 @@ if __name__ == "__main__": change_mode = True if ((line.find("MODE=G")) > 0): system("echo '\nPacSatSim Mode!!\n'") - mode = 'p' + mode = 'G' change_mode = True counter = (counter + 1) % 2 if ((line.find(":t8#")) > 0): system("echo '\nPacSatSim Mode!!\n'") - mode = 'p' + mode = 'G' change_mode = True if ((line.find("MODE=n")) > 0): system("echo '\nTransmit Commands Mode!!\n'") From 4442bd61f37b8117c590ac8a856d252d89f79ff1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 14:51:17 -0500 Subject: [PATCH 464/554] Update config clear pacsatsim logs too --- config | 1 + 1 file changed, 1 insertion(+) diff --git a/config b/config index a9c9e7fc..6207cafa 100755 --- a/config +++ b/config @@ -739,6 +739,7 @@ elif [ "$1" = "-C" ]; then sudo systemctl stop cubesatsim sudo systemctl stop transmit sudo systemctl stop command + sudo systemctl stop pacsatsim sudo mv -f /home/pi/CubeSatSim/telem.txt /home/pi/CubeSatSim/telem.txt.bk From fb7e87529d0cc95ad007fdee42e5dbb1e0f27116 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 16:42:56 -0500 Subject: [PATCH 465/554] Create pacsat-run.sh --- groundstation/pacsat-run.sh | 147 ++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 groundstation/pacsat-run.sh diff --git a/groundstation/pacsat-run.sh b/groundstation/pacsat-run.sh new file mode 100644 index 00000000..1bbe7dcb --- /dev/null +++ b/groundstation/pacsat-run.sh @@ -0,0 +1,147 @@ +#!/bin/bash +# script to run FoxTelem + +echo "Startup script to run the PacSat Ground Station for FIAB v4" + +echo + +source /home/pi/venv/bin/activate + +sudo killall -9 java &>/dev/null + +sudo killall -9 zenity &>/dev/null + +FILE=/home/pi/.pacsatprofile +if [ ! -f "$FILE" ]; then + + profile=$(zenity --text="Choose your default Pacsat profile:" --list 2>/dev/null --width=410 --height=120 --title="Set FoxTelem Profile" --column="Profile" --column="Receive and decode telemetry from" "PacSat" "AMSAT Satellites" "CubeSatSim" "AMSAT CubeSat Simulator" "Loopback" "Locally Simulated PacSat") + + echo $profile + + if [ -z "$profile" ]; then + + echo "No choice made. Exiting." + + sleep 3 + + exit + + #echo "You need to choose your default FoxTelem profile." + #echo + #echo "The choices are:" + #echo + #echo "1. Fox-in-a-Box. Use this profile if you want to receive and decode telemetry from the AMSAT Fox satellites. If you enter a callsign and a grid square, you can upload to the AMSAT telemetry server." + #echo + #echo "2. CubeSatSim Ground Station. Use this profile if you want to receive and decode telemetry from an AMSAT CubeSatSim or CubeSatSim Lite." + #echo + #echo "Which profile do you choose? Enter 1 or 2" + + #read -r ANS + + fi + + if [ "$ANS" = "1" ] || [ "$profile" = "PacSat" ] ; then + + echo "You have chosen the PacSat profile." + echo "p" > /home/pi/.pacsatprofile + echo + + sudo killall -9 java &>/dev/null + + sudo killall -9 gpredict &>/dev/null + + FILE=/home/pi/FoxTelemetryData/FoxTelem.properties.0 + if [ ! -f "$FILE" ]; then + cp /home/pi/FoxTelemetryData/FoxTelem.properties /home/pi/FoxTelemetryData/FoxTelem.properties.0 + fi + + python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py + + if [ $? -eq 1 ]; then + + echo "Enter your Groundstation Name. If you upload telemetry data to the AMSAT servers, this name will be displayed on the FoxTelem leader board at https://amsat.org/tlm" + read name + + if [ -n "$name" ]; then + sudo sed -i "s/callsign=.*/callsign=$name/g" /home/pi/FoxTelemetryData/FoxTelem.properties + fi + + echo + + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/retuneCenterFrequency=false/retuneCenterFrequency=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/stationDetails=.*/stationDetails=FoxInABox/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + # sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + sudo sed -i "s/soundCard=NONE/soundCard=Direct Audio Device\: FUNcube Dongle V2.0, USB Audi/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + + + + # echo "Enter your Maidenhead grid square. It is two letters followed by two numbers followed by two letters with no spaces. If you don't know your gridsquare, you can look it up here https://dxcluster.ha8tks.hu/hamgeocoding/" + # read grid + # sudo sed -i "s/maidenhead=XX00xx/maidenhead=$grid/g" /home/pi/Documents/FITB/FoxTelem.properties + # echo + + fi + + elif [ "$ANS" = "2" ] || [ "$profile" = "CubeSatSim" ] ; then + + echo "You have chosen the CubeSatSim PacSat Ground Station profile." + echo "c" > /home/pi/.pacsatprofile + + cp /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties.0 + + sudo sed -i "s/useCostas=false/useCostas=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties + + sudo sed -i "s/findSignal=false/findSignal=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties + + elif [ "$ANS" = "3" ] || [ "$profile" = "Loopback" ] ; then + + echo "You have chosen the Loopback Simulated PacSat Ground Station profile." + echo "l" > /home/pi/.pacsatprofile + + else + + echo "Please enter only 1 or 2 or 3" + + fi + +fi + +value=`cat /home/pi/FoxTelemetryData/.foxprofile` +echo "$value" > /dev/null +set -- $value + +sudo killall -9 java &>/dev/null + +if [ "$1" = "c" ]; then + echo "CubeSatSim Ground Station profile is set!" + echo + /home/pi/CubeSatSim/groundstation/pacsat.sh +elif [ "$1" = "l" ]; then + echo "Loopback Ground Station profile is set!" + echo + /home/pi/CubeSatSim/groundstation/pacsat.sh l +else + echo "AMSAT profile is set!" + echo +# /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData + cd /home/pi/Desktop/PacsatGround/ + + setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & + +fi + +sleep 10 + +#$SHELL From 6418c63a9d3a43d3d11b0a47894f40c0ed6287a1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 17:02:53 -0500 Subject: [PATCH 466/554] make pacsat scripts executable --- groundstation/pacsat-config.sh | 134 +++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 groundstation/pacsat-config.sh diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh new file mode 100644 index 00000000..e0723d41 --- /dev/null +++ b/groundstation/pacsat-config.sh @@ -0,0 +1,134 @@ +#!/bin/bash +# script to run FoxTelem + +echo "Startup script to configure the PacSat Ground Station for FIAB v4" + +echo + +source /home/pi/venv/bin/activate + +sudo killall -9 java &>/dev/null + +sudo killall -9 zenity &>/dev/null + +FILE=/home/pi/.pacsatprofile +if [ ! -f "$FILE" ]; then + + profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" --column="Choice" --column="Result" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") + + echo $profile + + if [ -z "$profile" ]; then + + echo "No choice made. Exiting." + + sleep 3 + + exit + + fi + + if [ "$ANS" = "1" ] || [ "$profile" = "PacSat" ] ; then + + echo "You have chosen the PacSat profile." + echo + + sudo killall -9 java &>/dev/null + + sudo killall -9 gpredict &>/dev/null + + FILE=/home/pi/FoxTelemetryData/FoxTelem.properties.0 + if [ ! -f "$FILE" ]; then + cp /home/pi/FoxTelemetryData/FoxTelem.properties /home/pi/FoxTelemetryData/FoxTelem.properties.0 + fi + + python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py + + if [ $? -eq 1 ]; then + + echo "Enter your Groundstation Name. If you upload telemetry data to the AMSAT servers, this name will be displayed on the FoxTelem leader board at https://amsat.org/tlm" + read name + + if [ -n "$name" ]; then + sudo sed -i "s/callsign=.*/callsign=$name/g" /home/pi/FoxTelemetryData/FoxTelem.properties + fi + + echo + + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/retuneCenterFrequency=false/retuneCenterFrequency=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/stationDetails=.*/stationDetails=FoxInABox/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + # sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + sudo sed -i "s/soundCard=NONE/soundCard=Direct Audio Device\: FUNcube Dongle V2.0, USB Audi/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + + + + # echo "Enter your Maidenhead grid square. It is two letters followed by two numbers followed by two letters with no spaces. If you don't know your gridsquare, you can look it up here https://dxcluster.ha8tks.hu/hamgeocoding/" + # read grid + # sudo sed -i "s/maidenhead=XX00xx/maidenhead=$grid/g" /home/pi/Documents/FITB/FoxTelem.properties + # echo + + fi + + elif [ "$ANS" = "2" ] || [ "$profile" = "CubeSatSim" ] ; then + + echo "You have chosen the CubeSatSim PacSat Ground Station profile." + echo "c" > /home/pi/.pacsatprofile + + cp /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties.0 + + sudo sed -i "s/useCostas=false/useCostas=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties + + sudo sed -i "s/findSignal=false/findSignal=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties + + elif [ "$ANS" = "3" ] || [ "$profile" = "Loopback" ] ; then + + echo "You have chosen the Loopback Simulated PacSat Ground Station profile." + echo "l" > /home/pi/.pacsatprofile + + else + + echo "Please enter only 1 or 2 or 3" + + fi + +fi + +value=`cat /home/pi/FoxTelemetryData/.foxprofile` +echo "$value" > /dev/null +set -- $value + +sudo killall -9 java &>/dev/null + +if [ "$1" = "c" ]; then + echo "CubeSatSim Ground Station profile is set!" + echo + /home/pi/CubeSatSim/groundstation/pacsat.sh +elif [ "$1" = "l" ]; then + echo "Loopback Ground Station profile is set!" + echo + /home/pi/CubeSatSim/groundstation/pacsat.sh l +else + echo "AMSAT profile is set!" + echo +# /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData + cd /home/pi/Desktop/PacsatGround/ + + setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & + +fi + +sleep 10 + +#$SHELL From 83083636639e76e82cc39f98a4dcb942a6d85ed8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 17:05:49 -0500 Subject: [PATCH 467/554] make pacsat config executable --- groundstation/pacsat-config.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 groundstation/pacsat-config.sh diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh old mode 100644 new mode 100755 From 985c817fa76dae4487e9b919c11e575da5439afd Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 17:12:19 -0500 Subject: [PATCH 468/554] Update pacsat-config.sh change options --- groundstation/pacsat-config.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index e0723d41..2e7b6ea5 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -11,10 +11,10 @@ sudo killall -9 java &>/dev/null sudo killall -9 zenity &>/dev/null -FILE=/home/pi/.pacsatprofile -if [ ! -f "$FILE" ]; then +#FILE=/home/pi/.pacsatprofile +#if [ ! -f "$FILE" ]; then - profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" --column="Choice" --column="Result" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") + profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") echo $profile @@ -103,11 +103,11 @@ if [ ! -f "$FILE" ]; then fi -fi +#fi -value=`cat /home/pi/FoxTelemetryData/.foxprofile` -echo "$value" > /dev/null -set -- $value +#value=`cat /home/pi/FoxTelemetryData/.foxprofile` +#echo "$value" > /dev/null +#set -- $value sudo killall -9 java &>/dev/null From 794034151047e812eddb5582aa7bf9d154606df2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Mar 2026 17:14:52 -0500 Subject: [PATCH 469/554] Update pacsat-config.sh fix popup menu --- groundstation/pacsat-config.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 2e7b6ea5..2963e4c6 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -14,8 +14,7 @@ sudo killall -9 zenity &>/dev/null #FILE=/home/pi/.pacsatprofile #if [ ! -f "$FILE" ]; then - profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") - + profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" --column="Choice" --column="Result" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") echo $profile if [ -z "$profile" ]; then From 7a7fb343201368fa98847d2729f47e3bbc5cc7f6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 10:07:26 -0500 Subject: [PATCH 470/554] Update pacsat-run.sh 3 options --- groundstation/pacsat-run.sh | 113 +++++++----------------------------- 1 file changed, 20 insertions(+), 93 deletions(-) diff --git a/groundstation/pacsat-run.sh b/groundstation/pacsat-run.sh index 1bbe7dcb..f41f44f7 100644 --- a/groundstation/pacsat-run.sh +++ b/groundstation/pacsat-run.sh @@ -11,21 +11,21 @@ sudo killall -9 java &>/dev/null sudo killall -9 zenity &>/dev/null -FILE=/home/pi/.pacsatprofile -if [ ! -f "$FILE" ]; then +#FILE=/home/pi/.pacsatprofile +#if [ ! -f "$FILE" ]; then - profile=$(zenity --text="Choose your default Pacsat profile:" --list 2>/dev/null --width=410 --height=120 --title="Set FoxTelem Profile" --column="Profile" --column="Receive and decode telemetry from" "PacSat" "AMSAT Satellites" "CubeSatSim" "AMSAT CubeSat Simulator" "Loopback" "Locally Simulated PacSat") + profile=$(zenity --text="Choose what you want to do:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station" --column="Choice" --column="Result" "PacSat" "Run PacSat Ground Station" "Configure" "Configure the Pacsat Ground Station" "Loopback" "Run a Locally Simulated PacSat") echo $profile if [ -z "$profile" ]; then - echo "No choice made. Exiting." - - sleep 3 - - exit - + echo "No choice made. Exiting." + + sleep 3 + + exit + #echo "You need to choose your default FoxTelem profile." #echo #echo "The choices are:" @@ -42,73 +42,25 @@ if [ ! -f "$FILE" ]; then if [ "$ANS" = "1" ] || [ "$profile" = "PacSat" ] ; then - echo "You have chosen the PacSat profile." - echo "p" > /home/pi/.pacsatprofile - echo - - sudo killall -9 java &>/dev/null + echo "You have chosen to run the PacSat Ground Station" + # echo "p" > /home/pi/.pacsatprofile + echo + + /home/pi/CubeSatSim/groundstation/pacsat.sh - sudo killall -9 gpredict &>/dev/null - - FILE=/home/pi/FoxTelemetryData/FoxTelem.properties.0 - if [ ! -f "$FILE" ]; then - cp /home/pi/FoxTelemetryData/FoxTelem.properties /home/pi/FoxTelemetryData/FoxTelem.properties.0 - fi - - python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py - - if [ $? -eq 1 ]; then - - echo "Enter your Groundstation Name. If you upload telemetry data to the AMSAT servers, this name will be displayed on the FoxTelem leader board at https://amsat.org/tlm" - read name - if [ -n "$name" ]; then - sudo sed -i "s/callsign=.*/callsign=$name/g" /home/pi/FoxTelemetryData/FoxTelem.properties - fi + elif [ "$ANS" = "2" ] || [ "$profile" = "Configure" ] ; then + echo "You have chosen to configure the PacSat Ground Station" echo - sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - - sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - - sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - - sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - - sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - - sudo sed -i "s/retuneCenterFrequency=false/retuneCenterFrequency=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + /home/pi/CubeSatSim/groundstation/pacsat-config.sh - sudo sed -i "s/stationDetails=.*/stationDetails=FoxInABox/g" /home/pi/FoxTelemetryData/FoxTelem.properties + elif [ "$ANS" = "3" ] || [ "$profile" = "Loopback" ] ; then - # sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube - sudo sed -i "s/soundCard=NONE/soundCard=Direct Audio Device\: FUNcube Dongle V2.0, USB Audi/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + echo "You have chosen the Loopback Simulated PacSat Ground Station" - - - # echo "Enter your Maidenhead grid square. It is two letters followed by two numbers followed by two letters with no spaces. If you don't know your gridsquare, you can look it up here https://dxcluster.ha8tks.hu/hamgeocoding/" - # read grid - # sudo sed -i "s/maidenhead=XX00xx/maidenhead=$grid/g" /home/pi/Documents/FITB/FoxTelem.properties - # echo - - fi - - elif [ "$ANS" = "2" ] || [ "$profile" = "CubeSatSim" ] ; then - - echo "You have chosen the CubeSatSim PacSat Ground Station profile." - echo "c" > /home/pi/.pacsatprofile - - cp /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties.0 - - sudo sed -i "s/useCostas=false/useCostas=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties - - sudo sed -i "s/findSignal=false/findSignal=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties - - elif [ "$ANS" = "3" ] || [ "$profile" = "Loopback" ] ; then - - echo "You have chosen the Loopback Simulated PacSat Ground Station profile." - echo "l" > /home/pi/.pacsatprofile + /home/pi/CubeSatSim/groundstation/pacsat.sh l else @@ -116,31 +68,6 @@ if [ ! -f "$FILE" ]; then fi -fi - -value=`cat /home/pi/FoxTelemetryData/.foxprofile` -echo "$value" > /dev/null -set -- $value - -sudo killall -9 java &>/dev/null - -if [ "$1" = "c" ]; then - echo "CubeSatSim Ground Station profile is set!" - echo - /home/pi/CubeSatSim/groundstation/pacsat.sh -elif [ "$1" = "l" ]; then - echo "Loopback Ground Station profile is set!" - echo - /home/pi/CubeSatSim/groundstation/pacsat.sh l -else - echo "AMSAT profile is set!" - echo -# /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData - cd /home/pi/Desktop/PacsatGround/ - - setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & - -fi sleep 10 From b0df38ee0a3e4cc89b1e1a5d22d2294639e5b7b1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 10:21:08 -0500 Subject: [PATCH 471/554] Update pacsat-config.sh prompt 1-5 configure options --- groundstation/pacsat-config.sh | 142 ++++++++++++--------------------- 1 file changed, 51 insertions(+), 91 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 2963e4c6..97382b39 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -1,132 +1,92 @@ #!/bin/bash # script to run FoxTelem -echo "Startup script to configure the PacSat Ground Station for FIAB v4" +echo "Script to configure the PacSat Ground Station for FIAB v4" echo -source /home/pi/venv/bin/activate +#source /home/pi/venv/bin/activate sudo killall -9 java &>/dev/null sudo killall -9 zenity &>/dev/null +sudo killall -9 direwolf &>/dev/null + #FILE=/home/pi/.pacsatprofile #if [ ! -f "$FILE" ]; then - profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" --column="Choice" --column="Result" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") - echo $profile +# profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" --column="Choice" --column="Result" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") +# echo $profile + + echo "Here are the PacSat Ground Station configuration choices:" + echo + echo "1. Set PacSat Ground Station Callsign" + echo + echo "2. Set PacSat Satellite Callsign" + echo + echo "3. Set Frequencies" + echo + echo "4. Reset PacSat Ground Station" + echo + echo "5. Reset PacSat Satellite" + echo + echo "Which do you choose? Enter 1 - 5" + + read -r ANS - if [ -z "$profile" ]; then + if [ -z "$ANS" ]; then - echo "No choice made. Exiting." - - sleep 3 - - exit + echo "No choice made. Exiting." + + sleep 3 + + exit fi - if [ "$ANS" = "1" ] || [ "$profile" = "PacSat" ] ; then - - echo "You have chosen the PacSat profile." - echo - - sudo killall -9 java &>/dev/null - - sudo killall -9 gpredict &>/dev/null - - FILE=/home/pi/FoxTelemetryData/FoxTelem.properties.0 - if [ ! -f "$FILE" ]; then - cp /home/pi/FoxTelemetryData/FoxTelem.properties /home/pi/FoxTelemetryData/FoxTelem.properties.0 - fi - - python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py - - if [ $? -eq 1 ]; then - - echo "Enter your Groundstation Name. If you upload telemetry data to the AMSAT servers, this name will be displayed on the FoxTelem leader board at https://amsat.org/tlm" - read name - - if [ -n "$name" ]; then - sudo sed -i "s/callsign=.*/callsign=$name/g" /home/pi/FoxTelemetryData/FoxTelem.properties - fi - - echo + if [ "$ANS" = "1" ] ; then - sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + echo "You have chosen to set the PacSat Ground Station Callsign" + echo - sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + elif [ "$ANS" = "2" ] ; then - sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + echo "You have chosen to set the CubeSatSim PacSat Satellite callsign" + echo - sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + /home/pi/CubeSatSim/config -c n - sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + elif [ "$ANS" = "3" ] ; then - sudo sed -i "s/retuneCenterFrequency=false/retuneCenterFrequency=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + echo "You have chosen to set the Frequency of the PacSat Ground Station" + echo - sudo sed -i "s/stationDetails=.*/stationDetails=FoxInABox/g" /home/pi/FoxTelemetryData/FoxTelem.properties + /home/pi/CubeSatSim/config -F n - # sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube - sudo sed -i "s/soundCard=NONE/soundCard=Direct Audio Device\: FUNcube Dongle V2.0, USB Audi/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + elif [ "$ANS" = "4" ] ; then + echo "You have chosen to reset the PacSat Ground Station" + echo + echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft" + echo + /home/pi/CubeSatSim/groundstation/pacsat-reset.sh - # echo "Enter your Maidenhead grid square. It is two letters followed by two numbers followed by two letters with no spaces. If you don't know your gridsquare, you can look it up here https://dxcluster.ha8tks.hu/hamgeocoding/" - # read grid - # sudo sed -i "s/maidenhead=XX00xx/maidenhead=$grid/g" /home/pi/Documents/FITB/FoxTelem.properties - # echo - fi + elif [ "$ANS" = "5" ] ; then - elif [ "$ANS" = "2" ] || [ "$profile" = "CubeSatSim" ] ; then + echo "You have chosen to reset the PacSat Satellite" + echo - echo "You have chosen the CubeSatSim PacSat Ground Station profile." - echo "c" > /home/pi/.pacsatprofile - - cp /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties.0 - - sudo sed -i "s/useCostas=false/useCostas=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties - - sudo sed -i "s/findSignal=false/findSignal=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties - - elif [ "$ANS" = "3" ] || [ "$profile" = "Loopback" ] ; then - - echo "You have chosen the Loopback Simulated PacSat Ground Station profile." - echo "l" > /home/pi/.pacsatprofile - + /home/pi/CubeSatSim/config -X n + else - echo "Please enter only 1 or 2 or 3" + echo "Please enter only 1 to 5" fi -#fi - -#value=`cat /home/pi/FoxTelemetryData/.foxprofile` -#echo "$value" > /dev/null -#set -- $value - -sudo killall -9 java &>/dev/null - -if [ "$1" = "c" ]; then - echo "CubeSatSim Ground Station profile is set!" - echo - /home/pi/CubeSatSim/groundstation/pacsat.sh -elif [ "$1" = "l" ]; then - echo "Loopback Ground Station profile is set!" - echo - /home/pi/CubeSatSim/groundstation/pacsat.sh l -else - echo "AMSAT profile is set!" - echo -# /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData - cd /home/pi/Desktop/PacsatGround/ - - setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & - -fi sleep 10 From aac360630533a269c83ddb9aaa5ad5dac3ceb9cb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 10:36:39 -0500 Subject: [PATCH 472/554] Update pacsat-config.sh add config commands --- groundstation/pacsat-config.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 97382b39..c4570ffc 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -50,6 +50,8 @@ sudo killall -9 direwolf &>/dev/null echo "You have chosen to set the PacSat Ground Station Callsign" echo + /home/pi/CubeSatSim/config -J n + elif [ "$ANS" = "2" ] ; then echo "You have chosen to set the CubeSatSim PacSat Satellite callsign" @@ -71,7 +73,8 @@ sudo killall -9 direwolf &>/dev/null echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft" echo - /home/pi/CubeSatSim/groundstation/pacsat-reset.sh +# /home/pi/CubeSatSim/groundstation/pacsat-reset.sh + /home/pi/CubeSatSim/config -K n elif [ "$ANS" = "5" ] ; then @@ -79,7 +82,7 @@ sudo killall -9 direwolf &>/dev/null echo "You have chosen to reset the PacSat Satellite" echo - /home/pi/CubeSatSim/config -X n + /home/pi/CubeSatSim/config -k n else From bb6b966ad9b4ea968dff8a7e7adf7ea021903fc0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 10:48:35 -0500 Subject: [PATCH 473/554] Update pacsatsim.sh add default configuration if not present --- pacsatsim.sh | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 2e5802d1..8b395c34 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -1,6 +1,36 @@ #!/bin/bash -# script to auto decode packet using rtl_fm and Direwolf and run Pacsat +# script to run PacsatSim + +if [ ! -d "/home/pi/PacSat" ]; then + + echo "Setting up PacSatSim default configuration" + echo + + mkdir /home/pi/PacSat + mkdir /home/pi/PacSat/pacsat + mkdir /home/pi/PacSat/pacsat/dir + + cd /home/pi/pi_pacsat/Debug + + sudo rm pacsat_last_command_time.dat + sudo rm pacsat_upload_table.dat + sudo rm pacsat.state + + echo "bit_rate=9600" > pacsat.config + echo "bbs_callsign=AMSAT-12" >> pacsat.config + echo "broadcast_callsign=AMSAT-11" >> pacsat.config + echo "digi_callsign=AMSAT-1" >> pacsat.config + echo "max_frames_in_tx_buffer=5" >> pacsat.config + + echo "pb_open=1" > pacsat.state + echo "uplink_open=1" >> pacsat.state + echo "pb_max_period_for_client_in_seconds=60" >> pacsat.state + echo "uplink_max_period_for_client_in_seconds=60" >> pacsat.state + + touch /home/pi/pi_pacsat/Debug/pacsat_upload_table.dat + +fi sudo /etc/init.d/alsa-utils stop sudo /etc/init.d/alsa-utils start From 661ba1d115d20192f9f4cf763ed6edeedad49da5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 10:57:15 -0500 Subject: [PATCH 474/554] Update pacsat.sh create PacSatGround dir if not present --- groundstation/pacsat.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 5151e803..c072d488 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -1,6 +1,17 @@ #!/bin/bash -# script to auto decode packet using rtl_fm and Direwolf and run Pacsat +# script to auto decode packet using rtl_fm and Direwolf and run Pacsat Ground Station + +if [ ! -d "/home/pi/PacSatGround" ]; then + + mkdir /home/pi/PacSatGround + + echo + echo "You will need to install the Pacsatsim spacecraft file and set the Delay to 750ms and Port to 8100 and restart the Pacsat Ground Station" + + sleep 10 + +fi sudo modprobe snd-aloop From 43fdf9936c36dec8d1c1baa7bddb355af27a3f4a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 10:58:21 -0500 Subject: [PATCH 475/554] add new configs --- config | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/config b/config index 6207cafa..29725c32 100755 --- a/config +++ b/config @@ -1487,6 +1487,27 @@ elif [ "$1" = "-I" ]; then # restart=1 # fi +elif [ "$1" = "-J" ]; then + + echo "Changing the PacSat Ground Station callsign" + echo + echo "Run the Pacsat Ground Station in the Desktop" + +elif [ "$1" = "-k" ]; then + + echo "Reset PacSat Ground Station configuration" + echo + sudo killall -9 java &>/dev/null + sudo rm -r /home/pi/PacSatGround + +elif [ "$1" = "-K" ]; then + + echo "Reset PacSatSim configuration" + echo + sudo systemctl stop pacsatsim + sudo rm -r /home/pi/PacSat + reboot=1 + elif [ "$1" = "-h" ]; then echo "config OPTION" @@ -1501,13 +1522,16 @@ elif [ "$1" = "-h" ]; then echo " -s Change to SSTV mode" echo " -n Change to Transmit Commands mode" echo " -e Change to Repeater mode" + echo " -j Change to FUNcube mode" + echo " -G Change to PacSatSim mode" + echo " -I Change to PacSat Ground Station mode" echo " -i Restart CubeSatsim software" echo " -c Change the CALLSIGN in the configuration file sim.cfg" echo " -t Change the Simulated Telemetry setting in sim.cfg" echo " -r Change the Resets Count in the configuration file sim.cfg" echo " -l Change the Latitude and Longitude in the configuration file sim.cfg" echo " -S Scan both I2C buses on the Raspberry Pi" - echo " -C Clear logs" + echo " -C Clear logs and reboot" echo " -T Change command and control state" echo " -d Change command and control Direwolf state" echo " -R Change the Commands Count in the file command_count.txt" @@ -1517,14 +1541,15 @@ elif [ "$1" = "-h" ]; then echo " -H Change the Balloon (HAB) mode" echo " -p Display payload sensor data" echo " -v Display voltage and current data" - echo " -P Change the PL (Private Line) CTCSS/CDCSS codes for RX and TX" + echo " -P Change the PL (Private Line) CTCSS/CDCSS codes for FM RX and TX" echo " -A Transmit APRS control packets to control another CubeSatSim" 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 " -g Reset configuration back to default settings" - echo " -G Change to PacSatSim mode" - echo " -I Changing to PacSat Ground Station mode" + echo " -g Reset configuration back to default settings and shutdown" + echo " -J Set the PacSat Ground Station callsign" + echo " -k Reset the PacSatSim Configuration" + echo " -K Reset the PacSatSim Ground Station Configuration" echo exit From 461e45dea67c3421f64845dfb7b6318632bc2ca2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 11:06:17 -0500 Subject: [PATCH 476/554] Update config swap k and K --- config | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config b/config index 29725c32..98c40816 100755 --- a/config +++ b/config @@ -1489,22 +1489,25 @@ elif [ "$1" = "-I" ]; then elif [ "$1" = "-J" ]; then + echo echo "Changing the PacSat Ground Station callsign" echo echo "Run the Pacsat Ground Station in the Desktop" -elif [ "$1" = "-k" ]; then +elif [ "$1" = "-K" ]; then + echo echo "Reset PacSat Ground Station configuration" echo sudo killall -9 java &>/dev/null sudo rm -r /home/pi/PacSatGround -elif [ "$1" = "-K" ]; then +elif [ "$1" = "-k" ]; then + echo echo "Reset PacSatSim configuration" echo - sudo systemctl stop pacsatsim + sudo systemctl stop pacsatsim &>/dev/null sudo rm -r /home/pi/PacSat reboot=1 From e5eb43df5c692cb33928dc23432dc5a533836e94 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 11:31:57 -0500 Subject: [PATCH 477/554] Update config add dev null to stop pacsatsim --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index 98c40816..c4b9b497 100755 --- a/config +++ b/config @@ -566,7 +566,7 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg - sudo systemctl stop pacsatsim + sudo systemctl stop pacsatsim &>/dev/null sudo killall -9 java &>/dev/null sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config From eb23200e6794aef3fa542144b4a510df50d1788a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 11:34:35 -0500 Subject: [PATCH 478/554] Update config also change callsign if old is AMSAT --- config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config b/config index c4b9b497..c6b20f02 100755 --- a/config +++ b/config @@ -571,7 +571,9 @@ elif [ "$1" = "-c" ]; then sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties + sudo sed -i "s/callsign=AMSAT/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties + sudo sed -i "s/AMSAT/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties fi if [ "$norestart" = "1" ]; then From eabb2bf9db495394b1361a0ec49cdc8cc54e7db3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 12:11:28 -0500 Subject: [PATCH 479/554] Update config fix pacsatsim callsign set when reset --- config | 1 + 1 file changed, 1 insertion(+) diff --git a/config b/config index c6b20f02..756baef0 100755 --- a/config +++ b/config @@ -570,6 +570,7 @@ elif [ "$1" = "-c" ]; then sudo killall -9 java &>/dev/null sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config + sudo sed -i "s/AMSAT/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties sudo sed -i "s/callsign=AMSAT/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties From 336e0d9ed3a605974dff9e6df0c114f31f96cf30 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 12:40:18 -0500 Subject: [PATCH 480/554] Update pacsat-config.sh update change remote PacSat callsign --- groundstation/pacsat-config.sh | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index c4570ffc..6445f480 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -23,7 +23,7 @@ sudo killall -9 direwolf &>/dev/null echo echo "1. Set PacSat Ground Station Callsign" echo - echo "2. Set PacSat Satellite Callsign" + echo "2. Set Remote PacSat Satellite Callsign in Ground Station configuration" echo echo "3. Set Frequencies" echo @@ -54,10 +54,34 @@ sudo killall -9 direwolf &>/dev/null elif [ "$ANS" = "2" ] ; then - echo "You have chosen to set the CubeSatSim PacSat Satellite callsign" + echo "You have chosen to set the remote CubeSatSim PacSat Satellite callsign in ground station configuration" echo - /home/pi/CubeSatSim/config -c n + oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGround/spacecraft/PacSatSim.properties) + + echo "Current value of remote PacSat callsign is" + echo $oldcallsign + echo + + echo "Enter new callsign in all capitals: " + read callsign + + if [ -z $callsign ] ; then + + callsign="$1" + echo "Keeping value of" $oldcallsign + + else + + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties + echo + echo "Changing callsign to " + echo $callsign + echo + echo "You will see the change next time you run the PacSat Ground Station" + echo + fi + elif [ "$ANS" = "3" ] ; then From 74fee1252626dffa5e7bc3cec2fa789f939caa2a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 12:42:22 -0500 Subject: [PATCH 481/554] Update pacsat-config.sh don't sleep at end --- groundstation/pacsat-config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 6445f480..014b4f8f 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -115,6 +115,6 @@ sudo killall -9 direwolf &>/dev/null fi -sleep 10 +# sleep 10 #$SHELL From 67b6c5f6bf7079dd1d9efc2a78a9e1fe16511a94 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 12:44:35 -0500 Subject: [PATCH 482/554] Update config remove Ground callsign set, remove remote pacsat --- config | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/config b/config index 756baef0..038eb8d5 100755 --- a/config +++ b/config @@ -573,8 +573,8 @@ elif [ "$1" = "-c" ]; then sudo sed -i "s/AMSAT/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties sudo sed -i "s/callsign=AMSAT/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties - sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties - sudo sed -i "s/AMSAT/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties +# sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties +# sudo sed -i "s/AMSAT/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties fi if [ "$norestart" = "1" ]; then @@ -1490,13 +1490,6 @@ elif [ "$1" = "-I" ]; then # restart=1 # fi -elif [ "$1" = "-J" ]; then - - echo - echo "Changing the PacSat Ground Station callsign" - echo - echo "Run the Pacsat Ground Station in the Desktop" - elif [ "$1" = "-K" ]; then echo @@ -1553,7 +1546,6 @@ elif [ "$1" = "-h" ]; then echo " -o Change telemetry beacon transmit state" echo " -L Change microphone level for command and control" echo " -g Reset configuration back to default settings and shutdown" - echo " -J Set the PacSat Ground Station callsign" echo " -k Reset the PacSatSim Configuration" echo " -K Reset the PacSatSim Ground Station Configuration" From e2dbc1de347ef413a09e0d00a99ab2dab86e5a05 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 12:46:02 -0500 Subject: [PATCH 483/554] Update pacsat-config.sh to fix ground station callsign config --- groundstation/pacsat-config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 014b4f8f..85d02f91 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -50,7 +50,7 @@ sudo killall -9 direwolf &>/dev/null echo "You have chosen to set the PacSat Ground Station Callsign" echo - /home/pi/CubeSatSim/config -J n + /home/pi/CubeSatSim/config -c n elif [ "$ANS" = "2" ] ; then From 69416a1770b21a1b62de81b29d84b7aa1616174f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 14:23:04 -0500 Subject: [PATCH 484/554] Update pacsat.sh add l parameter --- groundstation/pacsat.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index c072d488..34526a33 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -78,7 +78,7 @@ echo #echo echo -echo "The Pacsat Ground Station are running on this Pi using FM receiver and rpitx transmitter" +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/ @@ -90,12 +90,21 @@ echo sudo usermod -a -G gpio pi -/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-df.sh" +if [ ! "$1" = "l" ]; 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" + /home/pi/CubeSatSim/groundstation/pacsat-d.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 & ##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." +# echo "Don't close the direwolf window or the Pacsatsim will stop running." cd /home/pi/Desktop/PacsatGround/ From 8ff65ab10b4b751bb1648dd251aef1cdfee26f39 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 14:28:06 -0500 Subject: [PATCH 485/554] Update pacsat.sh direwolf to background --- groundstation/pacsat.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 34526a33..5c118cdb 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -93,11 +93,11 @@ sudo usermod -a -G gpio pi if [ ! "$1" = "l" ]; 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 + /home/pi/CubeSatSim/groundstation/pacsat-df.sh & else echo "Using audio loopback" - /home/pi/CubeSatSim/groundstation/pacsat-d.sh + /home/pi/CubeSatSim/groundstation/pacsat-d.sh & fi From 511b105c593aa3aef97535b63461f016f3d38173 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 14:37:27 -0500 Subject: [PATCH 486/554] Update pacsatsim-d.sh change to loopback --- pacsatsim-d.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim-d.sh b/pacsatsim-d.sh index f7c3e84e..7480af0c 100755 --- a/pacsatsim-d.sh +++ b/pacsatsim-d.sh @@ -2,4 +2,4 @@ sudo modprobe snd-aloop -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14-loop.conf -t 0 +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 From 6d58ac9bc324ee8f78d24ffd1555314bb9a48da3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 14:44:28 -0500 Subject: [PATCH 487/554] Update pacsat-run.sh for loopback run pacsatsim.sh l --- groundstation/pacsat-run.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/groundstation/pacsat-run.sh b/groundstation/pacsat-run.sh index f41f44f7..f4242560 100644 --- a/groundstation/pacsat-run.sh +++ b/groundstation/pacsat-run.sh @@ -59,6 +59,12 @@ sudo killall -9 zenity &>/dev/null elif [ "$ANS" = "3" ] || [ "$profile" = "Loopback" ] ; then echo "You have chosen the Loopback Simulated PacSat Ground Station" + + sleep 1 + + /usr/bin/x-terminal-emulator --geometry=120x40 -e "bash /home/pi/CubeSatSim/pacsatsim.sh l" + + sleep 1 /home/pi/CubeSatSim/groundstation/pacsat.sh l From 8ade73385c9c8e62f554de3856421d619d24a81e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 14:46:54 -0500 Subject: [PATCH 488/554] Update pacsatsim.sh add l parameter for loopback --- pacsatsim.sh | 145 +++++---------------------------------------------- 1 file changed, 13 insertions(+), 132 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 8b395c34..c80132d2 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -71,152 +71,22 @@ sudo modprobe snd-aloop echo -#frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") -#echo $frequency - -#if [ -z "$frequency" ]; then - -#echo "No choice made. Exiting." - -#sleep 3 - -#exit - -#echo "Choose the number for the packet decoding option:" -#echo -#echo "1. APRS US 2m (144390 kHz)" -#echo "2. CubeSatSim (434900 kHz)" -#echo "3. APRS European 2m (144800 kHz)" -#echo "4. APRS Australian 2m (145175 kHz)" -#echo "5. APRS on another frequency" -#echo "6. APRS on ISS (145825 kHz)" -#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" -#echo "8. Test Serenity CubeSat decoding with WAV file" -#echo "9. Test APRS decoding with CubeSatSim WAV file" -#echo - -#read -r choice - -choice=2 +#choice=2 #fi -if [ "$choice" = "1" ] || [ "$frequency" = "144390" ]; then - frequency=144390000 - -elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then - - frequency=434900000 +# frequency=434900000 echo echo "If your Pacsat Ground Station is transmitting packets, you will see them here" echo -elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then - - frequency=144800000 - -elif [ "$choice" = "4" ] || [ "$frequency" = "145175" ]; then - - frequency=145175000 - -elif [ "$choice" = "5" ] || [ "$frequency" = "Other" ] ; then - - echo - - echo "Enter the frequency in kiloHertz" - - echo - - read -r frequency - - frequency=$frequency"000" - - #echo $frequency - -elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then - - frequency=145825000 - echo - echo "If the ISS is overhead and in APRS mode (see tracking application such as Gpredict), you will see packets." - echo - -elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then - - frequency=437100000 - echo - echo "If the Serenity CubeSat is overhead and transmitting (see tracking application such as Gpredict), you will see packets." - echo - -elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then - - echo "A recorded WAV file will play and you should see some packets decoded" - - echo - - value=`aplay -l | grep "Loopback"` - echo "$value" > /dev/null - set -- $value - -# aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & -# aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & - aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & - aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & - - timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 - - echo - - echo "Test complete. This window will close in 10 seconds." - - sleep 5 - - exit - -elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then - - echo "A recorded APRS WAV file from the CubeSatSim will play and you should see a packet decoded." - - echo - - value=`aplay -l | grep "Loopback"` - echo "$value" > /dev/null - set -- $value - - #aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav & - (while true; do (sleep 2 && aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & - - #aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav & - (while true; do (sleep 2 && aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & - - timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 - - echo - - echo "Test complete. This window will close in 10 seconds." - - sleep 5 - - exit - -#fi - -fi #echo #echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." -echo - -if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then - - echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" - - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & - -else # echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" @@ -224,8 +94,19 @@ else # /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-df.sh" + + +if [ ! "$1" = "l" ]; then +#/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-df.sh" + echo "Using TXC FM transceiver" /home/pi/CubeSatSim/pacsatsim-df.sh & +else + echo "Using audio loopback" + /home/pi/CubeSatSim/pacsatsim-d.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 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 f524d8b340c5d7201641ff4c436f7efa06f9bf6e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 14:52:42 -0500 Subject: [PATCH 489/554] make executable --- groundstation/pacsat-run.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 groundstation/pacsat-run.sh diff --git a/groundstation/pacsat-run.sh b/groundstation/pacsat-run.sh old mode 100644 new mode 100755 From 0cab7f0623361d2a2f6bcc78ad60972c18cda5a7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 14:56:48 -0500 Subject: [PATCH 490/554] Update pacsat-d.sh change to loopback --- groundstation/pacsat-d.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/groundstation/pacsat-d.sh b/groundstation/pacsat-d.sh index e1569ce7..a794108c 100755 --- a/groundstation/pacsat-d.sh +++ b/groundstation/pacsat-d.sh @@ -2,5 +2,4 @@ sudo modprobe snd-aloop -direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14-loop.conf -t 0 - +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 From 34198a02eb1060900c78933f7747dd4e640ebb35 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 15:00:24 -0500 Subject: [PATCH 491/554] Update pacsatsim.sh fix extra fi --- pacsatsim.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index c80132d2..4d965b06 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -112,8 +112,6 @@ fi ## echo "Don't close the direwolf window or the Pacsatsim will stop running." - echo -fi sudo /home/pi/pacsat_telem/Debug/pacsat_telem -v -d /home/pi/PacSat/pacsat & From 2e2b7d1ec032ee18c737d248313b903833bd6151 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 16:39:09 -0500 Subject: [PATCH 492/554] Update direwolf-pacsatsim-loopback.conf make same as pam --- direwolf/direwolf-pacsatsim-loopback.conf | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/direwolf/direwolf-pacsatsim-loopback.conf b/direwolf/direwolf-pacsatsim-loopback.conf index e96bd980..1c74a18c 100644 --- a/direwolf/direwolf-pacsatsim-loopback.conf +++ b/direwolf/direwolf-pacsatsim-loopback.conf @@ -3,6 +3,16 @@ PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 MODEM 1200 -FULLDUP ON -TXDELAY 15 +##FULLDUP ON +##TXDELAY 15 #FIX_BITS 1 AX25 + +# +DWAIT 0 +SLOTTIME 10 +PERSIST 63 +TXDELAY 1000 +#TXDELAY 100 +TXTAIL 10 +#TXTAIL 1 +FULLDUP OFF From f77025d9825a59324bd1ba2f9fbd468d2651ebd9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 16:41:44 -0500 Subject: [PATCH 493/554] Update direwolf-pacsat-loopback.conf same as pwm --- .../direwolf/direwolf-pacsat-loopback.conf | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf index 6058c722..a101c334 100644 --- a/groundstation/direwolf/direwolf-pacsat-loopback.conf +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -1,10 +1,19 @@ MYCALL AMSAT ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=0 -#PTT GPIO 20 +PTT GPIO -20 27 #Transmit LED CHANNEL 0 MODEM 1200 KISSPORT 8100 AGWPORT 8002 -FULLDUP OFF -TXDELAY 30 +#FULLDUP OFF +#TXDELAY 30 #FIX_BITS 1 AX25 + +#DWAIT 0 +DWAIT 20 +SLOTTIME 300 +PERSIST 63 +TXDELAY 1000 +#TXDELAY 150 +#TXTAIL 10 +FULLDUP OFF From e9d0e570fc92ebb9b852ea0d734395667f364611 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 16:45:54 -0500 Subject: [PATCH 494/554] Update direwolf-pacsat-loopback.conf kissport 8102 --- groundstation/direwolf/direwolf-pacsat-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf index a101c334..46878576 100644 --- a/groundstation/direwolf/direwolf-pacsat-loopback.conf +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -3,7 +3,7 @@ ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=0 PTT GPIO -20 27 #Transmit LED CHANNEL 0 MODEM 1200 -KISSPORT 8100 +KISSPORT 8102 AGWPORT 8002 #FULLDUP OFF #TXDELAY 30 From e185aa91d84b35e6f02815c614132086a6d1fc5a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 16:49:28 -0500 Subject: [PATCH 495/554] Update direwolf-pacsatsim-loopback.conf mix loopback 1 0 --- direwolf/direwolf-pacsatsim-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-loopback.conf b/direwolf/direwolf-pacsatsim-loopback.conf index 1c74a18c..7812e543 100644 --- a/direwolf/direwolf-pacsatsim-loopback.conf +++ b/direwolf/direwolf-pacsatsim-loopback.conf @@ -1,4 +1,4 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 From 582c570be38748dbec6e6fe9e87e4d032dad98ea Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 16:49:35 -0500 Subject: [PATCH 496/554] Update direwolf-pacsat-loopback.conf mix loopback 0 1 --- groundstation/direwolf/direwolf-pacsat-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf index 46878576..22f60b15 100644 --- a/groundstation/direwolf/direwolf-pacsat-loopback.conf +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -1,5 +1,5 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 PTT GPIO -20 27 #Transmit LED CHANNEL 0 MODEM 1200 From a39e52c61706e54741f2e29a9a5ebc039fdc14c3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 16:53:56 -0500 Subject: [PATCH 497/554] Update direwolf-pacsatsim-loopback.conf back to 0 0 --- direwolf/direwolf-pacsatsim-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direwolf/direwolf-pacsatsim-loopback.conf b/direwolf/direwolf-pacsatsim-loopback.conf index 7812e543..f2ebf026 100644 --- a/direwolf/direwolf-pacsatsim-loopback.conf +++ b/direwolf/direwolf-pacsatsim-loopback.conf @@ -1,4 +1,4 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=0 PTT GPIO -20 MYCALL AMSAT-12 CHANNEL 0 From 22e9fd420904ff5d94b3cb032f36b3a98887107a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 2 Mar 2026 16:54:03 -0500 Subject: [PATCH 498/554] Update direwolf-pacsat-loopback.conf back to 1 1 --- groundstation/direwolf/direwolf-pacsat-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf index 22f60b15..a9a84df3 100644 --- a/groundstation/direwolf/direwolf-pacsat-loopback.conf +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -1,5 +1,5 @@ MYCALL AMSAT -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 PTT GPIO -20 27 #Transmit LED CHANNEL 0 MODEM 1200 From 20a9466e545a757121c62cc743bac41f88f400dd Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 08:58:58 -0500 Subject: [PATCH 499/554] Update pacsat.sh check callsign and update if changed --- groundstation/pacsat.sh | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) 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 & From 159d3d839dec3bd1cd2fc0759fe466e66ab3e74d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 09:01:06 -0500 Subject: [PATCH 500/554] Update pacsat.sh missing then --- groundstation/pacsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 96fbef3b..5a2c7247 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -28,7 +28,7 @@ callsign="$1" oldcallsign=$(grep -oP '(?<=callsign=).*(?=-)' /home/pi/PacSatGround/PacSatGround.properties) -if [ ! "$callsign" = "$oldcallsign" ] +if [ ! "$callsign" = "$oldcallsign" ] ; then sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties From 6c3eec3fd69b50dadd6b76305b1816a7ec39b75f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 09:05:43 -0500 Subject: [PATCH 501/554] Update pacsat.sh print callsigns --- groundstation/pacsat.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 5a2c7247..d4fd31e2 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -24,13 +24,22 @@ value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null set -- $value + callsign="$1" +echo "Configured callsign is " +echo $callsign + oldcallsign=$(grep -oP '(?<=callsign=).*(?=-)' /home/pi/PacSatGround/PacSatGround.properties) +echo "Callsign in PacSatGround.properties is " +echo $oldcallsign + if [ ! "$callsign" = "$oldcallsign" ] ; then sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties + + cat /home/pi/PacSatGround/PacSatGround.properties fi From b8cabfd761edf990748c2cb33edf24cf1bfa4adf Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 09:16:09 -0500 Subject: [PATCH 502/554] Update pacsat.sh fix callsign regex --- groundstation/pacsat.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index d4fd31e2..906c9276 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -24,13 +24,12 @@ value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null set -- $value - callsign="$1" echo "Configured callsign is " echo $callsign -oldcallsign=$(grep -oP '(?<=callsign=).*(?=-)' /home/pi/PacSatGround/PacSatGround.properties) +oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGround/PacSatGround.properties) echo "Callsign in PacSatGround.properties is " echo $oldcallsign From d648b0641982ab11ef4be0a65d3c4ed4071781dc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 09:35:37 -0500 Subject: [PATCH 503/554] Update pacsatsim.sh check callsign and update if changed --- pacsatsim.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index 4d965b06..f4b5f725 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -32,6 +32,35 @@ if [ ! -d "/home/pi/PacSat" ]; then fi +value=`cat /home/pi/CubeSatSim/sim.cfg` +echo "$value" > /dev/null +set -- $value + +callsign="$1" + +echo "Configured callsign is " +echo $callsign + +oldcallsign=$(grep -oP '(?<=bbs_callsign=).*(?=-)' /home/pi/pi_pacsat/Debug/pacsat.config) + +echo "Callsign in pacsat.config is " +echo $oldcallsign + +if [ ! "$callsign" = "$oldcallsign" ] ; then + + sudo sed -i "s/bbs_callsign=$oldcallsign/bbs_callsign=$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config + sudo sed -i "s/broadcast_callsign=$oldcallsign/broadcast_callsign=$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config + sudo sed -i "s/digi_callsign=$oldcallsign/digi_callsign=$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config + + echo "New pacsat.confg is" + echo + + cat /home/pi/pi_pacsat/Debug/pacsat.config + +fi + + + sudo /etc/init.d/alsa-utils stop sudo /etc/init.d/alsa-utils start From ff744c5fd7eb371afb7027d90ab97ce28f194b9c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 09:38:40 -0500 Subject: [PATCH 504/554] Update pacsat.desktop change to pacsat-run --- groundstation/pacsat.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/pacsat.desktop b/groundstation/pacsat.desktop index 7fef68f8..7097509e 100644 --- a/groundstation/pacsat.desktop +++ b/groundstation/pacsat.desktop @@ -2,7 +2,7 @@ Name=Pacsat GenericName=Pacsat Loopback Comment=Pacsat -Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat.sh" +Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-run.sh" Icon=/home/pi/Icons/pacsat.png Terminal=true Type=Application From 7fa62b4ea130e1efaaa220bfa6a2dca2a96f5463 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 09:46:10 -0500 Subject: [PATCH 505/554] Update pacsatsim.sh fix loopback variable --- pacsatsim.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index f4b5f725..22a70958 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -2,6 +2,13 @@ # script to run PacsatSim +loopback=0 +if [ "$1" = "l" ] ; then + + loopback=1 + +fi + if [ ! -d "/home/pi/PacSat" ]; then echo "Setting up PacSatSim default configuration" @@ -125,14 +132,15 @@ echo -if [ ! "$1" = "l" ]; then -#/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-df.sh" - echo "Using TXC FM transceiver" - /home/pi/CubeSatSim/pacsatsim-df.sh & +if [ "$loopback" = "1" ]; then -else echo "Using audio loopback" /home/pi/CubeSatSim/pacsatsim-d.sh & + +else + + echo "Using TXC FM transceiver" + /home/pi/CubeSatSim/pacsatsim-df.sh & fi From f6280e6fafb6ed4bd7995c3b3ff694557b7e4736 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 09:54:56 -0500 Subject: [PATCH 506/554] Update config remove all pacsat callsign change code --- config | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config b/config index 038eb8d5..09394c01 100755 --- a/config +++ b/config @@ -566,13 +566,13 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg - sudo systemctl stop pacsatsim &>/dev/null - sudo killall -9 java &>/dev/null +# sudo systemctl stop pacsatsim &>/dev/null +# sudo killall -9 java &>/dev/null - sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config - sudo sed -i "s/AMSAT/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config - sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties - sudo sed -i "s/callsign=AMSAT/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties +# sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config +# sudo sed -i "s/AMSAT/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config +# sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties +# sudo sed -i "s/callsign=AMSAT/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties # sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties # sudo sed -i "s/AMSAT/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties fi From e6a1b3c922d66d23a014625de62ba41ea15e0d54 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 10:05:17 -0500 Subject: [PATCH 507/554] Update pacsatsim.sh killall pi_pacsat and pacsat_telem --- pacsatsim.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pacsatsim.sh b/pacsatsim.sh index 22a70958..d873f254 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -105,6 +105,10 @@ sudo modprobe snd-aloop #sudo killall -9 zenity &>/dev/null +sudo killall -9 pacsat_telem &>/dev/null + +sudo killall -9 pi_pacsat &>/dev/null + echo From 005578a3e0f680874bcec86d9e5f167ec485f1d0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 10:56:01 -0500 Subject: [PATCH 508/554] Update pacsatsim.sh sudo for direwolf or shared_mic error --- pacsatsim.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index d873f254..56fc3033 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -139,12 +139,12 @@ echo if [ "$loopback" = "1" ]; then echo "Using audio loopback" - /home/pi/CubeSatSim/pacsatsim-d.sh & + sudo /home/pi/CubeSatSim/pacsatsim-d.sh & else echo "Using TXC FM transceiver" - /home/pi/CubeSatSim/pacsatsim-df.sh & + sudo /home/pi/CubeSatSim/pacsatsim-df.sh & fi From 646ab6cbc3b3320d8f7bbde010e50b025c5a1741 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 11:55:51 -0500 Subject: [PATCH 509/554] Update pacsat.sh add Loopback directory --- groundstation/pacsat.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 906c9276..4573cecf 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -6,15 +6,18 @@ loopback=0 if [ "$1" = "l" ] ; then loopback=1 + echo "PacSat Ground Station with Loopback" fi if [ ! -d "/home/pi/PacSatGround" ] ; then mkdir /home/pi/PacSatGround + + mkdir /home/pi/PacSatGroundLoop echo - echo "You will need to install the Pacsatsim spacecraft file and set the Delay to 750ms and Port to 8100 and restart the Pacsat Ground Station" + echo "The first time you run the Ground Station, you will need to install the Pacsatsim spacecraft file and set the Delay to 750ms and Port to 8100 and restart the Pacsat Ground Station" sleep 10 @@ -42,6 +45,19 @@ if [ ! "$callsign" = "$oldcallsign" ] ; then fi +oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGroundLoop/PacSatGround.properties) + +echo "Callsign in Loopback PacSatGround.properties is " +echo $oldcallsign + +if [ ! "$callsign" = "$oldcallsign" ] ; then + + sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGroundLoop/PacSatGround.properties + + cat /home/pi/PacSatGroundLoop/PacSatGround.properties + +fi + sudo modprobe snd-aloop #sudo systemctl stop cubesatsim >/dev/null 2>&1 @@ -139,9 +155,15 @@ fi cd /home/pi/Desktop/PacsatGround/ -setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & +if [ "$loopback" = "1" ]; then + setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGroundLoop" # removed & +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" From 88ed76d9dfde98c72368471b286da8a10f70d93a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 11:58:44 -0500 Subject: [PATCH 510/554] Update pacsat-config.sh add Loopback config reset --- groundstation/pacsat-config.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 85d02f91..c3f9a00c 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -27,9 +27,11 @@ sudo killall -9 direwolf &>/dev/null echo echo "3. Set Frequencies" echo - echo "4. Reset PacSat Ground Station" - echo - echo "5. Reset PacSat Satellite" + echo "4. Reset PacSat Ground Station Configuration" + echo + echo "5. Reset PacSat Ground Station Loopback Configuration" + echo + echo "6. Reset PacSat Satellite" echo echo "Which do you choose? Enter 1 - 5" @@ -92,16 +94,23 @@ sudo killall -9 direwolf &>/dev/null elif [ "$ANS" = "4" ] ; then - echo "You have chosen to reset the PacSat Ground Station" + echo "You have chosen to reset the PacSat Ground Station Configuration" echo echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft" echo -# /home/pi/CubeSatSim/groundstation/pacsat-reset.sh - /home/pi/CubeSatSim/config -K n + sudo rm -r /home/pi/PacSatGround + + elif [ "$ANS" = "5" ] ; then + + echo "You have chosen to reset the PacSat Ground Station Loopback Configuration" + echo + echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft" + echo + sudo rm -r /home/pi/PacSatGroundLoop - elif [ "$ANS" = "5" ] ; then + elif [ "$ANS" = "6" ] ; then echo "You have chosen to reset the PacSat Satellite" echo From da52631b1cb74612f707e555838e2795e183d14e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 11:59:43 -0500 Subject: [PATCH 511/554] Update pacsat.sh add Loopback configuration --- groundstation/pacsat.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 4573cecf..df8693d8 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -13,6 +13,15 @@ fi if [ ! -d "/home/pi/PacSatGround" ] ; then mkdir /home/pi/PacSatGround + + echo + echo "The first time you run the Ground Station, you will need to install the Pacsatsim spacecraft file and set the Delay to 750ms and Port to 8100 and restart the Pacsat Ground Station" + + sleep 10 + +fi + +if [ ! -d "/home/pi/PacSatGroundLoop" ] ; then mkdir /home/pi/PacSatGroundLoop From 6ece8ea7c917920caab73977ca8ee6bf11b32a39 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 12:02:04 -0500 Subject: [PATCH 512/554] Update config remove pacsat ground reset --- config | 9 --------- 1 file changed, 9 deletions(-) diff --git a/config b/config index 09394c01..55aaba34 100755 --- a/config +++ b/config @@ -1490,14 +1490,6 @@ elif [ "$1" = "-I" ]; then # restart=1 # fi -elif [ "$1" = "-K" ]; then - - echo - echo "Reset PacSat Ground Station configuration" - echo - sudo killall -9 java &>/dev/null - sudo rm -r /home/pi/PacSatGround - elif [ "$1" = "-k" ]; then echo @@ -1547,7 +1539,6 @@ elif [ "$1" = "-h" ]; then echo " -L Change microphone level for command and control" echo " -g Reset configuration back to default settings and shutdown" echo " -k Reset the PacSatSim Configuration" - echo " -K Reset the PacSatSim Ground Station Configuration" echo exit From 4025dca6c1a7b541879ae2fcc0c314adf3d667d7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 12:09:14 -0500 Subject: [PATCH 513/554] Update direwolf-pacsat-loopback.conf change to 8100 --- groundstation/direwolf/direwolf-pacsat-loopback.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf index a9a84df3..6cd3d988 100644 --- a/groundstation/direwolf/direwolf-pacsat-loopback.conf +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -3,7 +3,7 @@ ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 PTT GPIO -20 27 #Transmit LED CHANNEL 0 MODEM 1200 -KISSPORT 8102 +KISSPORT 8100 AGWPORT 8002 #FULLDUP OFF #TXDELAY 30 From 8d672cccb6d7f8c515c2e8f5834bfbb0e5a4a381 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 13:19:51 -0500 Subject: [PATCH 514/554] Update pacsat-config.sh add main and simulated --- groundstation/pacsat-config.sh | 160 +++++++++++++++++++++------------ 1 file changed, 101 insertions(+), 59 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index c3f9a00c..2eb59921 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -19,22 +19,18 @@ sudo killall -9 direwolf &>/dev/null # profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" --column="Choice" --column="Result" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") # echo $profile - echo "Here are the PacSat Ground Station configuration choices:" + echo "Here are the PacSat configuration choices:" echo - echo "1. Set PacSat Ground Station Callsign" + echo "1. PacSat Ground Station Configuration" echo - echo "2. Set Remote PacSat Satellite Callsign in Ground Station configuration" - echo - echo "3. Set Frequencies" + echo "2. PacSat Ground Station Loopback Configuration" echo - echo "4. Reset PacSat Ground Station Configuration" - echo - echo "5. Reset PacSat Ground Station Loopback Configuration" - echo - echo "6. Reset PacSat Satellite" + echo "3. Set Frequencies" echo - echo "Which do you choose? Enter 1 - 5" - + echo "4. Reset PacSat Satellite" + echo + echo "Which do you choose? Enter 1 - 4" + read -r ANS if [ -z "$ANS" ]; then @@ -48,42 +44,106 @@ sudo killall -9 direwolf &>/dev/null fi if [ "$ANS" = "1" ] ; then + + echo "Here are your PacSat Ground Station Configuration choices:" + echo + echo "1. PacSat Ground Station Callsign" + echo + echo "2. Set Remote PacSat Satellite Callsign in Ground Station configuration" + echo + echo "3. Reset PacSat Ground Station Configuration" + + read -r ANS - echo "You have chosen to set the PacSat Ground Station Callsign" - echo - - /home/pi/CubeSatSim/config -c n - - elif [ "$ANS" = "2" ] ; then - - echo "You have chosen to set the remote CubeSatSim PacSat Satellite callsign in ground station configuration" - echo + + if [ -z "$ANS" ]; then + + echo "No choice made. Exiting." + + sleep 3 + + exit + + fi - oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGround/spacecraft/PacSatSim.properties) + if [ "$ANS" = "1" ] ; then - echo "Current value of remote PacSat callsign is" - echo $oldcallsign - echo + oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGround/PacSatGround.properties) - echo "Enter new callsign in all capitals: " - read callsign - - if [ -z $callsign ] ; then + echo "Callsign in PacSatGround.properties is " + echo $oldcallsign + + echo "Enter new callsign in all capitals: " + read callsign + + if [ -z $callsign ] ; then + + callsign="$1" + echo "Keeping value of" $oldcallsign - callsign="$1" - echo "Keeping value of" $oldcallsign - - else + else + + echo "Configured callsign is " + echo $callsign + + if [ ! "$callsign" = "$oldcallsign" ] ; then + + sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties + + cat /home/pi/PacSatGround/PacSatGround.properties + + fi + + elif [ "$ANS" = "2" ] ; then - sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties + echo "You have chosen to set the remote CubeSatSim PacSat Satellite callsign in ground station configuration" echo - echo "Changing callsign to " - echo $callsign - echo - echo "You will see the change next time you run the PacSat Ground Station" + + oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGround/spacecraft/PacSatSim.properties) + + echo "Current value of remote PacSat callsign is" + echo $oldcallsign echo - fi + + echo "Enter new callsign in all capitals: " + read callsign + if [ -z $callsign ] ; then + + callsign="$1" + echo "Keeping value of" $oldcallsign + + else + + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties + echo + echo "Changing callsign to " + echo $callsign + echo + echo "You will see the change next time you run the PacSat Ground Station" + echo + fi + + elif [ "$ANS" = "3" ] ; then + + echo "You have chosen to reset the PacSat Ground Station Configuration" + echo + echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft" + echo + + sudo rm -r /home/pi/PacSatGround + + elif [ "$ANS" = "2" ] ; then + + echo "Here are your PacSat Ground Station Loopback Configuration choices:" + echo + echo "1. PacSat Ground Station Callsign" + echo + echo "2. Set Remote PacSat Satellite Callsign in Ground Station configuration" + echo + echo "3. Reset PacSat Ground Station Configuration" + + read -r ANS elif [ "$ANS" = "3" ] ; then @@ -92,25 +152,7 @@ sudo killall -9 direwolf &>/dev/null /home/pi/CubeSatSim/config -F n - elif [ "$ANS" = "4" ] ; then - - echo "You have chosen to reset the PacSat Ground Station Configuration" - echo - echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft" - echo - - sudo rm -r /home/pi/PacSatGround - - elif [ "$ANS" = "5" ] ; then - - echo "You have chosen to reset the PacSat Ground Station Loopback Configuration" - echo - echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft" - echo - - sudo rm -r /home/pi/PacSatGroundLoop - - elif [ "$ANS" = "6" ] ; then + elif [ "$ANS" = "4" ] ; then echo "You have chosen to reset the PacSat Satellite" echo @@ -119,7 +161,7 @@ sudo killall -9 direwolf &>/dev/null else - echo "Please enter only 1 to 5" + echo "Please enter only 1 to 4" fi From a98b949d20b1491e891c579df6c8795383035e51 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 13:20:08 -0500 Subject: [PATCH 515/554] Update pacsat.sh add TNC delay set to 750, remove callsign --- groundstation/pacsat.sh | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index df8693d8..16640dd6 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -32,40 +32,8 @@ if [ ! -d "/home/pi/PacSatGroundLoop" ] ; then fi -value=`cat /home/pi/CubeSatSim/sim.cfg` -echo "$value" > /dev/null -set -- $value - -callsign="$1" - -echo "Configured callsign is " -echo $callsign - -oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGround/PacSatGround.properties) - -echo "Callsign in PacSatGround.properties is " -echo $oldcallsign - -if [ ! "$callsign" = "$oldcallsign" ] ; then - - sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties - - cat /home/pi/PacSatGround/PacSatGround.properties - -fi - -oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGroundLoop/PacSatGround.properties) - -echo "Callsign in Loopback PacSatGround.properties is " -echo $oldcallsign - -if [ ! "$callsign" = "$oldcallsign" ] ; then - - sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGroundLoop/PacSatGround.properties - - cat /home/pi/PacSatGroundLoop/PacSatGround.properties - -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 sudo modprobe snd-aloop From d90344a08b2afab9032489389a2a91b190c46e83 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 13:24:21 -0500 Subject: [PATCH 516/554] Update pacsat-config.sh add else --- groundstation/pacsat-config.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index 2eb59921..ea8055dc 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -133,6 +133,12 @@ sudo killall -9 direwolf &>/dev/null sudo rm -r /home/pi/PacSatGround + else + + echo "Please choose an option 1-3" + + fi + elif [ "$ANS" = "2" ] ; then echo "Here are your PacSat Ground Station Loopback Configuration choices:" From 7e32427429cf49b238777407f4d28c563844ff53 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 13:25:38 -0500 Subject: [PATCH 517/554] Update pacsat-config.sh missing fi --- groundstation/pacsat-config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index ea8055dc..c69aad16 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -93,6 +93,7 @@ sudo killall -9 direwolf &>/dev/null cat /home/pi/PacSatGround/PacSatGround.properties fi + fi elif [ "$ANS" = "2" ] ; then From 0e86e8771e01c5f3df4d23ea67d95c166401c779 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 14:32:29 -0500 Subject: [PATCH 518/554] Update pacsat-config.sh Loopback config settings --- groundstation/pacsat-config.sh | 66 +++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index c69aad16..d15e7604 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -43,9 +43,13 @@ sudo killall -9 direwolf &>/dev/null fi - if [ "$ANS" = "1" ] ; then - - echo "Here are your PacSat Ground Station Configuration choices:" + if [ "$ANS" = "1" ] || [ "$ANS" = "2" ] ; then + + if [ "$ANS" = "1" ] ; then + echo "Here are your PacSat Ground Station Configuration choices:" + else + echo "Here are your PacSat Ground Station Simulation Configuration choices:" + fi echo echo "1. PacSat Ground Station Callsign" echo @@ -68,8 +72,11 @@ sudo killall -9 direwolf &>/dev/null if [ "$ANS" = "1" ] ; then - oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGround/PacSatGround.properties) - + if [ "$ANS" = "1" ] ; then + oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGround/PacSatGround.properties) + else + oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGroundLoop/PacSatGround.properties) + fi echo "Callsign in PacSatGround.properties is " echo $oldcallsign @@ -87,10 +94,14 @@ sudo killall -9 direwolf &>/dev/null echo $callsign if [ ! "$callsign" = "$oldcallsign" ] ; then - - sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties - - cat /home/pi/PacSatGround/PacSatGround.properties + + if [ "$ANS" = "1" ] ; then + sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties + cat /home/pi/PacSatGround/PacSatGround.properties + else + sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGroundLoop/PacSatGround.properties + cat /home/pi/PacSatGroundLoop/PacSatGround.properties + fi fi fi @@ -99,9 +110,12 @@ sudo killall -9 direwolf &>/dev/null echo "You have chosen to set the remote CubeSatSim PacSat Satellite callsign in ground station configuration" echo - - oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGround/spacecraft/PacSatSim.properties) - + + if [ "$ANS" = "1" ] ; then + oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGround/spacecraft/PacSatSim.properties) + else + oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGroundLoop/spacecraft/PacSatSim.properties) + fi echo "Current value of remote PacSat callsign is" echo $oldcallsign echo @@ -115,8 +129,11 @@ sudo killall -9 direwolf &>/dev/null echo "Keeping value of" $oldcallsign else - - sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties + if [ "$ANS" = "1" ] ; then + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties + else + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGroundLoop/spacecraft/PacSatSim.properties + fi echo echo "Changing callsign to " echo $callsign @@ -131,27 +148,18 @@ sudo killall -9 direwolf &>/dev/null echo echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft" echo - - sudo rm -r /home/pi/PacSatGround - + + if [ "$ANS" = "1" ] ; then + sudo rm -r /home/pi/PacSatGround + else + sudo rm -r /home/pi/PacSatGroundLoop + fi else echo "Please choose an option 1-3" fi - elif [ "$ANS" = "2" ] ; then - - echo "Here are your PacSat Ground Station Loopback Configuration choices:" - echo - echo "1. PacSat Ground Station Callsign" - echo - echo "2. Set Remote PacSat Satellite Callsign in Ground Station configuration" - echo - echo "3. Reset PacSat Ground Station Configuration" - - read -r ANS - elif [ "$ANS" = "3" ] ; then echo "You have chosen to set the Frequency of the PacSat Ground Station" From a1dee64675510da8568df5912e0f0d3fb739990f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 14:35:50 -0500 Subject: [PATCH 519/554] Update pacsat-config.sh cleanup --- groundstation/pacsat-config.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index d15e7604..ed820b13 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -21,13 +21,13 @@ sudo killall -9 direwolf &>/dev/null echo "Here are the PacSat configuration choices:" echo - echo "1. PacSat Ground Station Configuration" + echo " 1. PacSat Ground Station Configuration" echo - echo "2. PacSat Ground Station Loopback Configuration" + echo " 2. PacSat Ground Station Simulation Configuration" echo - echo "3. Set Frequencies" + echo " 3. Set Frequencies" echo - echo "4. Reset PacSat Satellite" + echo " 4. Reset PacSat Satellite" echo echo "Which do you choose? Enter 1 - 4" @@ -51,11 +51,11 @@ sudo killall -9 direwolf &>/dev/null echo "Here are your PacSat Ground Station Simulation Configuration choices:" fi echo - echo "1. PacSat Ground Station Callsign" + echo " 1. PacSat Ground Station Callsign" echo - echo "2. Set Remote PacSat Satellite Callsign in Ground Station configuration" + echo " 2. Set Remote PacSat Satellite Callsign in Ground Station configuration" echo - echo "3. Reset PacSat Ground Station Configuration" + echo " 3. Reset PacSat Ground Station Configuration" read -r ANS @@ -72,6 +72,7 @@ sudo killall -9 direwolf &>/dev/null if [ "$ANS" = "1" ] ; then + echo if [ "$ANS" = "1" ] ; then oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGround/PacSatGround.properties) else From 5cd4ebec220a2678688312c53fbb339bce1fa84c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 16:18:30 -0500 Subject: [PATCH 520/554] Update pacsat-run.sh add kill direwolf --- groundstation/pacsat-run.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/groundstation/pacsat-run.sh b/groundstation/pacsat-run.sh index f4242560..922fb3a5 100755 --- a/groundstation/pacsat-run.sh +++ b/groundstation/pacsat-run.sh @@ -5,16 +5,18 @@ echo "Startup script to run the PacSat Ground Station for FIAB v4" echo -source /home/pi/venv/bin/activate +# source /home/pi/venv/bin/activate sudo killall -9 java &>/dev/null sudo killall -9 zenity &>/dev/null +sudo killall -9 direwolf &>/dev/null + #FILE=/home/pi/.pacsatprofile #if [ ! -f "$FILE" ]; then - profile=$(zenity --text="Choose what you want to do:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station" --column="Choice" --column="Result" "PacSat" "Run PacSat Ground Station" "Configure" "Configure the Pacsat Ground Station" "Loopback" "Run a Locally Simulated PacSat") + profile=$(zenity --text="Choose what you want to do:" --list 2>/dev/null --width=410 --height=170 --title="PacSat Ground Station" --column="Choice" --column="Result" "PacSat" "Run PacSat Ground Station" "Configure" "Configure the Pacsat Ground Station" "Simulate" "Run a Locally Simulated PacSat") echo $profile @@ -56,9 +58,9 @@ sudo killall -9 zenity &>/dev/null /home/pi/CubeSatSim/groundstation/pacsat-config.sh - elif [ "$ANS" = "3" ] || [ "$profile" = "Loopback" ] ; then + elif [ "$ANS" = "3" ] || [ "$profile" = "Simulate" ] ; then - echo "You have chosen the Loopback Simulated PacSat Ground Station" + echo "You have chosen the PacSat Ground Station with Local Simulated Satellite" sleep 1 From 7c9e8e39b2fe43de5fcfb7bcbd4bec8b1c35541e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 16:19:47 -0500 Subject: [PATCH 521/554] Update pacsat-run.sh kill direwolf at end if quit Pacsat ground station --- groundstation/pacsat-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/pacsat-run.sh b/groundstation/pacsat-run.sh index 922fb3a5..37704d0f 100755 --- a/groundstation/pacsat-run.sh +++ b/groundstation/pacsat-run.sh @@ -76,6 +76,7 @@ sudo killall -9 direwolf &>/dev/null fi +sudo killall -9 direwolf &>/dev/null sleep 10 From ac14553038547bddc7c9d428582061ddf8b57f2c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 22:30:01 -0500 Subject: [PATCH 522/554] Update install fix pacsat_telem install --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 459b7abc..a28bbcb3 100755 --- a/install +++ b/install @@ -165,7 +165,7 @@ if [ -f "$FILE" ]; then fi FILE=/home/pi/pacsat_telem/Debug/pacsat_telem # code has already been compiled -if [ -f "$FILE" ]; then +if [ ! -f "$FILE" ]; then cd sudo apt-get install -y libbsd-dev git clone https://github.com/alanbjohnston/pacsat_telem.git From a269cca2b35ea69c7d1884e3eb1d3a7f146603c9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 22:38:30 -0500 Subject: [PATCH 523/554] Update install fix g0kla lib --- install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install b/install index a28bbcb3..b30dc015 100755 --- a/install +++ b/install @@ -129,8 +129,8 @@ sudo cp /home/pi/CubeSatSim/asound.conf /etc/asound.conf FILE=/home/pi/pi_pacsat/Debug/pi_pacsat # code has already been compiled if [ -f "$FILE" ]; then cd - git clone https://github.com/alanbjohnston/iors_common.git - cd iors_common/Debug/ + git clone https://github.com/alanbjohnston/g0kla_common.git + cd g0kla_common/Debug/ make all sudo ./install.sh From 0a69610f8ca53a52d66639893b84aa463fd11432 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 3 Mar 2026 22:48:43 -0500 Subject: [PATCH 524/554] Update install add desktop install --- install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install b/install index b30dc015..d4e12a4a 100755 --- a/install +++ b/install @@ -31,6 +31,8 @@ cd CubeSatSim/config -c -n CubeSatSim/config -l -n + +cp /home/piCubeSatSim/groundstation/pacsat.desktop /home/pi/Desktop/pacsat.desktop sudo apt-get update && sudo apt-get dist-upgrade -y From b1ff14c3bc0825462046cfed1c0a9e8810a6498d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 05:13:13 -0500 Subject: [PATCH 525/554] Update install fix pi_pacsat install --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index d4e12a4a..c1037a53 100755 --- a/install +++ b/install @@ -129,7 +129,7 @@ cd rpitx sudo cp /home/pi/CubeSatSim/asound.conf /etc/asound.conf FILE=/home/pi/pi_pacsat/Debug/pi_pacsat # code has already been compiled -if [ -f "$FILE" ]; then +if [ ! -f "$FILE" ]; then cd git clone https://github.com/alanbjohnston/g0kla_common.git cd g0kla_common/Debug/ From e2a1cb0fc98074dadc9316ac8641d90f955c2e36 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 09:13:26 -0500 Subject: [PATCH 526/554] fix second menu --- groundstation/pacsat-config.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh index ed820b13..6a2ce55c 100755 --- a/groundstation/pacsat-config.sh +++ b/groundstation/pacsat-config.sh @@ -57,10 +57,10 @@ sudo killall -9 direwolf &>/dev/null echo echo " 3. Reset PacSat Ground Station Configuration" - read -r ANS + read -r CH - if [ -z "$ANS" ]; then + if [ -z "$CH" ]; then echo "No choice made. Exiting." @@ -70,7 +70,7 @@ sudo killall -9 direwolf &>/dev/null fi - if [ "$ANS" = "1" ] ; then + if [ "$CH" = "1" ] ; then echo if [ "$ANS" = "1" ] ; then @@ -107,7 +107,7 @@ sudo killall -9 direwolf &>/dev/null fi fi - elif [ "$ANS" = "2" ] ; then + elif [ "$CH" = "2" ] ; then echo "You have chosen to set the remote CubeSatSim PacSat Satellite callsign in ground station configuration" echo @@ -143,7 +143,7 @@ sudo killall -9 direwolf &>/dev/null echo fi - elif [ "$ANS" = "3" ] ; then + elif [ "$CH" = "3" ] ; then echo "You have chosen to reset the PacSat Ground Station Configuration" echo From b456129b8855f8ba51da1eea3b0867c800fae0c3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 09:50:14 -0500 Subject: [PATCH 527/554] direwolf checkout master-sync-invert --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index c1037a53..1979bdcc 100755 --- a/install +++ b/install @@ -84,7 +84,7 @@ git clone https://github.com/alanbjohnston/direwolf.git cd direwolf -git checkout invert +git checkout master-sync-invert make -j From c22b8bc79b3033fff3c1461bb710e50d5d17d218 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 10:39:52 -0500 Subject: [PATCH 528/554] change to current version direwolf --- install | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/install b/install index 1979bdcc..7d65daa8 100755 --- a/install +++ b/install @@ -80,18 +80,14 @@ fi cd -git clone https://github.com/alanbjohnston/direwolf.git - +git clone https://github.com/wb2osz/direwolf.git cd direwolf - -git checkout master-sync-invert - -make -j - +mkdir build +cd build +cmake .. +make -j4 sudo make install - -make install-rpi - +make install-conf cd From f42b8f0f7ba9ad28492bb49c7a4bcf87861710c7 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 10:57:29 -0500 Subject: [PATCH 529/554] Update install fix desktop copy --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 7d65daa8..4e431f4e 100755 --- a/install +++ b/install @@ -32,7 +32,7 @@ CubeSatSim/config -c -n CubeSatSim/config -l -n -cp /home/piCubeSatSim/groundstation/pacsat.desktop /home/pi/Desktop/pacsat.desktop +cp /home/pi/CubeSatSim/groundstation/pacsat.desktop /home/pi/Desktop/pacsat.desktop sudo apt-get update && sudo apt-get dist-upgrade -y From 183374f903de9770f4e6739f8e28ff0a5538b867 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 11:17:40 -0500 Subject: [PATCH 530/554] Update install to install cmake --- install | 1 + 1 file changed, 1 insertion(+) diff --git a/install b/install index 4e431f4e..71e5262f 100755 --- a/install +++ b/install @@ -80,6 +80,7 @@ fi cd +sudo apt-get install -y cmake git clone https://github.com/wb2osz/direwolf.git cd direwolf mkdir build From 3ddf0b897d943a83e765e961ddd7ff8b86ff6a0d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 16:13:17 -0500 Subject: [PATCH 531/554] Update install remove peripheral --- install | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/install b/install index 71e5262f..4096ca2d 100755 --- a/install +++ b/install @@ -256,17 +256,10 @@ sudo raspi-config nonint do_legacy 0 fi if [[ $(grep 'dtoverlay=dwc2' /boot/config.txt) ]]; then - - if [[ $(grep 'dtoverlay=dwc2,dr_mode=peripheral' /boot/config.txt) ]]; then - echo "dtoverlay=dwc2,dr_mode=peripheral aalready in /boot/config.txt" - else - sudo sed -i 's/dtoverlay=dwc2/dtoverlay=dwc2,dr_mode=peripheral/g' /boot/config.txt - echo " adding dr_mode=peripheral to /boot/config.txt" - fi - + echo "dtoverlay=dwc2 aalready in /boot/config.txt" else - echo "adding dtoverlay=dwc2,dr_mode=peripheral to /boot/config.txt" - sudo sh -c 'echo "\ndtoverlay=dwc2,dr_mode=peripheral" >> /boot/config.txt' + echo "adding dtoverlay=dwc2 to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=dwc2" >> /boot/config.txt' fi if [[ $(grep 'modules-load=dwc2,g_ether' /boot/cmdline.txt) ]]; then From 8e92c2111472b0eba75fe04545e46a2720702137 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 16:44:39 -0500 Subject: [PATCH 532/554] Update pacsatsim.sh add v option for USB audio TX and RX --- pacsatsim.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 56fc3033..7b59fad8 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -140,7 +140,12 @@ if [ "$loopback" = "1" ]; then echo "Using audio loopback" sudo /home/pi/CubeSatSim/pacsatsim-d.sh & - + +elif [ "$loopback" = "v" ]; then + + echo "Using USB Audio TX and RX" + sudo /home/pi/CubeSatSim/pacsatsim-dj.sh & + else echo "Using TXC FM transceiver" From f801396a49495df1155c052ea6756af5f43e3799 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 16:46:59 -0500 Subject: [PATCH 533/554] Update pacsatsim.sh add vox variable --- pacsatsim.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 7b59fad8..6e9d363f 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -3,9 +3,14 @@ # script to run PacsatSim loopback=0 +vox=0 if [ "$1" = "l" ] ; then loopback=1 + +elif [ "$1" = "v" ] ; then + + vox=1 fi @@ -141,7 +146,7 @@ if [ "$loopback" = "1" ]; then echo "Using audio loopback" sudo /home/pi/CubeSatSim/pacsatsim-d.sh & -elif [ "$loopback" = "v" ]; then +elif [ "$vox" = "1" ]; then echo "Using USB Audio TX and RX" sudo /home/pi/CubeSatSim/pacsatsim-dj.sh & From c7a359fd7de98db2fa9d2ddee33421a9e28a9847 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 16:52:26 -0500 Subject: [PATCH 534/554] Update pacsatsim.sh add vox print --- pacsatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pacsatsim.sh b/pacsatsim.sh index 6e9d363f..1ea856b1 100755 --- a/pacsatsim.sh +++ b/pacsatsim.sh @@ -148,7 +148,7 @@ if [ "$loopback" = "1" ]; then elif [ "$vox" = "1" ]; then - echo "Using USB Audio TX and RX" + echo "Using Soundcard Audio TX and RX (VOX)" sudo /home/pi/CubeSatSim/pacsatsim-dj.sh & else From 5b16fe457fcab7abda679342e21ce3a768971236 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 16:53:46 -0500 Subject: [PATCH 535/554] Update pacsat.sh add sound card VOX option --- groundstation/pacsat.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 16640dd6..321907d2 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -3,10 +3,16 @@ # script to auto decode packet using rtl_fm and Direwolf and run Pacsat Ground Station loopback=0 +vox=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)" fi @@ -118,6 +124,11 @@ if [ "$loopback" = "1" ]; then echo "Using Audio Loopback" /home/pi/CubeSatSim/groundstation/pacsat-d.sh & +elif [ "$vox" = "1" ]; then + + echo "Using Soundcard Audio TX RX (VOX)" + /home/pi/CubeSatSim/groundstation/pacsat-dj.sh & + else echo "Using TXC FM Transceiver" From 8221559d770ea50e6675b068c49c1c591db0815b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 4 Mar 2026 17:12:41 -0500 Subject: [PATCH 536/554] Update direwolf-fm-pacsat-jp14.conf turn off ptt --- groundstation/direwolf/direwolf-fm-pacsat-jp14.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf index eb0bf0a2..5df8f59e 100644 --- a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -1,6 +1,6 @@ MYCALL AMSAT ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 -PTT GPIO -20 +#PTT GPIO -20 CHANNEL 0 MODEM 1200 KISSPORT 8100 From 6b23a0b47898b6c9354b7ed9f4bbbb06ec59be79 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 09:10:23 -0500 Subject: [PATCH 537/554] Update config merge conflict --- config | 875 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 711 insertions(+), 164 deletions(-) diff --git a/config b/config index 55aaba34..75cca3c1 100755 --- a/config +++ b/config @@ -1,7 +1,8 @@ #!/bin/bash -function transmit_command_aprs { +function transmit_command { +<<<<<<< HEAD FILE=/home/pi/CubeSatSim/transmit_dtmf if [ -f "$FILE" ]; then @@ -104,113 +105,119 @@ function transmit_command_bpsk { exit } +======= + MODE=$1 + echo "CubeSatSim is in Transmit Commands mode" + echo +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 -function transmit_command_sstv { + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo -n "TX Frequency is: " + echo -n ${7} + echo " MHz" FILE=/home/pi/CubeSatSim/transmit_dtmf if [ -f "$FILE" ]; then - echo "Stopping command and control" - sudo systemctl stop command - - echo "Transmit DTMF start" - gpio write 28 0 # ptt - gpio write 2 1 # tx LED - timeout 3 direwolf -c /home/pi/CubeSatSim/direwolf/direwolf-transmit-dtmf-sstv.conf -t 0l - gpio write 2 0 # tx LED - gpio write 28 1 #ptt - echo "Transmit stop" - - echo "Resuming command and control" - sudo systemctl start command - - else - - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=s" - sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 - echo $STRING > /home/pi/CubeSatSim/t.txt echo - echo -n "Sending APRS packet to change mode to SSTV" - echo $STRING - sudo touch /home/pi/CubeSatSim/ready - sleep 3 + echo "Sending DTMF tones to change to mode "$MODE - fi + case $MODE in + + a) + number=1 + ;; + f) + number=2 + ;; + b) + number=3 + ;; + s) + number=4 + ;; + m) + number=5 + ;; + e) + number=6 + ;; + j) + number=7 + ;; + o) + number=10 + ;; + *) + number=0 + ;; + esac - exit -} +# echo $number -function transmit_command_cw { + cat /home/pi/CubeSatSim/direwolf/direwolf-transmit-dtmf.conf > /home/pi/CubeSatSim/direwolf-tmp.conf && echo 'CBEACON dest="DTMF-3" info="'$number' #" delay=0' >> /home/pi/CubeSatSim/direwolf-tmp.conf - FILE=/home/pi/CubeSatSim/transmit_dtmf - if [ -f "$FILE" ]; then +# echo "Stopping command and control" +# sudo systemctl stop command - echo "Stopping command and control" - sudo systemctl stop command - - echo "Transmit DTMF start" +# echo "Transmit start" gpio write 28 0 # ptt gpio write 2 1 # tx LED - timeout 3 direwolf -c /home/pi/CubeSatSim/direwolf/direwolf-transmit-dtmf-cw.conf -t 0l + timeout 3 direwolf -c /home/pi/CubeSatSim/direwolf-tmp.conf -t 0l > /dev/null 2>&1 gpio write 2 0 # tx LED gpio write 28 1 #ptt - echo "Transmit stop" +# echo "Transmit stop" - echo "Resuming command and control" - sudo systemctl start command +# echo "Resuming command and control" +# sudo systemctl start command else - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=m" + STRING="$1-11>APCSS:=3901.40N\07704.39WShi hi MODE="$MODE sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 echo $STRING > /home/pi/CubeSatSim/t.txt echo - echo -n "Sending APRS packet to change mode to CW" + echo -n "Sending APRS packet to change mode to "$MODE" " echo $STRING sudo touch /home/pi/CubeSatSim/ready sleep 3 fi - exit + echo + echo "To change the mode of this CubeSatSim use config -n" } -function transmit_command_beacon { - - FILE=/home/pi/CubeSatSim/transmit_dtmf - if [ -f "$FILE" ]; then - - echo "Stopping command and control" - sudo systemctl stop command +function check_restart { - echo "Transmit DTMF start" - gpio write 28 0 # ptt - gpio write 2 1 # tx LED - timeout 3 direwolf -c /home/pi/CubeSatSim/direwolf/direwolf-transmit-dtmf-beacon.conf -t 0l - gpio write 2 0 # tx LED - gpio write 28 1 #ptt - echo "Transmit stop" - - echo "Resuming command and control" - sudo systemctl start command + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then + FILE=/home/pi/CubeSatSim/battery_saver + if [ -f "$FILE" ]; then + restart=1 +# echo "Need to restart since batt saver" + else + reboot=1 +# echo "Need to reboot" + fi else - - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=o" - sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 - echo $STRING > /home/pi/CubeSatSim/t.txt - echo - echo -n "Sending APRS packet to toggle Beacon" - echo $STRING - sudo touch /home/pi/CubeSatSim/ready - sleep 3 - - fi - - exit + restart=1 +# echo "Need to restart" + fi } +<<<<<<< HEAD echo "CubeSatSim v2.1 configuration tool" +======= +echo +echo "CubeSatSim v2.2 configuration tool" +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 echo # echo $1 # echo $2 @@ -222,8 +229,13 @@ sudo modprobe snd-aloop if [ -z "$2" ] ; then noreboot=0 else - noreboot=1 - echo "Reboot disabled" + if [ "$2" = "n" ] ; then + echo "Reboot disabled" + noreboot=1 + else + fail=$2 + fi + fi # echo "No reboot" @@ -249,6 +261,8 @@ if [ "$1" = "" ]; then echo "Mode is SSTV" elif [ "$1" = "e" ]; then echo "Mode is Repeater" + elif [ "$1" = "j" ]; then + echo "Mode is FUNcube" elif [ "$1" = "n" ]; then echo -n "Mode is Transmit Commands with " FILE=/home/pi/CubeSatSim/transmit_dtmf @@ -270,13 +284,89 @@ if [ "$1" = "" ]; then set -- $value if [ "$5" = "y" ] || [ "$5" = "yes" ] ; then -# sim="yes" echo "Simulated Telemetry is ON" else -# sim="no" - echo "Simulated Telemetry is OFF" + FILE=/home/pi/CubeSatSim/sim_mode_auto + if [ -f "$FILE" ]; then + echo "Simulated Telemetry is automatically turned ON" +# elif [[ $(timeout 2 i2cdetect -y 1 | grep -e "44" -e "45") ]]; then # check for battery board sensors +# # Check the exit code of the last command +# if [ $? -ne 0 ]; then +# echo "Simulated Telemetry is automatically turned ON" +# else +# echo "Simulated Telemetry is OFF" +# fi + else + echo "Simulated Telemetry is OFF" + fi fi - echo +# echo + + FILE=/home/pi/CubeSatSim/failure_mode.txt + if [ -f "$FILE" ]; then + if [[ $(grep "\-1" $FILE) ]]; then + echo "No simulated failure" + else + fail=$(<$FILE) + echo -n "Simulated " +# cat $FILE + + case $fail in + + 1) + echo "+Y Solar Panel Unplugged (1)" + ;; + 2) + echo "+X Solar Panel Failure (2)" + ;; + 3) + echo "-X Solar Panel Degredation (3)" + ;; + 4) + echo "-Y Solar Panel Short Circuit (4)" + ;; + 5) + echo "Failed I2C Bus 1 (5)" + ;; + 6) + echo "Failed I2C Bus 3 (6)" + ;; + 7) + echo "Failed Camera (7)" + ;; + 8) + echo "Failed Payload (8)" + ;; + 9) + echo "Failed BME Sensor (9)" + ;; + 10) + echo "Failed MPU Sensor (10)" + ;; + "11") + echo "Failed FM Audio (11)" + ;; + *) + echo "Unknown Failure" + ;; + esac +# echo $fail + fi + else + echo "No simulated failure" + fi + + if [ "${12}" = "y" ] || [ "${12}" = "yes" ] ; then + echo "Random Failure Mode is ON with time period" ${13} "seconds" + else + echo "Random Failure Mode is OFF" + fi + + echo -n "TX Frequency is: " + echo -n ${7} + echo -n " MHz, RX Frequency is: " + echo -n ${8} + echo " MHz" if [ "$9" = "yes" ] || [ "$9" = "y" ]; then echo "Balloon mode is ON" @@ -284,7 +374,7 @@ if [ "$1" = "" ]; then echo "Balloon mode is OFF" fi - echo +# echo echo -n "Current command count is: " cat /home/pi/CubeSatSim/command_count.txt echo @@ -295,7 +385,7 @@ if [ "$1" = "" ]; then echo -n "Squelch level is: " echo $6 - echo +# echo FILE=/home/pi/CubeSatSim/command_control if [ -f "$FILE" ]; then @@ -314,14 +404,14 @@ if [ "$1" = "" ]; then echo "Radio command and control is OFF" fi - echo +# echo echo -n "RX PL code is: " echo -n ${10} # echo echo -n " TX PL code is: " echo ${11} - echo +# echo FILE=/home/pi/CubeSatSim/battery_saver if [ -f "$FILE" ]; then @@ -330,7 +420,7 @@ if [ "$1" = "" ]; then echo "Battery saver mode is OFF" fi - echo +# echo FILE=/home/pi/CubeSatSim/beacon_off if [ -f "$FILE" ]; then echo "Transmit beacon telemetry is OFF" @@ -342,7 +432,7 @@ if [ "$1" = "" ]; then echo -e "Current sim.cfg configuration file:" # echo - echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} + echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} echo echo "To change, include an OPTION" @@ -364,11 +454,12 @@ elif [ "$1" = "-a" ]; then if [ "$1" == "n" ]; then - transmit_command_aprs + transmit_command "a" else echo "changing CubeSatSim to AFSK mode" +<<<<<<< HEAD sudo echo "a" > /home/pi/CubeSatSim/.mode if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then FILE=/home/pi/CubeSatSim/battery_saver @@ -382,6 +473,11 @@ elif [ "$1" = "-a" ]; then else restart=1 fi +======= + check_restart + sudo echo "a" > /home/pi/CubeSatSim/.mode + +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 fi elif [ "$1" = "-m" ]; then @@ -392,12 +488,14 @@ elif [ "$1" = "-m" ]; then if [ "$1" == "n" ]; then - transmit_command_cw + transmit_command "m" else echo "changing CubeSatSim to CW mode" + check_restart sudo echo "m" > /home/pi/CubeSatSim/.mode +<<<<<<< HEAD if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then FILE=/home/pi/CubeSatSim/battery_saver if [ -f "$FILE" ]; then @@ -410,6 +508,9 @@ elif [ "$1" = "-m" ]; then else restart=1 fi +======= + +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 fi elif [ "$1" = "-f" ]; then @@ -420,7 +521,7 @@ elif [ "$1" = "-f" ]; then if [ "$1" == "n" ]; then - transmit_command_fsk + transmit_command "f" else @@ -441,7 +542,7 @@ elif [ "$1" = "-b" ]; then if [ "$1" == "n" ]; then - transmit_command_bpsk + transmit_command "b" else @@ -462,14 +563,15 @@ elif [ "$1" = "-s" ]; then if [ "$1" == "n" ]; then - transmit_command_sstv + transmit_command "s" else echo "changing CubeSatSim to SSTV mode" + check_restart sudo echo "s" > /home/pi/CubeSatSim/.mode - if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then +<<<<<<< HEAD FILE=/home/pi/CubeSatSim/battery_saver if [ -f "$FILE" ]; then restart=1 @@ -481,6 +583,8 @@ elif [ "$1" = "-s" ]; then else restart=1 fi +======= +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 fi elif [ "$1" = "-t" ]; then @@ -495,14 +599,14 @@ elif [ "$1" = "-t" ]; then set -- $value if [ "$5" = "yes" ] || [ "$5" = "y" ]; then - echo "Simualted Telemetry is ON" + echo "Simulated Telemetry is ON" else - echo "Simualted Telemetry is OFF" + echo "Simulated Telemetry is OFF" fi echo -# $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} +# $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${12} ${13} echo "Do you want Simulated Telemetry ON (y/n) " read sim @@ -514,13 +618,14 @@ elif [ "$1" = "-t" ]; then else sim="no" echo "Simulated Telemetry is OFF" + echo "-1" > /home/pi/CubeSatSim/failure_mode.txt # make sure to turn off any simulated failures fi # echo echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" # echo - echo $1 $2 $3 $4 $sim $6 $7 $8 $9 ${10} ${11} - echo $1 $2 $3 $4 $sim $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $3 $4 $sim $6 $7 $8 $9 ${10} ${11} ${12} ${13} + echo $1 $2 $3 $4 $sim $6 $7 $8 $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg echo ## echo "Rebooting CubeSatSim with new configuration file" ## echo @@ -549,7 +654,7 @@ elif [ "$1" = "-c" ]; then echo $oldcallsign echo -# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} +# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${12} ${13} echo "Enter callsign in all capitals: " read callsign @@ -563,6 +668,7 @@ elif [ "$1" = "-c" ]; then echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" +<<<<<<< HEAD echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg @@ -575,6 +681,10 @@ elif [ "$1" = "-c" ]; then # sudo sed -i "s/callsign=AMSAT/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties # sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties # sudo sed -i "s/AMSAT/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties +======= + echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} + echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 fi if [ "$norestart" = "1" ]; then @@ -607,7 +717,7 @@ elif [ "$1" = "-r" ]; then echo $2 echo -# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} +# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} echo -e "Enter Reset Count (integer): " @@ -627,8 +737,8 @@ elif [ "$1" = "-r" ]; then echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" - echo $1 $resets $3 $4 $5 $6 $7 $8 $9 ${10} ${11} - echo $1 $resets $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg + echo $1 $resets $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} + echo $1 $resets $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg fi if [ "$norestart" = "1" ]; then @@ -662,7 +772,7 @@ elif [ "$1" = "-l" ]; then echo $3 echo -# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} +# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} echo -e "Enter latitude (decimal degrees, positive is north): " @@ -704,8 +814,8 @@ elif [ "$1" = "-l" ]; then fi echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" - echo $1 $2 $lat $long $5 $6 $7 $8 $9 ${10} ${11} - echo $1 $2 $lat $long $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $lat $long $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} + echo $1 $2 $lat $long $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg if [ "$norestart" = "1" ]; then echo @@ -756,7 +866,6 @@ elif [ "$1" = "-C" ]; then elif [ "$1" = "-T" ]; then - echo echo "Change command and control state" echo @@ -769,28 +878,51 @@ elif [ "$1" = "-T" ]; then echo if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then - echo "Command and control set to OFF" + echo "Turning command and control OFF" sudo rm /home/pi/CubeSatSim/command_control > /dev/null 2>&1 # reboot=1 echo "restarting command and control" sudo systemctl restart command + echo "restarting transmit" + sudo systemctl restart transmit ## sudo reboot now fi else - echo "Radio command and control is OFF" + echo "Radio command and control is OFF" echo echo "Do you want to set command and control to ON (y/n) " read reset echo if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then - echo "Command and control set to ON" - sudo touch /home/pi/CubeSatSim/command_control - echo "restarting command and control" -# reboot=1 - sudo systemctl restart command -## sudo reboot now + + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + + if [ "$1" != "n" ] ; then + echo "Turning command and control ON" + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo -n "RX Frequency is: " + echo -n ${8} + echo " MHz" + echo + + sudo touch /home/pi/CubeSatSim/command_control + echo "restarting command and control" +# reboot=1 + sudo systemctl restart command + echo "restarting transmit" + sudo systemctl restart transmit +## sudo reboot now + else + echo "Can't turn on Command and control in Transmit Commands mode." + fi fi fi @@ -918,7 +1050,7 @@ elif [ "$1" = "-R" ]; then if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then sudo rm /home/pi/CubeSatSim/command_count.txt > /dev/null 2>&1 echo "Commands count reset to 0" - echo "0\n" > /home/pi/CubeSatSim/command_count.txt + echo "0" > /home/pi/CubeSatSim/command_count.txt else echo "Commands count not reset" fi @@ -994,7 +1126,7 @@ elif [ "$1" = "-q" ]; then echo $6 echo -# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} +# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} echo -e "Enter squelch (integer 1 - 8): " @@ -1016,8 +1148,8 @@ elif [ "$1" = "-q" ]; then # echo echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" # echo - echo $1 $2 $3 $4 $5 $sq $7 $8 $9 ${10} ${11} - echo $1 $2 $3 $4 $4 $sq $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $3 $4 $5 $sq $7 $8 $9 ${10} ${11} ${12} ${13} + echo $1 $2 $3 $4 $4 $sq $7 $8 $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuration file" ## echo @@ -1039,7 +1171,7 @@ elif [ "$1" = "-P" ]; then echo echo "Editing the PL (Private Line) CTCSS/CDCSS setting in" - echo "the configuration file for CubeSatSim" + echo "the configuration file for CubeSatSim" echo value=`cat /home/pi/CubeSatSim/sim.cfg` @@ -1053,7 +1185,7 @@ elif [ "$1" = "-P" ]; then echo ${11} echo -# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} +# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} echo -e "Enter RX PL value integer 0: None, 01-38: CTCSS (analog, 39-121:CDCSS (digital)" @@ -1096,8 +1228,8 @@ elif [ "$1" = "-P" ]; then # echo echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" # echo - echo $1 $2 $3 $4 $5 $6 $7 $8 $9 $rxpl $txpl - echo $1 $2 $3 $4 $5 $6 $7 $8 $9 $rxpl $txpl > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $3 $4 $5 $6 $7 $8 $9 $rxpl $txpl ${12} ${13} + echo $1 $2 $3 $4 $5 $6 $7 $8 $9 $rxpl $txpl ${12} ${13} > /home/pi/CubeSatSim/sim.cfg echo ## echo "Rebooting CubeSatSim with new configuration file" ## echo @@ -1127,7 +1259,7 @@ elif [ "$1" = "-F" ]; then echo $8 echo -# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} +# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} echo "Enter tx frequency as 4XX.XXXX: " read tx @@ -1146,23 +1278,24 @@ elif [ "$1" = "-F" ]; then rx="$8" echo "Keeping value of" $rx fi -# else - - echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" + echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" - echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} - echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg -# fi - -# if [ "$norestart" = "1" ]; then -# echo + echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13} + echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg + + echo + echo "Restarting CubeSatSim with new configuration file" + +# if [[ $(sudo systemctl is-active gpsd.socket | grep inactive) ]]; then + sudo systemctl restart transmit # else - echo - echo "Restarting CubeSatSim with new configuration file" -## echo -# reboot=1 -## sudo reboot now +# echo +# echo "temporarily disabling gpsd and rebooting to program FM module" +# echo "this will take about 40 seconds" +# sudo systemctl stop gpsd.socket sudo systemctl restart transmit +# sleep 10 +# reboot=1 # fi elif [ "$1" = "-o" ]; then @@ -1173,7 +1306,7 @@ elif [ "$1" = "-o" ]; then if [ "$1" == "n" ]; then - transmit_command_beacon + transmit_command "o" else echo @@ -1212,6 +1345,7 @@ elif [ "$1" = "-o" ]; then # restart=1 fi fi + sleep 3 fi elif [ "$1" = "-H" ]; then @@ -1233,7 +1367,7 @@ elif [ "$1" = "-H" ]; then echo -# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} +# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} echo "Do you want Balloon mode ON (y/n) " read hab @@ -1250,8 +1384,8 @@ elif [ "$1" = "-H" ]; then # echo echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" # echo - echo $1 $2 $3 $4 $5 $6 $7 $8 $hab ${10} ${11} - echo $1 $2 $3 $4 $5 $6 $7 $8 $hab ${10} ${11} > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $3 $4 $5 $6 $7 $8 $hab ${10} ${11} ${12} ${13} + echo $1 $2 $3 $4 $5 $6 $7 $8 $hab ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg echo ## echo "Rebooting CubeSatSim with new configuration file" ## echo @@ -1277,59 +1411,111 @@ elif [ "$1" = "-v" ]; then elif [ "$1" = "-e" ]; then - echo "changing CubeSatSim to Repeater mode" - sudo echo "e" > /home/pi/CubeSatSim/.mode + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + if [ "$1" == "n" ]; then + +<<<<<<< HEAD if [ "$1" = "p" ] || [ "$1" = "P" ] ; then reboot=1 else +======= + transmit_command "e" + + else + + echo "changing CubeSatSim to Repeater mode" + sudo echo "e" > /home/pi/CubeSatSim/.mode +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 restart=1 fi elif [ "$1" = "-n" ]; then - echo "changing CubeSatSim to Transmit Commands mode" +# echo "changing CubeSatSim to Transmit Commands mode" + + new=$2 value=`cat /home/pi/CubeSatSim/.mode` echo "$value" > /dev/null set -- $value if [ "$1" = "n" ]; then - echo "Turning Transmit Command and Control mode OFF" - echo "Switching to BPSK mode" - sudo echo "b" > /home/pi/CubeSatSim/.mode - reboot=1 + echo "Turning Transmit Commands mode OFF" + if [ "$new" = "a" ] || [ "$new" = "s" ] || [ "$new" = "m" ] ; then + check_restart + echo "Switching to mode "$new + sudo echo $new > /home/pi/CubeSatSim/.mode + elif [ "$new" = "f" ] || [ "$new" = "b" ] || [ "$new" = "e" ] || [ "$new" = "j" ] ; then + echo "Switching to mode "$new + sudo echo $new > /home/pi/CubeSatSim/.mode + restart=1 + else + echo "Switching to BPSK mode" + sudo echo "b" > /home/pi/CubeSatSim/.mode + reboot=1 + fi + sudo systemctl restart command else - echo "Turning Transmit Command and Control mode ON" + echo "Switching to Transmit Commands mode" + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo -n "TX Frequency is: " + echo -n ${7} + echo " MHz" + echo + + check_restart sudo echo "n" > /home/pi/CubeSatSim/.mode - restart=1 + sudo systemctl stop command fi elif [ "$1" = "-A" ]; then - echo "Transmit APRS control packets to control another CubeSatSim" + echo "Transmit APRS Commands to control another CubeSatSim" + echo + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo -n "TX Frequency is: " + echo -n ${7} + echo " MHz" echo value=`cat /home/pi/CubeSatSim/.mode` echo "$value" > /dev/null set -- $value + if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then + echo "The CubeSatSim/config -A command can only be run in APRS, SSTV, CW, or Transmit Commands modes." + echo "Switch to one of these modes (a, s, m, or n) then re-run this command." + exit + fi + if [ "$1" != "n" ]; then sudo systemctl stop cubesatsim sudo systemctl stop transmit - # sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 # sudo python3 -u /home/pi/CubeSatSim/transmit.py x > /dev/null 2>&1 & # Force APRS mode fi + sudo systemctl stop command - sim="y" + MODE="0" - while [ "$sim" = "y" ] + while [ "$MODE" != "x" ]; do - echo "Enter the mode number to change: 1=APRS, 2=FSK, 3=BPSK, 4=SSTV, 5=CW" + echo "Enter the mode to change: a=APRS, f=FSK, b=BPSK, s=SSTV, m=CW, e=Repeater, j=FUNcube, o=Beacon on/off x=Exit this mode" read MODE +<<<<<<< HEAD case $MODE in @@ -1371,17 +1557,23 @@ elif [ "$1" = "-A" ]; then # sudo touch /home/pi/CubeSatSim/ready # sleep 5 # sudo touch /home/pi/CubeSatSim/ready +======= + + if [ "$MODE" != "x" ]; then + transmit_command $MODE + fi +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 echo - echo "Do you want to send another APRS command packet (y/n) " - read sim - echo + done - sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 -# sudo systemctl restart cubesatsim - if [ "$1" != "n" ]; then + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + if [ "$1" != "n" ] ; then + sudo systemctl restart command reboot=1 fi @@ -1412,7 +1604,7 @@ elif [ "$1" = "-g" ]; then if [ "$rset" = "y" ] || [ "$rset" = "yes" ] ; then - echo "Resetting" + echo "Resetting and shutting down." echo "AMSAT 0 0 0 no 3 434.9 435 no 0 0" > /home/pi/CubeSatSim/sim.cfg @@ -1422,11 +1614,13 @@ elif [ "$1" = "-g" ]; then sudo rm /home/pi/CubeSatSim/command_control > /dev/null 2>&1 - touch /home/pi/CubeSatSim/command_control_direwolf + sudo touch /home/pi/CubeSatSim/command_control_direwolf sudo rm /home/pi/CubeSatSim/beacon_off > /dev/null 2>&1 - sudo echo "0" > /home/pi/CubeSatSim/command_count.txt + sudo echo "0" > /home/pi/CubeSatSim/command_count.txt + + sudo rm /home/pi/CubeSatSim/failure_mode.txt > /dev/null 2>&1 sudo systemctl stop cubesatsim sudo systemctl stop transmit @@ -1436,13 +1630,356 @@ elif [ "$1" = "-g" ]; then sudo journalctl --rotate sudo journalctl --vacuum-time=1s + + rm -rf ~/.config/chromium/Singleton* + + cat /dev/null > ~/.bash_history && history -c + + sudo shutdown now - reboot=1 +# reboot=1 else echo "Not resetting" fi +elif [ "$1" = "-j" ]; then + + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + + if [ "$1" == "n" ]; then + + transmit_command "j" + + else + + echo "changing CubeSatSim to FUNcube mode" + sudo echo "j" > /home/pi/CubeSatSim/.mode + restart=1 + fi + +elif [ "$1" = "-M" ]; then + + if [ $fail ]; then + MODE=$fail + else + + FILE=/home/pi/CubeSatSim/failure_mode.txt + if [ -f "$FILE" ]; then + if [[ $(grep "\-1" $FILE) ]]; then + echo "Currently, no simulated failure (0)" + else + fail=$(<$FILE) + echo -n "Currently, simulated " + case $fail in + + 1) + echo "+Y Solar Panel Unplugged (1)" + ;; + 2) + echo "+X Solar Panel Failure (2)" + ;; + 3) + echo "-X Solar Panel Degredation (3)" + ;; + 4) + echo "-Y Solar Panel Short Circuit (4)" + ;; + 5) + echo "Failed I2C Bus 1 (5)" + ;; + 6) + echo "Failed I2C Bus 3 (6)" + ;; + 7) + echo "Failed Camera (7)" + ;; + 8) + echo "Failed Payload (8)" + ;; + 9) + echo "Failed BME Sensor (9)" + ;; + "10") + echo "Failed MPU Sensor (10)" + ;; + "11") + echo "Failed FM Audio (11)" + ;; + *) + echo "Unknown Failure" + ;; + esac + fi + else + echo "Currently, no simulated failure" + fi + + echo + echo "Set simulated failure mode (or Return to turn OFF)" + echo + + echo " 0 No Failure (turn OFF)" + echo " 1 +Y Solar Panel Unplugged" + echo " 2 +X Solar Panel Failure" + echo " 3 -X Solar Panel Degredation" + echo " 4 -Y Solar Panel Short Circuit" + echo " 5 Failed I2C Bus 1" + echo " 6 Failed I2C Bus 3" + echo " 7 Failed Camera" + echo " 8 Failed Payload" + echo " 9 Failed BME Sensor" + echo "10 Failed MPU Sensor" + echo "11 Failed FM Audio" + echo + + echo "Enter the failure number to set: 0 - 11" + read MODE + echo + fi + + if [ "$MODE" = "0" ]; then + echo "Setting No Simulated Failure" + MODE=-1 +# elif [ "$MODE" = "12" ]; then + +# if [ "$norestart" = "1" ]; then +# echo +# else +# reboot=1 +# fi + + else + case $MODE in + 1) + echo "+Y Solar Panel Unplugged" + ;; + 2) + echo "Setting Simulated +X Solar Panel Failure" + ;; + 3) + echo "Setting Simulated -X Solar Panel Degredation" + ;; + 4) + echo "Setting Simulated -Y Solar Panel Short Circuit" + ;; + 5) + echo "Setting Simulated Failed I2C Bus 1" + ;; + 6) + echo "Setting Simulated Failed I2C Bus 3" + ;; + 7) + echo "Setting Simulated Failed Camera" + ;; + 8) + echo "Setting Simulated Failed Payload" + ;; + 9) + echo "Setting Simulated Failed BME Sensor" + ;; + "10") + echo "Setting Simulated Failed MPU Sensor" + ;; + "11") + echo "Setting Failed FM Audio" + ;; + *) + echo "Setting No Simulated Failure" + MODE=-1 + ;; + esac + fi + +# echo $MODE + echo + sudo rm /home/pi/CubeSatSim/failure_mode.txt + echo $MODE > /home/pi/CubeSatSim/failure_mode.txt + + echo "Changing simulated failure mode to $MODE" | wall + +elif [ "$1" = "-N" ]; then + + FILE=/home/pi/CubeSatSim/failure_mode.txt + if [ -f "$FILE" ]; then + if [[ $(grep "\-1" $FILE) ]]; then + echo "No simulated failure" + fail=0 + else + echo "Simulated failure mode" + fail=$(<$FILE) + echo $fail + fi + else + echo "No simulated failure" + fail=0 + fi + + if [ $fail == 0 ]; then + echo "Changing to next mode" + + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + + if [ "$1" = "a" ]; then + echo "Current mode is APRS" + echo "Next mode is FSK" + /home/pi/CubeSatSim/config -f + elif [ "$1" = "m" ]; then + echo "Current mode is CW" + echo "Next mode is FunCube" + /home/pi/CubeSatSim/config -j + elif [ "$1" = "f" ]; then + echo "Current mode is FSK" + echo "Next mode is BPSK" + /home/pi/CubeSatSim/config -b + elif [ "$1" = "b" ]; then + echo "Current mode is BPSK" + echo "Next mode is SSTV" + /home/pi/CubeSatSim/config -s + elif [ "$1" = "s" ]; then + echo "Current mode is SSTV" + echo "Next mode is CW" + /home/pi/CubeSatSim/config -m + elif [ "$1" = "e" ]; then + echo "Current mode is Repeater" + echo "Next mode is APRS" + /home/pi/CubeSatSim/config -a + elif [ "$1" = "j" ]; then + echo "Current mode is FUNcube" + echo "Next mode is Repeater" + /home/pi/CubeSatSim/config -e + else + echo "Unknown mode" + fi + else + echo "Changing to next simulated failure mode" + fail=$((fail + 1)) +# if [ $fail == 12 ]; then + if [ "$fail" -gt "11" ]; then + fail=1 + fi + echo $fail + /home/pi/CubeSatSim/config -M $fail + + fi + +elif [ "$1" = "-U" ]; then + + echo + echo "Changing the Random Simulated Failure setting in" + echo "the configuration file for CubeSatSim" + echo + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + if [ "${12}" = "yes" ] || [ "${12}" = "y" ]; then + echo "Random Simulated Failure is ON" + else + echo "Random Simulated Failure is OFF" + fi + + echo + +# $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${12} ${13} + + echo "Do you want Random Simulated Failure ON (y/n) " + read sim + echo + + if [ "$sim" = "y" ] || [ "$sim" = "yes" ] ; then + sim="yes" + echo "Random Simulated Failure is ON" + echo + echo "A new random failure is selected every" + echo ${13} "seconds." + echo + echo "Enter a new value or Return keeps current value." + + echo "Enter time in seconds (integer): " + + read time + + if [ -z $time ] ; then + time="${13}" + echo "Keeping value of " $time " seconds" + fi + + if ! [[ $time =~ ^[0-9]+$ ]] ; then + echo "Error: not an integer!" + time="${13}" + echo "Keeping value of" $time + fi + + else + sim="no" + echo "Random Simulated Failure is OFF" + time="${13}" +# echo "-1" > /home/pi/CubeSatSim/failure_mode.txt # make sure to turn off any simulated failures + fi + +# echo + echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" +# echo + echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} $sim $time + echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} $sim $time > /home/pi/CubeSatSim/sim.cfg + echo + + if [ "${12}" != "$sim" ] || [ "${13}" != "$time" ] ; then + reboot=1 + fi + +elif [ "$1" = "-u" ]; then + + echo + echo "Change gpsd state" + echo + + if [[ $(sudo systemctl is-active gpsd.socket | grep inactive) ]]; then + echo "gpsd is inactive" + echo + echo "Do you want to turn gpsd to ON (y/n) " + read reset + echo + + if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then + echo "gpsd set to ON" + sudo systemctl enable gpsd + sudo systemctl enable gpsd.socket + echo + echo "Here is the current gpsd configuration /etc/default/gpsd which will work with many GPS modules:" + echo + + cat /etc/default/gpsd + + echo + echo "To change this configuration edit the file with sudo nano /etc/default/gpsd then restart gpsd." + echo + echo "To monitor your gps device, use the gpsmon command." + echo + reboot=1 + fi + + else + echo "gpsd is active" + echo + echo "Do you want to turn gpsd to OFF (y/n) " + read reset + echo + + if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then + echo "gpsd set to OFF" + sudo systemctl disable gpsd + sudo systemctl disable gpsd.socket +reboot=1 + fi + + fi elif [ "$1" = "-G" ]; then @@ -1511,7 +2048,8 @@ 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 Commands mode" + echo " -j Change to FUNcube mode" + echo " -n Change to Transmit Commands mode" echo " -e Change to Repeater mode" echo " -j Change to FUNcube mode" echo " -G Change to PacSatSim mode" @@ -1528,18 +2066,27 @@ elif [ "$1" = "-h" ]; then echo " -R Change the Commands Count in the file command_count.txt" echo " -B Change Safe Mode (battery saver mode) manually" echo " -q Change the Squelch setting for command receiver" + echo " -Q Read the current Squelch for 10 seconds" echo " -F Change the RX and TX frequency" echo " -H Change the Balloon (HAB) mode" - echo " -p Display payload sensor data" + echo " -p Display payload sensor data for 3 seconds" echo " -v Display voltage and current data" echo " -P Change the PL (Private Line) CTCSS/CDCSS codes for FM RX and TX" echo " -A Transmit APRS control packets to control another CubeSatSim" 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" +<<<<<<< HEAD echo " -g Reset configuration back to default settings and shutdown" echo " -k Reset the PacSatSim Configuration" +======= + echo " -g Reset configuration back to default settings" + echo " -M Set simulated failure mode" + echo " -U Change the random failure mode setting" + echo " -N Set next mode or failure" + echo " -u Change gpsd state" +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 echo exit From 7b0544ba23f21a0f75ca6dd53256738167cc08aa Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 09:42:46 -0500 Subject: [PATCH 538/554] Update config resolve merge conflicts --- config | 248 +++++---------------------------------------------------- 1 file changed, 18 insertions(+), 230 deletions(-) diff --git a/config b/config index 75cca3c1..22fb272d 100755 --- a/config +++ b/config @@ -2,114 +2,9 @@ function transmit_command { -<<<<<<< HEAD - FILE=/home/pi/CubeSatSim/transmit_dtmf - if [ -f "$FILE" ]; then - - echo "Stopping command and control" - sudo systemctl stop command - - echo "Transmit DTMF start" -# gpio write 28 0 # ptt - gpio write 2 1 # tx LED - timeout 3 direwolf -c /home/pi/CubeSatSim/direwolf/direwolf-transmit-dtmf-aprs.conf -t 0l - gpio write 2 0 # tx LED -# gpio write 28 1 #ptt - echo "Transmit stop" - - echo "Resuming command and control" - sudo systemctl start command - - else - - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=a" - sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 - echo $STRING > /home/pi/CubeSatSim/t.txt - echo - echo -n "Sending APRS packet to change mode to APRS " - echo $STRING - sudo touch /home/pi/CubeSatSim/ready - sleep 3 - - fi - - exit -} - -function transmit_command_fsk { - - FILE=/home/pi/CubeSatSim/transmit_dtmf - if [ -f "$FILE" ]; then - - echo "Stopping command and control" - sudo systemctl stop command - - echo "Transmit DTMF start" - gpio write 28 0 # ptt - gpio write 2 1 # tx LED - timeout 3 direwolf -c /home/pi/CubeSatSim/direwolf/direwolf-transmit-dtmf-fsk.conf -t 0l - gpio write 2 0 # tx LED - gpio write 28 1 #ptt - echo "Transmit stop" - - echo "Resuming command and control" - sudo systemctl start command - - else - - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=f" - sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 - echo $STRING > /home/pi/CubeSatSim/t.txt - echo - echo -n "Sending APRS packet to change mode to FSK" - echo $STRING - sudo touch /home/pi/CubeSatSim/ready - sleep 3 - - fi - - exit -} - -function transmit_command_bpsk { - - FILE=/home/pi/CubeSatSim/transmit_dtmf - if [ -f "$FILE" ]; then - - echo "Stopping command and control" - sudo systemctl stop command - - echo "Transmit DTMF start" - gpio write 28 0 # ptt - gpio write 2 1 # tx LED - timeout 3 direwolf -c /home/pi/CubeSatSim/direwolf/direwolf-transmit-dtmf-bpsk.conf -t 0l - gpio write 2 0 # tx LED - gpio write 28 1 #ptt - echo "Transmit stop" - - echo "Resuming command and control" - sudo systemctl start command - - else - - STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=b" - sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 - echo $STRING > /home/pi/CubeSatSim/t.txt - echo - echo -n "Sending APRS packet to change mode to BPSK" - echo $STRING - sudo touch /home/pi/CubeSatSim/ready - sleep 3 - - fi - - exit -} -======= MODE=$1 echo "CubeSatSim is in Transmit Commands mode" echo ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null @@ -148,6 +43,9 @@ function transmit_command_bpsk { j) number=7 ;; + p) + number=8 + ;; o) number=10 ;; @@ -197,7 +95,9 @@ function check_restart { echo "$value" > /dev/null set -- $value - if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then + if [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 + elif [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then FILE=/home/pi/CubeSatSim/battery_saver if [ -f "$FILE" ]; then restart=1 @@ -212,12 +112,8 @@ function check_restart { fi } -<<<<<<< HEAD -echo "CubeSatSim v2.1 configuration tool" -======= echo echo "CubeSatSim v2.2 configuration tool" ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 echo # echo $1 # echo $2 @@ -459,25 +355,9 @@ elif [ "$1" = "-a" ]; then else echo "changing CubeSatSim to AFSK mode" -<<<<<<< HEAD - sudo echo "a" > /home/pi/CubeSatSim/.mode - if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then - FILE=/home/pi/CubeSatSim/battery_saver - if [ -f "$FILE" ]; then - restart=1 - else - reboot=1 - fi - elif [ "$1" = "p" ] || [ "$1" = "P" ] ; then - reboot=1 - else - restart=1 - fi -======= check_restart sudo echo "a" > /home/pi/CubeSatSim/.mode ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 fi elif [ "$1" = "-m" ]; then @@ -495,22 +375,7 @@ elif [ "$1" = "-m" ]; then echo "changing CubeSatSim to CW mode" check_restart sudo echo "m" > /home/pi/CubeSatSim/.mode -<<<<<<< HEAD - if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then - FILE=/home/pi/CubeSatSim/battery_saver - if [ -f "$FILE" ]; then - restart=1 - else - reboot=1 - fi - elif [ "$1" = "p" ] || [ "$1" = "P" ] ; then - reboot=1 - else - restart=1 - fi -======= ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 fi elif [ "$1" = "-f" ]; then @@ -571,22 +436,6 @@ elif [ "$1" = "-s" ]; then check_restart sudo echo "s" > /home/pi/CubeSatSim/.mode -<<<<<<< HEAD - FILE=/home/pi/CubeSatSim/battery_saver - if [ -f "$FILE" ]; then - restart=1 - else - reboot=1 - fi - elif [ "$1" = "p" ] || [ "$1" = "P" ] ; then - reboot=1 - else - restart=1 - fi -======= ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 - fi - elif [ "$1" = "-t" ]; then echo @@ -668,23 +517,9 @@ elif [ "$1" = "-c" ]; then echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" -<<<<<<< HEAD - echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} - echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} > /home/pi/CubeSatSim/sim.cfg - -# sudo systemctl stop pacsatsim &>/dev/null -# sudo killall -9 java &>/dev/null - -# sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config -# sudo sed -i "s/AMSAT/$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config -# sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties -# sudo sed -i "s/callsign=AMSAT/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties -# sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties -# sudo sed -i "s/AMSAT/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties -======= echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} echo $callsign $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 + fi if [ "$norestart" = "1" ]; then @@ -1417,19 +1252,16 @@ elif [ "$1" = "-e" ]; then if [ "$1" == "n" ]; then -<<<<<<< HEAD - if [ "$1" = "p" ] || [ "$1" = "P" ] ; then - reboot=1 - else -======= transmit_command "e" else echo "changing CubeSatSim to Repeater mode" sudo echo "e" > /home/pi/CubeSatSim/.mode ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 - restart=1 + if [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 + else + restart=1 fi elif [ "$1" = "-n" ]; then @@ -1452,6 +1284,10 @@ elif [ "$1" = "-n" ]; then echo "Switching to mode "$new sudo echo $new > /home/pi/CubeSatSim/.mode restart=1 + elif [ "$1" = "p" ] || [ "$1" = "P" ] ; then + echo "Switching to PacSat mode" + sudo echo $new > /home/pi/CubeSatSim/.mode + reboot=1 else echo "Switching to BPSK mode" sudo echo "b" > /home/pi/CubeSatSim/.mode @@ -1513,56 +1349,12 @@ elif [ "$1" = "-A" ]; then while [ "$MODE" != "x" ]; do - echo "Enter the mode to change: a=APRS, f=FSK, b=BPSK, s=SSTV, m=CW, e=Repeater, j=FUNcube, o=Beacon on/off x=Exit this mode" + echo "Enter the mode to change: a=APRS, f=FSK, b=BPSK, s=SSTV, m=CW, e=Repeater, j=FUNcube, p=PacSat, o=Beacon on/off x=Exit this mode" read MODE -<<<<<<< HEAD - - case $MODE in - - 1) - echo "Mode 1 is APRS" - transmit_command_aprs -# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=a" - ;; - 2) - echo "Mode 2 is FSK" - transmit_command_fsk -# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=f" - ;; - 3) - echo "Mode 3 is BPSK" - transmit_command_bpsk -# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=b" - ;; - 4) - echo "Mode 4 is SSTV" - transmit_command_sstv -# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=s" - ;; - 5) - echo "Mode 5 is CW" - transmit_command_cw -# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=m" - ;; - *) - echo "Unknown mode" -# STRING="AMSAT-11>APCSS:=3901.40N\07704.39WShi hi MODE=?" - ;; - esac -# sudo rm /home/pi/CubeSatSim/t.txt > /dev/null 2>&1 -# echo $STRING > /home/pi/CubeSatSim/t.txt -# echo -# echo -n "Sending APRS packet " -# echo $STRING -# sudo touch /home/pi/CubeSatSim/ready -# sleep 5 -# sudo touch /home/pi/CubeSatSim/ready -======= if [ "$MODE" != "x" ]; then transmit_command $MODE fi ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 echo @@ -2076,17 +1868,13 @@ elif [ "$1" = "-h" ]; then 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" -<<<<<<< HEAD - echo " -g Reset configuration back to default settings and shutdown" - echo " -k Reset the PacSatSim Configuration" - -======= echo " -g Reset configuration back to default settings" echo " -M Set simulated failure mode" echo " -U Change the random failure mode setting" echo " -N Set next mode or failure" echo " -u Change gpsd state" ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 + echo " -k Reset the PacSatSim Configuration" + echo exit From c6bda6325e5bc0e8ec2fde37c1d8d74a353fead2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 10:10:31 -0500 Subject: [PATCH 539/554] Update direwolf-cc.conf resolve merge conflict --- direwolf-cc.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/direwolf-cc.conf b/direwolf-cc.conf index 2a3b5ef9..af71089d 100644 --- a/direwolf-cc.conf +++ b/direwolf-cc.conf @@ -1,4 +1,3 @@ -#ADEVICE hw:CARD=Device,DEV=0 default ADEVICE shared_mic hw:CARD=Loopback,DEV=1 DTMF MYCALL AMSAT From 13fe23c425b22c0ff3786b19ef73a4f00cfa7145 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 10:18:32 -0500 Subject: [PATCH 540/554] Update dtmf_aprs_cc.py needs merge conflict done --- dtmf_aprs_cc.py | 157 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 153 insertions(+), 4 deletions(-) diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index d9eba04a..68ae8954 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -1,15 +1,24 @@ import sys from os import system -import RPi.GPIO as GPIO -from RPi.GPIO import output +# import RPi.GPIO as GPIO +# from RPi.GPIO import output from time import sleep import logging logging.basicConfig(format='%(message)s') # logging.warning('CC-Warning!') +def blink(times): + for i in range(times): + system("gpio write 27 0") +# GPIO.output(27, 0) + sleep(0.1) + system("gpio write 27 1") +# GPIO.output(27, 1) + sleep(0.1) + if __name__ == "__main__": powerPin = 16 - txLed = 27 + txLed = 17 change_mode = False debug_mode = False counter = 1 @@ -18,6 +27,7 @@ if __name__ == "__main__": if ('d' == sys.argv[1]): debug_mode = True +<<<<<<< HEAD while True: try: for line in sys.stdin: @@ -206,7 +216,146 @@ if __name__ == "__main__": change_mode = False except: print("Error reading line (probably due to UTF-8 issue)") +======= + if ((line.find("MODE=a")) > 0): + system("echo '\nAPRS Mode!!\n'") + mode = 'a' + change_mode = True + if ((line.find("DTMF>APDW15:t1#")) > 0): + system("echo '\nAPRS Mode!!\n'") + mode = 'a' + change_mode = True + if ((line.find("MODE=f")) > 0): + system("echo '\nFSK Mode!!\n'") + mode = 'f' + change_mode = True + if ((line.find("DTMF>APDW15:t2#")) > 0): + system("echo '\nFSK Mode!!\n'") + mode = 'f' + change_mode = True + if ((line.find("MODE=b")) > 0): + system("echo '\nBPSK Mode!!\n'") + mode = 'b' + change_mode = True + if ((line.find("DTMF>APDW15:t3#")) > 0): + system("echo '\nBPSK Mode!!\n'") + mode = 'b' + change_mode = True + if ((line.find("MODE=s")) > 0): + system("echo '\nSSTV Mode!!\n'") + mode = 's' + change_mode = True + if ((line.find("DTMF>APDW15:t4#")) > 0): + system("echo '\nSSTV Mode!!\n'") + mode = 's' + change_mode = True + if ((line.find("MODE=m")) > 0): + system("echo '\nCW Mode!!\n'") + mode = 'm' + change_mode = True + if ((line.find("DTMF>APDW15:t5#")) > 0): + system("echo '\nCW Mode!!\n'") + mode = 'm' + change_mode = True + if ((line.find("MODE=e")) > 0): + system("echo '\nRepeater Mode!!\n'") + mode = 'e' + change_mode = True + if ((line.find("DTMF>APDW15:t6#")) > 0): + system("echo '\nRepeater Mode!!\n'") + mode = 'e' + change_mode = True + if ((line.find("MODE=j")) > 0): + system("echo '\nFUNcube Mode!!\n'") + mode = 'j' + change_mode = True + if ((line.find("DTMF>APDW15:t7#")) > 0): + system("echo '\nFUNcube Mode!!\n'") + mode = 'j' + change_mode = True + if ((line.find("MODE=n")) > 0): + system("echo '\nTransmit Commands Mode!!\n'") + mode = 'n' + change_mode = True + if ((line.find("DTMF>APDW15:t11#")) > 0): + system("echo '\nTransmit Commands Mode!!\n'") + mode = 'n' + change_mode = True + if ((line.find("MODE=o")) > 0): + counter = (counter + 1) % 2 # Direwolf prints it twice, only do once + if (counter == 1): + system("echo '\nBeacon Mode toggle!!\n'") + mode = 'o' + change_mode = True + counter = 1 + if ((line.find("DTMF>APDW15:t10#")) > 0): + system("echo '\nBeacon Mode toggle!!\n'") + mode = 'o' + change_mode = True + +# if ((debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice + if (debug_mode == False) and (change_mode == True): # skip every other APRS command since Direwolf prints them twice + if (mode == 'f'): + blink(2) + sleep(1) + + elif (mode == 'b'): + blink(3) + sleep(1) + + elif (mode == 's'): + blink(4) + sleep(1) + + elif (mode == 'm'): + blink(5) + sleep(1) + + elif (mode == 'e'): + blink(6) + sleep(1) + + elif (mode == 'j'): + blink(7) + sleep(1) + + elif (mode == 'a'): + mode = 'a' + blink(1) + sleep(1) + + try: + file = open("/home/pi/CubeSatSim/command_count.txt", "r") + string = file.read() + file.close() + command_count = int(string) + command_count += 1 + filec = open("/home/pi/CubeSatSim/command_count.txt", "w") + command_count_string = str(command_count) + print(command_count_string) + string = filec.write(command_count_string) + filec.close() + except: + print("Can't write command_count file!") + print("Command_count: ") + print(command_count) + +# GPIO.output(txLed, 0) +# GPIO.output(powerPin, 0) + system("gpio write 27 1") + system("gpio write 0 0") + system("gpio write 2 0") + + system("sudo systemctl stop transmit") +# system("sudo systemctl stop cubesatsim") + + print("\n/home/pi/CubeSatSim/config -" + mode) + system("/home/pi/CubeSatSim/config -" + mode) + + + change_mode = False + +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 print("Waiting 5 seconds to allow unplug and plug of soundcard") sleep(5) print("Done") - From e4d08dc1f01dcdcabc3bd812023281890b988c82 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 12:40:51 -0500 Subject: [PATCH 541/554] Update dtmf_aprs_cc.py making changes to merge --- dtmf_aprs_cc.py | 173 ++++-------------------------------------------- 1 file changed, 12 insertions(+), 161 deletions(-) diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index 68ae8954..7eec1ed2 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -1,24 +1,15 @@ import sys from os import system -# import RPi.GPIO as GPIO -# from RPi.GPIO import output +import RPi.GPIO as GPIO +from RPi.GPIO import output from time import sleep import logging logging.basicConfig(format='%(message)s') # logging.warning('CC-Warning!') -def blink(times): - for i in range(times): - system("gpio write 27 0") -# GPIO.output(27, 0) - sleep(0.1) - system("gpio write 27 1") -# GPIO.output(27, 1) - sleep(0.1) - if __name__ == "__main__": powerPin = 16 - txLed = 17 + txLed = 27 change_mode = False debug_mode = False counter = 1 @@ -27,7 +18,6 @@ if __name__ == "__main__": if ('d' == sys.argv[1]): debug_mode = True -<<<<<<< HEAD while True: try: for line in sys.stdin: @@ -42,7 +32,7 @@ if __name__ == "__main__": system("echo '\nAPRS Mode!!\n'") mode = 'a' change_mode = True - counter = (counter + 1) % 2 + if ((line.find(":t1#")) > 0): system("echo '\nAPRS Mode!!\n'") mode = 'a' @@ -51,7 +41,7 @@ if __name__ == "__main__": system("echo '\nFSK Mode!!\n'") mode = 'f' change_mode = True - counter = (counter + 1) % 2 + if ((line.find(":t2#")) > 0): system("echo '\nFSK Mode!!\n'") mode = 'f' @@ -60,7 +50,7 @@ if __name__ == "__main__": system("echo '\nBPSK Mode!!\n'") mode = 'b' change_mode = True - counter = (counter + 1) % 2 + if ((line.find(":t3#")) > 0): system("echo '\nBPSK Mode!!\n'") mode = 'b' @@ -69,7 +59,7 @@ if __name__ == "__main__": system("echo '\nSSTV Mode!!\n'") mode = 's' change_mode = True - counter = (counter + 1) % 2 + if ((line.find(":t4#")) > 0): system("echo '\nSSTV Mode!!\n'") mode = 's' @@ -78,7 +68,7 @@ if __name__ == "__main__": system("echo '\nCW Mode!!\n'") mode = 'm' change_mode = True - counter = (counter + 1) % 2 + if ((line.find(":t5#")) > 0): system("echo '\nCW Mode!!\n'") mode = 'm' @@ -87,7 +77,7 @@ if __name__ == "__main__": system("echo '\nPacSatSim Mode!!\n'") mode = 'G' change_mode = True - counter = (counter + 1) % 2 + if ((line.find(":t8#")) > 0): system("echo '\nPacSatSim Mode!!\n'") mode = 'G' @@ -96,7 +86,7 @@ if __name__ == "__main__": system("echo '\nTransmit Commands Mode!!\n'") mode = 'n' change_mode = True - counter = (counter + 1) % 2 + if ((line.find(":t11#")) > 0): system("echo '\nTransmit Commands Mode!!\n'") mode = 'n' @@ -106,7 +96,7 @@ if __name__ == "__main__": system("echo '\nBeacon Mode toggle!!\n'") mode = 'o' change_mode = True - counter = (counter + 1) % 2 + counter = (counter + 1) % 2 if ((line.find(":t10#")) > 0): system("echo '\nBeacon Mode toggle!!\n'") mode = 'o' @@ -216,146 +206,7 @@ if __name__ == "__main__": change_mode = False except: print("Error reading line (probably due to UTF-8 issue)") -======= - if ((line.find("MODE=a")) > 0): - system("echo '\nAPRS Mode!!\n'") - mode = 'a' - change_mode = True - if ((line.find("DTMF>APDW15:t1#")) > 0): - system("echo '\nAPRS Mode!!\n'") - mode = 'a' - change_mode = True - if ((line.find("MODE=f")) > 0): - system("echo '\nFSK Mode!!\n'") - mode = 'f' - change_mode = True - if ((line.find("DTMF>APDW15:t2#")) > 0): - system("echo '\nFSK Mode!!\n'") - mode = 'f' - change_mode = True - if ((line.find("MODE=b")) > 0): - system("echo '\nBPSK Mode!!\n'") - mode = 'b' - change_mode = True - if ((line.find("DTMF>APDW15:t3#")) > 0): - system("echo '\nBPSK Mode!!\n'") - mode = 'b' - change_mode = True - if ((line.find("MODE=s")) > 0): - system("echo '\nSSTV Mode!!\n'") - mode = 's' - change_mode = True - if ((line.find("DTMF>APDW15:t4#")) > 0): - system("echo '\nSSTV Mode!!\n'") - mode = 's' - change_mode = True - if ((line.find("MODE=m")) > 0): - system("echo '\nCW Mode!!\n'") - mode = 'm' - change_mode = True - if ((line.find("DTMF>APDW15:t5#")) > 0): - system("echo '\nCW Mode!!\n'") - mode = 'm' - change_mode = True - if ((line.find("MODE=e")) > 0): - system("echo '\nRepeater Mode!!\n'") - mode = 'e' - change_mode = True - if ((line.find("DTMF>APDW15:t6#")) > 0): - system("echo '\nRepeater Mode!!\n'") - mode = 'e' - change_mode = True - if ((line.find("MODE=j")) > 0): - system("echo '\nFUNcube Mode!!\n'") - mode = 'j' - change_mode = True - if ((line.find("DTMF>APDW15:t7#")) > 0): - system("echo '\nFUNcube Mode!!\n'") - mode = 'j' - change_mode = True - if ((line.find("MODE=n")) > 0): - system("echo '\nTransmit Commands Mode!!\n'") - mode = 'n' - change_mode = True - if ((line.find("DTMF>APDW15:t11#")) > 0): - system("echo '\nTransmit Commands Mode!!\n'") - mode = 'n' - change_mode = True - if ((line.find("MODE=o")) > 0): - counter = (counter + 1) % 2 # Direwolf prints it twice, only do once - if (counter == 1): - system("echo '\nBeacon Mode toggle!!\n'") - mode = 'o' - change_mode = True - counter = 1 - if ((line.find("DTMF>APDW15:t10#")) > 0): - system("echo '\nBeacon Mode toggle!!\n'") - mode = 'o' - change_mode = True - -# if ((debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice - if (debug_mode == False) and (change_mode == True): # skip every other APRS command since Direwolf prints them twice - if (mode == 'f'): - blink(2) - sleep(1) - - elif (mode == 'b'): - blink(3) - sleep(1) - - elif (mode == 's'): - blink(4) - sleep(1) - - elif (mode == 'm'): - blink(5) - sleep(1) - - elif (mode == 'e'): - blink(6) - sleep(1) - - elif (mode == 'j'): - blink(7) - sleep(1) - - elif (mode == 'a'): - mode = 'a' - blink(1) - sleep(1) - - try: - file = open("/home/pi/CubeSatSim/command_count.txt", "r") - string = file.read() - file.close() - command_count = int(string) - command_count += 1 - filec = open("/home/pi/CubeSatSim/command_count.txt", "w") - command_count_string = str(command_count) - print(command_count_string) - string = filec.write(command_count_string) - filec.close() - except: - print("Can't write command_count file!") - print("Command_count: ") - print(command_count) - -# GPIO.output(txLed, 0) -# GPIO.output(powerPin, 0) - system("gpio write 27 1") - system("gpio write 0 0") - system("gpio write 2 0") - - system("sudo systemctl stop transmit") -# system("sudo systemctl stop cubesatsim") - - print("\n/home/pi/CubeSatSim/config -" + mode) - system("/home/pi/CubeSatSim/config -" + mode) - - - change_mode = False - ->>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 print("Waiting 5 seconds to allow unplug and plug of soundcard") sleep(5) print("Done") + From 0e0a8e9927198f5d3be9c26df77b104a600c5a4d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 12:50:54 -0500 Subject: [PATCH 542/554] Update dtmf_aprs_cc.py finish merge conflict changes --- dtmf_aprs_cc.py | 115 ++++++++++++++++++++---------------------------- 1 file changed, 48 insertions(+), 67 deletions(-) diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index 7eec1ed2..67b82ec8 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -1,12 +1,21 @@ import sys from os import system -import RPi.GPIO as GPIO -from RPi.GPIO import output +#import RPi.GPIO as GPIO +#from RPi.GPIO import output from time import sleep import logging logging.basicConfig(format='%(message)s') # logging.warning('CC-Warning!') +def blink(times): + for i in range(times): + system("gpio write 27 0") +# GPIO.output(27, 0) + sleep(0.1) + system("gpio write 27 1") +# GPIO.output(27, 1) + sleep(0.1) + if __name__ == "__main__": powerPin = 16 txLed = 27 @@ -64,6 +73,7 @@ if __name__ == "__main__": system("echo '\nSSTV Mode!!\n'") mode = 's' change_mode = True + if ((line.find("MODE=m")) > 0): system("echo '\nCW Mode!!\n'") mode = 'm' @@ -73,15 +83,27 @@ if __name__ == "__main__": system("echo '\nCW Mode!!\n'") mode = 'm' change_mode = True + + if ((line.find("MODE=e")) > 0): + system("echo '\nRepeater Mode!!\n'") + mode = 'e' + change_mode = True + + if ((line.find(":t6#")) > 0): + system("echo '\nFUNcube Mode!!\n'") + mode = 'j' + change_mode = True + if ((line.find("MODE=G")) > 0): system("echo '\nPacSatSim Mode!!\n'") - mode = 'G' + mode = 'p' change_mode = True if ((line.find(":t8#")) > 0): system("echo '\nPacSatSim Mode!!\n'") - mode = 'G' - change_mode = True + mode = 'p' + change_mode = True + if ((line.find("MODE=n")) > 0): system("echo '\nTransmit Commands Mode!!\n'") mode = 'n' @@ -91,91 +113,50 @@ if __name__ == "__main__": system("echo '\nTransmit Commands Mode!!\n'") mode = 'n' change_mode = True - # Currently, C2C does not support Repeater mode e + if ((line.find("MODE=o")) > 0): system("echo '\nBeacon Mode toggle!!\n'") mode = 'o' change_mode = True counter = (counter + 1) % 2 + if ((line.find(":t10#")) > 0): system("echo '\nBeacon Mode toggle!!\n'") mode = 'o' change_mode = True if (debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice - GPIO.setmode(GPIO.BCM) - GPIO.setwarnings(False) - GPIO.setup(powerPin, GPIO.OUT) - GPIO.setup(txLed, GPIO.OUT) if (mode == 'f'): - GPIO.output(powerPin, 0) # blink two times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) + blink(2) sleep(1) elif (mode == 'b'): - GPIO.output(powerPin, 0) # blink three times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) + blink(3) sleep(1) elif (mode == 's'): - GPIO.output(powerPin, 0) # blink four times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) + blink(4) sleep(1) elif (mode == 'm'): - GPIO.output(powerPin, 0) # blink five times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1); - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) + blink(5) + sleep(1) + + elif (mode == 'e'): + blink(6) + sleep(1) + + elif (mode == 'j'): + blink(7) + sleep(1) + + elif (mode == 'p'): + blink(8) sleep(1) + elif (mode == 'a'): - mode = 'a' - GPIO.output(powerPin, 0) # blink one time - sleep(0.1) - GPIO.output(powerPin, 1) + blink(1) sleep(1) try: @@ -196,7 +177,7 @@ if __name__ == "__main__": GPIO.output(txLed, 0) GPIO.output(powerPin, 0) - system("sudo systemctl stop rpitx") + system("sudo systemctl stop transmit") # system("sudo systemctl stop cubesatsim") print("\n/home/pi/CubeSatSim/config -" + mode) From 42aa30f83d7a4363749fd0e5fa1721a3644d2b9e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 13:49:54 -0500 Subject: [PATCH 543/554] Update cubicsdr.sh resolve merge conflict --- groundstation/cubicsdr.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/groundstation/cubicsdr.sh b/groundstation/cubicsdr.sh index 2bfb65dc..3b125dc6 100755 --- a/groundstation/cubicsdr.sh +++ b/groundstation/cubicsdr.sh @@ -31,6 +31,8 @@ sudo killall -9 rtl_tcp &>/dev/null sudo killall -9 CubicSDR &>/dev/null +sudo killall -9 sdrpp &>/dev/null + #sudo kill `ps -aux | grep cubicsdr-packet | grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null #sudo kill `ps -aux | grep packet | grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null @@ -42,6 +44,24 @@ sudo killall -9 zenity &>/dev/null sudo /etc/init.d/alsa-utils stop sudo /etc/init.d/alsa-utils start +sudo killall -9 rtl_fm &>/dev/null + +zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen click on a signal in the watefall to listen." & + +sleep 5 + +setsid CubicSDR + +sleep 10 + +#$SHELL +#sudo kill `ps -aux | grep sstv_decode_prompt| grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null + +sudo killall -9 zenity &>/dev/null + +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen click on a signal in the watefall to listen." & sleep 5 From 47705af70746c7c05fb4a5ca81a03ba30cdc7692 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 13:51:43 -0500 Subject: [PATCH 544/554] Update direwolf.conf resolve merge conflict --- groundstation/direwolf/direwolf.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/direwolf/direwolf.conf b/groundstation/direwolf/direwolf.conf index 3b372144..7bf93998 100644 --- a/groundstation/direwolf/direwolf.conf +++ b/groundstation/direwolf/direwolf.conf @@ -1 +1 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 +ADEVICE plughw:CARD=Loopback,DEV=1 From 11bd5a7d1ec49a3c28e2494c627248bb2e4effe4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 13:53:45 -0500 Subject: [PATCH 545/554] Update fox.sh resolve merge conflict --- groundstation/fox.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 36e241e0..27050f9a 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -21,6 +21,8 @@ sudo killall -9 java &>/dev/null sudo killall -9 CubicSDR &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 direwolf &>/dev/null #sudo killall -9 aplay &>/dev/null @@ -32,6 +34,8 @@ sudo killall -9 zenity &>/dev/null sudo /etc/init.d/alsa-utils stop sudo /etc/init.d/alsa-utils start +sudo killall -9 rtl_fm &>/dev/null + sleep 5 #/home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim From 55e717332f98e25713fa926e46f6cde648f9391a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 13:54:58 -0500 Subject: [PATCH 546/554] Update loc.sh resolve merge conflict --- groundstation/loc.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/groundstation/loc.sh b/groundstation/loc.sh index 8aa8cd9f..94558962 100755 --- a/groundstation/loc.sh +++ b/groundstation/loc.sh @@ -7,10 +7,8 @@ sudo killall -9 gpredict &>/dev/null source /home/pi/venv/bin/activate - python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py #/usr/bin/gpredict nohup /usr/bin/gpredict /dev/null 2>&1 & - From 987cabaf327c7bab62bdaca48d2d1aee3cbed767 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 13:58:20 -0500 Subject: [PATCH 547/554] Update packet.sh resolve merge conflicts --- groundstation/packet.sh | 63 ++++++++++++----------------------------- 1 file changed, 18 insertions(+), 45 deletions(-) diff --git a/groundstation/packet.sh b/groundstation/packet.sh index 24c04f0b..2b47089f 100755 --- a/groundstation/packet.sh +++ b/groundstation/packet.sh @@ -4,6 +4,8 @@ sudo modprobe snd-aloop +sudo killall -9 CubicSDR &>/dev/null + sudo systemctl stop openwebrx sudo systemctl stop rtl_tcp @@ -24,26 +26,28 @@ sudo killall -9 rtl_tcp &>/dev/null sudo killall -9 java &>/dev/null -sudo killall -9 CubicSDR &>/dev/null +sudo killall -9 sdrpp &>/dev/null sudo killall -9 zenity &>/dev/null +sudo killall -9 rtl_fm &>/dev/null + +#sudo killall -9 fctelem &>/dev/null + sudo /etc/init.d/alsa-utils stop sudo /etc/init.d/alsa-utils start echo -frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") +frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" APRS "Test APRS decoding with CubeSatSim WAV file") #echo $frequency if [ -z "$frequency" ]; then -echo "No choice made. Exiting." +echo "No choice made." -sleep 3 - -exit +frequency=434900 #echo "Choose the number for the packet decoding option:" #echo @@ -102,38 +106,6 @@ elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then echo "If the ISS is overhead and in APRS mode (see tracking application such as Gpredict), you will see packets." echo -elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then - - frequency=437100000 - echo - echo "If the Serenity CubeSat is overhead and transmitting (see tracking application such as Gpredict), you will see packets." - echo - -elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then - - echo "A recorded WAV file will play and you should see some packets decoded" - - echo - - value=`aplay -l | grep "Loopback"` - echo "$value" > /dev/null - set -- $value - -# aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & -# aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & - aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & - aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & - - timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 - - echo - - echo "Test complete. This window will close in 10 seconds." - - sleep 5 - - exit - elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then echo "A recorded APRS WAV file from the CubeSatSim will play and you should see a packet decoded." @@ -170,19 +142,19 @@ echo "Note that the 'Tuned to' frequency will be different from the chosen frequ echo -if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then +#if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then - echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" +# echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & +# direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & -else +#else echo -e "Auto decoding APRS packets on $frequency Hz" - direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf & # -t 0 & + setsid direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf & -fi +#fi sleep 5 @@ -191,7 +163,8 @@ echo "$value" > /dev/null set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -r 48000 -t raw -f S16_LE -c 1 + rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From 91a6c2d9025334f11c895e1d59d23e08c7f9d578 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 14:06:32 -0500 Subject: [PATCH 548/554] Update rtl-tcp.sh resolve merge conflicts --- groundstation/rtl-tcp.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index d5d541b1..3d49d11d 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -39,6 +39,8 @@ sudo killall -9 rtl_fm &>/dev/null sudo killall -9 CubicSDR &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 rtl_tcp &>/dev/null sudo killall -9 qsstv &>/dev/null @@ -52,15 +54,9 @@ sudo killall -9 zenity &>/dev/null sudo /etc/init.d/alsa-utils stop sudo /etc/init.d/alsa-utils start -#sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")' -sudo systemctl start rtl_tcp &>/dev/null - -sudo journalctl -af -u rtl_tcp & +sudo killall -9 rtl_fm &>/dev/null -while [[ $(sudo systemctl status rtl_tcp | grep "Active: active (running)") ]] -do - sleep 5 -done +sudo /bin/sh -c 'rtl_tcp -a $(hostname -I|cut -f1 -d " ")' sleep 5 From 0f55b6019254a977967909bc112abcda726f6840 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 14:08:05 -0500 Subject: [PATCH 549/554] Update sdr.sh resolve merge conflicts --- groundstation/sdr.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh index 66983556..2821d7c0 100755 --- a/groundstation/sdr.sh +++ b/groundstation/sdr.sh @@ -36,6 +36,8 @@ sudo killall -9 rtl_tcp &>/dev/null sudo killall -9 CubicSDR &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 qsstv &>/dev/null #sudo killall -9 aplay &>/dev/null @@ -49,7 +51,9 @@ sudo systemctl stop rtl_tcp &>/dev/null sudo /etc/init.d/alsa-utils stop sudo /etc/init.d/alsa-utils start -sudo systemctl restart openwebrx &>/dev/null +sudo killall -9 rtl_fm &>/dev/null + +sudo systemctl restart openwebrx sleep 10 From 891a60befab640e0586f05127e3dfd8c6c4b541b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 14:11:05 -0500 Subject: [PATCH 550/554] Update sstv_decode_prompt.sh resolve merge conflicts --- groundstation/sstv_decode_prompt.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index fbc55895..ae49a758 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -28,24 +28,26 @@ sudo killall -9 java &>/dev/null sudo killall -9 CubicSDR &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 zenity &>/dev/null sudo /etc/init.d/alsa-utils stop sudo /etc/init.d/alsa-utils start +sudo killall -9 rtl_fm &>/dev/null + #echo "s" >> .mode -frequency=$(zenity --list 2>/dev/null --width=410 --height=220 --title="SSTV Decoding using QSSTV" --text="Choose the frequency for SSTV decoding:" --column="kHz" --column="Use" 145800 "ISS" 434900 "CubeSatSim" Other "Choose another frequency" SSTV "Test SSTV decoding with WAV file") +frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=220 --title="SSTV Decoding using QSSTV" --text="Choose the frequency for SSTV decoding:" --column="kHz" --column="Use" 145800 "ISS" 434900 "CubeSatSim" Other "Choose another frequency" SSTV "Test SSTV decoding with WAV file") echo $frequency if [ -z "$frequency" ]; then -echo "No choice made. Exiting." - -sleep 3 +echo "No choice made." -exit +frequency=434900 #echo "Choose the number for the frequency for SSTV decoding:" #echo "1. ISS (145800Hz)" @@ -120,7 +122,7 @@ echo -e "Auto decoding SSTV on $frequency Hz" sleep 2 -qsstv & +setsid qsstv & sleep 5 @@ -133,10 +135,9 @@ set -- $value #rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 #rtl_fm -M fm -f 434.9M -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -r 48000 -t raw -f S16_LE -c 1 -#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -#rtl_fm -M fm -f $frequency -s 48k | aplay -D plughw:${2:0:1},0,1 -r 48000 -t raw -f S16_LE -c 1 sleep 5 From 332a2fd21614ff6a685f3558970af09c8e8274f1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 14:39:57 -0500 Subject: [PATCH 551/554] Update install resolve merge conflicts --- install | 765 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 599 insertions(+), 166 deletions(-) diff --git a/install b/install index 4096ca2d..b1981204 100755 --- a/install +++ b/install @@ -1,13 +1,313 @@ #!/bin/bash -echo -e "\ninstallation script for CubeSatSim v2.1\n" +FLAG=0 +checkout=0 +BULLSEYE=0 +UPDATE=0 + +FILE=/home/pi/CubeSatSim/cubesatsim # code has already been compiled +if [ -f "$FILE" ]; then + + UPDATE=1 + + echo -e "\nUpdate script for CubeSatSim v2.2\n" + + if [ -z "$1" ] ; then + checkout=0 + else + checkout=1 + branch="$1" + echo -n "changing to branch " + echo $branch + FLAG=1 + fi + + if [ "$2" = "n" ] ; then + noreboot=1 + else + noreboot=0 + fi + +else + + echo -e "\nInstallation script for CubeSatSim v2.2\n" + + touch /home/pi/CubeSatSim/command_control_direwolf + + echo "creating $FILE" + echo "AMSAT 0 0 0 no 3 434.9 435 no 0 0 no 60" > /home/pi/CubeSatSim/sim.cfg + + /home/pi/CubeSatSim/config -c -n + + /home/pi/CubeSatSim/config -l -n + +fi + +if [[ $(grep '11.' /etc/debian_version) ]]; then + + BULLSEYE=1 + + echo "Debian 11 (Bullseye) detected" + + sudo cp /boot/config.txt /boot/config.txt.0 + + sudo cp /boot/cmdline.txt /boot/cmdline.txt.0 + + sudo raspi-config nonint do_i2c 0 + + sudo raspi-config nonint do_camera 0 + + sudo raspi-config nonint do_legacy 0 + + sudo sed -i 's/console=serial0,115200 //g' /boot/cmdline.txt + + sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2 + + sudo sed -i 's/maxcpus=2/maxcpus=1/g' /boot/cmdline.txt # single core if Pi Zero 2 + + sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/config.txt + + if [[ $(grep 'dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24' /boot/config.txt) ]]; then + echo "dtoverlay=i2c-gpio already in /boot/config.txt" + else + echo "adding dtoverlay=i2c-gpio to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24" >> /boot/config.txt' + fi + + if [[ $(grep 'enable_uart=1' /boot/config.txt) ]]; then + echo "enable_uart=1 already in /boot/config.txt" + else + echo "adding enable_uart=1 to /boot/config.txt" + sudo sh -c 'echo "\nenable_uart=1" >> /boot/config.txt' + fi + + if [[ $(grep 'dtoverlay=disable-bt' /boot/config.txt) ]]; then + echo "dtoverlay=disable-bt already in /boot/config.txt" + else + echo "adding dtoverlay=disable-bt to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=disable-bt" >> /boot/config.txt' + fi + + if [[ $(grep 'dtoverlay=dwc2' /boot/config.txt) ]]; then + echo "dtoverlay=dwc2 aalready in /boot/config.txt" + else + echo "adding dtoverlay=dwc2 to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=dwc2" >> /boot/config.txt' + fi + + if [[ $(grep 'modules-load=dwc2,g_ether' /boot/cmdline.txt) ]]; then + echo "modules-load=dwc2,g_ether already in /boot/cmdline.txt" + else + echo "adding modules-load=dwc2,g_ether to /boot/cmdline.txt" + sudo sed -i 's/ rootwait/ rootwait modules-load=dwc2,g_ether/g' /boot/cmdline.txt + fi + + if [[ $(grep 'dtparam=audio=on' /boot/config.txt) ]]; then + echo "dtparam=audio=on already in /boot/config.txt" + else + echo "adding dtparam=audio=on to /boot/config.txt" + sudo sh -c 'echo "\ndtparam=audio=on" >> /boot/config.txt' + fi + + if [[ $(grep 'dtoverlay=audremap,enable_jack=on' /boot/config.txt) ]]; then + echo "dtoverlay=audremap,enable_jack=on already in /boot/config.txt" + else + echo "adding dtoverlay=audremap,enable_jack=on to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=audremap,enable_jack=on" >> /boot/config.txt' + fi + + if [[ $(grep 'dtoverlay=pwm,pin=18,func=2' /boot/config.txt) ]]; then + echo "dtoverlay=pwm,pin=18,func=2 already in /boot/config.txt" + else + echo "adding overlay=pwm,pin=18,func=2 to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=pwm,pin=18,func=2" >> /boot/config.txt' + fi + + if [[ $(grep 'disable_splash=1' /boot/config.txt) ]]; then + echo "disable_splash=1 already in /boot/config.txt" + else + echo "adding disable_splash=1 to /boot/config.txt" + sudo sh -c 'echo "\ndisable_splash=1" >> /boot/config.txt' + fi + + if [[ $(grep 'boot_delay=0' /boot/config.txt) ]]; then + echo "boot_delay=0 already in /boot/config.txt" + else + echo "adding boot_delay=0 to /boot/config.txt" + sudo sh -c 'echo "\nboot_delay=0" >> /boot/config.txt' + fi + + if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi + + sudo sh -c 'echo "\n" >> /boot/config.txt' + fi + +if [[ $(grep 'bookworm' /etc/os-release) ]]; then + + echo "Debian 12 (Bookworm) detected" + + sudo cp /boot/firmware/config.txt /boot/firmware/config.txt.0 + + sudo cp /boot/firmware/cmdline.txt /boot/firmware/cmdline.txt.0 + + sudo raspi-config nonint do_i2c 0 + + sudo raspi-config nonint do_camera 0 + + sudo raspi-config nonint do_legacy 0 + + sudo sed -i 's/console=serial0,115200 //g' /boot/firmware/cmdline.txt + + sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/firmware/cmdline.txt # single core if Pi Zero 2 + + 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 + + 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" + else + echo "adding dtoverlay=i2c-gpio to /boot/firmware/config.txt" + sudo sh -c 'echo "\ndtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24" >> /boot/firmware/config.txt' + fi + + if [[ $(grep 'enable_uart=1' /boot/firmware/config.txt) ]]; then + echo "enable_uart=1 already in /boot/firmware/config.txt" + else + echo "adding enable_uart=1 to /boot/firmware/config.txt" + sudo sh -c 'echo "\nenable_uart=1" >> /boot/firmware/config.txt' + fi + + if [[ $(grep 'dtoverlay=disable-bt' /boot/firmware/config.txt) ]]; then + echo "dtoverlay=disable-bt already in /boot/firmware/config.txt" + else + echo "adding dtoverlay=disable-bt to /boot/firmware/config.txt" + sudo sh -c 'echo "\ndtoverlay=disable-bt" >> /boot/firmware/config.txt' + fi + + if [[ $(grep 'dtoverlay=dwc2' /boot/firmware/config.txt) ]]; then + echo "dtoverlay=dwc2 aalready in /boot/firmware/config.txt" + else + echo "adding dtoverlay=dwc2 to /boot/firmware/config.txt" + sudo sh -c 'echo "\ndtoverlay=dwc2" >> /boot/firmware/config.txt' + fi + + if [[ $(grep 'modules-load=dwc2,g_ether' /boot/firmware/cmdline.txt) ]]; then + echo "modules-load=dwc2,g_ether already in /boot/firmware/cmdline.txt" + else + echo "adding modules-load=dwc2,g_ether to /boot/firmware/cmdline.txt" + sudo sed -i 's/ rootwait/ rootwait modules-load=dwc2,g_ether/g' /boot/firmware/cmdline.txt + fi + + if [[ $(grep 'dtparam=audio=on' /boot/firmware/config.txt) ]]; then + echo "dtparam=audio=on already in /boot/firmware/config.txt" + else + echo "adding dtparam=audio=on to /boot/firmware/config.txt" + sudo sh -c 'echo "\ndtparam=audio=on" >> /boot/firmware/config.txt' + fi + + if [[ $(grep 'dtoverlay=audremap,enable_jack=on' /boot/firmware/config.txt) ]]; then + echo "dtoverlay=audremap,enable_jack=on already in /boot/firmware/config.txt" + else + echo "adding dtoverlay=audremap,enable_jack=on to /boot/firmware/config.txt" + sudo sh -c 'echo "\ndtoverlay=audremap,enable_jack=on" >> /boot/firmware/config.txt' + fi + + if [[ $(grep 'dtoverlay=pwm,pin=18,func=2' /boot/firmware/config.txt) ]]; then + echo "dtoverlay=pwm,pin=18,func=2 already in /boot/firmware/config.txt" + else + echo "adding to /boot/firmware/config.txt" + sudo sh -c 'echo "\ndtoverlay=pwm,pin=18,func=2" >> /boot/firmware/config.txt' + fi + + if [[ $(grep 'disable_splash=1' /boot/firmware/config.txt) ]]; then + echo "disable_splash=1 already in /boot/firmware/config.txt" + else + echo "adding disable_splash=1 to /boot/firmware/config.txt" + sudo sh -c 'echo "\ndisable_splash=1" >> /boot/firmware/config.txt' + fi + + if [[ $(grep 'boot_delay=0' /boot/firmware/config.txt) ]]; then + echo "boot_delay=0 already in /boot/firmware/config.txt" + else + echo "adding boot_delay=0 to /boot/firmware/config.txt" + sudo sh -c 'echo "\nboot_delay=0" >> /boot/firmware/config.txt' + fi + + if [[ $(grep 'camera_auto_detect=1' /boot/firmware/config.txt) ]]; then + echo "camera_auto_detect=1 already in /boot/firmware/config.txt" + else + echo "adding camera_auto_detect=1 to /boot/firmware/config.txt" + sudo sh -c 'echo "\ncamera_auto_detect=1" >> /boot/firmware/config.txt' + fi + + if ! grep -q force_turbo=1 /boot/firmware/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/firmware/config.txt'; fi + + sudo sh -c 'echo "\n" >> /boot/firmware/config.txt' + +elif [[ $(grep 'trixie' /etc/os-release) ]]; then + + echo "Trixie detected, installation continuing." + echo "Your Pi OS version is not Bookworm or Bullseye." + echo "The software installation will likely not work." + echo "See the README.md for how to install using Bookworm." + echo + + echo "Are you sure you want to continue the installation (y/n)?" + + read -r ANS + + if [ "$ANS" = "n" ]; then + exit 1 + fi +fi +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 FILE=/home/pi/CubeSatSim/sim.cfg if [ -f "$FILE" ]; then echo "$FILE exists." + + changed=0 + value=`cat /home/pi/CubeSatSim/sim.cfg` + # echo "$value" + echo "$value" > /dev/null + set -- $value + + if [ -z "$1" ] ; then n1="AMSAT" ; changed=1 ; else n1=$1 ; fi # callsign + if [ -z "$2" ] ; then n2="0" ; changed=1 ; else n2=$2 ; fi # reset count + if [ -z "$3" ] ; then n3="0" ; changed=1 ; else n3=$3 ; fi # lat + if [ -z "$4" ] ; then n4="0" ; changed=1 ; else n4=$4 ; fi # lon + if [ -z "$5" ] ; then n5="no" ; changed=1 ; else n5=$5 ; fi # sim mode + if [ -z "$6" ] ; then n6="3" ; changed=1 ; else n6=$6 ; fi # squelch + if [ -z "$7" ] ; then n7="434.9000" ; changed=1 ; else n7=$7 ; fi # transmit frequency + if [ -z "$8" ] ; then n8="435.0000" ; changed=1 ; else n8=$8 ; fi # receive frequency + if [ -z "$9" ] ; then n9="no" ; changed=1 ; else n9=$9 ; fi # hab mode + if [ -z "${10}" ] ; then m1="0" ; changed=1 ; else m1=${10} ; fi # rx pl code + if [ -z "${11}" ] ; then m2="0" ; changed=1 ; else m2=${11} ; fi # tx pl code + if [ -z "${12}" ] ; then m3="no" ; changed=1 ; else m3=${12} ; fi # random fail + if [ -z "${13}" ] ; then m4="60" ; changed=1 ; else m4=${13} ; fi # random fail period + + if [ $changed -eq 1 ]; then + echo -e "Current sim.cfg configuration file:" + echo + echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} + echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" + echo + echo $n1 $n2 $n3 $n4 $n5 $n6 $n7 $n8 $n9 $m1 $m2 $m3 $m4 + echo $n1 $n2 $n3 $n4 $n5 $n6 $n7 $n8 $n9 $m1 $m2 $m3 $m4> /home/pi/CubeSatSim/sim.cfg + echo + fi + else echo "creating $FILE" - echo "AMSAT 1 0.0 0.0" > /home/pi/CubeSatSim/sim.cfg + echo "AMSAT 0 0 0 no 3 434.9 435 no 0 0 no 60" > /home/pi/CubeSatSim/sim.cfg +fi + +if [[ $(grep 'cubesatsim' /etc/motd) ]]; then + echo "motd already updated" +else + echo "updating motd" + sudo sh -c 'cat /home/pi/CubeSatSim/motd.txt >> /etc/motd' fi FILE=/home/pi/CubeSatSim/command_tx @@ -25,48 +325,87 @@ else echo "creating $FILE" echo "0\n" > /home/pi/CubeSatSim/command_count.txt fi + +sudo apt-get update && sudo apt-get dist-upgrade -y -cd +# if [ $BULLSEYE -eq 1 ]; then +# sudo apt purge -y python3-pip +# sudo apt install -y python3-pip +# fi -CubeSatSim/config -c -n +cp /home/pi/CubeSatSim/groundstation/pacsat.desktop /home/pi/Desktop/pacsat.desktop -CubeSatSim/config -l -n +if [ ! -d "/home/pi/venv" ]; then -cp /home/pi/CubeSatSim/groundstation/pacsat.desktop /home/pi/Desktop/pacsat.desktop - -sudo apt-get update && sudo apt-get dist-upgrade -y + cd + sudo apt install -y python3-venv + sudo python3 -m venv venv + source /home/pi/venv/bin/activate + + curl https://bootstrap.pypa.io/get-pip.py | sudo /home/pi/venv/bin/python3 + + sudo /home/pi/venv/bin/pip3 install adafruit_extended_bus + sudo /home/pi/venv/bin/pip3 install adafruit-circuitpython-ina219 + +fi +>>>>>>> 9518ba870ed4548fcaf00285b0578312a9a300c2 sudo apt-get remove pulseaudio -y +sudo apt-get install -y gcc g++ make cmake libasound2-dev libudev-dev libavahi-client-dev libgpiod-dev raspi-config + # removed wiringpi and python-picamera python3-picamera sudo apt-get install -y git libasound2-dev i2c-tools build-essential libgd-dev libmagic-dev minicom -cd /tmp +if [ ! -d "/home/pi/direwolf" ]; then -# wget https://project-downloads.drogon.net/wiringpi-latest.deb + cd + git clone https://github.com/alanbjohnston/direwolf.git + cd direwolf + make -j + sudo make install + make install-rpi +fi -# sudo dpkg -i wiringpi-latest.deb + sudo apt-get install -y gpsd gpsd-clients libgps-dev python3-gps + sudo systemctl disable gpsd + sudo systemctl disable gpsd.socket + +if [ ! -d "/home/pi/WiringPi" ]; then + cd + git clone https://github.com/alanbjohnston/WiringPi + cd WiringPi + ./build debian + sudo dpkg -i debian-template/wiringpi-2.61-1.deb +fi cd -git clone https://github.com/alanbjohnston/WiringPi -cd WiringPi -./build debian +if [ ! $BULLSEYE -eq 1 ]; then + sudo apt install -y libtiff6 +fi -sudo dpkg -i debian-template/wiringpi-2.61-1.deb +sudo apt install -y python3-pip python3-smbus libjpeg-dev zlib1g-dev libfreetype6-dev libopenjp2-7 python3-pil python3-serial libusb-1.0-0 libusb-1.0-0-dev -cd +if [ $BULLSEYE -eq 1 ] || [ $UPDATE -eq 0 ] ; then -#changed to python3-smbus -sudo apt install -y python3-pip python3-smbus libjpeg-dev zlib1g-dev libfreetype6-dev libopenjp2-7 libtiff5 python3-pil python3-serial + sudo pip3 install --upgrade setuptools + + sudo pip3 install adafruit-blinka RPI.GPIO adafruit-extended-bus adafruit-circuitpython-ina219 -sudo pip3 install --upgrade setuptools +fi -sudo pip3 install adafruit-blinka RPI.GPIO adafruit-extended-bus adafruit-circuitpython-ina219 +cd /home/pi/CubeSatSim -cd ~/CubeSatSim +git pull --no-rebase > .updated -git pull --no-rebase +if [ $checkout -eq 1 ]; then + git checkout $branch + git pull --no-rebase > .updated + FLAG=1 + echo "Running update script again" + /home/pi/CubeSatSim/install +fi make debug @@ -80,7 +419,6 @@ fi cd -sudo apt-get install -y cmake git clone https://github.com/wb2osz/direwolf.git cd direwolf mkdir build @@ -92,39 +430,30 @@ make install-conf cd -git clone https://github.com/alanbjohnston/pi-power-button.git - -cd pi-power-button - -git checkout master +if [ ! -d "/home/pi/pi-power-button" ]; then -./script/install - - -cd - -git clone https://github.com/alanbjohnston/PiSSTVpp.git - -cd PiSSTVpp + cd + git clone https://github.com/alanbjohnston/pi-power-button.git + cd pi-power-button + git checkout master + ./script/install + sudo apt-get install -y libraspberrypi-dev -make pisstvpp +fi -echo "Copying SSTV image 1" -cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +cd /home/pi/pi-power-button -echo "Copying SSTV image 2" -cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +git pull --no-rebase > .updated_p +git checkout master +grep 'changed' /home/pi/pi-power-button/.updated_p +if [[ $(grep 'changed' /home/pi/pi-power-button/.updated_p) ]]; then + echo "updating pi-power-button." + script/install + FLAG=1 +fi cd -git clone https://github.com/alanbjohnston/rpitx.git - -cd rpitx - -./install.sh - -sudo cp /home/pi/CubeSatSim/asound.conf /etc/asound.conf - FILE=/home/pi/pi_pacsat/Debug/pi_pacsat # code has already been compiled if [ ! -f "$FILE" ]; then cd @@ -198,154 +527,258 @@ sudo apt-get install default-jdk -y cd -sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service - -sudo systemctl enable cubesatsim - -sudo cp ~/CubeSatSim/systemd/transmit.service /etc/systemd/system/transmit.service - -# sudo systemctl enable transmit - -sudo cp ~/CubeSatSim/systemd/command.service /etc/systemd/system/command.service - -sudo systemctl enable command +if [ ! -d "/home/pi/PiSSTVpp" ]; then -sudo cp ~/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + sudo apt-get update -y + sudo apt-get install -y python-picamera python3-picamera build-essential libgd-dev libmagic-dev + cd + git clone https://github.com/alanbjohnston/PiSSTVpp.git + cd PiSSTVpp + make pisstvpp -sudo cp /boot/config.txt /boot/config.txt.0 - -sudo cp /boot/cmdline.txt /boot/cmdline.txt.0 +fi +if [ ! -d "/home/pi/rpitx" ]; then -sudo raspi-config nonint do_i2c 0 + cd + git clone https://github.com/alanbjohnston/rpitx.git + cd rpitx + ./install.sh + cd +else -sudo raspi-config nonint do_camera 0 + if [[ $(grep 'SYNCWITHPWM' /home/pi/rpitx/src/librpitx/src/fskburst.h) ]]; then + echo "rpitx library already updated" + else + echo "updating rpitx" + cd /home/pi/rpitx + git pull + ./update.sh + cd + fi +fi -sudo raspi-config nonint do_legacy 0 +FILE=/etc/systemd/system/cubesatsim.service +if [ -f "$FILE" ]; then + if [[ $(diff /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then + echo "changed cubesatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service + FLAG=1 + else + echo "no changes to cubesatsim.service." + fi +else + echo "creating cubesatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service + sudo systemctl enable command -#if [ "$1" = "u" ]; then -#fi + FLAG=1 +fi -## sudo sed -i 's/console=serial0,115200 //g' /boot/cmdline.txt - - sudo sed -i 's/console=serial0,115200 //g' /boot/cmdline.txt +FILE=/etc/systemd/system/rpitx.service +if [ -f "$FILE" ]; then + sudo systemctl disable rpitx + sudo rm /etc/systemd/system/rpitx.service +fi - #sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2 - - sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/config.txt - - if [[ $(grep 'dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24' /boot/config.txt) ]]; then - echo "dtoverlay=i2c-gpio already in /boot/config.txt" +FILE=/etc/systemd/system/transmit.service +if [ -f "$FILE" ]; then + if [[ $(diff /home/pi/CubeSatSim/systemd/transmit.service /etc/systemd/system/transmit.service) ]]; then + echo "changed transmit.service." + sudo cp /home/pi/CubeSatSim/systemd/transmit.service /etc/systemd/system/transmit.service + FLAG=1 else - echo "adding dtoverlay=i2c-gpio to /boot/config.txt" - sudo sh -c 'echo "\ndtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24" >> /boot/config.txt' + echo "no change to transmit.service." fi +else + echo "creating transmit.service." + sudo cp /home/pi/CubeSatSim/systemd/transmit.service /etc/systemd/system/transmit.service + FLAG=1 +fi - if [[ $(grep 'enable_uart=1' /boot/config.txt) ]]; then - echo "enable_uart=1 already in /boot/config.txt" - else - echo "adding enable_uart=1 to /boot/config.txt" - sudo sh -c 'echo "\nenable_uart=1" >> /boot/config.txt' - fi - - if [[ $(grep 'dtoverlay=disable-bt' /boot/config.txt) ]]; then - echo "dtoverlay=disable-bt already in /boot/config.txt" - else - echo "adding dtoverlay=disable-bt to /boot/config.txt" - sudo sh -c 'echo "\ndtoverlay=disable-bt" >> /boot/config.txt' - fi - - if [[ $(grep 'dtoverlay=dwc2' /boot/config.txt) ]]; then - echo "dtoverlay=dwc2 aalready in /boot/config.txt" +FILE=/etc/systemd/system/command.service +if [ -f "$FILE" ]; then + if [[ $(diff /home/pi/CubeSatSim/systemd/command.service /etc/systemd/system/command.service) ]]; then + echo "changed command.service." + sudo cp /home/pi/CubeSatSim/systemd/command.service /etc/systemd/system/command.service + FLAG=1 else - echo "adding dtoverlay=dwc2 to /boot/config.txt" - sudo sh -c 'echo "\ndtoverlay=dwc2" >> /boot/config.txt' + echo "no change to command.service." fi +else + echo "creating command.service." + sudo cp /home/pi/CubeSatSim/systemd/command.service /etc/systemd/system/command.service + sudo systemctl enable command + FLAG=1 +fi - if [[ $(grep 'modules-load=dwc2,g_ether' /boot/cmdline.txt) ]]; then - echo "modules-load=dwc2,g_ether already in /boot/cmdline.txt" - else - echo "adding modules-load=dwc2,g_ether to /boot/cmdline.txt" - sudo sed -i 's/ rootwait/ rootwait modules-load=dwc2,g_ether/g' /boot/cmdline.txt - fi - - if [[ $(grep 'dtparam=audio=on' /boot/config.txt) ]]; then - echo "dtparam=audio=on already in /boot/config.txt" +FILE=/etc/systemd/system/pacsatsim.service +if [ -f "$FILE" ]; then + if [[ $(diff /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service) ]]; then + echo "changed pacsatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + FLAG=1 else - echo "adding dtparam=audio=on to /boot/config.txt" - sudo sh -c 'echo "\ndtparam=audio=on" >> /boot/config.txt' + echo "no change to pacsatsim.service." fi +else + echo "creating pacsatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + sudo systemctl enable command + FLAG=1 +fi - if [[ $(grep 'dtoverlay=audremap,enable_jack=on' /boot/config.txt) ]]; then - echo "dtoverlay=audremap,enable_jack=on already in /boot/config.txt" +FILE=/etc/asound.conf +if [ -f "$FILE" ]; then + if [[ $(diff /home/pi/CubeSatSim/asound.conf /etc/asound.conf) ]]; then + echo "changed /etc/asound.conf." + sudo cp /home/pi/CubeSatSim/asound.conf /etc/asound.conf + FLAG=1 else - echo "adding dtoverlay=audremap,enable_jack=on to /boot/config.txt" - sudo sh -c 'echo "\ndtoverlay=audremap,enable_jack=on" >> /boot/config.txt' + echo "no change to /etc/asound.conf." fi +else + echo "creating /etc/asound.conf." + sudo cp /home/pi/CubeSatSim/asound.conf /etc/asound.conf + FLAG=1 +fi - if [[ $(grep 'dtoverlay=pwm,pin=18,func=2' /boot/config.txt) ]]; then - echo "dtoverlay=pwm,pin=18,func=2 already in /boot/config.txt" - else - echo "adding to /boot/config.txt" - sudo sh -c 'echo "\ndtoverlay=pwm,pin=18,func=2" >> /boot/config.txt' - fi +FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 1." + cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +fi + +FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 2." + cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +fi - if [[ $(grep 'disable_splash=1 ' /boot/config.txt) ]]; then - echo "disable_splash=1 already in /boot/config.txt" - else - echo "adding to /boot/config.txt" - sudo sh -c 'echo "\ndisable_splash=1" >> /boot/config.txt' - fi +sudo sed -i 's/DEVICES=""/DEVICES="\/dev\/serial0"/g' /etc/default/gpsd - if [[ $(grep 'boot_delay=0' /boot/config.txt) ]]; then - echo "boot_delay=0 already in /boot/config.txt" - else - echo "adding to /boot/config.txt" - sudo sh -c 'echo "\nboot_delay=0" >> /boot/config.txt' - fi +sudo sed -i 's/GPSD_OPTIONS=""/GPSD_OPTIONS="-s 9600"/g' /etc/default/gpsd - if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi - -sudo sh -c 'echo "\n" >> /boot/config.txt' - -changed=0 -value=`cat /home/pi/CubeSatSim/sim.cfg` -echo "$value" > /dev/null -set -- $value - -if [ -z "$1" ] ; then n1="AMSAT" ; changed=1 ; else n1=$1 ; fi # callsign -if [ -z "$2" ] ; then n2="0" ; changed=1 ; else n2=$2 ; fi # reset count -if [ -z "$3" ] ; then n3="0" ; changed=1 ; else n3=$3 ; fi # lat -if [ -z "$4" ] ; then n4="0" ; changed=1 ; else n4=$4 ; fi # lon -if [ -z "$5" ] ; then n5="no" ; changed=1 ; else n5=$5 ; fi # sim mode -if [ -z "$6" ] ; then n6="3" ; changed=1 ; else n6=$6 ; fi # squelch -if [ -z "$7" ] ; then n7="434.9000" ; changed=1 ; else n7=$7 ; fi # transmit frequency -if [ -z "$8" ] ; then n8="435.0000" ; changed=1 ; else n8=$8 ; fi # receive frequency -if [ -z "$9" ] ; then n9="no" ; changed=1 ; else n9=$9 ; fi # hab mode -if [ -z "${10}" ] ; then n10="0" ; changed=1 ; else n10=${10} ; fi # rx pl code -if [ -z "${11}" ] ; then n11="0" ; changed=1 ; else n11=${11} ; fi # tx pl code - -if [ $changed -eq 1 ]; then - echo -e "Current sim.cfg configuration file:" - echo - echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} - echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo - echo $n1 $n2 $n3 $n4 $n5 $n6 $n7 $n8 $n9 $n10 $n11 - echo $n1 $n2 $n3 $n4 $n5 $n6 $n7 $n8 $n9 $n10 $n11 > /home/pi/CubeSatSim/sim.cfg - echo +if [ ! -d "/home/pi/fctelem" ]; then + echo "Installing fctelem binary v0.2 for FUNcube mode" + cd + mkdir /home/pi/fctelem + mkdir /home/pi/fctelem/public_html + cd fctelem + wget https://github.com/alanbjohnston/go/releases/download/v0.2/fctelem.zip + unzip -u fctelem.zip + FLAG=1 +elif [ ! -f "/home/pi/fctelem/v0.2" ]; then + echo "Updating fctelem binary to version v0.2 for FUNcube mode" + cd + cd /home/pi/fctelem + sudo mv fctelem fctelem.bk + sudo mv fcdecode.conf fcdecode.conf.bk + sudo mv fctelem.zip fctelem.zip.1 + wget https://github.com/alanbjohnston/go/releases/download/v0.2/fctelem.zip + unzip -u fctelem.zip + FLAG=1 fi -echo "Would you like to reboot to complete the installation (y/n)?" +if [ ! -f "/home/pi/MPU6050-C-CPP-Library-for-Raspberry-Pi/mpu6050" ]; then + echo "Installing MPU6050-C-CPP-Library-for-Raspberry-Pi" + sudo apt-get install -y libi2c-dev + cd + git clone https://github.com/alanbjohnston/MPU6050-C-CPP-Library-for-Raspberry-Pi.git + cd MPU6050-C-CPP-Library-for-Raspberry-Pi + sudo make install + make payload +fi + +cd /home/pi/MPU6050-C-CPP-Library-for-Raspberry-Pi +git checkout master +git pull --no-rebase > .updated_p + +if [[ $(grep 'changed' /home/pi/MPU6050-C-CPP-Library-for-Raspberry-Pi/.updated_p) ]]; then + echo "updating MPU6050-C-CPP-Library-for-Raspberry-Pi" + sudo make install + make payload +else + echo "nothing to do for MPU6050-C-CPP-Library-for-Raspberry-Pi." +fi + +if [ ! -f "/home/pi/raspberry-pi-bme280/bme280" ]; then + echo "Installing raspberry-pi-bme280" + sudo apt-get install -y libi2c-dev + cd + git clone https://github.com/alanbjohnston/raspberry-pi-bme280.git + cd raspberry-pi-bme280 + git checkout payload + make +fi -read -r ANS +cd /home/pi/raspberry-pi-bme280 +git checkout payload +git pull --no-rebase > .updated_p -if [ "$ANS" = "y" ]; then +if [[ $(grep 'changed' /home/pi/raspberry-pi-bme280/.updated_p) ]]; then - sudo reboot now + echo "updating raspberry-pi-bme280" + make else + echo "nothing to do for raspberry-pi-bme280." +fi + +if [ ! -f "/home/pi/fcdctl/fcdctl" ]; then + echo "Installing fcdctl to set FUNcubeDongle Pro gain" + sudo rm /var/lib/dpkg/info/python3-pip.list + sudo apt install python3-pip --reinstall + sudo apt-get install -y python3-smbus libusb-1.0 + cd + git clone https://github.com/csete/fcdctl.git + cd fcdctl + make fcdpp +fi - echo "The CubeSatSim software will start next time you reboot" +if [ ! -f "/home/pi/ssdv/ssdv" ]; then + cd + echo "Installing SSDV for FUNcube mode" + git clone https://github.com/alanbjohnston/ssdv.git # install ssdv for FUNcube images + cd ssdv + make +fi + +cd + +#echo "Would you like to reboot to complete the installation (y/n)?" + +#read -r ANS + +#if [ "$ANS" = "y" ]; then + +# sudo reboot now + +#else + + # echo "The CubeSatSim software will start next time you reboot" +#fi + +if [ "$noreboot" = "0" ] ; then + + if [ $FLAG -eq 1 ]; then + echo "systemctl daemon-reload and reboot" + sudo systemctl daemon-reload + sudo reboot -h now +# sudo cubesatsim + else + grep 'changed' /home/pi/CubeSatSim/.updated + if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then + echo "reboot due to code changes " | wall + sudo reboot -h now +# sudo cubesatsim + else + echo "nothing to do." + fi + fi +else + if [ $FLAG -eq 1 ]; then + echo "reboot needed for changes to take effect" | wall + fi fi From 9e0c897d60815b5287d44725fa285dc372eb4596 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 14:54:30 -0500 Subject: [PATCH 552/554] Update main.c resolve merge conflicts --- main.c | 2269 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 1594 insertions(+), 675 deletions(-) diff --git a/main.c b/main.c index e0fda7e1..bcb7d75d 100644 --- a/main.c +++ b/main.c @@ -18,17 +18,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + #include "main.h" //#define HAB // uncomment to change APRS icon from Satellite to Balloon and only BAT telemetry int main(int argc, char * argv[]) { - printf("\n\nCubeSatSim v2.1 starting...\n\n"); + printf("\n\nCubeSatSim v2.2 starting...\n\n"); wiringPiSetup(); - + + strcpy(fail_yes, "no"); // Open configuration file with callsign and reset count FILE * config_file = fopen("/home/pi/CubeSatSim/sim.cfg", "r"); if (config_file == NULL) { @@ -41,11 +42,11 @@ int main(int argc, char * argv[]) { // char * cfg_buf[100]; - fscanf(config_file, "%s %d %f %f %s %d %s %s %s %d %d", - call, & reset_count, & lat_file, & long_file, sim_yes, & squelch, tx, rx, hab_yes, & rx_pl, & tx_pl); + fscanf(config_file, "%s %d %f %f %s %d %s %s %s %d %d %s %d", + call, &reset_count, &lat_file, &long_file, sim_yes, &squelch, tx, rx, hab_yes, &rx_pl, &tx_pl, fail_yes, &fail_time); fclose(config_file); - fprintf(stderr,"Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s %d %s %s %s %d %d\n", - call, reset_count, lat_file, long_file, sim_yes, squelch, tx, rx, hab_yes, rx_pl, tx_pl); + fprintf(stderr,"Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s %d %s %s %s %d %d %s %d\n", + call, reset_count, lat_file, long_file, sim_yes, squelch, tx, rx, hab_yes, rx_pl, tx_pl, fail_yes, fail_time); fprintf(stderr, "Transmit on %s MHz Receive on %s MHz\n", tx, rx); @@ -79,13 +80,19 @@ int main(int argc, char * argv[]) { if (strcmp(sim_yes, "yes") == 0) { sim_mode = TRUE; - fprintf(stderr, "Sim mode is turned ON by configuration\n"); + fprintf(stderr, "Sim Mode is turned ON by configuration\n"); sim_config = TRUE; } if (strcmp(hab_yes, "yes") == 0) { hab_mode = TRUE; fprintf(stderr, "HAB mode is ON\n"); } + if (strcmp(fail_yes, "yes") == 0) { + fail_rnd_mode = TRUE; + fprintf(stderr, "Random fail mode is ON\n"); + failTime = 0; + srand((unsigned int)time(0)); + } FILE * command_file = fopen("/home/pi/CubeSatSim/command_control", "r"); if (command_file == NULL) { @@ -102,6 +109,25 @@ int main(int argc, char * argv[]) { } } printf("c2cStatus: %d \n", c2cStatus); + + printf("Test bus 1\n"); + fflush(stdout); + i2c_bus1 = (test_i2c_bus(1) != -1) ? 1 : OFF; + printf("Test bus 3\n"); + fflush(stdout); + i2c_bus3 = (test_i2c_bus(3) != -1) ? 3 : OFF; + printf("Finished testing\n"); + fflush(stdout); + + if (i2c_bus3 == OFF) { + printf("Sim Mode turned on automatically\n"); + sim_mode = TRUE; + FILE * sim_mode_auto = popen("touch /home/pi/CubeSatSim/sim_mode_auto", "r"); // store sim_mode_auto flag + pclose(sim_mode_auto); + } else { + FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag + pclose(sim_mode_auto); + } char resbuffer[1000]; // const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//' | grep '9000'"; @@ -121,21 +147,26 @@ int main(int argc, char * argv[]) { fgets(resbuffer, 1000, file2_test); fprintf(stderr, "Pi Zero 2 test result: %s\n", resbuffer); fclose(file2_test); - if (strlen(resbuffer) > 5) + if (strlen(resbuffer) > 5) { fprintf(stderr, "Pi Zero 2 detected\n"); + FILE * pi_zero2 = popen("touch /home/pi/CubeSatSim/pi_zero2", "r"); // store Pi Zero 2 flag + pclose(pi_zero2); + } else fprintf(stderr, "Not a Pi Zero or Pi Zero 2\n"); - pi_zero_2_offset = 500; - if (uptime_sec < 30.0) { - FILE * transmit_stop = popen("sudo systemctl start transmit", "r"); - pclose(transmit_stop); + pi_zero_2_offset = 500; + if (uptime_sec < 30.0) { + FILE * transmit_stop = popen("sudo systemctl start transmit", "r"); + pclose(transmit_stop); fprintf(stderr, "Sleep 5 sec\n"); - sleep(5); // try sleep at start to help boot + sleep(5); // try sleep at start to help boot } } else { fprintf(stderr,"Pi Zero detected\n"); + FILE * pi_zero2 = popen("sudo rm /home/pi/CubeSatSim/pi_zero2 &>/dev/null", "r"); // remove Pi Zero 2 flag if present + pclose(pi_zero2); if ((c2cStatus == DISABLED) || (c2cStatus == CARRIER)) { pi_zero_2_offset = 500; } @@ -156,15 +187,6 @@ int main(int argc, char * argv[]) { // FILE * file_deletes = popen("sudo rm /home/pi/CubeSatSim/ready /home/pi/CubeSatSim/cwready > /dev/null", "r"); // pclose(file_deletes); - - printf("Test bus 1\n"); - fflush(stdout); - i2c_bus1 = (test_i2c_bus(1) != -1) ? 1 : OFF; - printf("Test bus 3\n"); - fflush(stdout); - i2c_bus3 = (test_i2c_bus(3) != -1) ? 3 : OFF; - printf("Finished testing\n"); - fflush(stdout); // sleep(2); @@ -190,6 +212,9 @@ int main(int argc, char * argv[]) { } else if ( * argv[1] == 'm') { mode = CW; printf("Mode is CW\n"); + } else if ( * argv[1] == 'j') { + mode = FC; + printf("Mode is FUNcube\n"); } else { printf("Mode is BPSK\n"); } @@ -228,6 +253,9 @@ int main(int argc, char * argv[]) { } else if ( mode_string == 'm') { mode = CW; printf("Mode is CW\n"); + } else if ( mode_string == 'j') { + mode = FC; + printf("Mode is FUNcube\n"); } else if ( mode_string == 'e') { mode = REPEATER; printf("Mode is Repeater\n"); @@ -276,47 +304,10 @@ int main(int argc, char * argv[]) { /**/ fflush(stderr); - - if (mode == AFSK) - { - // Check for SPI and AX-5043 Digital Transceiver Board - FILE * file = popen("sudo raspi-config nonint get_spi", "r"); -// printf("getc: %c \n", fgetc(file)); - if (fgetc(file) == 48) { - printf("SPI is enabled!\n"); - - FILE * file2 = popen("ls /dev/spidev0.* 2>&1", "r"); - printf("Result getc: %c \n", getc(file2)); - - if (fgetc(file2) != 'l') { - printf("SPI devices present!\n"); - // } - - setSpiChannel(SPI_CHANNEL); - setSpiSpeed(SPI_SPEED); - initializeSpi(); - ax25_init( & hax25, (uint8_t * ) dest_addr, 11, (uint8_t * ) call, 11, AX25_PREAMBLE_LEN, AX25_POSTAMBLE_LEN); - if (init_rf()) { - printf("AX5043 successfully initialized!\n"); - ax5043 = TRUE; - cw_id = OFF; -// mode = AFSK; - // cycle = OFF; - printf("Mode AFSK with AX5043\n"); - transmit = TRUE; -// sleep(10); // just in case CW ID is sent - } else - printf("AX5043 not present!\n"); - pclose(file2); - } - } - pclose(file); - } - + txLed = 2; txLedOn = HIGH; txLedOff = LOW; - vB5 = TRUE; onLed = 27; onLedOn = HIGH; onLedOff = LOW; @@ -330,44 +321,52 @@ int main(int argc, char * argv[]) { } config_file = fopen("sim.cfg", "w"); - fprintf(config_file, "%s %d %8.4f %8.4f %s %d %s %s %s %d %d", call, reset_count, lat_file, long_file, sim_yes, squelch, tx, rx, hab_yes, rx_pl, tx_pl); + fprintf(config_file, "%s %d %8.4f %8.4f %s %d %s %s %s %d %d %s %d", + call, reset_count, lat_file, long_file, sim_yes, squelch, tx, rx, hab_yes, rx_pl, tx_pl, fail_yes, fail_time); // fprintf(config_file, "%s %d", call, reset_count); fclose(config_file); config_file = fopen("sim.cfg", "r"); - if (vB4) { - map[BAT] = BAT2; - map[BAT2] = BAT; - snprintf(busStr, 10, "%d %d", i2c_bus1, test_i2c_bus(0)); - } else if (vB5) { - map[MINUS_X] = MINUS_Y; - map[PLUS_Z] = MINUS_X; - map[MINUS_Y] = PLUS_Z; + map[MINUS_X] = MINUS_Y; + map[PLUS_Z] = MINUS_X; + map[MINUS_Y] = PLUS_Z; - if (access("/dev/i2c-11", W_OK | R_OK) >= 0) { // Test if I2C Bus 11 is present + if (access("/dev/i2c-11", W_OK | R_OK) >= 0) { // Test if I2C Bus 11 is present printf("/dev/i2c-11 is present\n\n"); snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(11)); - } else { - snprintf(busStr, 10, "%d %d", i2c_bus1, i2c_bus3); - } } else { - map[BAT2] = MINUS_Z; - map[BAT] = BAT2; - map[PLUS_Z] = BAT; - map[MINUS_Z] = PLUS_Z; - snprintf(busStr, 10, "%d %d", i2c_bus1, test_i2c_bus(0)); - voltageThreshold = 8.0; + snprintf(busStr, 10, "%d %d", i2c_bus1, i2c_bus3); } - - // check for camera -// char cmdbuffer1[1000]; - FILE * file4 = popen("vcgencmd get_camera", "r"); - fgets(cmdbuffer, 1000, file4); - char camera_present[] = "supported=1 detected=1"; + + FILE * os_test = popen("cat /etc/os-release", "r"); + fgets(cmdbuffer, 1000, os_test); + printf("os-release: %s\n", cmdbuffer); + char os_present[] = "bookworm"; // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); - camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF; - printf("Camera result:%s camera: %d \n", & cmdbuffer, camera); - pclose(file4); + int os_status = (strstr( (const char *)& cmdbuffer, os_present) != NULL) ? ON : OFF; + printf("os_status: %d\n", os_status); + pclose(os_test); + + // check for camera + FILE *cam_test; + if (os_status == ON) { // bookworm + cam_test = popen("sudo rpicam-hello --list-cameras | grep 'No cameras available!'", "r"); + fgets(cmdbuffer, 1000, cam_test); + char no_camera_present[] = "No cameras available!"; + // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); + camera = (strstr( (const char *)& cmdbuffer, no_camera_present) != NULL) ? OFF : ON; + } + else // bullseye + { + cam_test = popen("vcgencmd get_camera", "r"); + fgets(cmdbuffer, 1000, cam_test); + char camera_present[] = "supported=1 detected=1"; + // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); + camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF; + } + + printf("Camera result: %s camera: %d \n", & cmdbuffer, camera); + pclose(cam_test); #ifdef DEBUG_LOGGING printf("INFO: I2C bus status 0: %d 1: %d 3: %d camera: %d\n", i2c_bus0, i2c_bus1, i2c_bus3, camera); @@ -377,68 +376,117 @@ int main(int argc, char * argv[]) { //file5 = popen("sudo rm /home/pi/CubeSatSim/camera_out.jpg.wav > /dev/null 2>&1", "r"); pclose(file5); - if (!ax5043) // don't test for payload if AX5043 is present - { + cmdbuffer[0] = '\0'; + gps_status = OFF; + FILE *gps_read = NULL; + if ((mode == AFSK) || (mode == CW) || (mode == SSTV)) + { + gps_read = sopen("python3 /home/pi/CubeSatSim/gps_client.py"); // python sensor polling function + + if (gps_read != NULL) { + fgets(cmdbuffer, 1000, gps_read); + fprintf(stderr, "gps read: %s\n", cmdbuffer); + if ((cmdbuffer[0] == '-') && (cmdbuffer[1] == '1')) + { + gps_status = OFF; + fprintf(stderr, "Pi GPS off\n"); + } else if ((cmdbuffer[0] == '1') || (cmdbuffer[0] == '2') || (cmdbuffer[0] == '3')) { + gps_status = ON; + fprintf(stderr, "Pi GPS on\n"); + } + fclose(gps_read); + } else + fprintf(stderr, "Error checking gps"); + } + payload = OFF; - fprintf(stderr,"Opening serial\n"); - if ((uart_fd = serialOpen("/dev/ttyAMA0", 115200)) >= 0) { // was 9600 - fprintf(stderr,"Serial opened to Pico\n"); -// payload = ON; - payload = get_payload_serial(FALSE); - fprintf(stderr,"Get_payload_status: %d \n", payload); // not debug - - } else { - fprintf(stderr, "Unable to open UART: %s\n -> Did you configure /boot/config.txt and /boot/cmdline.txt?\n", strerror(errno)); - } - } - if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) { + if (gps_status == OFF) + { + fprintf(stderr,"Opening serial\n"); + if ((uart_fd = serialOpen("/dev/ttyAMA0", 115200)) >= 0) { // was 9600 + fprintf(stderr,"Serial opened to Pico\n"); + // payload = ON; + payload = get_payload_serial(FALSE); + fprintf(stderr,"Get_payload_status: %d \n", payload); // not debug + + if (sim_mode && payload && !sim_config) { + sim_mode = FALSE; + printf("Turning off Sim Mode since payload is present and Sim Mode not manually configured.\n"); + FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag + pclose(sim_mode_auto); + } + } else { + fprintf(stderr, "Unable to open UART: %s\n -> Did you configure /boot/config.txt and /boot/cmdline.txt?\n", strerror(errno)); + } + } + else + { + payload = FALSE; + printf("get_payload_status not run since gps_status is ON\n"); + } + + sensor_setup(); - sim_mode = TRUE; - - fprintf(stderr, "Simulated telemetry mode!\n"); + if (sim_mode == TRUE) { + + fprintf(stderr, "Sim Mode is active\n"); srand((unsigned int)time(0)); - axis[0] = rnd_float(-0.2, 0.2); - if (axis[0] == 0) - axis[0] = rnd_float(-0.2, 0.2); - axis[1] = rnd_float(-0.2, 0.2); - axis[2] = (rnd_float(-0.2, 0.2) > 0) ? 1.0 : -1.0; + axis[X] = rnd_float(-0.2, 0.2); + if (axis[X] == 0) + axis[X] = rnd_float(-0.2, 0.2); + axis[Y] = rnd_float(-0.2, 0.2); + float axis_z; + axis_z = sqrt(1 - axis[X] * axis[X] - axis[Y] * axis[Y]); + axis[Z] = (rnd_float(-0.2, 0.2) > 0) ? axis_z : -1.0 * axis_z; - angle[0] = (float) atan(axis[1] / axis[2]); - angle[1] = (float) atan(axis[2] / axis[0]); - angle[2] = (float) atan(axis[1] / axis[0]); + angle[X] = (float) atan(axis[Y] / axis[Z]); + angle[Y] = (float) atan(axis[Z] / axis[X]); + angle[Z] = (float) atan(axis[Y] / axis[X]); - volts_max[0] = rnd_float(4.5, 5.5) * (float) sin(angle[1]); - volts_max[1] = rnd_float(4.5, 5.5) * (float) cos(angle[0]); - volts_max[2] = rnd_float(4.5, 5.5) * (float) cos(angle[1] - angle[0]); + volts_max[X] = rnd_float(9.0, 12.0) * (float) sin(angle[Y]); + volts_max[Y] = rnd_float(9.0, 12.0) * (float) cos(angle[X]); + volts_max[Z] = rnd_float(9.0, 12.0) * (float) cos(angle[Y] - angle[X]); - float amps_avg = rnd_float(150, 300); + float amps_avg = rnd_float(150, 750); - amps_max[0] = (amps_avg + rnd_float(-25.0, 25.0)) * (float) sin(angle[1]); - amps_max[1] = (amps_avg + rnd_float(-25.0, 25.0)) * (float) cos(angle[0]); - amps_max[2] = (amps_avg + rnd_float(-25.0, 25.0)) * (float) cos(angle[1] - angle[0]); + amps_max[X] = (amps_avg + rnd_float(-25.0, 25.0)) * (float) sin(angle[Y]); + amps_max[Y] = (amps_avg + rnd_float(-25.0, 25.0)) * (float) cos(angle[X]); + amps_max[Z] = (amps_avg + rnd_float(-25.0, 25.0)) * (float) cos(angle[Y] - angle[X]); - batt = rnd_float(3.8, 4.3); + batt = rnd_float(3.8, 4.1); speed = rnd_float(1.0, 2.5); eclipse = (rnd_float(-1, +4) > 0) ? 1.0 : 0.0; + atmosphere = (rnd_float(-1, +1) > 0) ? 0.0 : 1.0; + +// eclipse = 1; period = rnd_float(150, 300); tempS = rnd_float(20, 55); temp_max = rnd_float(50, 70); temp_min = rnd_float(10, 20); - #ifdef DEBUG_LOGGING - for (int i = 0; i < 3; i++) +// #ifdef DEBUG_LOGGING + for (int i = X; i <= Z; i++) printf("axis: %f angle: %f v: %f i: %f \n", axis[i], angle[i], volts_max[i], amps_max[i]); - printf("batt: %f speed: %f eclipse_time: %f eclipse: %f period: %f temp: %f max: %f min: %f\n", batt, speed, eclipse_time, eclipse, period, tempS, temp_max, temp_min); - #endif + printf("batt: %f speed: %f eclipse_time: %f eclipse: %f period: %f temp: %f max: %f min: %f atmosphere: %f\n", + batt, speed, eclipse_time, eclipse, period, tempS, temp_max, temp_min, atmosphere); +// #endif time_start = (long int) millis(); eclipse_time = (long int)(millis() / 1000.0); if (eclipse == 0.0) eclipse_time -= period / 2; // if starting in eclipse, shorten interval + + tempP = rnd_float(80, 90); // simulated payload parameters + altSP = rnd_float(28000, 32000); + changeP = rnd_float(-10, 10); + presP = rnd_float(1014, 1016); + altGP = rnd_float(20,120); + humiP = rnd_float(40,60); + } // tx_freq_hz -= tx_channel * 50000; @@ -472,6 +520,7 @@ int main(int argc, char * argv[]) { bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod); // } else if (mode == BPSK) { } else { + bitRate = 1200; rsFrames = 3; payloads = 6; @@ -506,16 +555,61 @@ int main(int argc, char * argv[]) { // printf(" %d", sin_map[j]); } printf("\n"); + + } else if (mode == FC) { // for now copy BPSK settings + bitRate = 1200; +// rsFrames = 3; +// payloads = 6; +// rsFrameLen = 159; + headerLen = 768; // 8; + dataLen = 5200; // 78; + syncBits = 32; // 31; + syncWord = 0x1acffc1d; // 0b1000111110011010010000101011101; +// parityLen = 32; + amplitude = 32767; + samples = S_RATE / bitRate; + // bufLen = (frameCnt * (syncBits + 10 * (headerLen + rsFrames * (rsFrameLen + parityLen))) * samples); + bufLen = (headerLen + syncBits + dataLen)/8; + + // samplePeriod = ((float)((syncBits + 10 * (headerLen + rsFrames * (rsFrameLen + parityLen))))/(float)bitRate) * 1000 - 1800; + samplePeriod = 5000; + // samplePeriod = 3000; + // sleepTime = 3.0; + //samplePeriod = 2200; // reduce dut to python and sensor querying delays +// sleepTime = 2.2f; + +// frameTime = ((float)((float)bufLen / (samples * frameCnt * bitRate))) * 1000; // frame time in ms + frameTime = 5000; + + printf("\n FC Mode, bufLen: %d, %d bits per frame, %d bits per second, %d ms per frame %d ms sample period\n", + bufLen, bufLen / samples, bitRate, frameTime, samplePeriod); + + sin_samples = S_RATE/freq_Hz; + for (int j = 0; j < sin_samples; j++) { + sin_map[j] = (short int)(amplitude * sin((float)(2 * M_PI * j / sin_samples))); + + FILE * delete_image = popen("sudo rm /home/pi/CubeSatSim/image_file.bin", "r"); // delete any previous camera images + pclose(delete_image); + } + printf("\n"); } memset(voltage, 0, sizeof(voltage)); memset(current, 0, sizeof(current)); memset(sensor, 0, sizeof(sensor)); - memset(other, 0, sizeof(other)); + memset(other, 0, sizeof(other)); if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT)) // && !sim_mode) get_tlm_fox(); // fill transmit buffer with reset count 0 packets that will be ignored - firstTime = 1; +// get_tlm_fox(); + } + else if (mode == FC) // && !sim_mode) + get_tlm_fc(); // fill transmit buffer with reset count 0 packets that will be ignored + else if (mode == CW) + get_tlm(); // generate a frame of telemetry right away + + if (firstTime == 0) + firstTime = 1; // if (!sim_mode) // always read sensors, even in sim mode { @@ -529,7 +623,7 @@ int main(int argc, char * argv[]) { file1 = sopen(pythonConfigStr); // python sensor polling function fgets(cmdbuffer, 1000, file1); - fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); + fprintf(stderr, "pythonStr INA219 read result: %s\n", cmdbuffer); } for (int i = 0; i < 9; i++) { @@ -539,13 +633,13 @@ int main(int argc, char * argv[]) { current_max[i] = -1000.0; } for (int i = 0; i < SENSOR_FIELDS; i++) { - sensor_min[i] = 1000.0; - sensor_max[i] = -1000.0; + sensor_min[i] = 100000.0; + sensor_max[i] = -100000.0; // printf("Sensor min and max initialized!"); } for (int i = 0; i < 3; i++) { - other_min[i] = 1000.0; - other_max[i] = -1000.0; + other_min[i] = 100000.0; + other_max[i] = -100000.0; } loopTime = millis(); @@ -554,11 +648,13 @@ int main(int argc, char * argv[]) { fflush(stdout); fflush(stderr); // frames_sent++; +// if (!sim_mode) { + sensor_payload[0] = '\0'; + memset(sensor, 0, sizeof(sensor)); +// } - sensor_payload[0] = 0; memset(voltage, 0, sizeof(voltage)); memset(current, 0, sizeof(current)); - memset(sensor, 0, sizeof(sensor)); memset(other, 0, sizeof(other)); FILE * uptime_file = fopen("/proc/uptime", "r"); @@ -571,12 +667,40 @@ int main(int argc, char * argv[]) { // #endif fclose(uptime_file); + if (fail_rnd_mode) { + if ((millis() - failTime) > fail_time * 1000) { + failureMode = rnd_float(1.0, 10.0); + printf("Simulated Random Failure Change to %d\n", failureMode); + FILE * failure_mode_file = fopen("/home/pi/CubeSatSim/failure_mode.txt", "w"); + fprintf(failure_mode_file, "%d", failureMode); + fclose(failure_mode_file); + failTime = loopTime; + } else + printf("No random failure change. millis: %ld failTime: %ld fail_time: %d\n", millis(), failTime, fail_time); + } +// else +// { +// failureMode = OFF; + FILE * failure_mode_file = fopen("/home/pi/CubeSatSim/failure_mode.txt", "r"); + if (failure_mode_file != NULL) { + char failure_string[10]; + if ( (fgets(failure_string, 10, failure_mode_file)) != NULL) { + failureMode = atoi(failure_string); + fclose(failure_mode_file); + printf("Failure mode: %d\n", failureMode); + } + } else { + failureMode = FAIL_NONE; + printf("No simulated failure.\n"); + } +// } + { int count1; char * token; fputc('\n', file1); fgets(cmdbuffer, 1000, file1); -// fprintf(stderr, "Python read Result: %s\n", cmdbuffer); + fprintf(stderr, "Python INA219 read Result: %s\n", cmdbuffer); // serialPuts(uart_fd, cmdbuffer); // write INA data to Pico over serial @@ -600,32 +724,61 @@ int main(int argc, char * argv[]) { token = strtok(NULL, space); } } - if (voltage[map[BAT]] == 0.0) - batteryVoltage = 4.5; - else { - batteryVoltage = voltage[map[BAT]]; - if (sim_mode && !sim_config) { // if Voltage sensor on Battery board is present, exit simulated telemetry mode - sim_mode = FALSE; - fprintf(stderr, "Turning off sim_mode since battery sensor is present\n"); + if (voltage[map[BAT]] == 0.0) // No BAT Board + if (voltage[map[BAT2]] == 0.0) // No BAT2 Board + batteryVoltage = 4.5; + else { + batteryVoltage = voltage[map[BAT2]]; // only BAT2 Board present + if (sim_mode && !sim_config) { // if Voltage sensor on Battery board is present, exit simulated telemetry mode + sim_mode = FALSE; + fprintf(stderr, "Turning off Sim Mode since battery sensor 2 is present\n"); + FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag + pclose(sim_mode_auto); + } + } + else { + batteryVoltage = voltage[map[BAT]]; // BAT Board present + if (sim_mode && !sim_config) { // if Voltage sensor on Battery board is present, exit simulated telemetry mode + sim_mode = FALSE; + fprintf(stderr, "Turning off Sim Mode since battery sensor is present\n"); + FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag + pclose(sim_mode_auto); + } } - } - batteryCurrent = current[map[BAT]]; - + batteryCurrent = current[map[BAT]] + current[map[BAT2]]; // Sum BAT and BAT2 currents } + + if (gps_status == OFF) + { + payload = get_payload_serial(FALSE); // not debug + printf("get_payload_status: %d \n", payload); + } + else + { + payload = FALSE; + printf("get_payload_status not run since gps_status is ON\n"); + } + + if (payload == FALSE) { + payload = pi_sensors(buffer2); + printf("pi_sensors status: %d \n", payload); + } -// if (payload == ON) { // moved to here - if (!ax5043) { -// if ((payload == ON) && (mode != BPSK)) { // moved to here -// STEMBoardFailure = 0; - payload = get_payload_serial(FALSE); - printf("get_payload_status: %d \n", payload); // not debug + if (sim_mode && payload && !sim_config) { + sim_mode = FALSE; + printf("Turning off Sim Mode since payload is present and Sim Mode not manually configured.\n"); + FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag + pclose(sim_mode_auto); + } + fflush(stdout); // printf("String: %s\n", buffer2); fflush(stdout); - strcpy(sensor_payload, buffer2); -// printf(" Response from STEM Payload board: %s\n", sensor_payload); + strcpy(sensor_payload, buffer2); + + printf(" Response from STEM Payload: %s\n", sensor_payload); - telem_file = fopen("/home/pi/CubeSatSim/telem.txt", "a"); + telem_file = fopen("/home/pi/CubeSatSim/telem.txt", "a"); // printf("Writing payload string\n"); time_t timeStamp; time(&timeStamp); // get timestamp @@ -634,17 +787,30 @@ int main(int argc, char * argv[]) { char timeStampNoNl[31], bat_string[31]; snprintf(timeStampNoNl, 30, "%.24s", ctime(&timeStamp)); // printf("TimeStamp: %s\n", timeStampNoNl); - +/* if (c2cStatus == DISABLED) snprintf(bat_string, 30, "BAT %4.2f %5.1f", batteryVoltage, batteryCurrent); else snprintf(bat_string, 30, "BAT %4.2f %5.1f C", batteryVoltage, batteryCurrent); - + */ + snprintf(bat_string, 30, "BAT %.2f %.1f", batteryVoltage, batteryCurrent); + if (c2cStatus != DISABLED) + strcat(bat_string," C"); + if (sim_mode || (failureMode != FAIL_NONE)) + strcat(bat_string," S"); fprintf(telem_file, "%s %s %s\n", timeStampNoNl, bat_string, sensor_payload); // write telemetry string to telem.txt file fclose(telem_file); - + + if (failureMode == FAIL_PAYLOAD) { + sensor_payload[0] = '\0'; // This will cause the payload to not be processed. + printf("Simulated Payload Failure.\n"); + } + +//// if (!sim_mode) { + { if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) // only process if valid payload response { +// printf("Valid Payload!\n"); int count1; char * token; @@ -654,14 +820,66 @@ int main(int argc, char * argv[]) { for (count1 = 0; count1 < SENSOR_FIELDS; count1++) { if (token != NULL) { sensor[count1] = (float) atof(token); + strcpy(sensor_string[count1], token); // #ifdef DEBUG_LOGGING // printf("sensor: %f ", sensor[count1]); // print sensor data +// printf("Sensor String %d is %s\n",count1, sensor_string[count1]); // #endif token = strtok(NULL, space); } } - printf("\n"); + if (gps_status == TRUE) { + fprintf(stderr, "Checking Pi gps\n"); + cmdbuffer[0] = '\0'; + gps_read = sopen("python3 /home/pi/CubeSatSim/gps_client.py"); // python sensor polling function + + if (gps_read != NULL) { +// fputc('\n', gps_read); + fgets(cmdbuffer, 1000, gps_read); + +// const char gpsTestStr[] = "2 32.3 -54 333\n"; +// strcpy(cmdbuffer, gpsTestStr); + + fprintf(stderr, "gps read: %s\n", cmdbuffer); + if ((cmdbuffer[0] == '2') || (cmdbuffer[0] == '3')) + { + printf("Valid gps data!\n"); +// printf("%x %x \n", cmdbuffer[strlen(cmdbuffer) - 2], cmdbuffer[strlen(cmdbuffer) - 1] ); + if (cmdbuffer[strlen(cmdbuffer) - 1] == '\n') + cmdbuffer[strlen(cmdbuffer) - 1] = '\0'; +// printf("%x %x \n", cmdbuffer[strlen(cmdbuffer) - 2], cmdbuffer[strlen(cmdbuffer) - 1] ); + + int count1; + char * token; + + const char space[2] = " "; + token = strtok(cmdbuffer, space); + // printf("token: %s\n", token); + for (count1 = GPS; count1 < (GPS + 4); count1++) { + if (token != NULL) { + sensor[count1] = (float) atof(token); + strcpy(sensor_string[count1], token); + // #ifdef DEBUG_LOGGING +// printf("sensor: %f ", sensor[count1]); // print sensor data +// printf("Sensor String %d is %s\n",count1, sensor_string[count1]); + // #endif + token = strtok(NULL, space); + } + } +// printf("\n"); + strcpy(sensor_string[GPS], "GPS"); + + } else { + fprintf(stderr, "No Pi gps available\n"); + } + fclose(gps_read); + } else + fprintf(stderr, "Error checking gps"); + + } + + printf("\n"); // if (sensor[GPS1] != 0) { if ((sensor[GPS1] > -90.0) && (sensor[GPS1] < 90.0) && (sensor[GPS1] != 0.0)) { if (sensor[GPS1] != latitude) { @@ -678,10 +896,11 @@ int main(int argc, char * argv[]) { newGpsTime = millis(); } } - } - else - ; //payload = OFF; // turn off since STEM Payload is not responding - } + } + } +// else +// ; //payload = OFF; // turn off since STEM Payload is not responding + if ((millis() - newGpsTime) > 60000) { longitude += rnd_float(-0.05, 0.05) / 100.0; // was .05 latitude += rnd_float(-0.05, 0.05) / 100.0; @@ -689,8 +908,130 @@ int main(int argc, char * argv[]) { // printf("GPS Location with Rnd: APRS %07.2f, %08.2f \n", toAprsFormat(latitude), toAprsFormat(longitude)); newGpsTime = millis(); } - + +// if (sim_mode && (failureMode != FAIL_PAYLOAD) && !payload) { + if (sim_mode && (failureMode != FAIL_PAYLOAD)) { + char str_tmp[10]; + printf("Generating simulated payload telemetry\n"); + if (atmosphere == 0) { + sensor[PRES] = 0; + strcpy(sensor_string[PRES], "0.0"); + altSP += changeP; + sensor[ALT] = altSP; + sprintf(str_tmp, "%5.0f", altSP); + strcpy(sensor_string[ALT], str_tmp); + printf("Alt: %s\n", sensor_string[ALT]); + sensor[HUMI] = 0; + strcpy(sensor_string[HUMI], "0.0"); + sensor[TEMP] = tempP - 80 * (1 - eclipse) + rnd_float(-0.7, 0.7); + sprintf(str_tmp, "%4.1f", sensor[TEMP]); + strcpy(sensor_string[TEMP], str_tmp); + printf("Temp: %s\n", sensor_string[TEMP]); + } else { + sensor[PRES] = presP + rnd_float(-1, 1); + sprintf(str_tmp, "%6.1f", presP); + strcpy(sensor_string[PRES], str_tmp); + printf("Pres: %s\n", sensor_string[PRES]); + sensor[ALT] = altGP; + sprintf(str_tmp, "%5.0f", altGP); + strcpy(sensor_string[ALT], str_tmp); + sensor[HUMI] = humiP + rnd_float(-1, 1); + sprintf(str_tmp, "%4.1f", sensor[HUMI]); + strcpy(sensor_string[HUMI], str_tmp); + sensor[TEMP] = tempS + rnd_float(-0.7, 0.7); + sprintf(str_tmp, "%4.1f",sensor[TEMP]); + strcpy(sensor_string[TEMP], str_tmp); + printf("Temp: %s\n", sensor_string[TEMP]); + } + char sensor_number[20]; + sensor[ACCEL_X] = axis[X]; + sprintf(sensor_number, "%.2f", axis[X]); + strcpy(sensor_string[ACCEL_X], sensor_number); + sensor[ACCEL_Y] = axis[Y]; + sprintf(sensor_number, "%.2f", axis[Y]); + strcpy(sensor_string[ACCEL_Y], sensor_number); + sensor[ACCEL_Z] = axis[Z]; + sprintf(sensor_number, "%.2f", axis[Z]); + strcpy(sensor_string[ACCEL_Z], sensor_number); + + float spin; + spin = rnd_float(-30.0, 30.0); + sensor[GYRO_X] = axis[X] * spin; + sprintf(sensor_number, "%.2f", sensor[GYRO_X]); + strcpy(sensor_string[GYRO_X], sensor_number); + sensor[GYRO_Y] = axis[Y] * spin; + sprintf(sensor_number, "%.2f", sensor[GYRO_Y]); + strcpy(sensor_string[GYRO_Y], sensor_number); + sensor[GYRO_Z] = axis[Z] * spin; + sprintf(sensor_number, "%.2f", sensor[GYRO_Z]); + strcpy(sensor_string[GYRO_Z], sensor_number); + + // printf("sim sensor: %s\n", sensor_string[GYRO_Z]); + printf("sim sensor spin: %f value: %f length: %d string: %s\n", spin, sensor[GYRO_Z], strlen(sensor_string[GYRO_Z]), sensor_string[GYRO_Z]); + } + + if (failureMode == FAIL_BME) { + sensor[TEMP] = 0.0; + strcpy(sensor_string[TEMP], "0.0"); + sensor[PRES] = 0.0; + strcpy(sensor_string[PRES], "0.0"); + sensor[HUMI] = 0.0; + strcpy(sensor_string[HUMI], "0.0"); + sensor[ALT] = 0.0; + strcpy(sensor_string[ALT], "0.0"); + printf("Simulated BME Failure!\n"); + } + + if (failureMode == FAIL_MPU) { + sensor[ACCEL_X] = 0.0; + strcpy(sensor_string[ACCEL_X], "0.0"); + sensor[ACCEL_Y] = 0.0; + strcpy(sensor_string[ACCEL_Y], "0.0"); + sensor[ACCEL_Z] = 0.0; + strcpy(sensor_string[ACCEL_Z], "0.0"); + sensor[GYRO_X] = 0.0; + strcpy(sensor_string[GYRO_X], "0.0"); + sensor[GYRO_Y] = 0.0; + strcpy(sensor_string[GYRO_Y], "0.0"); + sensor[GYRO_Z] = 0.0; + strcpy(sensor_string[GYRO_Z], "0.0"); + printf("Simulated MPU Failure!\n"); + } + +// if ((failureMode == FAIL_BME) || (failureMode == FAIL_MPU) || (sim_mode && (failureMode != FAIL_PAYLOAD))) // recreaate sensor_payload string + if (failureMode != FAIL_PAYLOAD) + { + sensor_payload[0] = '\0'; + strcpy(sensor_string[0], "OK"); + strcpy(sensor_string[1], "BME280"); + strcpy(sensor_string[6], "MPU6050"); + + for (count1 = 0; count1 < SENSOR_FIELDS; count1++) { + strcat(sensor_payload, sensor_string[count1]); + strcat(sensor_payload, " "); + } + printf("Updated Sensor String: %s\n", sensor_payload); + } +// else if (failureMode != FAIL_PAYLOAD) { +// printf("Restoring sensor_payload\n"); +// strcpy(sensor_payload, buffer2); // restore sensor_payload after strtok operation +// } + + char sensor_buffer[30]; + int sensor_count; + sensor_buffer[0] = 0; + sensor_count = sensor_loop(sensor_buffer); + if (sensor_count > NEW_SENSOR_FIELDS_MAX) + sensor_count = NEW_SENSOR_FIELDS_MAX; + if ((sensor_count > 0) && (failureMode != FAIL_PAYLOAD)) { + char space[] = " "; + strcat(sensor_payload, space); + strcat(sensor_payload, sensor_buffer); + printf(" Payload after new sensor read: %s\n", sensor_payload); + } + if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) { +// printf("Valid Payload!!\n"); for (int count1 = 0; count1 < SENSOR_FIELDS; count1++) { if (sensor[count1] < sensor_min[count1]) sensor_min[count1] = sensor[count1]; @@ -719,7 +1060,7 @@ int main(int argc, char * argv[]) { double Yv = eclipse * volts_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); double Zv = 2.0 * eclipse * volts_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); - // printf("Yi: %f Zi: %f %f %f Zv: %f \n", Yi, Zi, amps_max[2], angle[2], Zv); + printf("Yi: %f Zi: %f %f %f Zv: %f \n", Yi, Zi, amps_max[2], angle[2], Zv); current[map[PLUS_X]] = (Xi >= 0) ? Xi : 0; current[map[MINUS_X]] = (Xi >= 0) ? 0 : ((-1.0f) * Xi); @@ -728,15 +1069,6 @@ int main(int argc, char * argv[]) { current[map[PLUS_Z]] = (Zi >= 0) ? Zi : 0; current[map[MINUS_Z]] = (Zi >= 0) ? 0 : ((-1.0f) * Zi); - voltage[map[PLUS_X]] = (Xv >= 1) ? Xv : rnd_float(0.9, 1.1); - voltage[map[MINUS_X]] = (Xv <= -1) ? ((-1.0f) * Xv) : rnd_float(0.9, 1.1); - voltage[map[PLUS_Y]] = (Yv >= 1) ? Yv : rnd_float(0.9, 1.1); - voltage[map[MINUS_Y]] = (Yv <= -1) ? ((-1.0f) * Yv) : rnd_float(0.9, 1.1); - voltage[map[PLUS_Z]] = (Zv >= 1) ? Zv : rnd_float(0.9, 1.1); - voltage[map[MINUS_Z]] = (Zv <= -1) ? ((-1.0f) * Zv) : rnd_float(0.9, 1.1); - - // printf("temp: %f Time: %f Eclipse: %d : %f %f | %f %f | %f %f\n",tempS, time, eclipse, voltage[map[PLUS_X]], voltage[map[MINUS_X]], voltage[map[PLUS_Y]], voltage[map[MINUS_Y]], current[map[PLUS_Z]], current[map[MINUS_Z]]); - tempS += (eclipse > 0) ? ((temp_max - tempS) / 50.0f) : ((temp_min - tempS) / 50.0f); tempS += +rnd_float(-1.0, 1.0); // IHUcpuTemp = (int)((tempS + rnd_float(-1.0, 1.0)) * 10 + 0.5); @@ -745,31 +1077,47 @@ int main(int argc, char * argv[]) { voltage[map[BAT2]] = 0.0; // rnd_float(5.0, 5.005); current[map[BAT2]] = 0.0; // rnd_float(158, 171); - // float charging = current[map[PLUS_X]] + current[map[MINUS_X]] + current[map[PLUS_Y]] + current[map[MINUS_Y]] + current[map[PLUS_Z]] + current[map[MINUS_Z]]; - float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0)); + float charging = current[map[PLUS_X]] + current[map[MINUS_X]] + current[map[PLUS_Y]] + current[map[MINUS_Y]] + current[map[PLUS_Z]] + current[map[MINUS_Z]]; +// float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0)); // current[map[BAT]] = ((current[map[BAT2]] * voltage[map[BAT2]]) / batt) - charging; current[map[BAT]] = rnd_float(320, 510) - charging; printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BAT2]], batt, voltage[map[BAT2]]); - batt -= (batt > 3.5) ? current[map[BAT]] / 30000 : current[map[BAT]] / 3000; - if (batt < 3.0) { - batt = 3.0; + batt -= (batt > 3.5) ? current[map[BAT]] / 300000 : current[map[BAT]] / 30000; + if (batt < 3.6) { + batt = 3.6; SafeMode = 1; printf("Safe Mode!\n"); } else SafeMode= 0; - if (batt > 4.5) - batt = 4.5; + if (batt > 4.1) + batt = 4.1; voltage[map[BAT]] = batt + rnd_float(-0.01, 0.01); + + float Vm, Vp; + Vm = batt + 0.5; + Vp = (Xv > 0) ? Xv : rnd_float(0.0, 0.1); + voltage[map[PLUS_X]] = (Vp >= Vm) ? (Vm + rnd_float(-0.1, 0.1)) : Vp; + Vp = (Xv < 0) ? ((-1.0f) * Xv) : rnd_float(0.0, 0.1); + voltage[map[MINUS_X]] = (Vp >= Vm) ? (Vm + rnd_float(-0.1, 0.1)) : Vp; + Vp = (Yv > 0) ? Yv : rnd_float(0.0, 0.1); + voltage[map[PLUS_Y]] = (Vp >= Vm) ? (Vm + rnd_float(-0.1, 0.1)) : Vp; + Vp = (Yv < 0) ? ((-1.0f) * Yv) : rnd_float(0.0, 0.1); + voltage[map[MINUS_Y]] = (Vp >= Vm) ? (Vm + rnd_float(-0.1, 0.1)) : Vp; + Vp = (Zv > 0) ? Zv : rnd_float(0.0, 0.1); + voltage[map[PLUS_Z]] = (Vp >= Vm) ? (Vm + rnd_float(-0.1, 0.1)) : Vp; + Vp = (Zv < 0) ? ((-1.0f) * Zv) : rnd_float(0.0, 0.1); + voltage[map[MINUS_Z]] = (Vp >= Vm) ? (Vm + rnd_float(-0.1, 0.1)) : Vp; + + printf("temp: %f Time: %f Eclipse: %d : %f %f | %f %f | %f %f\n",tempS, time, eclipse, voltage[map[PLUS_X]], voltage[map[MINUS_X]], voltage[map[PLUS_Y]], voltage[map[MINUS_Y]], current[map[PLUS_Z]], current[map[MINUS_Z]]); // end of simulated telemetry - } - else { - } + } + FILE * cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r"); if (cpuTempSensor) { // double cpuTemp; @@ -787,9 +1135,9 @@ int main(int argc, char * argv[]) { fclose(cpuTempSensor); } - #ifdef DEBUG_LOGGING -// fprintf(stderr, "INFO: Battery voltage: %5.2f V Threshold %5.2f V Current: %6.1f mA Threshold: %6.1f mA\n", batteryVoltage, voltageThreshold, batteryCurrent, currentThreshold); - #endif +// #ifdef DEBUG_LOGGING + fprintf(stderr, "INFO: Battery voltage: %5.2f V Threshold %5.2f V Current: %6.1f mA Threshold: %6.1f mA\n", batteryVoltage, voltageThreshold, batteryCurrent, currentThreshold); +// #endif if ((batteryCurrent > currentThreshold) && (batteryVoltage < (voltageThreshold + 0.15)) && !sim_mode && !hab_mode) { @@ -834,22 +1182,7 @@ int main(int argc, char * argv[]) { sleep(10); } //#endif - - FILE * fp = fopen("/home/pi/CubeSatSim/telem_string.txt", "w"); - if (fp != NULL) { -// printf("Writing telem_string.txt\n"); - if (batteryVoltage != 4.5) - if (c2cStatus == DISABLED) - fprintf(fp, "BAT %4.2fV %4.0fmA\n", batteryVoltage, batteryCurrent); - else - fprintf(fp, "BAT %4.2fV %4.0fmA C\n", batteryVoltage, batteryCurrent); // show command and control is on - else - fprintf(fp, "\n"); // don't show voltage and current if it isn't a sensor value - - fclose(fp); - } else - printf("Error writing to telem_string.txt\n"); - + /**/ // sleep(1); // Delay 1 second ctr = 0; @@ -878,6 +1211,75 @@ int main(int argc, char * argv[]) { } } // printf("c2cStatus: %d \n", c2cStatus); + + if (failureMode == FAIL_NONE) + printf("No Simulated Failure!\n"); + if (failureMode == FAIL_UNPLUG) { + voltage[map[PLUS_Y]] = rnd_float(0.8, 0.95); + current[map[PLUS_Y]] = 0.0; + printf("+Y Solar Unplugged Failure\n"); + } + if (failureMode == FAIL_SOLAR) { + voltage[map[PLUS_X]] = 0.0; + current[map[PLUS_X]] = 0.0; + printf("+X Solar Simulated Failure\n"); + } + if (failureMode == FAIL_DEGRADE) { + voltage[map[MINUS_X]] = voltage[map[MINUS_X]] * 0.5; + current[map[MINUS_X]] = current[map[MINUS_X]] * 0.5; + printf("-X Solar Deg Simulated Failure\n"); + } + if (failureMode == FAIL_SHORT) { + voltage[map[MINUS_Y]] = 0.0; + printf("-Y Solar SC Simulated Failure!\n"); + } + if (failureMode == FAIL_I2C1) { + voltage[map[PLUS_X]] = 0.0; + current[map[PLUS_X]] = 0.0; + voltage[map[PLUS_Y]] = 0.0; + current[map[PLUS_Y]] = 0.0; + voltage[map[BAT]] = 0.0; + current[map[BAT]] = 0.0; + voltage[map[BAT2]] = 0.0; + current[map[BAT2]] = 0.0; + printf("I2C Bus 1 Simulated Failure!\n"); + } + if (failureMode == FAIL_I2C3) { + voltage[map[MINUS_X]] = 0.0; + current[map[MINUS_X]] = 0.0; + voltage[map[MINUS_Y]] = 0.0; + current[map[MINUS_Y]] = 0.0; + voltage[map[MINUS_Z]] = 0.0; + current[map[MINUS_Z]] = 0.0; + voltage[map[PLUS_Z]] = 0.0; + current[map[PLUS_Z]] = 0.0; + printf("I2C Bus 3 Simulated Failure!\n"); + } + + FILE * fp = fopen("/home/pi/CubeSatSim/telem_string.txt", "w"); + if (fp != NULL) { +// printf("Writing telem_string.txt v: %f v2: %f batteryVoltage: %f\n", voltage[map[BAT]], voltage[map[BAT2]], batteryVoltage); + if (sim_mode || (failureMode != FAIL_NONE)) { + if (voltage[map[BAT2]] == 0) + fprintf(fp, "BAT %.2f %.1f ", voltage[map[BAT]], current[map[BAT]]); + else + fprintf(fp, "BAT %.2f %.1f ", voltage[map[BAT2]], current[map[BAT]] + current[map[BAT2]]); + } + else { + fprintf(fp, "BAT %.2fV %.0fmA", batteryVoltage, batteryCurrent); + } + +// fprintf(fp, "BAT %.2fV %.0fmA", batteryVoltage, batteryCurrent); + + if (c2cStatus != DISABLED) + fprintf(fp," C"); + if (sim_mode || (failureMode != FAIL_NONE)) + fprintf(fp," S\n"); + else + fprintf(fp,"\n"); + fclose(fp); + } else + printf("Error writing to telem_string.txt\n"); if ((mode == AFSK) || (mode == CW)) { get_tlm(); @@ -890,7 +1292,9 @@ int main(int argc, char * argv[]) { } else if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT)) {// FSK or BPSK get_tlm_fox(); - } else { // SSTV or PACSATGND + } else if ((mode == FC)) { + get_tlm_fc(); + } else { // SSTV or PACSATGND // fprintf(stderr, "Sleeping\n"); sleep(30); } @@ -900,7 +1304,7 @@ int main(int argc, char * argv[]) { #endif } - if (mode == BPSK) { + if ((mode == BPSK) || (mode == FC)) { // digitalWrite(txLed, txLedOn); #ifdef DEBUG_LOGGING // printf("Tx LED On 1\n"); @@ -946,20 +1350,6 @@ int upper_digit(int number) { return digit; } -static int init_rf() { - int ret; - fprintf(stderr, "Initializing AX5043\n"); - - ret = ax5043_init( & hax5043, XTAL_FREQ_HZ, VCO_INTERNAL); - if (ret != PQWS_SUCCESS) { - fprintf(stderr, - "ERROR: Failed to initialize AX5043 with error code %d\n", ret); - // exit(EXIT_FAILURE); - return (0); - } - return (1); -} - void get_tlm(void) { FILE * txResult; @@ -1016,22 +1406,22 @@ void get_tlm(void) { char header_lat[10]; char header_long[10]; char header_str4[] = "hi hi de "; + char header_c2c[] = " C"; // char footer_str1[] = "\' > t.txt && echo \'"; char footer_str1[] = "\' > t.txt"; // char footer_str[] = "-11>APCSS:010101/hi hi ' >> t.txt && touch /home/pi/CubeSatSim/ready"; // transmit is done by transmit.py char footer_str[] = " && echo 'AMSAT-11>APCSS:010101/hi hi ' >> t.txt && touch /home/pi/CubeSatSim/ready"; // transmit is done by transmit.py char footer_str2[] = " && touch /home/pi/CubeSatSim/ready"; + char zero[] = "0.0"; - if (ax5043) { - strcpy(str, header_str); - } else { + strcpy(str, header_str3); // } if (mode == AFSK) { strcat(str, call); strcat(str, header_str2); } - } + // printf("Str: %s \n", str); if (mode != CW) { // sprintf(header_str2b, "=%7.2f%c%c%c%08.2f%cShi hi ",4003.79,'N',0x5c,0x5c,07534.33,'W'); // add APRS lat and long @@ -1044,9 +1434,6 @@ void get_tlm(void) { else sprintf(header_long, "%08.2f%c",toAprsFormat( longitude) * (-1.0), 'W'); // long - if (ax5043) - sprintf(header_str2b, "=%s%c%sShi hi ", header_lat, 0x5c, header_long); // add APRS lat and long - else //#ifdef HAB if (hab_mode) sprintf(header_str2b, "=%s%c%sOhi hi ", header_lat, 0x2f, header_long); // add APRS lat and long with Balloon HAB icon @@ -1059,7 +1446,13 @@ void get_tlm(void) { strcat(str, header_str2b); } else { // CW mode strcat(str, header_str4); - strcat(str, call); + strcat(str, call); + if (c2cStatus != DISABLED) { + strcat(str, " C"); + } + if (sim_mode || failureMode != FAIL_NONE) { + strcat(str, " S"); + } sprintf(tlm_str, "%s' > cw0.txt", &str); printf("CW string to execute: %s\n", &tlm_str); @@ -1086,21 +1479,35 @@ void get_tlm(void) { pclose(cw_file); } - if (c2cStatus != DISABLED) { - FILE *file_append = sopen("echo 'C' >> cw6.txt"); - fclose(file_append); - } +// if (c2cStatus != DISABLED) { +// FILE *file_append = sopen("echo 'C' >> cw6.txt"); +// fclose(file_append); +// } } else { // APRS - if (c2cStatus == 0) - sprintf(tlm_str, "BAT %4.2f %5.1f ", voltage[map[BAT]] , current[map[BAT]] ); - else - sprintf(tlm_str, "BAT %4.2f %5.1f C ", voltage[map[BAT]] , current[map[BAT]] ); - - strcat(str, tlm_str); + if (sim_mode || (failureMode != FAIL_NONE)) { + if (voltage[map[BAT2]] == 0) + snprintf(tlm_str, 30, "BAT %.2f %.1f ", voltage[map[BAT]], current[map[BAT]]); + else + snprintf(tlm_str, 30, "BAT %.2f %.1f ", voltage[map[BAT2]], current[map[BAT]] + current[map[BAT2]]); + + if (c2cStatus != DISABLED) + strcat(tlm_str,"C "); + + strcat(tlm_str,"S "); + } + else { + snprintf(tlm_str, 30, "BAT %.2f %.1f ", batteryVoltage, batteryCurrent); + + if (c2cStatus != DISABLED) + strcat(tlm_str,"C "); + } +// printf("tlm_str: %s\n", tlm_str); + strcat(str, tlm_str); } - strcpy(sensor_payload, buffer2); - printf(" Response from STEM Payload board:: %s\n", sensor_payload); + +// strcpy(sensor_payload, buffer2); + printf(" sensor_payload: %s\n", sensor_payload); // printf(" Str so far: %s\n", str); if (mode != CW) @@ -1124,30 +1531,7 @@ void get_tlm(void) { sleep(5); } } - else if (ax5043) { - digitalWrite(txLed, txLedOn); - fprintf(stderr, "INFO: Transmitting X.25 packet using AX5043\n"); - memcpy(data, str, strnlen(str, 256)); - printf("data: %s \n", data); - int ret = ax25_tx_frame( & hax25, & hax5043, data, strnlen(str, 256)); - if (ret) { - fprintf(stderr, - "ERROR: Failed to transmit AX.25 frame with error code %d\n", - ret); - exit(EXIT_FAILURE); - } - ax5043_wait_for_transmit(); - digitalWrite(txLed, txLedOff); - - if (ret) { - fprintf(stderr, - "ERROR: Failed to transmit entire AX.25 frame with error code %d\n", - ret); - exit(EXIT_FAILURE); - } - sleep(4); // was 2 - - } else { // APRS using transmit + else { // APRS using transmit strcat(str, footer_str1); // strcat(str, call); @@ -1156,7 +1540,7 @@ void get_tlm(void) { else strcat(str, footer_str2); - fprintf(stderr, "String to execute: %s\n", str); + fprintf(stderr, "APRS String to execute: %s\n", str); printf("\n\nTelemetry string is %s \n\n", str); @@ -1183,23 +1567,24 @@ void get_tlm(void) { // generates telemetry which is decoded by AMSAT's FoxTelem: https://www.amsat.org/foxtelem-software-for-windows-mac-linux/ // for more info about how we use FoxTelem see https://www.g0kla.com/foxtelem/amsat_telemetry_designers_handbook.pdf -void get_tlm_fox() { +void get_tlm_fox() { int i; long int sync = syncWord; + int cam = ON; - smaller = (int) (S_RATE / (2 * freq_Hz)); + smaller = (int)(S_RATE / (2 * freq_Hz)); // if (mode == PACSAT) // dataLen = 78; short int b[dataLen]; short int b_max[dataLen]; short int b_min[dataLen]; - + memset(b, 0, sizeof(b)); memset(b_max, 0, sizeof(b_max)); memset(b_min, 0, sizeof(b_min)); - + short int h[headerLen]; memset(h, 0, sizeof(h)); @@ -1216,124 +1601,128 @@ void get_tlm_fox() { int posXi = 0, negXi = 0, posYi = 0, negYi = 0, posZi = 0, negZi = 0; int head_offset = 0; + STEMBoardFailure = 1; + short int buffer_test[bufLen]; int buffSize; - buffSize = (int) sizeof(buffer_test); + buffSize = (int)sizeof(buffer_test); + + if (failureMode == FAIL_PAYLOAD) { + payload = OFF; + printf("Payload Simulated Failure!\n"); + } + if (failureMode == FAIL_CAMERA) { + cam = OFF; + printf("Camera Simulated Failure!\n"); + } + else { + cam = camera; + } + if (mode == FSK) id = 7; else - id = 0; // 99 in h[6] - - // for (int frames = 0; frames < FRAME_CNT; frames++) + id = 0; // 99 in h[6] + + // for (int frames = 0; frames < FRAME_CNT; frames++) for (int frames = 0; frames < frameCnt; frames++) { - - if (firstTime != ON) { + // if (firstTime != ON) { + if (TRUE) { // delay for sample period -/**/ -// while ((millis() - sampleTime) < (unsigned int)samplePeriod) - int startSleep = millis(); - if ((millis() - sampleTime) < ((unsigned int)frameTime - 750 + pi_zero_2_offset)) // was 250 100 500 for FSK -// sleep(2.0); // 0.5); // 25); // initial period - sleep(1.0); // 0.5); // 25); // initial period - while ((millis() - sampleTime) < ((unsigned int)frameTime - 750 + pi_zero_2_offset)) // was 250 100 - sleep(0.1); // 25); // 0.5); // 25); -// sleep((unsigned int)sleepTime); -/**/ + /**/ + // while ((millis() - sampleTime) < (unsigned int)samplePeriod) + int startSleep = millis(); + if ((millis() - sampleTime) < ((unsigned int)frameTime - 750 + pi_zero_2_offset)) // was 250 100 500 for FSK + // sleep(2.0); // 0.5); // 25); // initial period + sleep(1.0); // 0.5); // 25); // initial period + while ((millis() - sampleTime) < ((unsigned int)frameTime - 750 + pi_zero_2_offset)) // was 250 100 + sleep(0.1); // 25); // 0.5); // 25); + // sleep((unsigned int)sleepTime); + /**/ printf("Start sleep %d Sleep period: %d while period: %d\n", startSleep, millis() - startSleep, (unsigned int)frameTime - 750 + pi_zero_2_offset); fflush(stdout); - - sampleTime = (unsigned int) millis(); + + sampleTime = (unsigned int)millis(); } else { printf("first time - no sleep\n"); firstTime = OFF; } - printf("++++ Loop time: %5.3f sec +++++\n", (millis() - loopTime)/1000.0); + printf("++++ Loop time: %5.3f sec +++++\n", (millis() - loopTime) / 1000.0); fflush(stdout); - loopTime = millis(); - -// if (mode == FSK) + loopTime = millis(); + + // if (mode == FSK) { // just moved for (int count1 = 0; count1 < 8; count1++) { - if (voltage[count1] < voltage_min[count1]) - voltage_min[count1] = voltage[count1]; - if (current[count1] < current_min[count1]) - current_min[count1] = current[count1]; - - if (voltage[count1] > voltage_max[count1]) - voltage_max[count1] = voltage[count1]; - if (current[count1] > current_max[count1]) - current_max[count1] = current[count1]; + if (voltage[count1] < voltage_min[count1]) voltage_min[count1] = voltage[count1]; + if (current[count1] < current_min[count1]) current_min[count1] = current[count1]; -// printf("Vmin %4.2f Vmax %4.2f Imin %4.2f Imax %4.2f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); + if (voltage[count1] > voltage_max[count1]) voltage_max[count1] = voltage[count1]; + if (current[count1] > current_max[count1]) current_max[count1] = current[count1]; + + // printf("Vmin %4.2f Vmax %4.2f Imin %4.2f Imax %4.2f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); } - for (int count1 = 0; count1 < 3; count1++) { - if (other[count1] < other_min[count1]) - other_min[count1] = other[count1]; - if (other[count1] > other_max[count1]) - other_max[count1] = other[count1]; + for (int count1 = 0; count1 < 3; count1++) { + if (other[count1] < other_min[count1]) other_min[count1] = other[count1]; + if (other[count1] > other_max[count1]) other_max[count1] = other[count1]; // printf("Other min %f max %f \n", other_min[count1], other_max[count1]); } - if (mode == FSK) - { - if (loop % 32 == 0) { // was 8 -// printf("Sending MIN frame \n"); - frm_type = 0x03; - for (int count1 = 0; count1 < SENSOR_FIELDS; count1++) { - if (count1 < 3) - other[count1] = other_min[count1]; - if (count1 < 8) { - voltage[count1] = voltage_min[count1]; - current[count1] = current_min[count1]; - } - if (sensor_min[count1] != 1000.0) // make sure values are valid - sensor[count1] = sensor_min[count1]; - } - } - if ((loop + 16) % 32 == 0) { // was 8 -// printf("Sending MAX frame \n"); - frm_type = 0x02; - for (int count1 = 0; count1 < SENSOR_FIELDS; count1++) { - if (count1 < 3) - other[count1] = other_max[count1]; - if (count1 < 8) { - voltage[count1] = voltage_max[count1]; - current[count1] = current_max[count1]; - } - if (sensor_max[count1] != -1000.0) // make sure values are valid - sensor[count1] = sensor_max[count1]; - } - } - } - else - frm_type = 0x02; // BPSK always send MAX MIN frame - } + if (mode == FSK) { + if (loop % 32 == 0) { // was 8 + // printf("Sending MIN frame \n"); + frm_type = 0x03; + for (int count1 = 0; count1 < SENSOR_FIELDS; count1++) { + if (count1 < 3) other[count1] = other_min[count1]; + if (count1 < 8) { + voltage[count1] = voltage_min[count1]; + current[count1] = current_min[count1]; + } + if (sensor_min[count1] != 100000.0) // make sure values are valid + sensor[count1] = sensor_min[count1]; + } + } + if ((loop + 16) % 32 == 0) { // was 8 + // printf("Sending MAX frame \n"); + frm_type = 0x02; + for (int count1 = 0; count1 < SENSOR_FIELDS; count1++) { + if (count1 < 3) other[count1] = other_max[count1]; + if (count1 < 8) { + voltage[count1] = voltage_max[count1]; + current[count1] = current_max[count1]; + } + if (sensor_max[count1] != -100000.0) // make sure values are valid + sensor[count1] = sensor_max[count1]; + } + } + } else + frm_type = 0x02; // BPSK always send MAX MIN frame + } sensor_payload[0] = 0; // clear for next payload - -// if (mode == FSK) { // remove this -// } + + // if (mode == FSK) { // remove this + // } memset(rs_frame, 0, sizeof(rs_frame)); memset(parities, 0, sizeof(parities)); - h[0] = (short int) ((h[0] & 0xf8) | (id & 0x07)); // 3 bits - if (uptime != 0) // if uptime is 0, leave reset count at 0 + h[0] = (short int)((h[0] & 0xf8) | (id & 0x07)); // 3 bits + if (uptime != 0) // if uptime is 0, leave reset count at 0 { - h[0] = (short int) ((h[0] & 0x07) | ((reset_count & 0x1f) << 3)); - h[1] = (short int) ((reset_count >> 5) & 0xff); - h[2] = (short int) ((h[2] & 0xf8) | ((reset_count >> 13) & 0x07)); + h[0] = (short int)((h[0] & 0x07) | ((reset_count & 0x1f) << 3)); + h[1] = (short int)((reset_count >> 5) & 0xff); + h[2] = (short int)((h[2] & 0xf8) | ((reset_count >> 13) & 0x07)); } - h[2] = (short int) ((h[2] & 0x0e) | ((uptime & 0x1f) << 3)); - h[3] = (short int) ((uptime >> 5) & 0xff); - h[4] = (short int) ((uptime >> 13) & 0xff); - h[5] = (short int) ((h[5] & 0xf0) | ((uptime >> 21) & 0x0f)); - h[5] = (short int) ((h[5] & 0x0f) | (frm_type << 4)); + h[2] = (short int)((h[2] & 0x0e) | ((uptime & 0x1f) << 3)); + h[3] = (short int)((uptime >> 5) & 0xff); + h[4] = (short int)((uptime >> 13) & 0xff); + h[5] = (short int)((h[5] & 0xf0) | ((uptime >> 21) & 0x0f)); + h[5] = (short int)((h[5] & 0x0f) | (frm_type << 4)); - if (mode == BPSK) - h[6] = 99; + if (mode == BPSK) h[6] = 99; posXi = (int)(current[map[PLUS_X]] + 0.5) + 2048; posYi = (int)(current[map[PLUS_Y]] + 0.5) + 2048; @@ -1354,22 +1743,23 @@ void get_tlm_fox() { BAT2Voltage = (int)(voltage[map[BAT2]] * 100); BAT2Current = (int)(current[map[BAT2]] + 0.5) + 2048; - if (payload == ON) - STEMBoardFailure = 0; +// if (payload == ON) STEMBoardFailure = 0; + if ((payload == ON) || (sim_mode && (failureMode != FAIL_PAYLOAD))) + STEMBoardFailure = 0; // read payload sensor if available -// encodeA(b, 0 + head_offset, batt_a_v); // replaced by XS2 and XS3 below -// encodeB(b, 1 + head_offset, batt_b_v); + // encodeA(b, 0 + head_offset, batt_a_v); // replaced by XS2 and XS3 below + // encodeB(b, 1 + head_offset, batt_b_v); encodeA(b, 3 + head_offset, batt_c_v); - encodeB(b, 4 + head_offset, (int)(sensor[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel - encodeA(b, 6 + head_offset, (int)(sensor[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel - encodeB(b, 7 + head_offset, (int)(sensor[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel + encodeB(b, 4 + head_offset, (int)(sensor[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel + encodeA(b, 6 + head_offset, (int)(sensor[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel + encodeB(b, 7 + head_offset, (int)(sensor[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel encodeA(b, 9 + head_offset, battCurr); - encodeB(b, 10 + head_offset, (int)(sensor[TEMP] * 10 + 0.5)); // Temp + encodeB(b, 10 + head_offset, (int)(sensor[TEMP] * 10 + 0.5)); // Temp if (mode == FSK) { encodeA(b, 12 + head_offset, posXv); @@ -1385,7 +1775,7 @@ void get_tlm_fox() { encodeB(b, 25 + head_offset, negYi); encodeA(b, 27 + head_offset, posZi); encodeB(b, 28 + head_offset, negZi); - } else // BPSK + } else // BPSK { encodeA(b, 12 + head_offset, posXv); encodeB(b, 13 + head_offset, posYv); @@ -1400,7 +1790,7 @@ void get_tlm_fox() { encodeB(b, 25 + head_offset, negXi); encodeA(b, 27 + head_offset, negYi); encodeB(b, 28 + head_offset, negZi); - + encodeA(b_max, 12 + head_offset, (int)(voltage_max[map[PLUS_X]] * 100)); encodeB(b_max, 13 + head_offset, (int)(voltage_max[map[PLUS_Y]] * 100)); encodeA(b_max, 15 + head_offset, (int)(voltage_max[map[PLUS_Z]] * 100)); @@ -1413,159 +1803,228 @@ void get_tlm_fox() { encodeA(b_max, 24 + head_offset, (int)(current_max[map[PLUS_Z]] + 0.5) + 2048); encodeB(b_max, 25 + head_offset, (int)(current_max[map[MINUS_X]] + 0.5) + 2048); encodeA(b_max, 27 + head_offset, (int)(current_max[map[MINUS_Y]] + 0.5) + 2048); - encodeB(b_max, 28 + head_offset, (int)(current_max[map[MINUS_Z]] + 0.5) + 2048); + encodeB(b_max, 28 + head_offset, (int)(current_max[map[MINUS_Z]] + 0.5) + 2048); encodeA(b_max, 9 + head_offset, (int)(current_max[map[BAT]] + 0.5) + 2048); encodeA(b_max, 3 + head_offset, (int)(voltage_max[map[BAT]] * 100)); encodeA(b_max, 30 + head_offset, (int)(voltage_max[map[BAT2]] * 100)); encodeB(b_max, 46 + head_offset, (int)(current_max[map[BAT2]] + 0.5) + 2048); - - encodeB(b_max, 37 + head_offset, (int)(other_max[RSSI] + 0.5) + 2048); + + encodeB(b_max, 37 + head_offset, (int)(other_max[RSSI] + 0.5) + 2048); encodeA(b_max, 39 + head_offset, (int)(other_max[IHU_TEMP] * 10 + 0.5)); encodeB(b_max, 31 + head_offset, ((int)(other_max[SPIN] * 10)) + 2048); - if (sensor_min[TEMP] != 1000.0) // make sure values are valid - { - encodeB(b_max, 4 + head_offset, (int)(sensor_max[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel - encodeA(b_max, 6 + head_offset, (int)(sensor_max[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel - encodeB(b_max, 7 + head_offset, (int)(sensor_max[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel - - encodeA(b_max, 33 + head_offset, (int)(sensor_max[PRES] + 0.5)); // Pressure - encodeB(b_max, 34 + head_offset, (int)(sensor_max[ALT] * 10.0 + 0.5)); // Altitude - encodeB(b_max, 40 + head_offset, (int)(sensor_max[GYRO_X] + 0.5) + 2048); - encodeA(b_max, 42 + head_offset, (int)(sensor_max[GYRO_Y] + 0.5) + 2048); - encodeB(b_max, 43 + head_offset, (int)(sensor_max[GYRO_Z] + 0.5) + 2048); - - encodeA(b_max, 48 + head_offset, (int)(sensor_max[DTEMP] * 10 + 0.5) + 2048); -// encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS1] * 10 + 0.5) + 2048); - encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); - encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] * 10 + 0.5)); - - encodeB(b_max, 49 + head_offset, (int)(sensor[XS1])); - encodeA(b_max, 0 + head_offset, (int)(sensor[XS2])); - encodeB(b_max, 1 + head_offset, (int)(sensor[XS3])); - } - else - { - encodeB(b_max, 4 + head_offset, 2048); // 0 - encodeA(b_max, 6 + head_offset, 2048); // 0 - encodeB(b_max, 7 + head_offset, 2048); // 0 - - encodeB(b_max, 40 + head_offset, 2048); - encodeA(b_max, 42 + head_offset, 2048); - encodeB(b_max, 43 + head_offset, 2048); - - encodeA(b_max, 48 + head_offset, 2048); -// encodeB(b_max, 49 + head_offset, 2048); - } - encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); - encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); - encodeA(b_min, 15 + head_offset, (int)(voltage_min[map[PLUS_Z]] * 100)); - encodeB(b_min, 16 + head_offset, (int)(voltage_min[map[MINUS_X]] * 100)); - encodeA(b_min, 18 + head_offset, (int)(voltage_min[map[MINUS_Y]] * 100)); - encodeB(b_min, 19 + head_offset, (int)(voltage_min[map[MINUS_Z]] * 100)); + if (sensor_min[TEMP] != 100000.0) // make sure values are valid + { + encodeB(b_max, 4 + head_offset, (int)(sensor_max[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel + encodeA(b_max, 6 + head_offset, (int)(sensor_max[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel + encodeB(b_max, 7 + head_offset, (int)(sensor_max[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel + + encodeA(b_max, 33 + head_offset, (int)(sensor_max[PRES] + 0.5)); // Pressure + if (sensor_max[ALT] < 0) sensor_max[ALT] = 0.0; + encodeB(b_max, 34 + head_offset, (int)(sensor_max[ALT] / 10.0 + 0.5)); // Altitude + encodeB(b_max, 40 + head_offset, (int)(sensor_max[GYRO_X] + 0.5) + 2048); + encodeA(b_max, 42 + head_offset, (int)(sensor_max[GYRO_Y] + 0.5) + 2048); + encodeB(b_max, 43 + head_offset, (int)(sensor_max[GYRO_Z] + 0.5) + 2048); + + // encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS1] * 10 + 0.5) + 2048); + encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); + encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] * 10 + 0.5)); + if (failureMode != FAIL_PAYLOAD) { + encodeA(b_max, 48 + head_offset, (int)(sensor_max[DTEMP] * 10 + 0.5) + 2048); + encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS1])); + encodeA(b_max, 0 + head_offset, (int)(sensor_max[XS2])); + encodeB(b_max, 1 + head_offset, (int)(sensor_max[XS3])); + } + else { + encodeA(b_max, 48 + head_offset, 2048); + encodeB(b_max, 49 + head_offset, 0); + encodeA(b_max, 0 + head_offset, 0); + encodeB(b_max, 1 + head_offset, 0); + } + } else { + encodeB(b_max, 4 + head_offset, 2048); // 0 + encodeA(b_max, 6 + head_offset, 2048); // 0 + encodeB(b_max, 7 + head_offset, 2048); // 0 + + encodeB(b_max, 40 + head_offset, 2048); + encodeA(b_max, 42 + head_offset, 2048); + encodeB(b_max, 43 + head_offset, 2048); + + encodeA(b_max, 48 + head_offset, 2048); + // encodeB(b_max, 49 + head_offset, 2048); + } + encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); + encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); + encodeA(b_min, 15 + head_offset, (int)(voltage_min[map[PLUS_Z]] * 100)); + encodeB(b_min, 16 + head_offset, (int)(voltage_min[map[MINUS_X]] * 100)); + encodeA(b_min, 18 + head_offset, (int)(voltage_min[map[MINUS_Y]] * 100)); + encodeB(b_min, 19 + head_offset, (int)(voltage_min[map[MINUS_Z]] * 100)); encodeA(b_min, 21 + head_offset, (int)(current_min[map[PLUS_X]] + 0.5) + 2048); encodeB(b_min, 22 + head_offset, (int)(current_min[map[PLUS_Y]] + 0.5) + 2048); encodeA(b_min, 24 + head_offset, (int)(current_min[map[PLUS_Z]] + 0.5) + 2048); encodeB(b_min, 25 + head_offset, (int)(current_min[map[MINUS_X]] + 0.5) + 2048); encodeA(b_min, 27 + head_offset, (int)(current_min[map[MINUS_Y]] + 0.5) + 2048); - encodeB(b_min, 28 + head_offset, (int)(current_min[map[MINUS_Z]] + 0.5) + 2048); - + encodeB(b_min, 28 + head_offset, (int)(current_min[map[MINUS_Z]] + 0.5) + 2048); + encodeA(b_min, 9 + head_offset, (int)(current_min[map[BAT]] + 0.5) + 2048); encodeA(b_min, 3 + head_offset, (int)(voltage_min[map[BAT]] * 100)); encodeA(b_min, 30 + head_offset, (int)(voltage_min[map[BAT2]] * 100)); encodeB(b_min, 46 + head_offset, (int)(current_min[map[BAT2]] + 0.5) + 2048); - + encodeB(b_min, 31 + head_offset, ((int)(other_min[SPIN] * 10)) + 2048); - encodeB(b_min, 37 + head_offset, (int)(other_min[RSSI] + 0.5) + 2048); + encodeB(b_min, 37 + head_offset, (int)(other_min[RSSI] + 0.5) + 2048); encodeA(b_min, 39 + head_offset, (int)(other_min[IHU_TEMP] * 10 + 0.5)); - - if (sensor_min[TEMP] != 1000.0) // make sure values are valid - { - encodeB(b_min, 4 + head_offset, (int)(sensor_min[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel - encodeA(b_min, 6 + head_offset, (int)(sensor_min[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel - encodeB(b_min, 7 + head_offset, (int)(sensor_min[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel - - encodeA(b_min, 33 + head_offset, (int)(sensor_min[PRES] + 0.5)); // Pressure - encodeB(b_min, 34 + head_offset, (int)(sensor_min[ALT] * 10.0 + 0.5)); // Altitude - encodeB(b_min, 40 + head_offset, (int)(sensor_min[GYRO_X] + 0.5) + 2048); - encodeA(b_min, 42 + head_offset, (int)(sensor_min[GYRO_Y] + 0.5) + 2048); - encodeB(b_min, 43 + head_offset, (int)(sensor_min[GYRO_Z] + 0.5) + 2048); - - encodeA(b_min, 48 + head_offset, (int)(sensor_min[DTEMP] * 10 + 0.5) + 2048); -// encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS1] * 10 + 0.5) + 2048); - encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5)); - encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] * 10 + 0.5)); - - encodeB(b_min, 49 + head_offset, (int)(sensor[XS1])); - encodeA(b_min, 0 + head_offset, (int)(sensor[XS2])); - encodeB(b_min, 1 + head_offset, (int)(sensor[XS3])); - } - else - { - encodeB(b_min, 4 + head_offset, 2048); // 0 - encodeA(b_min, 6 + head_offset, 2048); // 0 - encodeB(b_min, 7 + head_offset, 2048); // 0 - - encodeB(b_min, 40 + head_offset, 2048); - encodeA(b_min, 42 + head_offset, 2048); - encodeB(b_min, 43 + head_offset, 2048); - - encodeA(b_min, 48 + head_offset, 2048); -// encodeB(b_min, 49 + head_offset, 2048); - } - } + + if (sensor_min[TEMP] != 100000.0) // make sure values are valid + { + encodeB(b_min, 4 + head_offset, (int)(sensor_min[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel + encodeA(b_min, 6 + head_offset, (int)(sensor_min[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel + encodeB(b_min, 7 + head_offset, (int)(sensor_min[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel + + encodeA(b_min, 33 + head_offset, (int)(sensor_min[PRES] + 0.5)); // Pressure + if (sensor_min[ALT] < 0) sensor_min[ALT] = 0.0; + encodeB(b_min, 34 + head_offset, (int)(sensor_min[ALT] / 10.0 + 0.5)); // Altitude + encodeB(b_min, 40 + head_offset, (int)(sensor_min[GYRO_X] + 0.5) + 2048); + encodeA(b_min, 42 + head_offset, (int)(sensor_min[GYRO_Y] + 0.5) + 2048); + encodeB(b_min, 43 + head_offset, (int)(sensor_min[GYRO_Z] + 0.5) + 2048); + + // encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS1] * 10 + 0.5) + 2048); + encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5)); + encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] * 10 + 0.5)); + + if (failureMode != FAIL_PAYLOAD) { + encodeA(b_min, 48 + head_offset, (int)(sensor_min[DTEMP] * 10 + 0.5) + 2048); + encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS1])); + encodeA(b_min, 0 + head_offset, (int)(sensor_min[XS2])); + encodeB(b_min, 1 + head_offset, (int)(sensor_min[XS3])); + } + else { + encodeA(b_min, 48 + head_offset, 2048); + encodeB(b_min, 49 + head_offset, 0); + encodeA(b_min, 0 + head_offset, 0); + encodeB(b_min, 1 + head_offset, 0); + } + } else { + encodeB(b_min, 4 + head_offset, 2048); // 0 + encodeA(b_min, 6 + head_offset, 2048); // 0 + encodeB(b_min, 7 + head_offset, 2048); // 0 + + encodeB(b_min, 40 + head_offset, 2048); + encodeA(b_min, 42 + head_offset, 2048); + encodeB(b_min, 43 + head_offset, 2048); + + encodeA(b_min, 48 + head_offset, 2048); + // encodeB(b_min, 49 + head_offset, 2048); + } + } + encodeA(b, 30 + head_offset, BAT2Voltage); + + encodeB(b, 31 + head_offset, ((int)(other[SPIN] * 10)) + 2048); + + encodeA(b, 33 + head_offset, (int)(sensor[PRES] + 0.5)); // Pressure + if (sensor[ALT] < 0) sensor[ALT] = 0.0; + encodeB(b, 34 + head_offset, (int)(sensor[ALT] / 10.0 + 0.5)); // Altitude + encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS1])); + encodeA(b_min, 0 + head_offset, (int)(sensor_min[XS2])); + encodeB(b_min, 1 + head_offset, (int)(sensor_min[XS3])); + // } + // else + // { + // encodeB(b_min, 4 + head_offset, 2048); // 0 + // encodeA(b_min, 6 + head_offset, 2048); // 0 + // encodeB(b_min, 7 + head_offset, 2048); // 0 + // + // encodeB(b_min, 40 + head_offset, 2048); + // encodeA(b_min, 42 + head_offset, 2048); + // encodeB(b_min, 43 + head_offset, 2048); + // + // encodeA(b_min, 48 + head_offset, 2048); + // // encodeB(b_min, 49 + head_offset, 2048); + // } + // + // } encodeA(b, 30 + head_offset, BAT2Voltage); encodeB(b, 31 + head_offset, ((int)(other[SPIN] * 10)) + 2048); - encodeA(b, 33 + head_offset, (int)(sensor[PRES] + 0.5)); // Pressure - encodeB(b, 34 + head_offset, (int)(sensor[ALT] * 10.0 + 0.5)); // Altitude + encodeA(b, 33 + head_offset, (int)(sensor[PRES] + 0.5)); // Pressure + if (sensor[ALT] < 0) sensor[ALT] = 0.0; + encodeB(b, 34 + head_offset, (int)(sensor[ALT] / 10.0 + 0.5)); // Altitude + encodeA(b, 45 + head_offset, (int)(sensor[HUMI] * 10 + 0.5)); // in place of sensor1 + encodeA(b, 39 + head_offset, (int)(other[TEMP] * 10 + 0.5)); encodeA(b, 36 + head_offset, Resets); encodeB(b, 37 + head_offset, (int)(other[RSSI] + 0.5) + 2048); - encodeA(b, 39 + head_offset, (int)(other[IHU_TEMP] * 10 + 0.5)); - encodeB(b, 40 + head_offset, (int)(sensor[GYRO_X] + 0.5) + 2048); encodeA(b, 42 + head_offset, (int)(sensor[GYRO_Y] + 0.5) + 2048); encodeB(b, 43 + head_offset, (int)(sensor[GYRO_Z] + 0.5) + 2048); - encodeA(b, 45 + head_offset, (int)(sensor[HUMI] * 10 + 0.5)); // in place of sensor1 + if (failureMode != FAIL_PAYLOAD) { + encodeA(b, 48 + head_offset, (int)(sensor[DTEMP] * 10 + 0.5) + 2048); + encodeB(b, 49 + head_offset, (int)(sensor[XS1])); + encodeA(b, 0 + head_offset, (int)(sensor[XS2])); + encodeB(b, 1 + head_offset, (int)(sensor[XS3])); + } + else { + encodeA(b, 48 + head_offset, 2048); + encodeB(b, 49 + head_offset, 0); + encodeA(b, 0 + head_offset, 0); + encodeB(b, 1 + head_offset, 0); + } encodeB(b, 46 + head_offset, BAT2Current); - encodeA(b, 48 + head_offset, (int)(sensor[DTEMP] * 10 + 0.5) + 2048); -// encodeB(b, 49 + head_offset, (int)(sensor[XS1] * 10 + 0.5) + 2048); - - encodeB(b, 49 + head_offset, (int)(sensor[XS1])); - encodeA(b, 0 + head_offset, (int)(sensor[XS2])); - encodeB(b, 1 + head_offset, (int)(sensor[XS3])); - - FILE * command_count_file = fopen("/home/pi/CubeSatSim/command_count.txt", "r"); - if (command_count_file != NULL) { - char count_string[10]; - if ( (fgets(count_string, 10, command_count_file)) != NULL) - groundCommandCount = atoi(count_string); -// fclose(command_count_file); - } else - printf("Error opening command_count.txt!\n"); + encodeA(b, 39 + head_offset, (int)(other[IHU_TEMP] * 10 + 0.5)); + + // encodeB(b, 49 + head_offset, (int)(sensor[XS1] * 10 + 0.5) + 2048); + + FILE* command_count_file = fopen("/home/pi/CubeSatSim/command_count.txt", "r"); + if (command_count_file != NULL) { + char count_string[10]; + if ((fgets(count_string, 10, command_count_file)) != NULL) + groundCommandCount = atoi(count_string); + else + printf("command_count.txt is invalid\n"); + // fclose(command_count_file); + } else + printf("Error opening command_count.txt!\n"); fclose(command_count_file); - -// printf("Command count: %d\n", groundCommandCount); - - int status = STEMBoardFailure + SafeMode * 2 + sim_mode * 4 + PayloadFailure1 * 8 + - (i2c_bus0 == OFF) * 16 + (i2c_bus1 == OFF) * 32 + (i2c_bus3 == OFF) * 64 + (camera == OFF) * 128 + groundCommandCount * 256; + + printf("Command count: %d\n", groundCommandCount); + int simulated; + simulated = sim_mode; + if (failureMode != FAIL_NONE) { + simulated = TRUE; + printf("Showing Simulated in FoxTelem\n"); + } + int i2c_1, i2c_3; + i2c_1 = i2c_bus1; + i2c_3 = i2c_bus3; + // printf("Bus1: %d Bus2: %d \n", i2c_1, i2c_3); + if (failureMode == FAIL_I2C1) { + i2c_1 = OFF; + // printf("I2C Bus 1 Simulated Failure\n"); + } else if (failureMode == FAIL_I2C3) { + i2c_3 = OFF; + // printf("I2C Bus 3 Simulated Failure\n"); + } + // int status = STEMBoardFailure + SafeMode * 2 + sim_mode * 4 + PayloadFailure1 * 8 + + // (i2c_bus0 == OFF) * 16 + (i2c_bus1 == OFF) * 32 + (i2c_bus3 == OFF) * 64 + (camera == OFF) * 128 + groundCommandCount * 256; + int status = STEMBoardFailure + SafeMode * 2 + simulated * 4 + PayloadFailure1 * 8 + (i2c_bus0 == OFF) * 16 + (i2c_1 == OFF) * 32 + (i2c_3 == OFF) * 64 + (cam == OFF) * 128 + groundCommandCount * 256; encodeA(b, 51 + head_offset, status); encodeB(b, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); - if ((mode == BPSK) || (mode == PACSAT)) { - encodeA(b_max, 51 + head_offset, status); + encodeA(b, 53 + head_offset, groundCommandCount); + + if ((mode == BPSK) || (mode == PACSAT)) { + encodeA(b_max, 51 + head_offset, status); encodeA(b_min, 51 + head_offset, status); encodeB(b_max, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); encodeB(b_min, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); } - + if (txAntennaDeployed == 0) { txAntennaDeployed = 1; printf("TX Antenna Deployed!\n"); @@ -1573,13 +2032,13 @@ void get_tlm_fox() { if (rxAntennaDeployed == 0) { rxAntennaDeployed = 1; printf("RX Antenna Deployed!\n"); - } - + } + if (mode == BPSK) { // wod field experiments unsigned long val = 0xffff; - encodeA(b, 64 + head_offset, 0xff & val); - encodeA(b, 65 + head_offset, val >> 8); - encodeA(b, 63 + head_offset, 0x00); + encodeA(b, 64 + head_offset, 0xff & val); + encodeA(b, 65 + head_offset, val >> 8); + encodeA(b, 63 + head_offset, 0x00); encodeA(b, 62 + head_offset, 0x01); encodeB(b, 74 + head_offset, 0xfff); } @@ -1612,6 +2071,7 @@ void get_tlm_fox() { else { // extra bracket for some reason? { + short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; @@ -1619,7 +2079,7 @@ void get_tlm_fox() { int ctr3 = 0; for (i = 0; i < rsFrameLen; i++) { for (int j = 0; j < rsFrames; j++) { - if (!((i == (rsFrameLen - 1)) && (j == 2))) // skip last one for BPSK + if (!((i == (rsFrameLen - 1)) && (j == 2))) // skip last one for BPSK { if (ctr1 < headerLen) { rs_frame[j][i] = h[ctr1]; @@ -1628,30 +2088,23 @@ void get_tlm_fox() { data8[ctr1++] = rs_frame[j][i]; // printf ("data8[%d] = %x \n", ctr1 - 1, rs_frame[j][i]); } else { - if (mode == FSK) - { - rs_frame[j][i] = b[ctr3 % dataLen]; - update_rs(parities[j], b[ctr3 % dataLen]); - } else // BPSK - if ((int)(ctr3/dataLen) == 3) - { - rs_frame[j][i] = b_max[ctr3 % dataLen]; - update_rs(parities[j], b_max[ctr3 % dataLen]); - } - else if ((int)(ctr3/dataLen) == 4) - { - rs_frame[j][i] = b_min[ctr3 % dataLen]; - update_rs(parities[j], b_min[ctr3 % dataLen]); - } - else - { - rs_frame[j][i] = b[ctr3 % dataLen]; - update_rs(parities[j], b[ctr3 % dataLen]); - } - { - } - - // printf("%d rs_frame[%d][%d] = %x %d \n", + if (mode == FSK) { + rs_frame[j][i] = b[ctr3 % dataLen]; + update_rs(parities[j], b[ctr3 % dataLen]); + } else // BPSK + if ((int)(ctr3 / dataLen) == 3) { + rs_frame[j][i] = b_max[ctr3 % dataLen]; + update_rs(parities[j], b_max[ctr3 % dataLen]); + } else if ((int)(ctr3 / dataLen) == 4) { + rs_frame[j][i] = b_min[ctr3 % dataLen]; + update_rs(parities[j], b_min[ctr3 % dataLen]); + } else { + rs_frame[j][i] = b[ctr3 % dataLen]; + update_rs(parities[j], b[ctr3 % dataLen]); + } + {} + + // printf("%d rs_frame[%d][%d] = %x %d \n", // ctr1, j, i, b[ctr3 % DATA_LEN], ctr3 % DATA_LEN); data8[ctr1++] = rs_frame[j][i]; // printf ("data8[%d] = %x \n", ctr1 - 1, rs_frame[j][i]); @@ -1661,54 +2114,54 @@ void get_tlm_fox() { } } - #ifdef DEBUG_LOGGING - // printf("\nAt end of data8 write, %d ctr1 values written\n\n", ctr1); - /* - printf("Parities "); - for (int m = 0; m < parityLen; m++) { - printf("%d ", parities[0][m]); - } - printf("\n"); - */ - #endif - +#ifdef DEBUG_LOGGING +// printf("\nAt end of data8 write, %d ctr1 values written\n\n", ctr1); +/* + printf("Parities "); + for (int m = 0; m < parityLen; m++) { + printf("%d ", parities[0][m]); + } + printf("\n"); +*/ +#endif + int ctr2 = 0; memset(data10, 0, sizeof(data10)); - for (i = 0; i < dataLen * payloads + headerLen; i++) // 476 for BPSK + for (i = 0; i < dataLen * payloads + headerLen; i++) // 476 for BPSK { - data10[ctr2] = (Encode_8b10b[rd][((int) data8[ctr2])] & 0x3ff); - nrd = (Encode_8b10b[rd][((int) data8[ctr2])] >> 10) & 1; + data10[ctr2] = (Encode_8b10b[rd][((int)data8[ctr2])] & 0x3ff); + nrd = (Encode_8b10b[rd][((int)data8[ctr2])] >> 10) & 1; // printf ("data10[%d] = encoded data8[%d] = %x \n", - // ctr2, ctr2, data10[ctr2]); + // ctr2, ctr2, data10[ctr2]); - rd = nrd; // ^ nrd; + rd = nrd; // ^ nrd; ctr2++; } -// { - for (i = 0; i < parityLen; i++) { - for (int j = 0; j < rsFrames; j++) { - if ((uptime != 0) || (i != 0)) // don't correctly update parties if uptime is 0 so the frame will fail the FEC check and be discarded - data10[ctr2++] = (Encode_8b10b[rd][((int) parities[j][i])] & 0x3ff); - nrd = (Encode_8b10b[rd][((int) parities[j][i])] >> 10) & 1; + // { + for (i = 0; i < parityLen; i++) { + for (int j = 0; j < rsFrames; j++) { + if ((uptime != 0) || (i != 0)) // don't correctly update parties if uptime is 0 so the frame will fail the FEC check and be discarded + data10[ctr2++] = (Encode_8b10b[rd][((int)parities[j][i])] & 0x3ff); + nrd = (Encode_8b10b[rd][((int)parities[j][i])] >> 10) & 1; // printf ("data10[%d] = encoded parities[%d][%d] = %x \n", - // ctr2 - 1, j, i, data10[ctr2 - 1]); + // ctr2 - 1, j, i, data10[ctr2 - 1]); - rd = nrd; - } + rd = nrd; } - // } - #ifdef DEBUG_LOGGING - // printf("\nAt end of data10 write, %d ctr2 values written\n\n", ctr2); - #endif + } + // } +#ifdef DEBUG_LOGGING +// printf("\nAt end of data10 write, %d ctr2 values written\n\n", ctr2); +#endif int data; int val; - //int offset = 0; + // int offset = 0; - #ifdef DEBUG_LOGGING - // printf("\nAt start of buffer loop, syncBits %d samples %d ctr %d\n", syncBits, samples, ctr); - #endif +#ifdef DEBUG_LOGGING +// printf("\nAt start of buffer loop, syncBits %d samples %d ctr %d\n", syncBits, samples, ctr); +#endif for (i = 1; i <= syncBits * samples; i++) { write_wave(ctr, buffer); @@ -1718,7 +2171,7 @@ void get_tlm_fox() { val = sync; data = val & 1 << (bit - 1); // printf ("%d i: %d new frame %d sync bit %d = %d \n", - // ctr/SAMPLES, i, frames, bit, (data > 0) ); + // ctr/, i, frames, bit, (data > 0) ); if (mode == FSK) { phase = ((data != 0) * 2) - 1; // printf("Sending a %d\n", phase); @@ -1726,18 +2179,17 @@ void get_tlm_fox() { if (data == 0) { phase *= -1; if ((ctr - smaller) > 0) { - for (int j = 1; j <= smaller; j++) - buffer[ctr - j] = buffer[ctr - j] * 0.4; + for (int j = 1; j <= smaller; j++) buffer[ctr - j] = buffer[ctr - j] * 0.4; } flip_ctr = ctr; } } } } - #ifdef DEBUG_LOGGING - // printf("\n\nValue of ctr after header: %d Buffer Len: %d\n\n", ctr, buffSize); - #endif - for (i = 1; i <= (10 * (headerLen + dataLen * payloads + rsFrames * parityLen) * samples); i++) // 572 +#ifdef DEBUG_LOGGING +// printf("\n\nValue of ctr after header: %d Buffer Len: %d\n\n", ctr, buffSize); +#endif + for (i = 1; i <= (10 * (headerLen + dataLen * payloads + rsFrames * parityLen) * samples); i++) // 572 { write_wave(ctr, buffer); if ((i % samples) == 0) { @@ -1746,7 +2198,7 @@ void get_tlm_fox() { val = data10[symbol]; data = val & 1 << (bit - 1); // printf ("%d i: %d new frame %d data10[%d] = %x bit %d = %d \n", - // ctr/SAMPLES, i, frames, symbol, val, bit, (data > 0) ); + // ctr/, i, frames, symbol, val, bit, (data > 0) ); if (mode == FSK) { phase = ((data != 0) * 2) - 1; // printf("Sending a %d\n", phase); @@ -1754,8 +2206,7 @@ void get_tlm_fox() { if (data == 0) { phase *= -1; if ((ctr - smaller) > 0) { - for (int j = 1; j <= smaller; j++) - buffer[ctr - j] = buffer[ctr - j] * 0.4; + for (int j = 1; j <= smaller; j++) buffer[ctr - j] = buffer[ctr - j] * 0.4; } flip_ctr = ctr; } @@ -1763,53 +2214,29 @@ void get_tlm_fox() { } } } - #ifdef DEBUG_LOGGING - // printf("\nValue of ctr after looping: %d Buffer Len: %d\n", ctr, buffSize); - // printf("\ctr/samples = %d ctr/(samples*10) = %d\n\n", ctr/samples, ctr/(samples*10)); - #endif +#ifdef DEBUG_LOGGING +// printf("\nValue of ctr after looping: %d Buffer Len: %d\n", ctr, buffSize); +// printf("\ctr/samples = %d ctr/(samples*10) = %d\n\n", ctr/samples, ctr/(samples*10)); +#endif - int error = 0; - // int count; - // for (count = 0; count < dataLen; count++) { - // printf("%02X", b[count]); - // } - // printf("\n"); + // int error = 0; + // int count; + // for (count = 0; count < dataLen; count++) { + // printf("%02X", b[count]); + // } + // printf("\n"); // socket write - if (!socket_open && transmit) { - printf("Opening socket!\n"); - // struct sockaddr_in address; - // int valread; - struct sockaddr_in serv_addr; - // char *hello = "Hello from client"; - // char buffer[1024] = {0}; - if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - printf("\n Socket creation error \n"); - error = 1; - } - - memset( & serv_addr, '0', sizeof(serv_addr)); - - serv_addr.sin_family = AF_INET; - serv_addr.sin_port = htons(PORT); - - // Convert IPv4 and IPv6 addresses from text to binary form - if (inet_pton(AF_INET, "127.0.0.1", & serv_addr.sin_addr) <= 0) { - printf("\nInvalid address/ Address not supported \n"); - error = 1; - } - - if (connect(sock, (struct sockaddr * ) & serv_addr, sizeof(serv_addr)) < 0) { - printf("\nConnection Failed \n"); - printf("Error: %s\n", strerror(errno)); - error = 1; -// FILE * transmit_restartf2 = popen("sudo systemctl restart transmit", "r"); -// pclose(transmit_restartf2); -// sleep(10); // was 5 // sleep if socket connection refused - - // try again - error = 0; + socket_send(ctr); + /* + if (!socket_open && transmit) { + printf("Opening socket!\n"); + // struct sockaddr_in address; + // int valread; + struct sockaddr_in serv_addr; + // char *hello = "Hello from client"; + // char buffer[1024] = {0}; if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { printf("\n Socket creation error \n"); error = 1; @@ -1820,7 +2247,7 @@ void get_tlm_fox() { serv_addr.sin_family = AF_INET; serv_addr.sin_port = htons(PORT); - // Convert IPv4 and IPv6 addresses from text to binary form + // Convert IPv4 and IPv6 addresses from text to binary form if (inet_pton(AF_INET, "127.0.0.1", & serv_addr.sin_addr) <= 0) { printf("\nInvalid address/ Address not supported \n"); error = 1; @@ -1830,89 +2257,109 @@ void get_tlm_fox() { printf("\nConnection Failed \n"); printf("Error: %s\n", strerror(errno)); error = 1; -// FILE * transmit_restartf = popen("sudo systemctl restart transmit", "r"); -// pclose(transmit_restartf); -// sleep(10); // was 5 // sleep if socket connection refused - } - } - if (error == 1) { - printf("Socket error count: %d\n", error_count); -// ; //transmitStatus = -1; - if (error_count++ > 5) { - printf("Restarting transmit\n"); - FILE * transmit_restartf = popen("sudo systemctl restart transmit", "r"); - pclose(transmit_restartf); - sleep(10); // was 5 // sleep if socket connection refused - } - } - else { - socket_open = 1; - error_count = 0; - } - } + // FILE * transmit_restartf2 = popen("sudo systemctl restart transmit", "r"); + // pclose(transmit_restartf2); + // sleep(10); // was 5 // sleep if socket connection refused + + // try again + error = 0; + if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + printf("\n Socket creation error \n"); + error = 1; + } - if (!error && transmit) { - // digitalWrite (0, LOW); - // printf("Sending %d buffer bytes over socket after %d ms!\n", ctr, (long unsigned int)millis() - start); - start = millis(); - int sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); -// printf("socket send 1 %d ms bytes: %d \n\n", (unsigned int)millis() - start, sock_ret); - fflush(stdout); - - if (sock_ret < (ctr * 2 + 2)) { - // printf("Not resending\n"); - sleep(0.5); - sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); -// printf("socket send 2 %d ms bytes: %d \n\n", millis() - start, sock_ret); - } - - loop_count++; - if ((firstTime == 1) || (((loop_count % 180) == 0) && (mode == FSK)) || (((loop_count % 80) == 0) && (mode == BPSK))) // do first time and was every 180 samples - { - int max; - if (mode == FSK) - if (sim_mode) - max = 6; - else if (firstTime == 1) - max = 4; // 5; // was 6 - else - max = 3; - else - if (firstTime == 1) - max = 5; // 5; // was 6 - else - max = 4; - - for (int times = 0; times < max; times++) - { - start = millis(); // send frame until buffer fills - sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); -// printf("socket send %d in %d ms bytes: %d \n\n",times + 2, (unsigned int)millis() - start, sock_ret); - - if ((millis() - start) > 500) { - printf("Buffer over filled!\n"); - break; - } + memset( & serv_addr, '0', sizeof(serv_addr)); - if (sock_ret < (ctr * 2 + 2)) { - // printf("Not resending\n"); - sleep(0.5); - sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); - printf("socket resend %d in %d ms bytes: %d \n\n",times, millis() - start, sock_ret); - } + serv_addr.sin_family = AF_INET; + serv_addr.sin_port = htons(PORT); + + // Convert IPv4 and IPv6 addresses from text to binary form + if (inet_pton(AF_INET, "127.0.0.1", & serv_addr.sin_addr) <= 0) { + printf("\nInvalid address/ Address not supported \n"); + error = 1; + } + + if (connect(sock, (struct sockaddr * ) & serv_addr, sizeof(serv_addr)) < 0) { + printf("\nConnection Failed \n"); + printf("Error: %s\n", strerror(errno)); + error = 1; + // FILE * transmit_restartf = popen("sudo systemctl restart transmit", "r"); + // pclose(transmit_restartf); + // sleep(10); // was 5 // sleep if socket connection refused + } + } + if (error == 1) { + printf("Socket error count: %d\n", error_count); + // ; //transmitStatus = -1; + if (error_count++ > 5) { + printf("Restarting transmit\n"); + FILE * transmit_restartf = popen("sudo systemctl restart transmit", "r"); + pclose(transmit_restartf); + sleep(10); // was 5 // sleep if socket connection refused + } + } + else { + socket_open = 1; + error_count = 0; } - sampleTime = (unsigned int) millis(); // resetting time for sleeping - fflush(stdout); -// if (firstTime == 1) -// max -= 1; } - if (sock_ret == -1) { - printf("Error: %s \n", strerror(errno)); - socket_open = 0; - //transmitStatus = -1; + if (!error && transmit) { + // digitalWrite (0, LOW); + // printf("Sending %d buffer bytes over socket after %d ms!\n", ctr, (long unsigned int)millis() - start); + start = millis(); + int sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); + // printf("socket send 1 %d ms bytes: %d \n\n", (unsigned int)millis() - start, sock_ret); + fflush(stdout); + + if (sock_ret < (ctr * 2 + 2)) { + // printf("Not resending\n"); + sleep(0.5); + sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); + // printf("socket send 2 %d ms bytes: %d \n\n", millis() - start, sock_ret); + } + */ + + loop_count++; + if ((firstTime == 1) || (((loop_count % 180) == 0) && (mode == FSK)) || (((loop_count % 80) == 0) && (mode == BPSK))) // do first time and was every 180 samples + { + int max; + if (mode == FSK) + if (sim_mode) + max = 6; + else if (firstTime == 1) + max = 4; // 5; // was 6 + else + max = 3; + else if (firstTime == 1) + max = 5; // 5; // was 6 + else + max = 4; + + for (int times = 0; times < max; times++) { + /// start = millis(); // send frame until buffer fills + socket_send(ctr); + /// sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); + // printf("socket send %d in %d ms bytes: %d \n\n",times + 2, (unsigned int)millis() - start, sock_ret); + + /// if ((millis() - start) > 500) { + /// printf("Buffer over filled!\n"); + /// break; + /// } + + /// if (sock_ret < (ctr * 2 + 2)) { + // printf("Not resending\n"); + /// sleep(0.5); + /// sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); + /// printf("socket resend %d in %d ms bytes: %d \n\n",times, millis() - start, sock_ret); + /// } } + sampleTime = (unsigned int)millis(); // resetting time for sleeping + // fflush(stdout); + // if (firstTime == 1) + // max -= 1; } + if (socket_open == 1) firstTime = 0; // else if (frames_sent > 0) //5) @@ -1992,13 +2439,16 @@ void write_wave(int i, short int *buffer) } else { - if ((ctr - flip_ctr) < smaller) -// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); + if ((ctr - flip_ctr) < smaller) { +// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); buffer[ctr++] = (short int)(phase * sin_map[ctr % sin_samples] / 2); +// if (ctr < 1000) printf("*"); + } else -// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); buffer[ctr++] = (short int)(amplitude * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); - buffer[ctr++] = (short int)(phase * sin_map[ctr % sin_samples]); } -// printf("%d %d \n", i, buffer[ctr - 1]); +// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); + buffer[ctr++] = (short int)(phase * sin_map[ctr % sin_samples]); + } +// if (ctr < 1000) printf("%d %d %d \n", ctr, i, buffer[ctr - 1]); } @@ -2091,8 +2541,7 @@ int get_payload_serial(int debug_camera) { end_flag_detected = FALSE; jpeg_start = 0; - serialFlush (uart_fd); // flush serial buffer so latest payload is read - + serialFlush (uart_fd); // flush serial buffer so latest payload is read // #ifdef GET_IMAGE_DEBUG if (debug_camera) printf("Received from Payload:\n"); @@ -2302,3 +2751,473 @@ if (setting == ON) { } return; } + +void get_tlm_fc() { // FUNcube Mode telemetry generation + + printf("++++ Loop time: %5.3f sec +++++\n", (millis() - loopTime) / 1000.0); + fflush(stdout); + loopTime = millis(); + +//# define FC_EM +//#define JY_1 +#define FC_SIM + + /* create data, stream, and waveform buffers */ + + unsigned char source_bytes[256]; + int byte_count = 256; + + /* write telemetry into data buffer */ + +// printf("\nBLOCKSIZE = %d\n", BLOCKSIZE); +// printf("\nSYMPBLOCK = %d\n", SYMPBLOCK); + + memset(source_bytes, 0x00, sizeof(source_bytes)); +#ifdef FC_EM + source_bytes[0] = 0b00000001 ; // Sat Id is FUNcube-EM +#endif +#ifdef JY_1 +// source_bytes[0] = 0b11000001 ; // Sat Id is extended, Frame 2 (RT2 + WO2) + source_bytes[0] = 0xE0 | 0x20 | 0x00; // 1; // Sat Id is extended, Frame 34 (RT2 + IMG2) + + source_bytes[0] = source_bytes[0] | ( 0x01 & (uint8_t)(sequence % 2)); // alternate last bit for RT1, RT2. + + // source_bytes[1] = 0x08 ; // extended Nayify - works per code + source_bytes[1] = 0x10 ; // extended JY-1 - works, no documentation + + int extended = 1; +#endif +#ifdef FC_SIM +// source_bytes[0] = 0b11000001 ; // Sat Id is extended, Frame 2 (RT2 + WO2) + source_bytes[0] = 0xE0 | 0x20 | 0x00; // 1; // Sat Id is extended, Frame 34 (RT2 + IMG2) + + source_bytes[0] = source_bytes[0] | ( 0x01 & (uint8_t)(sequence % 2)); // alternate last bit for RT1, RT2. + + // source_bytes[1] = 0x08 ; // extended Nayify - works per code + source_bytes[1] = 0xfb ; // funcube sim sat id per AMSAT-UK allocation + int extended = 1; +#endif +#if defined(FC_SIM) || defined(JY_1) +// if (sequence > 10) { + if (image_file == NULL) { + image_file = fopen("/home/pi/CubeSatSim/image_file.bin", "r"); + image_id++; + printf("Opening file image_file.bin for image_id: %d\n", image_id); + } +// } + int pos = FC_PAYLOAD + extended; + int value; + if (image_file != NULL) { + printf("Writing image data to payload\n"); + while ((pos < 256) && ((value = getc(image_file)) != EOF)) { + source_bytes[pos++] = value; +// printf("%2x ", value); + } + if (value == EOF) { + image_file = NULL; + printf("End of file reached! Delete image_file.bin"); + FILE * delete_image = popen("sudo rm /home/pi/CubeSatSim/image_file.bin", "r"); + pclose(delete_image); + } + } + +#endif + +// printf("Volts: %f %f %f %f \n", voltage[map[BAT]], voltage[map[PLUS_X]] , voltage[map[PLUS_Y]], voltage[map[PLUS_Z]]); +// printf("AmpsPlus: %f %f %f %f \n", current[map[BAT]], current[map[PLUS_X]] , current[map[PLUS_Y]], current[map[PLUS_Z]]); +// printf("AmpsMinus: %f %f %f %f \n", current[map[BAT2]], current[map[MINUS_X]] , current[map[MINUS_Y]], current[map[MINUS_Z]]); + + float xmax = (voltage[map[PLUS_X]] > voltage[map[MINUS_X]]) ? voltage[map[PLUS_X]] : voltage[map[MINUS_X]]; + float ymax = (voltage[map[PLUS_Y]] > voltage[map[MINUS_Y]]) ? voltage[map[PLUS_Y]] : voltage[map[MINUS_Y]]; + float zmax = (voltage[map[PLUS_Z]] > voltage[map[MINUS_Z]]) ? voltage[map[PLUS_Z]] : voltage[map[MINUS_Z]]; + +// printf("Vmax: %f %f %f \n", xmax, ymax, zmax); + + uint16_t x = (uint16_t)(xmax * 1000) & 0x3fff; // 14 bits + uint16_t y = (uint16_t)(ymax * 1000) & 0x3fff; + uint16_t z = (uint16_t)(zmax * 1000) & 0x3fff; + uint16_t b = (uint16_t)(voltage[map[BAT]] * 1000) & 0x3fff; + + uint16_t ix = (uint16_t)((current[map[PLUS_X]] + current[map[MINUS_X]])) & 0x3ff; // 10 bits + uint16_t iy = (uint16_t)((current[map[PLUS_Y]] + current[map[MINUS_Y]])) & 0x3ff; + uint16_t iz = (uint16_t)((current[map[PLUS_Z]] + current[map[MINUS_Z]])) & 0x3ff; + + uint16_t ic = 0; + uint16_t ib = 0; + + if (current[map[BAT]] < 0 ) + ic = (uint16_t)(current[map[BAT]] * (-1)) & 0x3ff; // charging current + else + ib = (uint16_t)(current[map[BAT]]) & 0x3ff; // supplying current + +// printf("X %x Y %x Z %x B %x\n", x, y, z, b); +// printf("iX %x iY %x iZ %x iB %x iC\n", ix, iy, iz, ib, ic); + +#if defined(FC_SIM) || defined(JY_1) + source_bytes[extended + FC_EPS + 0] = 0xff & (x >> 6); // Vx + source_bytes[extended + FC_EPS + 1] = 0xfc & (x << 2); + source_bytes[extended + FC_EPS + 1] = source_bytes[extended + FC_EPS + 1] | (0x03 & (y >> 12)); + source_bytes[extended + FC_EPS + 2] = 0xff & (y >> 2); // Vy + source_bytes[extended + FC_EPS + 3] = 0xf0 & (y << 4); + + source_bytes[extended + FC_EPS + 3] = source_bytes[extended + FC_EPS + 3] | (0x0f & (z >> 10)); + source_bytes[extended + FC_EPS + 4] = 0xff & (z >> 2); // Vz + source_bytes[extended + FC_EPS + 5] = 0xc0 & (z << 6); + + source_bytes[extended + FC_EPS + 5] = source_bytes[extended + FC_EPS + 5] | (0x3f & (b >> 8)); + source_bytes[extended + FC_EPS + 6] = 0xff & (b >> 0); // Vb + + source_bytes[extended + FC_EPS + 7] = 0xff & (ix >> 2); // ix + source_bytes[extended + FC_EPS + 8] = 0xc0 & (iy << 6); // iy + + source_bytes[extended + FC_EPS + 8] = source_bytes[extended + FC_EPS + 8] | (0x3f & (iy >> 4)); + source_bytes[extended + FC_EPS + 9] = 0xf0 & (iy << 4); + + source_bytes[extended + FC_EPS + 9] = source_bytes[extended + FC_EPS + 9] | (0x0f & (iz >> 6)); + source_bytes[extended + FC_EPS + 10] = 0x3f & (iz << 2); // iz + + source_bytes[extended + FC_EPS + 10] = source_bytes[extended + FC_EPS + 10] | (0x03 & (ic >> 8)); + source_bytes[extended + FC_EPS + 11] = 0xff & (ic << 0); // ic battery charging curent + + source_bytes[extended + FC_EPS + 12] = 0xff & (ib >> 2); // ib battery discharging current + source_bytes[extended + FC_EPS + 13] = 0xc0 & (ib << 6); + + source_bytes[extended + FC_EPS + 13] = source_bytes[extended + FC_EPS + 13] | 0x3f & (((unsigned long int)reset_count) >> 2); + source_bytes[extended + FC_EPS + 14] = 0xff & (((unsigned long int)reset_count) << 6); // reset count + + uint8_t temp = (int)(other[IHU_TEMP] + 0.5); + + source_bytes[extended + FC_EPS + 17] = source_bytes[extended + FC_EPS + 17] | 0x3f & (temp >> 2); // cpu temp + source_bytes[extended + FC_EPS + 18] = 0xff & (temp << 6); + + source_bytes[extended + 48] = 0x0c; // Antenna 1 and 2 deployed + + source_bytes[extended + 49] = 0xff & ((unsigned long int)sequence >> 16); // sequence number + source_bytes[extended + 50] = 0xff & ((unsigned long int)sequence >> 8); + source_bytes[extended + 51] = 0xff & (unsigned long int)sequence++; + + uint16_t groundCommandCount = 0; + FILE * command_count_file = fopen("/home/pi/CubeSatSim/command_count.txt", "r"); + if (command_count_file != NULL) { + char count_string[10]; + if ( (fgets(count_string, 10, command_count_file)) != NULL) + groundCommandCount = (uint16_t) atoi(count_string); + else + printf("command_count.txt is invalid\n"); + } else + printf("Error opening command_count.txt!\n"); + fclose(command_count_file); + +// source_bytes[extended + 52] = 0xfc & (groundCommandCount << 2); // command doesn't work + + source_bytes[extended + 53] = 0x0f; // SW valid + source_bytes[extended + 54] = 0xe0; // SW valid + + if ((ix + iy + iz) < 4) + source_bytes[extended + 54] = source_bytes[extended + 54] | 0x10; // eclipse + if (SafeMode == 1) + source_bytes[extended + 54] = source_bytes[extended + 54] | 0x08; // safe mode +#endif + +#ifdef FC_EM + source_bytes[FC_EPS + 0] = 0xff & (((unsigned int)((voltage[map[PLUS_X]] + voltage[map[MINUS_X]]) * 1000) >> 8)); // mV + source_bytes[FC_EPS + 1] = 0xff & ((unsigned int)((voltage[map[PLUS_X]] + voltage[map[MINUS_X]]) * 1000)); + source_bytes[FC_EPS + 2] = 0xff & (((unsigned int)((voltage[map[PLUS_Y]] + voltage[map[MINUS_Y]]) * 1000) >> 8)); // mV + source_bytes[FC_EPS + 3] = 0xff & ((unsigned int)((voltage[map[PLUS_Y]] + voltage[map[MINUS_Y]]) * 1000)); + source_bytes[FC_EPS + 4] = 0xff & (((unsigned int)((voltage[map[PLUS_Z]] + voltage[map[MINUS_Z]]) * 1000) >> 8)); // mV + source_bytes[FC_EPS + 5] = 0xff & ((unsigned int)((voltage[map[PLUS_Z]] + voltage[map[MINUS_Z]]) * 1000)); + unsigned int total_solar_current = (unsigned int) (current[map[PLUS_X]] + current[map[MINUS_X]] + + current[map[PLUS_Y]] + current[map[MINUS_Y]] + + current[map[PLUS_Z]] + current[map[MINUS_Z]]); + source_bytes[FC_EPS + 6] = 0xff & total_solar_current >> 8; + source_bytes[FC_EPS + 7] = 0xff & total_solar_current; + source_bytes[FC_EPS + 8] = 0xff & (((unsigned int)(voltage[map[BAT]] * 1000) >> 8)); // mV + source_bytes[FC_EPS + 9] = 0xff & ((unsigned int)(voltage[map[BAT]] * 1000)); + source_bytes[FC_EPS + 10] = 0xff & (((unsigned int)(current[map[BAT]] * 1) >> 8)); // mA + source_bytes[FC_EPS + 11] = 0xff & ((unsigned int)(current[map[BAT]] * 1)); + source_bytes[FC_EPS + 12] = 0xff & (((unsigned long int)reset_count >> 8)); + source_bytes[FC_EPS + 13] = 0xff & ((unsigned long int)reset_count); + + source_bytes[FC_SW + 0] = 0xff & ((unsigned long int)sequence >> 16); // Sequence number + source_bytes[FC_SW + 1] = 0xff & ((unsigned long int)sequence >> 8); + source_bytes[FC_SW + 2] = 0xff & (unsigned long int)sequence++; + +#endif + +/**/ + printf("\nsource_bytes\n"); + for (int i=0; i<256; i++) + printf("%x ", source_bytes[i]); + printf("\n\n"); +/**/ + + /* convert data buffer into stream buffer */ + + const unsigned char* encoded_bytes = encode(source_bytes, byte_count); +/* + printf("\nencoded_bytes\n"); + for (int i=0; i<5200; i++) + printf("%d", encoded_bytes[i]); + printf("\n\n"); +*/ + /* convert to waveform buffer */ + + int data; + int val; + int i; + ctr = 0; + int symbol = 0; + smaller = (int) (S_RATE / (2 * freq_Hz)); +// printf("\n\nsmaller = %d \n\n",smaller); + + for (i = 1; i <= headerLen * samples; i++) { + write_wave(ctr, buffer); + if ((i % samples) == 0) { + phase *= -1; + if ((ctr - smaller) > 0) { + int j; + for (j = 1; j <= smaller; j++) { + buffer[ctr - j] = buffer[ctr - j] * 0.5; +// if (ctr < 1000) printf("# %d %d\n", ctr - j, buffer[ctr - j]); + } + } + flip_ctr = ctr; + } + } + + for (i = 1; i <= syncBits * samples; i++) { + write_wave(ctr, buffer); + // printf("%d ",ctr); + if ((i % samples) == 0) { + int bit = syncBits - i / samples + 1; + val = syncWord; + data = val & 1 << (bit - 1); +// printf ("--- %d i: %d sync bit %d = %d \n", +// ctr, i, bit, (data > 0) ); + if (data == 0) { + phase *= -1; + if ((ctr - smaller) > 0) { + int j; + for (j = 1; j <= smaller; j++) + buffer[ctr - j] = buffer[ctr - j] * 0.5; + } + flip_ctr = ctr; + } + } + } + + for (i = 1; i <= (dataLen * samples); i++) // 5200 + { + write_wave(ctr, buffer); + if ((i % samples) == 0) { + symbol = i / samples - 1; +// if (i < 100) printf("symbol = %d\n",symbol); + data = encoded_bytes[symbol]; + if (data == 0) { + phase *= -1; + if ((ctr - smaller) > 0) { + int j; + for (j = 1; j <= smaller; j++) { + buffer[ctr - j] = buffer[ctr - j] * 0.5; +// if (ctr < 1000) printf("# %d %d\n", ctr - j, buffer[ctr - j]); + } + } + flip_ctr = ctr; + } + } + } +// printf("symbol = %d\n",symbol); +// printf("\nctr = %d\n\n", ctr); + +// socket_send((((headerLen + syncBits + dataLen) * samples) * 2) + 2); + socket_send(ctr); + + if (!transmit) { + fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n"); + fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); + } + + int startSleep = millis(); + if ((millis() - sampleTime) < ((unsigned int)frameTime)) // - 750 + pi_zero_2_offset)) + sleep(1.0); + while ((millis() - sampleTime) < ((unsigned int)frameTime)) // - 750 + pi_zero_2_offset)) + sleep(0.1); + printf("Start sleep %d Sleep period: %d while period: %d\n", startSleep, millis() - startSleep, millis() - sampleTime); + sampleTime = (unsigned int) millis(); // resetting time for sleeping + fflush(stdout); +} + +void socket_send(int length) { + + printf("Socket_send!\n"); + fflush(stdout); + int error = 0; + + if (!socket_open && transmit) { // open socket if not open + printf("Opening socket!\n"); + // struct sockaddr_in address; + // int valread; + struct sockaddr_in serv_addr; + // char *hello = "Hello from client"; + // char buffer[1024] = {0}; + // error_count = 0; + if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + printf("\n Socket creation error \n"); + error = 1; + } + + memset( & serv_addr, '0', sizeof(serv_addr)); + + serv_addr.sin_family = AF_INET; + serv_addr.sin_port = htons(PORT); + + // Convert IPv4 and IPv6 addresses from text to binary form + if (inet_pton(AF_INET, "127.0.0.1", & serv_addr.sin_addr) <= 0) { + printf("\nInvalid address/ Address not supported \n"); + error = 1; + } + + if (connect(sock, (struct sockaddr * ) & serv_addr, sizeof(serv_addr)) < 0) { + printf("\nConnection Failed \n"); + printf("Error: %s\n", strerror(errno)); + fflush(stdout); + error = 1; + sleep(1); + + // try again + error = 0; + if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + printf("\n Socket creation error \n"); + error = 1; + } + + memset( & serv_addr, '0', sizeof(serv_addr)); + + serv_addr.sin_family = AF_INET; + serv_addr.sin_port = htons(PORT); + + // Convert IPv4 and IPv6 addresses from text to binary form + if (inet_pton(AF_INET, "127.0.0.1", & serv_addr.sin_addr) <= 0) { + printf("\nInvalid address/ Address not supported \n"); + error = 1; + } + + if (connect(sock, (struct sockaddr * ) & serv_addr, sizeof(serv_addr)) < 0) { + printf("\nConnection Failed \n"); + printf("Error: %s\n", strerror(errno)); + fflush(stdout); + error = 1; + sleep(1); + } + } + if (error == 1) { + printf("Socket error count: %d\n", error_count); +// ; //transmitStatus = -1; + if (error_count++ > 5) { + printf("Restarting transmit\n"); + fflush(stdout); + FILE * transmit_restartf = popen("sudo systemctl restart transmit", "r"); + pclose(transmit_restartf); + sleep(10); // was 5 // sleep if socket connection refused + } + } + else { + socket_open = 1; + error_count = 0; + } + } + +/* write waveform buffer over socket */ + +// int length = (((headerLen + syncBits + dataLen) * samples) * 2) + 2; // ctr * 2 + 2 like bpsk due to 2 bytes per sample. + length = length * 2 + 2; // convert from samples to bytes +// printf("length in bytes: %d\n", length); + + if (!error && transmit) { + // printf("Sending %d buffer bytes over socket after %d ms!\n", ctr, (long unsigned int)millis() - start); + start = millis(); + int sock_ret = send(sock, buffer, length, 0); + printf("socket send 1 %d ms bytes: %d \n\n", (unsigned int)millis() - start, sock_ret); + fflush(stdout); + + if (sock_ret < length) { + // printf("Not resending\n"); + sleep(0.5); + sock_ret = send(sock, &buffer[sock_ret], length - sock_ret, 0); +// printf("socket send 2 %d ms bytes: %d \n\n", millis() - start, sock_ret); + } + +// loop_count++; + + if (sock_ret == -1) { + printf("Error: %s \n", strerror(errno)); + socket_open = 0; + } + } + +/* + if (!transmit) { + fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n"); + fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); + } + + int startSleep = millis(); + if ((millis() - sampleTime) < ((unsigned int)frameTime)) // - 750 + pi_zero_2_offset)) + sleep(1.0); + while ((millis() - sampleTime) < ((unsigned int)frameTime)) // - 750 + pi_zero_2_offset)) + sleep(0.1); + printf("Start sleep %d Sleep period: %d while period: %d\n", startSleep, millis() - startSleep, millis() - sampleTime); + sampleTime = (unsigned int) millis(); // resetting time for sleeping + fflush(stdout); + */ + + if (socket_open == 1) + firstTime = 0; +} + +int pi_sensors(char *buffer) +{ + char sensor_buffer[1000]; + FILE *sensor_read; + + strcpy(buffer, "OK BME280 "); + + sensor_read = sopen("/home/pi/raspberry-pi-bme280/bme280"); // read BME if present + fgets(sensor_buffer, 1000, sensor_read); + fprintf(stderr, "bme result: %s\n", sensor_buffer); + fclose(sensor_read); + if (sensor_buffer[strlen(sensor_buffer) - 1] == '\n') + sensor_buffer[strlen(sensor_buffer) - 1] = '\0'; // remove newline at end + strcat(buffer, sensor_buffer); + + strcat(buffer, " MPU6050 "); + + sensor_read = sopen("/home/pi/MPU6050-C-CPP-Library-for-Raspberry-Pi/mpu6050"); // read MPU if present + fgets(sensor_buffer, 1000, sensor_read); + fprintf(stderr, "mpu result: %s\n", sensor_buffer); + fclose(sensor_read); + if (sensor_buffer[strlen(sensor_buffer) - 1] == '\n') + sensor_buffer[strlen(sensor_buffer) - 1] = '\0'; // remove newline at end + strcat(buffer, sensor_buffer); + + fprintf(stderr, "pi_sensors string: %s\n", buffer); + + strcat(buffer, " GPS 0.0 0.0 0.0 TMP 0.0"); // place holders for GPS and diode temp +/* + strcat(buffer, " YPR "); + + sensor_read = sopen("/home/pi/MPU6050-C-CPP-Library-for-Raspberry-Pi/ypr"); // read MPU if present + fgets(sensor_buffer, 1000, sensor_read); + fprintf(stderr, "mpu result: %s\n", sensor_buffer); + fclose(sensor_read); + if (sensor_buffer[strlen(sensor_buffer) - 1] == '\n') + sensor_buffer[strlen(sensor_buffer) - 1] = '\0'; // remove newline at end + strcat(buffer, sensor_buffer); // no need to remove newline at end + + fprintf(stderr, "pi_sensors string: %s\n", buffer); +*/ + if (strncmp(buffer, "OK BME280 0.0 0.0 0.0 0.0 MPU6050 0.0 0.0 0.0 0.0 0.0 0.0 GPS 0.0 0.0 0.0", 57) == 0) + return (0); + else + return (1); +} From 876e1c011de49e6fcf5e18cfb9ca33dde2ba09ee Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 14:56:22 -0500 Subject: [PATCH 553/554] Update main.h resolve merge conflicts --- main.h | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 155 insertions(+), 14 deletions(-) diff --git a/main.h b/main.h index 068d45d6..dfa37b2e 100644 --- a/main.h +++ b/main.h @@ -13,6 +13,7 @@ #include #include //#include "TelemEncoding.h" +#include "codecAO40.h" #include #include #include @@ -38,26 +39,35 @@ #define PRES 3 #define ALT 4 #define HUMI 5 -#define GYRO_X 7 // MPU6050 is posisition 6 +#define GYRO_X 7 // MPU6050 label is posisition 6 #define GYRO_Y 8 #define GYRO_Z 9 #define ACCEL_X 10 #define ACCEL_Y 11 #define ACCEL_Z 12 -#define GPS1 14 // GPS is position 13 -#define GPS2 15 -#define GPS3 16 -#define DTEMP 18 // TMP is position 17 +#define GPS 13 // GPS label +#define GPS1 14 // latitude +#define GPS2 15 // longitude +#define GPS3 16 // altitude +#define DTEMP 18 // TMP label is position 17 #define XS1 20 // NEW user defined token will be position 19 #define XS2 21 #define XS3 22 -#define SENSOR_FIELDS 26 +#define NEW_SENSOR_FIELDS_MAX 6 +#define SENSOR_FIELDS (26 + 6) +#define FC_EPS 1 +#define FC_BOB 25 +#define FC_SW 50 +#define FC_PAYLOAD 55 +#define X 0 +#define Y 1 +#define Z 2 #define RSSI 0 #define IHU_TEMP 2 #define SPIN 1 -#define OFF - 1 +#define OFF -1 #define ON 1 #define CHECK 0 #define DISABLED 0 @@ -68,14 +78,12 @@ uint32_t tx_freq_hz = 434900000 + FREQUENCY_OFFSET; uint8_t data[1024]; uint32_t tx_channel = 0; -ax5043_conf_t hax5043; -ax25_conf_t hax25; - int twosToInt(int val, int len); float toAprsFormat(float input); float rnd_float(double min, double max); void get_tlm(); void get_tlm_fox(); +void get_tlm_fc(); int encodeA(short int * b, int index, int val); int encodeB(short int * b, int index, int val); void config_x25(); @@ -86,12 +94,16 @@ void update_rs(unsigned char parity[32], unsigned char c); void write_little_endian(unsigned int word, int num_bytes, FILE *wav_file); static int init_rf(); extern int Encode_8b10b[][256]; +extern const unsigned char ALPHA_TO[]; +// const unsigned char *CCodecAO40::encode(unsigned char *source_bytes, int byte_count); void program_radio(); +void socket_send(int length); int socket_open = 0; int sock = 0; int loop = -1, loop_count = 0; int firstTime = ON; // 0; +int secondTime = ON; long start; int testCount = 0; long time_start; @@ -100,6 +112,9 @@ FILE * file1; short int buffer[2336400]; // max size for 10 frames count of BPSK FILE *sopen(const char *program); FILE *telem_file; +long int sequence = 0; +int image_id = 0; +FILE *image_file; #define S_RATE (48000) // (44100) @@ -108,11 +123,28 @@ FILE *telem_file; #define BPSK 3 #define SSTV 4 #define CW 5 +#define FC 6 +#define REPEATER 7 #define PACSAT 8 #define REPEATER 11 #define TXCOMMAND 12 #define PACSATGND 13 +#define FAIL_COUNT 11 +#define FAIL_NONE -1 +#define FAIL_UNPLUG 1 +#define FAIL_SOLAR 2 +#define FAIL_DEGRADE 3 +#define FAIL_SHORT 4 +#define FAIL_I2C1 5 +#define FAIL_I2C3 6 +#define FAIL_CAMERA 7 +#define FAIL_PAYLOAD 8 +#define FAIL_BME 9 +#define FAIL_MPU 10 +#define FAIL_AUDIO 11 +int failureMode = FAIL_NONE; + int transmitStatus = -1; float amplitude; // = ; // 20000; // 32767/(10%amp+5%amp+100%amp) @@ -137,6 +169,8 @@ long int uptime; char call[5]; char sim_yes[10]; char hab_yes[10]; +char fail_yes[10]; +int fail_time = 60; int squelch = 3; // default squelch char rx[12], tx[12]; int tx_pl = 0; @@ -147,16 +181,16 @@ float sleepTime; unsigned int sampleTime = 0; int frames_sent = 0; int cw_id = ON; -int vB4 = FALSE, vB5 = FALSE, vB3 = FALSE, ax5043 = FALSE, transmit = FALSE, onLed, onLedOn, onLedOff, txLed, txLedOn, txLedOff, payload = OFF; +int transmit = FALSE, onLed, onLedOn, onLedOff, txLed, txLedOn, txLedOff, payload = OFF; // float voltageThreshold = 3.6, batteryVoltage = 4.5, batteryCurrent = 0, currentThreshold = 100; -float voltageThreshold = 3.5, batteryVoltage = 4.5, batteryCurrent = 0, currentThreshold = 100; +float voltageThreshold = 3.50, batteryVoltage = 4.5, batteryCurrent = 0, currentThreshold = 100; float latitude = 39.027702f, longitude = -77.078064f; float lat_file, long_file; double cpuTemp; int frameTime; long int newGpsTime; -float axis[3], angle[3], volts_max[3], amps_max[3], batt, speed, period, tempS, temp_max, temp_min, eclipse; +float axis[3], angle[3], volts_max[3], amps_max[3], batt, speed, period, tempS, temp_max, temp_min, eclipse, atmosphere, tempP, altSP, presP, altGP, humiP, changeP; int i2c_bus0 = OFF, i2c_bus1 = OFF, i2c_bus3 = OFF, camera = OFF, sim_mode = FALSE, SafeMode = FALSE; int rxAntennaDeployed = 0, txAntennaDeployed = 0, c2cStatus = 0; int sim_config = FALSE; // sim mode not set by configuration @@ -164,11 +198,12 @@ double eclipse_time; float voltage[9], current[9], sensor[SENSOR_FIELDS], other[3]; char sensor_payload[500]; +char sensor_string[SENSOR_FIELDS][32]; int test_i2c_bus(int bus); //const char pythonCmd[] = "python3 -u /home/pi/CubeSatSim/python/voltcurrent.py "; -const char pythonCmd[] = "python3 -u /home/pi/CubeSatSim/ina219.py "; +const char pythonCmd[] = "/home/pi/venv/bin/python3 -u /home/pi/CubeSatSim/ina219.py "; char pythonStr[100], pythonConfigStr[100], busStr[10]; int map[8] = {0, 1, 2, 3, 4, 5, 6, 7}; char src_addr[5] = ""; @@ -200,8 +235,114 @@ int pi_zero_2_offset = 0; int hab_mode = FALSE; +int fail_rnd_mode = FALSE; int battery_saver_mode = FALSE; long int loopTime; +long int failTime = 0; +int gps_status = OFF; int error_count = 0; int groundCommandCount = 0; + + unsigned char m_RS_block[RSBLOCKS][NROOTS]; /* RS parity blocks */ + unsigned char m_encoded[SYMPBLOCK] ; /* encoded symbols */ + int m_encoded_bytes; /* Byte counter for encode_data() */ + int m_ileaver_index; /* Byte counter for interleaver */ + unsigned char m_conv_sr; /* Convolutional encoder shift register state */ + +void sensor_setup(); // defined in sensor_extension.c +int sensor_loop(char *sensor_buffer); // defined in sensor_extension.c +int pi_sensors(char *buffer); // used to read BME and MPU sensor if connected to Pi + +// from funcubeLib/common/fecConstants.h + +const unsigned char RS_poly[] = { + 249, 59, 66, 4, 43,126,251, 97, 30, 3,213, 50, 66,170, 5, 24 +}; + +/* Tables for RS decoder */ +/* Galois field log/antilog tables */ +const unsigned char ALPHA_TO[] = +{ + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x87, 0x89, 0x95, 0xad, 0xdd, 0x3d, 0x7a, 0xf4, + 0x6f, 0xde, 0x3b, 0x76, 0xec, 0x5f, 0xbe, 0xfb, 0x71, 0xe2, 0x43, 0x86, 0x8b, 0x91, 0xa5, 0xcd, + 0x1d, 0x3a, 0x74, 0xe8, 0x57, 0xae, 0xdb, 0x31, 0x62, 0xc4, 0x0f, 0x1e, 0x3c, 0x78, 0xf0, 0x67, + 0xce, 0x1b, 0x36, 0x6c, 0xd8, 0x37, 0x6e, 0xdc, 0x3f, 0x7e, 0xfc, 0x7f, 0xfe, 0x7b, 0xf6, 0x6b, + 0xd6, 0x2b, 0x56, 0xac, 0xdf, 0x39, 0x72, 0xe4, 0x4f, 0x9e, 0xbb, 0xf1, 0x65, 0xca, 0x13, 0x26, + 0x4c, 0x98, 0xb7, 0xe9, 0x55, 0xaa, 0xd3, 0x21, 0x42, 0x84, 0x8f, 0x99, 0xb5, 0xed, 0x5d, 0xba, + 0xf3, 0x61, 0xc2, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, + 0x47, 0x8e, 0x9b, 0xb1, 0xe5, 0x4d, 0x9a, 0xb3, 0xe1, 0x45, 0x8a, 0x93, 0xa1, 0xc5, 0x0d, 0x1a, + 0x34, 0x68, 0xd0, 0x27, 0x4e, 0x9c, 0xbf, 0xf9, 0x75, 0xea, 0x53, 0xa6, 0xcb, 0x11, 0x22, 0x44, + 0x88, 0x97, 0xa9, 0xd5, 0x2d, 0x5a, 0xb4, 0xef, 0x59, 0xb2, 0xe3, 0x41, 0x82, 0x83, 0x81, 0x85, + 0x8d, 0x9d, 0xbd, 0xfd, 0x7d, 0xfa, 0x73, 0xe6, 0x4b, 0x96, 0xab, 0xd1, 0x25, 0x4a, 0x94, 0xaf, + 0xd9, 0x35, 0x6a, 0xd4, 0x2f, 0x5e, 0xbc, 0xff, 0x79, 0xf2, 0x63, 0xc6, 0x0b, 0x16, 0x2c, 0x58, + 0xb0, 0xe7, 0x49, 0x92, 0xa3, 0xc1, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, 0xc7, 0x09, 0x12, 0x24, + 0x48, 0x90, 0xa7, 0xc9, 0x15, 0x2a, 0x54, 0xa8, 0xd7, 0x29, 0x52, 0xa4, 0xcf, 0x19, 0x32, 0x64, + 0xc8, 0x17, 0x2e, 0x5c, 0xb8, 0xf7, 0x69, 0xd2, 0x23, 0x46, 0x8c, 0x9f, 0xb9, 0xf5, 0x6d, 0xda, + 0x33, 0x66, 0xcc, 0x1f, 0x3e, 0x7c, 0xf8, 0x77, 0xee, 0x5b, 0xb6, 0xeb, 0x51, 0xa2, 0xc3, 0x00, +}; + +const unsigned char INDEX_OF[]= +{ + 0xff, 0x00, 0x01, 0x63, 0x02, 0xc6, 0x64, 0x6a, 0x03, 0xcd, 0xc7, 0xbc, 0x65, 0x7e, 0x6b, 0x2a, + 0x04, 0x8d, 0xce, 0x4e, 0xc8, 0xd4, 0xbd, 0xe1, 0x66, 0xdd, 0x7f, 0x31, 0x6c, 0x20, 0x2b, 0xf3, + 0x05, 0x57, 0x8e, 0xe8, 0xcf, 0xac, 0x4f, 0x83, 0xc9, 0xd9, 0xd5, 0x41, 0xbe, 0x94, 0xe2, 0xb4, + 0x67, 0x27, 0xde, 0xf0, 0x80, 0xb1, 0x32, 0x35, 0x6d, 0x45, 0x21, 0x12, 0x2c, 0x0d, 0xf4, 0x38, + 0x06, 0x9b, 0x58, 0x1a, 0x8f, 0x79, 0xe9, 0x70, 0xd0, 0xc2, 0xad, 0xa8, 0x50, 0x75, 0x84, 0x48, + 0xca, 0xfc, 0xda, 0x8a, 0xd6, 0x54, 0x42, 0x24, 0xbf, 0x98, 0x95, 0xf9, 0xe3, 0x5e, 0xb5, 0x15, + 0x68, 0x61, 0x28, 0xba, 0xdf, 0x4c, 0xf1, 0x2f, 0x81, 0xe6, 0xb2, 0x3f, 0x33, 0xee, 0x36, 0x10, + 0x6e, 0x18, 0x46, 0xa6, 0x22, 0x88, 0x13, 0xf7, 0x2d, 0xb8, 0x0e, 0x3d, 0xf5, 0xa4, 0x39, 0x3b, + 0x07, 0x9e, 0x9c, 0x9d, 0x59, 0x9f, 0x1b, 0x08, 0x90, 0x09, 0x7a, 0x1c, 0xea, 0xa0, 0x71, 0x5a, + 0xd1, 0x1d, 0xc3, 0x7b, 0xae, 0x0a, 0xa9, 0x91, 0x51, 0x5b, 0x76, 0x72, 0x85, 0xa1, 0x49, 0xeb, + 0xcb, 0x7c, 0xfd, 0xc4, 0xdb, 0x1e, 0x8b, 0xd2, 0xd7, 0x92, 0x55, 0xaa, 0x43, 0x0b, 0x25, 0xaf, + 0xc0, 0x73, 0x99, 0x77, 0x96, 0x5c, 0xfa, 0x52, 0xe4, 0xec, 0x5f, 0x4a, 0xb6, 0xa2, 0x16, 0x86, + 0x69, 0xc5, 0x62, 0xfe, 0x29, 0x7d, 0xbb, 0xcc, 0xe0, 0xd3, 0x4d, 0x8c, 0xf2, 0x1f, 0x30, 0xdc, + 0x82, 0xab, 0xe7, 0x56, 0xb3, 0x93, 0x40, 0xd8, 0x34, 0xb0, 0xef, 0x26, 0x37, 0x0c, 0x11, 0x44, + 0x6f, 0x78, 0x19, 0x9a, 0x47, 0x74, 0xa7, 0xc1, 0x23, 0x53, 0x89, 0xfb, 0x14, 0x5d, 0xf8, 0x97, + 0x2e, 0x4b, 0xb9, 0x60, 0x0f, 0xed, 0x3e, 0xe5, 0xf6, 0x87, 0xa5, 0x17, 0x3a, 0xa3, 0x3c, 0xb7, +}; + +/* 8-bit parity table */ +const unsigned char Partab[] = { + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, +}; + +/* Scramble byte table */ +const unsigned char Scrambler[]= +{ + 0xff, 0x48, 0x0e, 0xc0, 0x9a, 0x0d, 0x70, 0xbc, 0x8e, 0x2c, 0x93, 0xad, 0xa7, 0xb7, 0x46, 0xce, + 0x5a, 0x97, 0x7d, 0xcc, 0x32, 0xa2, 0xbf, 0x3e, 0x0a, 0x10, 0xf1, 0x88, 0x94, 0xcd, 0xea, 0xb1, + 0xfe, 0x90, 0x1d, 0x81, 0x34, 0x1a, 0xe1, 0x79, 0x1c, 0x59, 0x27, 0x5b, 0x4f, 0x6e, 0x8d, 0x9c, + 0xb5, 0x2e, 0xfb, 0x98, 0x65, 0x45, 0x7e, 0x7c, 0x14, 0x21, 0xe3, 0x11, 0x29, 0x9b, 0xd5, 0x63, + 0xfd, 0x20, 0x3b, 0x02, 0x68, 0x35, 0xc2, 0xf2, 0x38, 0xb2, 0x4e, 0xb6, 0x9e, 0xdd, 0x1b, 0x39, + 0x6a, 0x5d, 0xf7, 0x30, 0xca, 0x8a, 0xfc, 0xf8, 0x28, 0x43, 0xc6, 0x22, 0x53, 0x37, 0xaa, 0xc7, + 0xfa, 0x40, 0x76, 0x04, 0xd0, 0x6b, 0x85, 0xe4, 0x71, 0x64, 0x9d, 0x6d, 0x3d, 0xba, 0x36, 0x72, + 0xd4, 0xbb, 0xee, 0x61, 0x95, 0x15, 0xf9, 0xf0, 0x50, 0x87, 0x8c, 0x44, 0xa6, 0x6f, 0x55, 0x8f, + 0xf4, 0x80, 0xec, 0x09, 0xa0, 0xd7, 0x0b, 0xc8, 0xe2, 0xc9, 0x3a, 0xda, 0x7b, 0x74, 0x6c, 0xe5, + 0xa9, 0x77, 0xdc, 0xc3, 0x2a, 0x2b, 0xf3, 0xe0, 0xa1, 0x0f, 0x18, 0x89, 0x4c, 0xde, 0xab, 0x1f, + 0xe9, 0x01, 0xd8, 0x13, 0x41, 0xae, 0x17, 0x91, 0xc5, 0x92, 0x75, 0xb4, 0xf6, 0xe8, 0xd9, 0xcb, + 0x52, 0xef, 0xb9, 0x86, 0x54, 0x57, 0xe7, 0xc1, 0x42, 0x1e, 0x31, 0x12, 0x99, 0xbd, 0x56, 0x3f, + 0xd2, 0x03, 0xb0, 0x26, 0x83, 0x5c, 0x2f, 0x23, 0x8b, 0x24, 0xeb, 0x69, 0xed, 0xd1, 0xb3, 0x96, + 0xa5, 0xdf, 0x73, 0x0c, 0xa8, 0xaf, 0xcf, 0x82, 0x84, 0x3c, 0x62, 0x25, 0x33, 0x7a, 0xac, 0x7f, + 0xa4, 0x07, 0x60, 0x4d, 0x06, 0xb8, 0x5e, 0x47, 0x16, 0x49, 0xd6, 0xd3, 0xdb, 0xa3, 0x67, 0x2d, + 0x4b, 0xbe, 0xe6, 0x19, 0x51, 0x5f, 0x9f, 0x05, 0x08, 0x78, 0xc4, 0x4a, 0x66, 0xf5, 0x58, 0xff, + 0x48, 0x0e, 0xc0, 0x9a, 0x0d, 0x70, 0xbc, 0x8e, 0x2c, 0x93, 0xad, 0xa7, 0xb7, 0x46, 0xce, 0x5a, + 0x97, 0x7d, 0xcc, 0x32, 0xa2, 0xbf, 0x3e, 0x0a, 0x10, 0xf1, 0x88, 0x94, 0xcd, 0xea, 0xb1, 0xfe, + 0x90, 0x1d, 0x81, 0x34, 0x1a, 0xe1, 0x79, 0x1c, 0x59, 0x27, 0x5b, 0x4f, 0x6e, 0x8d, 0x9c, 0xb5, + 0x2e, 0xfb, 0x98, 0x65, 0x45, 0x7e, 0x7c, 0x14, 0x21, 0xe3, 0x11, 0x29, 0x9b, 0xd5, 0x63, 0xfd, +}; From 04dda2aadfcef2fe3f52aae88521b2bf76cabc11 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 5 Mar 2026 15:56:29 -0500 Subject: [PATCH 554/554] Update transmit.py resolve merge conflicts --- transmit.py | 737 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 456 insertions(+), 281 deletions(-) diff --git a/transmit.py b/transmit.py index 602dd3cd..57feed85 100644 --- a/transmit.py +++ b/transmit.py @@ -3,13 +3,99 @@ import RPi.GPIO as GPIO from RPi.GPIO import output #import subprocess -#import time +import time from time import sleep #import os import sys from os import system +from os import path from PIL import Image, ImageDraw, ImageFont, ImageColor import serial +import random +import subprocess + +def output(pin, value): + if (pin != 20): + command = "gpio -g write " + str(pin) + " " + str(value) + system(command) + print(command) + else: # ptt pin + GPIO.output(pin, value) + +def input(pin): + # command = "gpio -g read " + str(pin) + query = ["gpio", "-g", "read", str(pin)] # Read GPIO pin + try: + result = subprocess.run(query, capture_output=True, text=True, check=True) + print(f"Command run was: {query}") + print("Sucess!") + print(f"Output of the command (stdout): {result.stdout}") + return int(result.stdout) + except subprocess.CalledProcessError as e: + print(f"Command failed with return code: {e.returncode}") + print(f"Command run was: {e.cmd}") + print(f"Output of the command (stdout): {e.stdout}") + print(f"Error output of the command (stderr): {e.stderr}") + return -1 + +def setup(pin, config): + if config == "in" or config == "out" or config == "up" or config == "down": + if (pin != 20): + command = "gpio -g mode " + str(pin) + " " + config + system(command) + print(command) + else: # ptt pin + GPIO.setwarnings(False) + GPIO.setmode(GPIO.BCM) + if config == "out: + GPIO.setup(27, GPIO.OUT) + else: + GPIO.setup(27, GPIO.IN) + else: + print(f"Unknown GPIO setup configuration: {config}") + +def blink(times): + powerPin = 16 + for i in range(times): + system("gpio -g write " + str(powerPin) + " 0") # blink two times + sleep(0.1) + system("gpio -g write " + str(powerPin) + " 1") + sleep(0.1) + +def sim_failure_check(): + try: + global card + global cam_fail + global sim_mode + global sim_config + cam_fail = False + file = open("/home/pi/CubeSatSim/failure_mode.txt") + fail_mode = int(file.read(2)) +# print("Fail_mode: ") +# print(fail_mode) + if (fail_mode == 11): + card = "Device" # Change audio so no FM audio plays + print("Failure mode no FM audio") + sim_mode = True + elif (fail_mode == 7): + cam_fail = True + print("Failure mode camera fail") + sim_mode = True + card = "Headphones" + elif (fail_mode == -1): + print("No failure mode") + card = "Headphones" + if sim_config: + sim_mode = True + else: + print("Other failure mode") + card = "Headphones" + sim_mode = True + except: + print("No failure mode") + card = "Headphones" + if sim_config: + sim_mode = True def battery_saver_check(): try: @@ -22,6 +108,14 @@ def battery_saver_check(): except: print("battery saver not activated") # txc = True + +def blink(times): + powerPin = 16 + for i in range(times): + output(powerPin, 0) # blink + sleep(0.1) + output(powerPin, 1) + sleep(0.1) def increment_mode(): print("increment mode") @@ -38,76 +132,26 @@ def increment_mode(): print(mode) if (mode == 'a'): mode = 'f' - GPIO.output(powerPin, 0) # blink two times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) + blink(2) sleep(2.5) elif (mode == 'f'): mode = 'b' - GPIO.output(powerPin, 0) # blink three times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) + blink(3) sleep(2.5) elif (mode == 'b'): mode = 's' - GPIO.output(powerPin, 0) # blink four times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) + blink(4) sleep(2.5) elif (mode == 's'): mode = 'm' - GPIO.output(powerPin, 0) # blink five times - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1); - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) - sleep(0.1) - GPIO.output(powerPin, 0) - sleep(0.1) - GPIO.output(powerPin, 1) + blink(5) sleep(2.5) else: mode = 'a' - GPIO.output(powerPin, 0) # blink one time - sleep(0.1) - GPIO.output(powerPin, 1) + blink(1) sleep(2.5) try: @@ -117,13 +161,13 @@ def increment_mode(): file.close() print(".mode file written") - GPIO.setwarnings(False) - GPIO.output(txLed, 0) - GPIO.output(powerPin, 0) +# GPIO.setwarnings(False) + output(txLed, 0) + output(powerPin, 0) print("sudo reboot -h now") - GPIO.setwarnings(False) - GPIO.setup(powerPin, GPIO.OUT) - GPIO.output(powerPin, 0); +# GPIO.setwarnings(False) + setup(powerPin, "out") + output(powerPin, 0); # system("reboot -h now") # release = True; @@ -135,8 +179,57 @@ def increment_mode(): except: print("can't write to .mode file") +def camera_photo(): + global cam_fail + global os_status + sim_failure_check() + system("sudo rm /home/pi/CubeSatSim/camera_out.jpg") + stored_image = False + try: + if os_status == "bookworm": + system("rpicam-still -o /home/pi/CubeSatSim/camera_out.jpg --width 320 --height 256") # > /dev/null 2>&1") + else: + system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") + f = open("/home/pi/CubeSatSim/camera_out.jpg") + f.close() + print("Photo taken") + if (cam_fail == True): + system("cp /home/pi/CubeSatSim/sstv//sstv_image_2_320_x_256.jpeg /home/pi/CubeSatSim/camera_out.jpg") + print("Using stored image") + stored_image = True + except: + system("cp /home/pi/CubeSatSim/sstv//sstv_image_2_320_x_256.jpeg /home/pi/CubeSatSim/camera_out.jpg") + print("Using stored image") + stored_image = True + if (stored_image == False): + file='/home/pi/CubeSatSim/camera_out.jpg' + font1 = ImageFont.truetype('DejaVuSerif.ttf', 20) + font2 = ImageFont.truetype('DejaVuSerif-Bold.ttf', 16) + + try: + filep = open("/home/pi/CubeSatSim/telem_string.txt") + telem_string = filep.readline() + except: + telem_string = "" + if (debug_mode == 1): + print("Can't read telem_string.txt") + print(telem_string) + + img = Image.open(file) + draw = ImageDraw.Draw(img) + # draw.text((10, 10), callsign, font=font2, fill='white') + # draw.text((120, 10), telem_string, font=font2, fill='white') + draw.text((12, 12), callsign, font=font1, fill='black') + draw.text((10, 10), callsign, font=font1, fill='white') + draw.text((112, 12), telem_string, font=font2, fill='black') # was 122 + draw.text((110, 10), telem_string, font=font2, fill='white') # was 120 + img.save(file) -print("CubeSatSim v2.1 transmit.py starting...") + return True + else: + return False + +print("CubeSatSim v2.2 transmit.py starting...") pd = 21 ptt = 20 @@ -147,20 +240,18 @@ powerPin = 16 command_tx = True -GPIO.setmode(GPIO.BCM) -GPIO.setwarnings(False) -GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_UP) -GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) -GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP) -GPIO.setup(txc_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) -GPIO.setup(green, GPIO.OUT) -GPIO.output(powerPin, 1) +# GPIO.setmode(GPIO.BCM) +# GPIO.setwarnings(False) +setup(13, "up") +setup(12, "up") +setup(27, "up") +setup(txc_pin, "up") +setup(green, "out") +output(powerPin, 1) transmit = False txLed = 27 -txLedOn = 1 -txLedOff = 0 -if GPIO.input(12) == False: +if input(12) == False: print("LPF present") transmit = True else: @@ -168,38 +259,38 @@ else: # GPIO.setup(txLed, GPIO.OUT) -# output(txLed, txLedOff) +# output(txLed, 0) -GPIO.setmode(GPIO.BCM) # Repeat to make LED work on Pi 4 -GPIO.setwarnings(False) -GPIO.setup(txLed, GPIO.OUT) +# GPIO.setmode(GPIO.BCM) # Repeat to make LED work on Pi 4 +# GPIO.setwarnings(False) +setup(txLed, "out") -GPIO.setup(pd, GPIO.OUT) +setup(pd, "out") #output(pd, 1) output(pd, 0) -GPIO.setup(ptt, GPIO.OUT) +setup(ptt, "out") output (ptt, 1) txc = False -if GPIO.input(txc_pin) == False: +if input(txc_pin) == False: print("TXC is present") txc = True; else: print("TXC not present") # txc = False # forcing it off -output(txLed, txLedOn) +output(txLed, 1) sleep(1) -output(txLed, txLedOff) +output(txLed, 0) battery_saver_check() -# print(txLedOn) +# print(1) print(txLed) # GPIO.setup(27, GPIO.OUT) # GPIO.output(27, 0) -debug_mode = 0 #no debugging transmit +debug_mode = 0 # change to 1 to debug transmit skip = False @@ -218,6 +309,14 @@ if __name__ == "__main__": print(transmit) + uptime_time = 55 # 55 second boot time if Pi Zero + try: + f = open("/home/pi/CubeSatSim/pi_zero2", "r") + f.close() + print("Pi Zero 2 detected!") + uptime_time = 30 # 30 second boot time if Pi Zero 2 + except: + print("Pi Zero 2 not detected") try: system("cat /proc/uptime > /home/pi/CubeSatSim/uptime") @@ -226,14 +325,16 @@ if __name__ == "__main__": print(up) uptime = float(up) print(uptime) - if (uptime < 45): - print("Uptime < 45 seconds") + if (uptime < uptime_time): + print("Uptime < threshold seconds") else: - print("Uptime > 45 seconds") + print("Uptime > threshold seconds") + print("Skip CW ID") skip = True file.close() except: print("Can't open /proc/uptime") + print(skip) if ( mode == "y"): try: @@ -277,29 +378,53 @@ if __name__ == "__main__": rx_value = '0' sq = '0' tx = '434.9000' - rx = '435.0000' + rx = '435.0000' + txr = '144.9000' + sim_mode = False + sim_config = False + hab_mode = False try: file = open("/home/pi/CubeSatSim/sim.cfg") # callsign = file.readline().split(" ")[0] config = file.readline().split() callsign = config[0] + if len(config) > 4: + if config[4] == 'y' or config[4] == 'yes': + sim_mode = True + sim_config = True + print("Simulated telemetry mode is configured") + else: + try: + if path.isfile("/home/pi/CubeSatSim/sim_mode_auto"): + print("Simulated telemetry mode automatically turned on!") + sim_mode = True + sim_config = True + except: + if (debug_mode == 1): + print("/home/pi/CubeSatSim/sim_mode_auto not found") if len(config) > 5: if (mode != 'p') and (mode != 'P'): # squelch off for Pacsat sq = config[5] print(f'squelch: {sq}') if len(config) > 6: - txf = float(config[6]) -# print(txf) -# print( "{:.4f}".format(txf)) - tx = "{:.4f}".format(txf) - print(tx) + txf = float(config[6]) + if (mode == 'e'): + txr = (txf - 290.0) # - 0.1 # Cross Band Repeater mode transmit frequency in 2m band + tx = "{:.4f}".format(txr) + else: + tx = "{:.4f}".format(txf) + print("Transmit frequency: ",tx) if len(config) > 7: rxf = float(config[7]) # print(rxf) # print( "{:.4f}".format(rxf)) rx = "{:.4f}".format(rxf) print(rx) + if len(config) > 8: + if config[8] == 'y' or config[8] == 'yes': + hab_mode = True + print("Balloon (HAB) mode is configured.") if len(config) > 9: rxpl = float(config[9]) # print(rxpl) @@ -316,11 +441,11 @@ if __name__ == "__main__": print # print(callsign) print(sq) - if sq == '8': - print("squelch set to 8, no command input!") - no_command = True - else: - no_command = False +# if sq == '8': +# print("squelch set to 8, no command input!") +# no_command = True +# else: + no_command = False print(no_command) except: callsign = "AMSAT" @@ -328,92 +453,119 @@ if __name__ == "__main__": print("Can't read callsign from sim.cfg file, defaulting to AMSAT") file.close() - if (mode != 'p') and (mode != 'P'): - try: - f = open("/home/pi/CubeSatSim/command_control", "r") - f.close() - GPIO.setmode(GPIO.BCM) - GPIO.setwarnings(False) - GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected - if GPIO.input(squelch) == False: - print("squelch not set correctly, no command input!") - no_command = True - else: + no_command = True + try: + f = open("/home/pi/CubeSatSim/command_control", "r") + f.close() +# GPIO.setmode(GPIO.BCM) +# GPIO.setwarnings(False) + setup(squelch, "up") ## pull up in case pin is not connected + if input(squelch) == False: + print("squelch not set correctly, no command input!") + else: + if (mode != 'n') and (mode != 'x'): print("command and control is activated") no_command = False - # system("/home/pi/CubeSatSim/command &") system("sudo systemctl start command") - except: - print("command and control not activated") - no_command = True - + else: + print("Command and control not activated since Transmit Commands mode") + txc = True # Transmit commands only works with FM transceiver, so bypass Battery Saver if activated + except: + print("command and control not activated") + print(callsign) - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 - print(txLed) - print(txLedOn) - GPIO.setup(txLed, GPIO.OUT) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 +# print(txLed) +# print(1) +# setup(txLed, "out") + query = ["grep", "VERSION_CODENAME=bullseye", "/etc/os-release"] + try: + result = subprocess.run(query, capture_output=True, text=True, check=True) + print(f"Command run was: {query}") + os_status = result.stdout.strip() + print(f"Output of the command (stdout): {os_status}") + except subprocess.CalledProcessError as e: +# print(f"Command failed with return code: {e.returncode}") + print(f"Command run was: {e.cmd}") + os_status = e.stdout.strip() + print(f"Output of the command (stdout): {e.stdout}") +# print(f"Error output of the command (stderr): {e.stderr}") + if os_status != "VERSION_CODENAME=bullseye": + os_status = "bookworm" + else: + os_status = "bullseye" + print (os_status) + card = "Headphones" # default using pcm audio output of Pi Zero # card = "Device" # using USB sound card for audio output - print("Programming FM module!\n"); - output(pd, 1) - output (ptt, 1) + query = ["sudo", "systemctl", "is-active", "gpsd.socket"] try: - ser = serial.Serial("/dev/ttyAMA0", 9600) - print(ser.portstr) -# uhf_string = "AT+DMOSETGROUP=0," + rx +"," + tx + ",0,3,0,0\r\n" - uhf_string = "AT+DMOSETGROUP=0," + rx + "," + tx + "," + rxpl_value + "," + sq + "," + txpl_value + ",0\r\n" - print(uhf_string) - for i in range(6): -# ser.write(b"AT+DMOSETGROUP=0,435.0000,434.9000,0,3,0,0\r\n") - ser.write(uhf_string.encode()) - sleep(0.1) - ser.close() - ser = serial.Serial("/dev/ttyAMA0", 115200) # reset back to 115200 for cubesatsim code for payload sensor data - except: - print("Error in serial write") - output(pd, 0) - -# if (mode != 'x') and (skip == False): -# sleep(10) # delay so cubesatsim code catches up - - system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1") - -# command_control_check() - -# if (mode != ) and (command_tx == True): -# if (command_tx == True): - if ((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'p') or (mode == 'P')) and (command_tx == True) and (skip == False): -# battery_saver_mode - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) -# if (txc): -# output(pd, 1) -# output (ptt, 0) -# sleep(0.1) -# system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/morse.wav") -# sleep(0.1) -# output (ptt, 1) -# output(pd, 0) -# else: - if (True): + result = subprocess.run(query, capture_output=True, text=True, check=True) + print(f"Command run was: {query}") + gpsd_status = result.stdout.strip() + print(f"Output of the command (stdout): {gpsd_status}") + except subprocess.CalledProcessError as e: +# print(f"Command failed with return code: {e.returncode}") + print(f"Command run was: {e.cmd}") + gpsd_status = e.stdout.strip() + print(f"Output of the command (stdout): {e.stdout}") +# print(f"Error output of the command (stderr): {e.stderr}") + + if (mode != 'e'): + + if (gpsd_status == "active"): + print("Stopping gpsd.socket") + system("sudo systemctl stop gpsd.socket") + print("Programming FM module!\n"); + output(pd, 1) + output (ptt, 1) + try: + ser = serial.Serial("/dev/ttyAMA0", 9600) + print(ser.portstr) + # uhf_string = "AT+DMOSETGROUP=0," + rx +"," + tx + ",0,3,0,0\r\n" + uhf_string = "AT+DMOSETGROUP=0," + rx + "," + tx + "," + rxpl_value + "," + sq + "," + txpl_value + ",0\r\n" + print(uhf_string) + for i in range(6): + # ser.write(b"AT+DMOSETGROUP=0,435.0000,434.9000,0,3,0,0\r\n") + ser.write(uhf_string.encode()) + sleep(0.1) + ser.close() + ser = serial.Serial("/dev/ttyAMA0", 115200) # reset back to 115200 for cubesatsim code for payload sensor data + except: + print("Error in serial write") + output(pd, 0) + if (gpsd_status == "active"): + print("Restarting gpsd.socket") + system("sudo systemctl restart gpsd.socket") + + sim_failure_check() + if (hab_mode == True) and (mode == 'a'): + print("Don't transmit CW ID since APRS HAB mode is active") + else: + if (((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'j') or (mode == 'p') or (mode == 'P')) and (command_tx == True) and (skip == False)) or ((mode == 'e') and (command_tx == True)): # battery_saver_mode +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) + print("Transmit CW ID") + status = "" + if not no_command: + status = status + " C" + if sim_mode: + status = status + " S" if (debug_mode == 1): -# system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") - system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3") + system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3") else: -# system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 > /dev/null 2>&1") - system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") + system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") + output(txLed, 0) + + sleep(1) + else: + print("Don't transmit CW ID since command_tx is False or APRS mode or change of mode") + - output(txLed, txLedOff) - - sleep(1) - else: - print("Don't transmit CW ID since command_tx is False or APRS mode") - if (transmit): - # print 'Length: ', len(sys.argv) # if (len(sys.argv)) > 1: @@ -451,12 +603,13 @@ if __name__ == "__main__": GPIO.output(txLed, 0) print("0") else: - GPIO.output(powerPin, 0) +# GPIO.output(powerPin, 0) print("Transmit APRS Commands") + system("sudo systemctl stop command") # while True: # sleep(0.1) - if (mode != 'n'): - system("touch /home/pi/CubeSatSim/ready") +# if (mode != 'n'): +# system("touch /home/pi/CubeSatSim/ready") while True: try: @@ -467,20 +620,21 @@ if __name__ == "__main__": system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1") system("cat /home/pi/CubeSatSim/t.txt") if (command_tx == True): - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) # output(pd, 1) # output (ptt, 0) # sleep(.1) # # battery_saver_check() if (txc): + sim_failure_check() # output(pd, 1) sleep(0.1) # add delay before transmit output (ptt, 0) sleep(0.3) # add even more time at start - system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/telem.wav") + system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/telem.wav") sleep(0.2) # add more time at end output (ptt, 1) # output(pd, 0) @@ -494,7 +648,7 @@ if __name__ == "__main__": sleep(0.1) # output (ptt, 1) # output(pd, 0) - output(txLed, txLedOff) + output(txLed, 0) system("sudo rm /home/pi/CubeSatSim/ready") f.close() @@ -502,11 +656,12 @@ if __name__ == "__main__": print("Ready for next packet!") sleep(0.5) + except: # command_control_check() sleep(1) elif (mode == 'm'): - system("touch /home/pi/CubeSatSim/cwready") +# system("touch /home/pi/CubeSatSim/cwready") print("CW") while True: # command_control_check() @@ -523,11 +678,12 @@ if __name__ == "__main__": system(command) ## chan = chan + 1 if (command_tx == True): - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) if (txc): + sim_failure_check() # output (pd, 1) sleep(0.3) output (ptt, 0) @@ -539,8 +695,8 @@ if __name__ == "__main__": if (debug_mode == 1): system("cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3") else: - system("cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") - output(txLed, txLedOff) + system("cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") + output(txLed, 0) # command_control_check() sleep(2) @@ -559,7 +715,10 @@ if __name__ == "__main__": # from pysstv.sstv import SSTV # camera = PiCamera() print("Testing for camera") - system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") + if os_status == "bookworm": + system("rpicam-still -o /home/pi/CubeSatSim/camera_out.jpg --width 320 --height 256") # > /dev/null 2>&1") + else: + system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") f = open("/home/pi/CubeSatSim/camera_out.jpg") f.close() print("Camera present") @@ -571,7 +730,7 @@ if __name__ == "__main__": camera_present = 0 # while 1: - output(txLed, txLedOff) + output(txLed, 0) # output (ptt, 1) # output(pd, 0) if (camera_present == 1): @@ -583,12 +742,13 @@ if __name__ == "__main__": if (command_tx == True): print ("Sending SSTV image") - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) # battery_saver_check() if (txc): + sim_failure_check() # output(pd, 1) output (ptt, 0) system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav") @@ -600,42 +760,14 @@ if __name__ == "__main__": else: system("cat /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") - output(txLed, txLedOff) + output(txLed, 0) # sleep(1) except: print("image 2 did not load - copy from CubeSatSim/sstv directory") while 1: # command_control_check() - - system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") - print("Photo taken") - - file='/home/pi/CubeSatSim/camera_out.jpg' - font1 = ImageFont.truetype('DejaVuSerif.ttf', 20) - font2 = ImageFont.truetype('DejaVuSerif-Bold.ttf', 16) - - try: - filep = open("/home/pi/CubeSatSim/telem_string.txt") - telem_string = filep.readline() - except: - telem_string = "" - if (debug_mode == 1): - print("Can't read telem_string.txt") - print(telem_string) - - img = Image.open(file) - draw = ImageDraw.Draw(img) -# draw.text((10, 10), callsign, font=font2, fill='white') -# draw.text((120, 10), telem_string, font=font2, fill='white') - draw.text((12, 12), callsign, font=font1, fill='black') - draw.text((10, 10), callsign, font=font1, fill='white') - draw.text((122, 12), telem_string, font=font2, fill='black') - draw.text((120, 10), telem_string, font=font2, fill='white') - img.save(file) - -# command_control_check() - + camera_photo() system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/camera_out.jpg") system("sudo rm /home/pi/CubeSatSim/camera_out.jpg > /dev/null 2>&1") @@ -643,12 +775,14 @@ if __name__ == "__main__": if (command_tx == True): print ("Sending SSTV image") - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) # battery_saver_check() if (txc): +# print(card) + sim_failure_check() # output(pd, 1) output (ptt, 0) system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/camera_out.jpg.wav") @@ -660,7 +794,7 @@ if __name__ == "__main__": else: system("cat /home/pi/CubeSatSim/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") - output(txLed, txLedOff) + output(txLed, 0) # output (ptt, 1) # output(pd, 0) @@ -679,13 +813,14 @@ if __name__ == "__main__": if (command_tx == True): print ("Sending SSTV image") - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) # battery_saver_check() if (txc): + sim_failure_check() # output(pd, 1) output (ptt, 0) system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg.wav") @@ -697,7 +832,7 @@ if __name__ == "__main__": else: system("cat /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") - output(txLed, txLedOff) + output(txLed, 0) # output (ptt, 1) # output(pd, 0) sleep(1) @@ -716,12 +851,13 @@ if __name__ == "__main__": if (command_tx == True): print ("Sending SSTV image") - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) # battery_saver_check() if (txc): + sim_failure_check() # output(pd, 1) output (ptt, 0) system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg.wav") @@ -733,7 +869,7 @@ if __name__ == "__main__": else: system("cat /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") - output(txLed, txLedOff) + output(txLed, 0) # output (ptt, 1) # output(pd, 0) sleep(10) @@ -746,13 +882,14 @@ if __name__ == "__main__": if (command_tx == True): # command_control_check() - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) # battery_saver_check() if (txc): + sim_failure_check() # output(pd, 1) output (ptt, 0) system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/sstv.wav") @@ -761,102 +898,140 @@ if __name__ == "__main__": else: sleep(60) - output(txLed, txLedOff) + output(txLed, 0) # output (ptt, 1) # output(pd, 0) sleep(10) - elif (mode == 'b'): + elif (mode == 'b') or (mode == 'j'): # command_control_check() - print("BPSK") + if (mode == 'b'): + print("BPSK") + else: + print("FUNcube") print("turn on FM rx") output(pd, 1) output(ptt, 1) - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 - GPIO.setup(txLed, GPIO.OUT) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 +# setup(txLed, "out") if (command_tx == True): # system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.9e6 -t float &") system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f " + tx + "e6 -t float &") print("Turning LED on/off and listening for carrier") + image_id = random.randint(0, 255) + print("Initial image_id: " + str(image_id) + "\n") while 1: - output(txLed, txLedOff) +# print ("LED on") + output(txLed, 0) sleep(0.4) # if (command_tx == False): -# output(txLed, txLedOn) +# output(txLed, 1) # sleep(0.03) -# output(txLed, txLedOff) +# output(txLed, 0) # command_control_check() if (command_tx == True): - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) # print(txLed) -# print(txLedOn) - sleep(4.2) +# print(1) + + if (mode == 'b'): + sleep(4.2) + else: # FUNcube mode image + for i in range(4): +# print("Checking image_file.bin") + try: + file = open("/home/pi/CubeSatSim/image_file.bin") + file.close() + # image_present = True + sleep(1.0) + except: + # image_present = False + + # if (image_present == False): + start = time.perf_counter() + camera_photo() + system("/home/pi/ssdv/ssdv -e -n -i " + str(image_id) + " -q 3 -J /home/pi/CubeSatSim/camera_out.jpg /home/pi/CubeSatSim/image_file.bin") + print("image_id: " + str(image_id) + "\n") + image_id = ( image_id + 1 ) % 256 + print("new image_id: " + str(image_id) + "\n") + elapsed_time = time.perf_counter() - start + print("Elapsed time: ") + print(elapsed_time) + if (elapsed_time < 9): + sleep(9 - time.perf_counter() + start) + # else: + sleep(0.6) elif (mode == 'e'): # code based on https://zr6aic.blogspot.com/2016/11/creating-2m-fm-repeater-with-raspberry.html - print("Repeater") - print("Stopping command and control") - system("sudo systemctl stop command") + print("Cross Band Repeater Mode") +# print("Stopping command and control") +# system("sudo systemctl stop command") print("turn on FM rx") output(pd, 1) output(ptt, 1) - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 - GPIO.setup(txLed, GPIO.OUT) - GPIO.setup(powerPin, GPIO.OUT) - GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected - GPIO.output(powerPin, 0) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 +# setup(txLed, "out") +# GPIO.setup(powerPin, GPIO.OUT) + setup(squelch, "up") ## pull up in case pin is not connected +# GPIO.output(powerPin, 1) # was 0 +# txf = float(tx) - 288.9 +# print("Transmit frequency: ",txf) + if (command_tx != True): + print("Beacon mode off so no repeater transmission") + + print("Ready to detect carrier") while True: - sleep(0.5) - if (GPIO.input(squelch) == False): + if (input(squelch) == False) and (command_tx == True): print("Carrier detected, starting repeater") - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) -# system("arecord -D plughw:CARD=Device,DEV=0 | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 &") -## system("arecord -D plughw:CARD=Device,DEV=0 -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 " + tx + "e3 &") - system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 &") - sleep(1) - system("sudo arecord -D plughw:CARD=Device,DEV=0 -r48000 -fS16_LE -c1 | nc localhost 8011 &") - GPIO.output(powerPin, 1) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) + system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1 &") sleep(0.5) - GPIO.output(powerPin, 0) - while (GPIO.input(squelch) == False): + system("sudo arecord -D shared_mic -r48000 -fS16_LE -c1 | nc localhost 8011 &") + while (input(squelch) == False): sleep(1) print("No carrier detected, stopping repeater") - output(txLed, txLedOff) + output(txLed, 0) + system("sudo rpitx -i null > /dev/null 2>&1") system("sudo killall -9 arecord > /dev/null 2>&1") system("sudo killall -9 nc > /dev/null 2>&1") system("sudo killall -9 rpitx > /dev/null 2>&1") - + print("Resetting audio") + system("sudo /etc/init.d/alsa-utils stop") + system("sudo /etc/init.d/alsa-utils start") + print("Finished resetting audio") + print("Ready to detect carrier") else: print("FSK") print("turn on FM rx") output(pd, 1) output(ptt, 1) - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 - GPIO.setup(txLed, GPIO.OUT) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 +# setup(txLed, "out") if (command_tx == True): system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 &") print("Turning LED on/off and listening for carrier") while 1: - output(txLed, txLedOff) + output(txLed, 0) sleep(0.4) # if (command_tx == False): -# output(txLed, txLedOn) +# output(txLed, 1) # sleep(0.03) -# output(txLed, txLedOff) +# output(txLed, 0) # command_control_check() if (command_tx == True): - GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) - output(txLed, txLedOn) +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# setup(txLed, "out") + output(txLed, 1) # print(txLed) -# print(txLedOn) +# print(1) sleep(4.2) else: print("No Low Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the LPF.")