diff --git a/groundstation/WAV/README.md b/groundstation/WAV/README.md new file mode 100644 index 00000000..fb509f43 --- /dev/null +++ b/groundstation/WAV/README.md @@ -0,0 +1,11 @@ +Audio files for Serenity CubeSat + +These are the 4k8 demodulated outupt. + +You can play them with any audio player. + +If you loopback the audio to an input, you can decode them using DireWolf or SoundModem. + +beacon_test2.wav is a test file provided by Joel Latrell + +packet.wav is a test file I generated. diff --git a/groundstation/WAV/beacon_test_2-48k-loud.wav b/groundstation/WAV/beacon_test_2-48k-loud.wav new file mode 100644 index 00000000..935cfcad Binary files /dev/null and b/groundstation/WAV/beacon_test_2-48k-loud.wav differ diff --git a/groundstation/WAV/beacon_test_2-48k.wav b/groundstation/WAV/beacon_test_2-48k.wav new file mode 100644 index 00000000..d97a7c74 Binary files /dev/null and b/groundstation/WAV/beacon_test_2-48k.wav differ diff --git a/groundstation/WAV/beacon_test_2.wav b/groundstation/WAV/beacon_test_2.wav new file mode 100644 index 00000000..adda907d Binary files /dev/null and b/groundstation/WAV/beacon_test_2.wav differ diff --git a/groundstation/aprs-cubesatsim.sh b/groundstation/aprs-cubesatsim.sh index 4599d9b4..f71a70e3 100755 --- a/groundstation/aprs-cubesatsim.sh +++ b/groundstation/aprs-cubesatsim.sh @@ -35,7 +35,7 @@ value=`aplay -l | grep "Loopback"` echo "$value" > /dev/null 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 | 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 +sleep 5 diff --git a/groundstation/aprs-cubicsdr.sh b/groundstation/aprs-cubicsdr.sh new file mode 100755 index 00000000..bd20f24d --- /dev/null +++ b/groundstation/aprs-cubicsdr.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# script to run CubicSDR and Direwolf to decode APRS + +echo "Script to run CubicSDR and Direwolf for ARISS Radio Pi" + +echo + +sudo killall -9 CubicSDR &>/dev/null + +sleep 5 + +sudo modprobe snd-aloop + +echo "Now run CubicSDR (Under Pi/Hamradio), Select Generic RTL2832 device then click Start to begin." + +echo "Then select File/Session/Open Session then load cubicsdr-aprs-direwolf.xml then Open." + +echo + +echo "Hit enter only when CubicSDR is running" + +read input + +echo + +direwolf -r 48000 -c direwolf.conf -t 0 + +sleep 10 + +#$SHELL diff --git a/groundstation/aprs.desktop b/groundstation/aprs.desktop new file mode 100644 index 00000000..b9ee2512 --- /dev/null +++ b/groundstation/aprs.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=APRS Decode using Direwolf +GenericName=Decodes APRS using rtl_fm and Direwolf +Comment=APRS signals +Exec=/home/pi/CubeSatSim/groundstation/aprs.sh +Icon=/home/pi/Icons/aprs.png +Terminal=true +Type=Application +Categories=HamRadio; +Keywords=APRS;ISS; diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index 315a6ba0..2e1c6873 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -23,7 +23,58 @@ sudo killall -9 java &>/dev/null sudo killall -9 CubicSDR &>/dev/null -echo -e "Script to auto decode APRS packets on 144.390 MHz\n" +echo + +echo "Choose the number for the frequency for APRS decoding:" +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. Enter a frequency in kiloHertz" +echo + +read -r choice + +if [ "$choice" = "1" ]; then + +frequency=144390000 + +elif [ "$choice" = "2" ]; then + +frequency=434900000 + +elif [ "$choice" = "3" ]; then + +frequency=144800000 + +elif [ "$choice" = "4" ]; then + +frequency=145175000 + +else + +echo + +echo "Enter the frequency in kiloHertz" + +echo + +read -r frequency + +frequency=$frequency"000" + +fi + +#echo $frequency + +echo + +echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." + +echo + +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 - @@ -35,8 +86,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 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 diff --git a/groundstation/cubicsdr-aprs-auto.sh b/groundstation/cubicsdr-aprs-auto.sh new file mode 100755 index 00000000..ca6b1807 --- /dev/null +++ b/groundstation/cubicsdr-aprs-auto.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +sudo killall -9 CubicSDR &>/dev/null +sudo killall -9 direwolf &>/dev/null + +sleep 5 + +CubicSDR &>/dev/null & + +sleep 15 + +xdotool mousemove 290 348 click 1 +sleep 1.9 +xdotool mousemove 449 572 click 1 +sleep 1.9 +xdotool mousemove 20 77 click 1 +sleep 1.9 +xdotool mousemove 59 208 +sleep 1.9 +xdotool mousemove 325 208 click 1 +sleep 1.9 +xdotool mousemove 290 487 click 1 +sleep 1.9 +xdotool type "cubicsdr-aprs-direwolf.xml" +sleep 5 +xdotool mousemove 938 568 click 1 +sleep 5 + +direwolf -c direwolf.conf -r 48000 -t 0 + +sleep 5 + + + diff --git a/groundstation/cubicsdr-aprs-direwolf.xml b/groundstation/cubicsdr-aprs-direwolf.xml new file mode 100644 index 00000000..29e2500a --- /dev/null +++ b/groundstation/cubicsdr-aprs-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 144390000 + 2048000 + 0 +
+ + + 12500 + 144390000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/cubicsdr-aprs.sh b/groundstation/cubicsdr-aprs.sh new file mode 100755 index 00000000..4b6e7d4a --- /dev/null +++ b/groundstation/cubicsdr-aprs.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +sudo modprobe snd-aloop + +#if [ ! -d "./direwolf.conf" ]; then + +FILE=direwolf.conf +if [ ! -f "$FILE" ]; then + + wget https://raw.githubusercontent.com/alanbjohnston/CubeSatSim/FIAB-v3/groundstation/direwolf.conf + +fi + +FILE=cubicsdr-aprs-direwolf.xml +if [ ! -f "$FILE" ]; then + + wget https://raw.githubusercontent.com/alanbjohnston/CubeSatSim/FIAB-v3/groundstation/cubicsdr/cubicsdr-aprs-direwolf.xml + +fi + +sudo killall -9 CubicSDR &>/dev/null +sudo killall -9 direwolf &>/dev/null + +sleep 5 + +echo + +echo "Opening CubicSDR... (this will take a few seconds)" + +nohup CubicSDR /dev/null 2>&1 & + +echo + +echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + +echo + +echo "Then select File/Session/Open Session then load /home/pi/CubeSatSim/groundstation/cubicsdr/cubicsdr-aprs-direwolf.xml then Open." + +echo + +echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + +read input + +direwolf -c direwolf.conf -r 48000 -t 0 + +sleep 5 + + + diff --git a/groundstation/cubicsdr-decode.sh b/groundstation/cubicsdr-decode.sh new file mode 100755 index 00000000..1cee856d --- /dev/null +++ b/groundstation/cubicsdr-decode.sh @@ -0,0 +1,183 @@ +#!/bin/sh + +sudo modprobe snd-aloop + +#if [ ! -d "./direwolf.conf" ]; then + +FILE=direwolf.conf +if [ ! -f "$FILE" ]; then + + wget https://raw.githubusercontent.com/alanbjohnston/CubeSatSim/FIAB-v3/groundstation/direwolf.conf + +fi + +FILE=direwolf-4800.conf +if [ ! -f "$FILE" ]; then + + wget https://raw.githubusercontent.com/alanbjohnston/CubeSatSim/FIAB-v3/groundstation/direwolf-4800.conf + +fi + +FILE=cubicsdr-aprs-direwolf.xml +if [ ! -f "$FILE" ]; then + + wget https://raw.githubusercontent.com/alanbjohnston/CubeSatSim/FIAB-v3/groundstation/cubicsdr-aprs-direwolf.xml + +fi + +FILE=cubicsdr-iss-direwolf.xml +if [ ! -f "$FILE" ]; then + + wget https://raw.githubusercontent.com/alanbjohnston/CubeSatSim/FIAB-v3/groundstation/cubicsdr-iss-direwolf.xml + +fi + +FILE=cubicsdr-serenity-direwolf.xml +if [ ! -f "$FILE" ]; then + + wget https://raw.githubusercontent.com/alanbjohnston/CubeSatSim/FIAB-v3/groundstation/cubicsdr-serenity-direwolf.xml + +fi + +sudo killall -9 CubicSDR &>/dev/null +sudo killall -9 direwolf &>/dev/null + +sleep 5 + +echo + +echo "Choose the number for the type of decoding:" +echo +echo "1. APRS US 2m (144.390 MHz)" +echo "2. ISS APRS (145.825 MHz" +echo "3. APRS on some other frequency" +echo "4. Serenity CubeSat 4800 bps (437.1 MHz)" +echo "5. Test Serenity CubeSat decoding with WAV file" + +echo + +read -r choice + + +if [ "$choice" = "1" ]; then + echo + + echo "CubicSDR will load in about 10 sceonds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load /home/pi/CubeSatSim/groundstation/cubicsdr/cubicsdr-aprs-direwolf.xml then Open." + echo "Note that you won't hear anything as the audio is routed to Direwolf for decoding. To hear the signal, change the Audio Out setting." + + echo + + echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + read input + + direwolf -c direwolf.conf -r 48000 -t 0 + +elif [ "$choice" = "2" ]; then + echo + + echo "CubicSDR will load in about 10 sceonds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load cubicsdr-iss-direwolf.xml then Open." + echo "Note that you won't get packets unless the ISS is passing over and the radio is in APRS digipeater mode." + echo + + echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + read input + + direwolf -c direwolf.conf -r 48000 -t 0 + +elif [ "$choice" = "3" ]; then + echo + + echo "CubicSDR will load in about 10 sceonds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load cubicsdr-aprs-direwolf.xml then Open." + echo "Then tune the CubicSDR frequency to the one you want to decode." + + echo + + echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + read input + + direwolf -c direwolf.conf -r 48000 -t 0 + +elif [ "$choice" = "4" ]; then + echo + + echo "CubicSDR will load in about 10 sceonds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load cubicsdr-serenity-direwolf.xml then Open." + echo "Note that you won't get packets unless the Serenity CubeSat is passing over and is beaconing." + + echo + + echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + read input + + direwolf -c direwolf-4800.conf -r 48000 -t 0 + +elif [ "$choice" = "5" ]; then + + echo "A recorded WAV file will play and you should see about 4 packets decoded" + + echo + +# echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + +# read input + + aplay -D hw:0,0 ~/Recordings/437.098_2021-08-28_10-41-34.wav & + + aplay -D hw:3,0,0 ~/Recordings/437.098_2021-08-28_10-41-34.wav & + + timeout 30 direwolf -c direwolf-4800.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + +fi + +sleep 5 + + diff --git a/groundstation/cubicsdr-iss-direwolf.xml b/groundstation/cubicsdr-iss-direwolf.xml new file mode 100644 index 00000000..ccd087ca --- /dev/null +++ b/groundstation/cubicsdr-iss-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 145490000 + 2048000 + 0 +
+ + + 12500 + 145825000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/cubicsdr-packet.sh b/groundstation/cubicsdr-packet.sh new file mode 100755 index 00000000..c5f0a1e8 --- /dev/null +++ b/groundstation/cubicsdr-packet.sh @@ -0,0 +1,262 @@ +#!/bin/bash + +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 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 + +frequency=$(zenity --list --width=510 --height=320 --title="Packet Decoding with CubicSDR and 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") + +#echo $frequency + +if [ -z "$frequency" ]; then + +echo "No choice made. Exiting." + +sleep 3 + +exit + +#echo "Choose the number for the frequency for packet decoding:" +#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 (437100 kHz)" +#echo "8. Test Serenity CubeSat decoding with WAV file" + +#echo + +#read -r choice + +fi + +if [ "$choice" = "1" ] || [ "$frequency" = "144390" ] ; then + echo + + echo "CubicSDR will load in about 10 seconds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load /home/pi/CubeSatSim/groundstation/cubicsdr-session/cubicsdr-aprs-direwolf.xml then Open." + echo "Note that you won't hear anything as the audio is routed to Direwolf for decoding. To hear the signal, change the Audio Out setting." + + echo + +# echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + result=$(zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen select File/Session/Open Session then load CubeSatSim/groundstation/cubicsdr-session/cubicsdr-aprs-direwolf.xml then Open.\n\nNote that you won\'t hear anything as the audio is routed to Direwolf for decoding. To hear the signal, change the Audio Out setting.\n\nThen click OK to start Direwolf!") + +# echo $result + +# [[ ! -z "$result" ]] && read input + + direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + +elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then + echo + + echo "CubicSDR will load in about 10 seconds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load /home/pi/CubeSatSim/groundstation/cubicsdr-session/cubicsdr-cubesatsim-direwolf.xml then Open." + echo "Note that you won't get packets unless your CubeSat Simulator is transmitting in APRS telemetry mode." + echo "Note that you might need to adjust the frequency in CubicSDR slightly so the signal is centered." + echo + +# echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + result=$(zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen select File/Session/Open Session then load CubeSatSim/groundstation/cubicsdr-session/cubicsdr-cubesatsim-direwolf.xml then Open.\n\nNote that you won't get packets unless your CubeSat Simulator is transmitting in APRS telemetry mode.\n\nNote that you might need to adjust the frequency in CubicSDR slightly so the signal is centered.\n\nNote that you won't hear anything as the audio is routed to Direwolf for decoding. To hear the signal, change the Audio Out setting.\n\nThen click OK to start Direwolf!") + + direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + +elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ] ; then + echo + + echo "CubicSDR will load in about 10 seconds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load /home/pi/CubeSatSim/groundstation/cubicsdr-session/cubicsdr-aprs-eu-direwolf.xml then Open." + + echo + +# echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + result=$(zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen select File/Session/Open Session then load CubeSatSim/groundstation/cubicsdr-session/cubicsdr-aprs-eu-direwolf.xml then Open.\n\nNote that you won't hear anything as the audio is routed to Direwolf for decoding. To hear the signal, change the Audio Out setting.\n\nThen click OK to start Direwolf!") + + direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + + +elif [ "$choice" = "4" ] || [ "$frequency" = "145175" ] ; then + echo + + echo "CubicSDR will load in about 10 seconds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load /home/pi/CubeSatSim/groundstation/cubicsdr-session/cubicsdr-aprs-au-direwolf.xml then Open." + + echo + +# echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + result=$(zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen select File/Session/Open Session then load CubeSatSim/groundstation/cubicsdr-session/cubicsdr-aprs-au-direwolf.xml then Open.\n\nNote that you won't hear anything as the audio is routed to Direwolf for decoding. To hear the signal, change the Audio Out setting.\n\nThen click OK to start Direwolf!") + + direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + +elif [ "$choice" = "5" ] || [ "$frequency" = "Other" ] ; then + echo + + echo "CubicSDR will load in about 10 seconds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load /home/pi/CubeSatSim/groundstation/cubicsdr-session/cubicsdr-aprs-direwolf.xml then Open." + echo "Then tune the CubicSDR frequency to the one you want to decode." + + echo + +# echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + result=$(zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen select File/Session/Open Session then load CubeSatSim/groundstation/cubicsdr-session/cubicsdr-aprs-direwolf.xml then Open.\n\nThen tune the CubicSDR frequency to the one you want to decode.\n\nNote that you won't hear anything as the audio is routed to Direwolf for decoding. To hear the signal, change the Audio Out setting.\n\nThen click OK to start Direwolf!") + + direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + +elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then + echo + + echo "CubicSDR will load in about 10 seconds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load /home/pi/CubeSatSim/groundstation/cubicsdr-session/cubicsdr-iss-direwolf.xml then Open." + echo "Note that you won't get packets unless the ISS is passing over (see Gpredict) and the ISS radio is in APRS digipeater mode (check social media)." + echo "Note that you may need to adjust the frequency due to Doppler shift." + echo + +# echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + result=$(zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen select File/Session/Open Session then load CubeSatSim/groundstation/cubicsdr-session/cubicsdr-iss-direwolf.xml then Open.\n\nNote that you won't get packets unless the ISS is passing over (see Gpredict) and the ISS radio is in APRS digipeater mode (check social media).\n\nNote that you may need to adjust the frequency due to Doppler shift.\n\nNote that you won't hear anything as the audio is routed to Direwolf for decoding. To hear the signal, change the Audio Out setting.\n\nThen click OK to start Direwolf!") + + direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + +elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then + echo + + echo "CubicSDR will load in about 10 seconds." + + nohup CubicSDR /dev/null 2>&1 & + + echo + + echo "When CubicSDR opens, select Generic RTL2832 device then click Start to begin." + + echo + + echo "Then select File/Session/Open Session then load /home/pi/CubeSatSim/groundstation/cubicsdr-session/cubicsdr-serenity-direwolf.xml then Open." + echo "Note that you will not get packets unless the Serenity CubeSat is passing over (see Gpredict)and is beaconing." + + echo + +# echo "Hit the Return key when you have done this in CubicSDR and Direwolf will start" + + result=$(zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen select File/Session/Open Session then load CubeSatSim/groundstation/cubicsdr-session/cubicsdr-serenity-direwolf.xml then Open.\n\nNote that you won't get packets unless the Serenity CubeSat is passing over (see Gpredict)and is beaconing.\n\nNote that you won't hear anything as the audio is routed to Direwolf for decoding. To hear the signal, change the Audio Out setting.\n\nThen click OK to start Direwolf!") + + direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 + +elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then + + echo + + 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 + +fi + +sleep 5 + diff --git a/groundstation/cubicsdr-serenity-direwolf.xml b/groundstation/cubicsdr-serenity-direwolf.xml new file mode 100644 index 00000000..6fc9d717 --- /dev/null +++ b/groundstation/cubicsdr-serenity-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 436825000 + 2048000 + 0 +
+ + + 23500 + 437100000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/cubicsdr-session/cubicsdr-aprs-au-direwolf.xml b/groundstation/cubicsdr-session/cubicsdr-aprs-au-direwolf.xml new file mode 100644 index 00000000..f786bece --- /dev/null +++ b/groundstation/cubicsdr-session/cubicsdr-aprs-au-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 145200000 + 2048000 + 0 +
+ + + 12500 + 145175000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/cubicsdr-session/cubicsdr-aprs-direwolf.xml b/groundstation/cubicsdr-session/cubicsdr-aprs-direwolf.xml new file mode 100644 index 00000000..29e2500a --- /dev/null +++ b/groundstation/cubicsdr-session/cubicsdr-aprs-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 144390000 + 2048000 + 0 +
+ + + 12500 + 144390000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/cubicsdr-session/cubicsdr-aprs-eu-direwolf.xml b/groundstation/cubicsdr-session/cubicsdr-aprs-eu-direwolf.xml new file mode 100644 index 00000000..34fd356b --- /dev/null +++ b/groundstation/cubicsdr-session/cubicsdr-aprs-eu-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 144900000 + 2048000 + 0 +
+ + + 12500 + 144800000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/cubicsdr-session/cubicsdr-cubesatsim-direwolf.xml b/groundstation/cubicsdr-session/cubicsdr-cubesatsim-direwolf.xml new file mode 100644 index 00000000..756ed6a7 --- /dev/null +++ b/groundstation/cubicsdr-session/cubicsdr-cubesatsim-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 435000000 + 2048000 + 0 +
+ + + 12500 + 434900000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/cubicsdr-session/cubicsdr-iss-direwolf.xml b/groundstation/cubicsdr-session/cubicsdr-iss-direwolf.xml new file mode 100644 index 00000000..ccd087ca --- /dev/null +++ b/groundstation/cubicsdr-session/cubicsdr-iss-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 145490000 + 2048000 + 0 +
+ + + 12500 + 145825000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/cubicsdr-session/cubicsdr-serenity-direwolf.xml b/groundstation/cubicsdr-session/cubicsdr-serenity-direwolf.xml new file mode 100644 index 00000000..6fc9d717 --- /dev/null +++ b/groundstation/cubicsdr-session/cubicsdr-serenity-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 436825000 + 2048000 + 0 +
+ + + 23500 + 437100000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/cubicsdr.sh b/groundstation/cubicsdr.sh index 9e9e6be0..47b5e12f 100755 --- a/groundstation/cubicsdr.sh +++ b/groundstation/cubicsdr.sh @@ -21,8 +21,18 @@ sudo systemctl stop rtl_tcp sudo killall -9 rtl_tcp &>/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 -CubicSDR +setsid CubicSDR + +sleep 10 -$SHELL +#$SHELL diff --git a/groundstation/cubicsdr/cubicsdr-aprs-direwolf.xml b/groundstation/cubicsdr/cubicsdr-aprs-direwolf.xml new file mode 100644 index 00000000..29e2500a --- /dev/null +++ b/groundstation/cubicsdr/cubicsdr-aprs-direwolf.xml @@ -0,0 +1,23 @@ + + +
+ %30%2e%32%2e%35 + 144390000 + 2048000 + 0 +
+ + + 12500 + 144390000 + NBFM + + -100 + 1 + hw:Loopback,0 + 1 + 0 + 1 + + +
diff --git a/groundstation/direwolf-4800.conf b/groundstation/direwolf-4800.conf new file mode 100644 index 00000000..86fcbfd0 --- /dev/null +++ b/groundstation/direwolf-4800.conf @@ -0,0 +1,10 @@ +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 + +ARATE 48000 + +CHANNEL 0 + +#MODEM 1200 +MODEM 4800 + +DWAIT 5 diff --git a/groundstation/direwolf/direwolf-4800.conf b/groundstation/direwolf/direwolf-4800.conf new file mode 100644 index 00000000..86fcbfd0 --- /dev/null +++ b/groundstation/direwolf/direwolf-4800.conf @@ -0,0 +1,10 @@ +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 + +ARATE 48000 + +CHANNEL 0 + +#MODEM 1200 +MODEM 4800 + +DWAIT 5 diff --git a/groundstation/direwolf/direwolf-windows-1200.conf b/groundstation/direwolf/direwolf-windows-1200.conf new file mode 100644 index 00000000..f49fd001 --- /dev/null +++ b/groundstation/direwolf/direwolf-windows-1200.conf @@ -0,0 +1,498 @@ +############################################################# +# # +# Configuration file for Dire Wolf # +# # +# Windows version # +# # +############################################################# +# +# Extensive documentation can be found here: +# Stable release - https://github.com/wb2osz/direwolf/tree/master/doc +# Latest development - https://github.com/wb2osz/direwolf/tree/dev/doc +# +# The complete documentation set can also be found in the doc folder. +# +# This sample file does not have examples for all of the possibilities. +# Consult the User Guide for more details on configuration options.%C%# +# +# These are the most likely settings you might change: +# +# (1) MYCALL - call sign and SSID for your station. +# +# Look for lines starting with MYCALL and +# change NOCALL to your own. +# +# (2) PBEACON - enable position beaconing. +# +# Look for lines starting with PBEACON and +# modify for your call, location, etc. +# +# (3) DIGIPEATER - configure digipeating rules. +# +# Look for lines starting with DIGIPEATER. +# Most people will probably use the given example. +# Just remove the "#" from the start of the line +# to enable it. +# +# (4) IGSERVER, IGLOGIN - IGate server and login +# +# Configure an IGate client to relay messages between +# radio and internet servers. +# +# +# The default location is "direwolf.conf" in the current working directory. +# An alternate configuration file location can be specified with the "-c" command line option. +# +# As you probably guessed by now, # indicates a comment line. +# +# Remove the # at the beginning of a line if you want to use a sample +# configuration that is currently commented out. +# +# Commands are a keyword followed by parameters. +# +# Command key words are case insensitive. i.e. upper and lower case are equivalent. +# +# Command parameters are generally case sensitive. i.e. upper and lower case are different. +# + + +############################################################# +# # +# FIRST AUDIO DEVICE PROPERTIES # +# (Channel 0 + 1 if in stereo) # +# # +############################################################# + +# +# Many people will simply use the default sound device. +# Some might want to use an alternative device by choosing it here. +# +# When the Windows version starts up, it displays something like +# this with the available sound devices and capabilities: +# +# Available audio input devices for receive (*=selected): +# * 0: Microphone (C-Media USB Headpho (channel 2) +# 1: Microphone (Bluetooth SCO Audio +# 2: Microphone (Bluetooth AV Audio) +# * 3: Microphone (Realtek High Defini (channels 0 & 1) +# Available audio output devices for transmit (*=selected): +# * 0: Speakers (C-Media USB Headphone (channel 2) +# 1: Speakers (Bluetooth SCO Audio) +# 2: Realtek Digital Output(Optical) +# 3: Speakers (Bluetooth AV Audio) +# * 4: Speakers (Realtek High Definiti (channels 0 & 1) +# 5: Realtek Digital Output (Realtek +# +# Example: To use the microphone and speaker connections on the +# system board, either of these forms can be used: + +#ADEVICE High +ADEVICE 1 0 + +# Example: To use the USB Audio, use a command like this with +# the input and output device numbers. (Remove the # comment character.) +#ADEVICE USB + +# You can also use "-" or "stdin" to pipe stdout from +# some other application such as a software defined radio. +# "stdin" is not an audio device. Don't use this unless you +# understand what this means. Read the User Guide. +# You can also specify "UDP:" and an optional port for input. +# Something different must be specified for output. + +# ADEVICE stdin 0 +# ADEVICE UDP:7355 0 + +# The position in the list can change when devices (e.g. USB) are added and removed. +# You can also specify devices by using part of the name. +# Here is an example of specifying the USB Audio device. +# This is case-sensitive. Upper and lower case are not treated the same. + +#ADEVICE USB + + + +# +# Number of audio channels for this souncard: 1 (mono) or 2 (stereo). +# 1 is the default so there is no need to specify it. +# + +#ACHANNELS 2 + + +############################################################# +# # +# SECOND AUDIO DEVICE PROPERTIES # +# (Channel 2 + 3 if in stereo) # +# # +############################################################# + +#ADEVICE1 ... + + +############################################################# +# # +# THIRD AUDIO DEVICE PROPERTIES # +# (Channel 4 + 5 if in stereo) # +# # +############################################################# + +#ADEVICE2 ... + + +############################################################# +# # +# CHANNEL 0 PROPERTIES # +# # +############################################################# + +CHANNEL 0 + +# +# The following MYCALL, MODEM, PTT, etc. configuration items +# apply to the most recent CHANNEL. +# + +# +# Station identifier for this channel. +# Multiple channels can have the same or different names. +# +# It can be up to 6 letters and digits with an optional ssid. +# The APRS specification requires that it be upper case. +# +# Example (don't use this unless you are me): MYCALL WB2OSZ-5 +# + +MYCALL KU2Y + +# +# Pick a suitable modem speed based on your situation. +# 1200 Most common for VHF/UHF. Default if not specified. +# 2400 QPSK compatible with MFJ-2400, and probably PK232-2400 & KPC-2400. +# 300 Low speed for HF SSB. Default tones 1600 & 1800. +# EAS Emergency Alert System (EAS) Specific Area Message Encoding (SAME). +# 9600 G3RUH style - Can't use Microphone and Speaker connections. +# AIS International system for tracking ships on VHF. +# Also uses 9600 bps so Speaker connection won't work. +# +# In most cases you can just specify the speed. Examples: +# + +MODEM 1200 +#MODEM 9600 + +# +# Many options are available for great flexibility. +# See User Guide for details. +# + +# +# Uncomment line below to enable the DTMF decoder for this channel. +# + +#DTMF + +# +# If not using a VOX circuit, the transmitter Push to Talk (PTT) +# control is usually wired to a serial port with a suitable interface circuit. +# DON'T connect it directly! +# +# For the PTT command, specify the device and either RTS or DTR. +# RTS or DTR may be preceded by "-" to invert the signal. +# Both can be used for interfaces that want them driven with opposite polarity. +# + +#PTT COM1 RTS +#PTT COM1 RTS -DTR + +# The Data Carrier Detect (DCD) signal can be sent to the same places +# as the PTT signal. This could be used to light up an LED like a normal TNC. + +#DCD COM1 -DTR + + +############################################################# +# # +# CHANNEL 1 PROPERTIES # +# # +############################################################# + +#CHANNEL 1 + +# +# Specify MYCALL, MODEM, PTT, etc. configuration items for +# CHANNEL 1. Repeat for any other channels. + + +############################################################# +# # +# TEXT TO SPEECH COMMAND FILE # +# # +############################################################# + +#SPEECH dwespeak.bat + + +############################################################# +# # +# VIRTUAL TNC SERVER PROPERTIES # +# # +############################################################# + +# +# Dire Wolf acts as a virtual TNC and can communicate with +# client applications by different protocols: +# +# - the "AGW TCPIP Socket Interface" - default port 8000 +# - KISS protocol over TCP socket - default port 8001 +# - KISS TNC via serial port +# + +AGWPORT 8000 +KISSPORT 8001 + +# +# Some applications are designed to operate with only a physical +# TNC attached to a serial port. For these, we provide a virtual serial +# port that appears to be connected to a TNC. +# +# Take a look at the User Guide for instructions to set up +# two virtual serial ports named COM3 and COM4 connected by +# a null modem. +# +# Using the configuration described, Dire Wolf will connect to +# COM3 and the client application will use COM4. +# +# Uncomment following line to use this feature. + +#NULLMODEM COM3 + + +# +# It is sometimes possible to recover frames with a bad FCS. +# This applies to all channels. +# +# 0 [NONE] - Don't try to repair. +# 1 [SINGLE] - Attempt to fix single bit error. (default) +# ... see User Guide for more values and in-depth discussion. +# + +#FIX_BITS 0 + +# +############################################################# +# # +# FIXED POSIION BEACONING PROPERTIES # +# # +############################################################# + + +# +# Beaconing is configured with these two commands: +# +# PBEACON - for a position report (usually yourself) +# OBEACON - for an object report (usually some other entity) +# +# Each has a series of keywords and values for options. +# See User Guide for details. +# +# Example: +# +# This results in a broadcast once every 10 minutes. +# Every half hour, it can travel via two digipeater hops. +# The others are kept local. +# + +#PBEACON delay=1 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA" via=WIDE1-1,WIDE2-1 +#PBEACON delay=11 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA" +#PBEACON delay=21 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA" + + +# With UTM coordinates instead of latitude and longitude. + +#PBEACON delay=1 every=10 overlay=S symbol="digi" zone=19T easting=307477 northing=4720178 + + +# +# When the destination field is set to "SPEECH" the information part is +# converted to speech rather than transmitted as a data frame. +# + +#CBEACON dest="SPEECH" info="Club meeting tonight at 7 pm." + +# Similar for Morse code. If SSID is specified, it is multiplied +# by 2 to get speed in words per minute (WPM). + +#CBEACON dest="MORSE-6" info="de MYCALL" + + +# +# Modify for your particular situation before removing +# the # comment character from the beginning of appropriate lines above. +# + + +############################################################# +# # +# APRS DIGIPEATER PROPERTIES # +# # +############################################################# + +# +# For most common situations, use something like this by removing +# the "#" from the beginning of the line below. +# + +#DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$ TRACE + +# See User Guide for more explanation of what this means and how +# it can be customized for your particular needs. + +# Filtering can be used to limit was is digipeated. +# For example, only weather weather reports, received on channel 0, +# will be retransmitted on channel 1. +# + +#FILTER 0 1 t/wn + +# Traditional connected mode packet radio uses a different +# type of digipeating. See User Guide for details. + +############################################################# +# # +# INTERNET GATEWAY # +# # +############################################################# + +# First you need to specify the name of a Tier 2 server. +# The current preferred way is to use one of these regional rotate addresses: + +# noam.aprs2.net - for North America +# soam.aprs2.net - for South America +# euro.aprs2.net - for Europe and Africa +# asia.aprs2.net - for Asia +# aunz.aprs2.net - for Oceania + +#IGSERVER noam.aprs2.net + +# You also need to specify your login name and passcode. +# Contact the author if you can't figure out how to generate the passcode. + +#IGLOGIN WB2OSZ-5 123456 + +# That's all you need for a receive only IGate which relays +# messages from the local radio channel to the global servers. + +# Some might want to send an IGate client position directly to a server +# without sending it over the air and relying on someone else to +# forward it to an IGate server. This is done by using sendto=IG rather +# than a radio channel number. Overlay R for receive only, T for two way. + +#PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat=42^37.14N long=071^20.83W +#PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=T lat=42^37.14N long=071^20.83W + + +# To relay messages from the Internet to radio, you need to add +# one more option with the transmit channel number and a VIA path. + +#IGTXVIA 0 WIDE1-1 + + +# Finally, we don't want to flood the radio channel. +# The IGate function will limit the number of packets transmitted +# during 1 minute and 5 minute intervals. If a limit would +# be exceeded, the packet is dropped and message is displayed in red. + +IGTXLIMIT 6 10 + + +############################################################# +# # +# APRStt GATEWAY # +# # +############################################################# + +# +# Dire Wolf can receive DTMF (commonly known as Touch Tone) +# messages and convert them to packet objects. +# +# See separate "APRStt-Implementation-Notes" document for details. +# + +# +# Sample gateway configuration based on: +# +# http://www.aprs.org/aprstt/aprstt-coding24.txt +# http://www.aprs.org/aprs-jamboree-2013.html +# + +# Define specific points. + +TTPOINT B01 37^55.37N 81^7.86W +TTPOINT B7495088 42.605237 -71.34456 +TTPOINT B934 42.605237 -71.34456 + +TTPOINT B901 42.661279 -71.364452 +TTPOINT B902 42.660411 -71.364419 +TTPOINT B903 42.659046 -71.364452 +TTPOINT B904 42.657578 -71.364602 + + +# For location at given bearing and distance from starting point. + +TTVECTOR B5bbbddd 37^55.37N 81^7.86W 0.01 mi + +# For location specified by x, y coordinates. + +TTGRID Byyyxxx 37^50.00N 81^00.00W 37^59.99N 81^09.99W + +# UTM location for Lowell-Dracut-Tyngsborough State Forest. + +TTUTM B6xxxyyy 19T 10 300000 4720000 + + + +# Location for the corral. + +TTCORRAL 37^55.50N 81^7.00W 0^0.02N + +# Compact messages - Fixed locations xx and object yyy where +# Object numbers 100 - 199 = bicycle +# Object numbers 200 - 299 = fire truck +# Others = dog + +TTMACRO xx1yy B9xx*AB166*AA2B4C5B3B0A1yy +TTMACRO xx2yy B9xx*AB170*AA3C4C7C3B0A2yy +TTMACRO xxyyy B9xx*AB180*AA3A6C4A0Ayyy + +TTMACRO z Cz + +# Receive on channel 0, Transmit object reports on channel 1 with optional via path. +# You probably want to put in a transmit delay on the APRStt channel so it +# it doesn't start sending a response before the user releases PTT. +# This is in 10 ms units so 100 means 1000 ms = 1 second. + +#TTOBJ 0 1 WIDE1-1 +#CHANNEL 0 +#DWAIT 100 + +# Advertise gateway position with beacon. + +# OBEACON DELAY=0:15 EVERY=10:00 VIA=WIDE1-1 OBJNAME=WB2OSZ-tt SYMBOL=APRStt LAT=42^37.14N LONG=71^20.83W COMMENT="APRStt Gateway" + + +# Sample speech responses. +# Default is Morse code "R" for received OK and "?" for all errors. + +#TTERR OK SPEECH Message Received. +#TTERR D_MSG SPEECH D not implemented. +#TTERR INTERNAL SPEECH Internal error. +#TTERR MACRO_NOMATCH SPEECH No definition for digit sequence. +#TTERR BAD_CHECKSUM SPEECH Bad checksum on call. +#TTERR INVALID_CALL SPEECH Invalid callsign. +#TTERR INVALID_OBJNAME SPEECH Invalid object name. +#TTERR INVALID_SYMBOL SPEECH Invalid symbol. +#TTERR INVALID_LOC SPEECH Invalid location. +#TTERR NO_CALL SPEECH No call or object name. +#TTERR SATSQ SPEECH Satellite square must be 4 digits. +#TTERR SUFFIX_NO_CALL SPEECH Send full call before using suffix. diff --git a/groundstation/direwolf/direwolf-windows-4800.conf b/groundstation/direwolf/direwolf-windows-4800.conf new file mode 100644 index 00000000..e0b29f27 --- /dev/null +++ b/groundstation/direwolf/direwolf-windows-4800.conf @@ -0,0 +1,499 @@ +############################################################# +# # +# Configuration file for Dire Wolf # +# # +# Windows version # +# # +############################################################# +# +# Extensive documentation can be found here: +# Stable release - https://github.com/wb2osz/direwolf/tree/master/doc +# Latest development - https://github.com/wb2osz/direwolf/tree/dev/doc +# +# The complete documentation set can also be found in the doc folder. +# +# This sample file does not have examples for all of the possibilities. +# Consult the User Guide for more details on configuration options.%C%# +# +# These are the most likely settings you might change: +# +# (1) MYCALL - call sign and SSID for your station. +# +# Look for lines starting with MYCALL and +# change NOCALL to your own. +# +# (2) PBEACON - enable position beaconing. +# +# Look for lines starting with PBEACON and +# modify for your call, location, etc. +# +# (3) DIGIPEATER - configure digipeating rules. +# +# Look for lines starting with DIGIPEATER. +# Most people will probably use the given example. +# Just remove the "#" from the start of the line +# to enable it. +# +# (4) IGSERVER, IGLOGIN - IGate server and login +# +# Configure an IGate client to relay messages between +# radio and internet servers. +# +# +# The default location is "direwolf.conf" in the current working directory. +# An alternate configuration file location can be specified with the "-c" command line option. +# +# As you probably guessed by now, # indicates a comment line. +# +# Remove the # at the beginning of a line if you want to use a sample +# configuration that is currently commented out. +# +# Commands are a keyword followed by parameters. +# +# Command key words are case insensitive. i.e. upper and lower case are equivalent. +# +# Command parameters are generally case sensitive. i.e. upper and lower case are different. +# + + +############################################################# +# # +# FIRST AUDIO DEVICE PROPERTIES # +# (Channel 0 + 1 if in stereo) # +# # +############################################################# + +# +# Many people will simply use the default sound device. +# Some might want to use an alternative device by choosing it here. +# +# When the Windows version starts up, it displays something like +# this with the available sound devices and capabilities: +# +# Available audio input devices for receive (*=selected): +# * 0: Microphone (C-Media USB Headpho (channel 2) +# 1: Microphone (Bluetooth SCO Audio +# 2: Microphone (Bluetooth AV Audio) +# * 3: Microphone (Realtek High Defini (channels 0 & 1) +# Available audio output devices for transmit (*=selected): +# * 0: Speakers (C-Media USB Headphone (channel 2) +# 1: Speakers (Bluetooth SCO Audio) +# 2: Realtek Digital Output(Optical) +# 3: Speakers (Bluetooth AV Audio) +# * 4: Speakers (Realtek High Definiti (channels 0 & 1) +# 5: Realtek Digital Output (Realtek +# +# Example: To use the microphone and speaker connections on the +# system board, either of these forms can be used: + +#ADEVICE High +ADEVICE 1 0 + + +# Example: To use the USB Audio, use a command like this with +# the input and output device numbers. (Remove the # comment character.) +#ADEVICE USB + +# You can also use "-" or "stdin" to pipe stdout from +# some other application such as a software defined radio. +# "stdin" is not an audio device. Don't use this unless you +# understand what this means. Read the User Guide. +# You can also specify "UDP:" and an optional port for input. +# Something different must be specified for output. + +# ADEVICE stdin 0 +# ADEVICE UDP:7355 0 + +# The position in the list can change when devices (e.g. USB) are added and removed. +# You can also specify devices by using part of the name. +# Here is an example of specifying the USB Audio device. +# This is case-sensitive. Upper and lower case are not treated the same. + +#ADEVICE USB + + + +# +# Number of audio channels for this souncard: 1 (mono) or 2 (stereo). +# 1 is the default so there is no need to specify it. +# + +#ACHANNELS 2 + + +############################################################# +# # +# SECOND AUDIO DEVICE PROPERTIES # +# (Channel 2 + 3 if in stereo) # +# # +############################################################# + +#ADEVICE1 ... + + +############################################################# +# # +# THIRD AUDIO DEVICE PROPERTIES # +# (Channel 4 + 5 if in stereo) # +# # +############################################################# + +#ADEVICE2 ... + + +############################################################# +# # +# CHANNEL 0 PROPERTIES # +# # +############################################################# + +CHANNEL 0 + +# +# The following MYCALL, MODEM, PTT, etc. configuration items +# apply to the most recent CHANNEL. +# + +# +# Station identifier for this channel. +# Multiple channels can have the same or different names. +# +# It can be up to 6 letters and digits with an optional ssid. +# The APRS specification requires that it be upper case. +# +# Example (don't use this unless you are me): MYCALL WB2OSZ-5 +# + +MYCALL KU2Y + +# +# Pick a suitable modem speed based on your situation. +# 1200 Most common for VHF/UHF. Default if not specified. +# 2400 QPSK compatible with MFJ-2400, and probably PK232-2400 & KPC-2400. +# 300 Low speed for HF SSB. Default tones 1600 & 1800. +# EAS Emergency Alert System (EAS) Specific Area Message Encoding (SAME). +# 9600 G3RUH style - Can't use Microphone and Speaker connections. +# AIS International system for tracking ships on VHF. +# Also uses 9600 bps so Speaker connection won't work. +# +# In most cases you can just specify the speed. Examples: +# + +MODEM 4800 +#MODEM 9600 + +# +# Many options are available for great flexibility. +# See User Guide for details. +# + +# +# Uncomment line below to enable the DTMF decoder for this channel. +# + +#DTMF + +# +# If not using a VOX circuit, the transmitter Push to Talk (PTT) +# control is usually wired to a serial port with a suitable interface circuit. +# DON'T connect it directly! +# +# For the PTT command, specify the device and either RTS or DTR. +# RTS or DTR may be preceded by "-" to invert the signal. +# Both can be used for interfaces that want them driven with opposite polarity. +# + +#PTT COM1 RTS +#PTT COM1 RTS -DTR + +# The Data Carrier Detect (DCD) signal can be sent to the same places +# as the PTT signal. This could be used to light up an LED like a normal TNC. + +#DCD COM1 -DTR + + +############################################################# +# # +# CHANNEL 1 PROPERTIES # +# # +############################################################# + +#CHANNEL 1 + +# +# Specify MYCALL, MODEM, PTT, etc. configuration items for +# CHANNEL 1. Repeat for any other channels. + + +############################################################# +# # +# TEXT TO SPEECH COMMAND FILE # +# # +############################################################# + +#SPEECH dwespeak.bat + + +############################################################# +# # +# VIRTUAL TNC SERVER PROPERTIES # +# # +############################################################# + +# +# Dire Wolf acts as a virtual TNC and can communicate with +# client applications by different protocols: +# +# - the "AGW TCPIP Socket Interface" - default port 8000 +# - KISS protocol over TCP socket - default port 8001 +# - KISS TNC via serial port +# + +AGWPORT 8000 +KISSPORT 8001 + +# +# Some applications are designed to operate with only a physical +# TNC attached to a serial port. For these, we provide a virtual serial +# port that appears to be connected to a TNC. +# +# Take a look at the User Guide for instructions to set up +# two virtual serial ports named COM3 and COM4 connected by +# a null modem. +# +# Using the configuration described, Dire Wolf will connect to +# COM3 and the client application will use COM4. +# +# Uncomment following line to use this feature. + +#NULLMODEM COM3 + + +# +# It is sometimes possible to recover frames with a bad FCS. +# This applies to all channels. +# +# 0 [NONE] - Don't try to repair. +# 1 [SINGLE] - Attempt to fix single bit error. (default) +# ... see User Guide for more values and in-depth discussion. +# + +#FIX_BITS 0 + +# +############################################################# +# # +# FIXED POSIION BEACONING PROPERTIES # +# # +############################################################# + + +# +# Beaconing is configured with these two commands: +# +# PBEACON - for a position report (usually yourself) +# OBEACON - for an object report (usually some other entity) +# +# Each has a series of keywords and values for options. +# See User Guide for details. +# +# Example: +# +# This results in a broadcast once every 10 minutes. +# Every half hour, it can travel via two digipeater hops. +# The others are kept local. +# + +#PBEACON delay=1 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA" via=WIDE1-1,WIDE2-1 +#PBEACON delay=11 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA" +#PBEACON delay=21 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA" + + +# With UTM coordinates instead of latitude and longitude. + +#PBEACON delay=1 every=10 overlay=S symbol="digi" zone=19T easting=307477 northing=4720178 + + +# +# When the destination field is set to "SPEECH" the information part is +# converted to speech rather than transmitted as a data frame. +# + +#CBEACON dest="SPEECH" info="Club meeting tonight at 7 pm." + +# Similar for Morse code. If SSID is specified, it is multiplied +# by 2 to get speed in words per minute (WPM). + +#CBEACON dest="MORSE-6" info="de MYCALL" + + +# +# Modify for your particular situation before removing +# the # comment character from the beginning of appropriate lines above. +# + + +############################################################# +# # +# APRS DIGIPEATER PROPERTIES # +# # +############################################################# + +# +# For most common situations, use something like this by removing +# the "#" from the beginning of the line below. +# + +#DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$ TRACE + +# See User Guide for more explanation of what this means and how +# it can be customized for your particular needs. + +# Filtering can be used to limit was is digipeated. +# For example, only weather weather reports, received on channel 0, +# will be retransmitted on channel 1. +# + +#FILTER 0 1 t/wn + +# Traditional connected mode packet radio uses a different +# type of digipeating. See User Guide for details. + +############################################################# +# # +# INTERNET GATEWAY # +# # +############################################################# + +# First you need to specify the name of a Tier 2 server. +# The current preferred way is to use one of these regional rotate addresses: + +# noam.aprs2.net - for North America +# soam.aprs2.net - for South America +# euro.aprs2.net - for Europe and Africa +# asia.aprs2.net - for Asia +# aunz.aprs2.net - for Oceania + +#IGSERVER noam.aprs2.net + +# You also need to specify your login name and passcode. +# Contact the author if you can't figure out how to generate the passcode. + +#IGLOGIN WB2OSZ-5 123456 + +# That's all you need for a receive only IGate which relays +# messages from the local radio channel to the global servers. + +# Some might want to send an IGate client position directly to a server +# without sending it over the air and relying on someone else to +# forward it to an IGate server. This is done by using sendto=IG rather +# than a radio channel number. Overlay R for receive only, T for two way. + +#PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat=42^37.14N long=071^20.83W +#PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=T lat=42^37.14N long=071^20.83W + + +# To relay messages from the Internet to radio, you need to add +# one more option with the transmit channel number and a VIA path. + +#IGTXVIA 0 WIDE1-1 + + +# Finally, we don't want to flood the radio channel. +# The IGate function will limit the number of packets transmitted +# during 1 minute and 5 minute intervals. If a limit would +# be exceeded, the packet is dropped and message is displayed in red. + +IGTXLIMIT 6 10 + + +############################################################# +# # +# APRStt GATEWAY # +# # +############################################################# + +# +# Dire Wolf can receive DTMF (commonly known as Touch Tone) +# messages and convert them to packet objects. +# +# See separate "APRStt-Implementation-Notes" document for details. +# + +# +# Sample gateway configuration based on: +# +# http://www.aprs.org/aprstt/aprstt-coding24.txt +# http://www.aprs.org/aprs-jamboree-2013.html +# + +# Define specific points. + +TTPOINT B01 37^55.37N 81^7.86W +TTPOINT B7495088 42.605237 -71.34456 +TTPOINT B934 42.605237 -71.34456 + +TTPOINT B901 42.661279 -71.364452 +TTPOINT B902 42.660411 -71.364419 +TTPOINT B903 42.659046 -71.364452 +TTPOINT B904 42.657578 -71.364602 + + +# For location at given bearing and distance from starting point. + +TTVECTOR B5bbbddd 37^55.37N 81^7.86W 0.01 mi + +# For location specified by x, y coordinates. + +TTGRID Byyyxxx 37^50.00N 81^00.00W 37^59.99N 81^09.99W + +# UTM location for Lowell-Dracut-Tyngsborough State Forest. + +TTUTM B6xxxyyy 19T 10 300000 4720000 + + + +# Location for the corral. + +TTCORRAL 37^55.50N 81^7.00W 0^0.02N + +# Compact messages - Fixed locations xx and object yyy where +# Object numbers 100 - 199 = bicycle +# Object numbers 200 - 299 = fire truck +# Others = dog + +TTMACRO xx1yy B9xx*AB166*AA2B4C5B3B0A1yy +TTMACRO xx2yy B9xx*AB170*AA3C4C7C3B0A2yy +TTMACRO xxyyy B9xx*AB180*AA3A6C4A0Ayyy + +TTMACRO z Cz + +# Receive on channel 0, Transmit object reports on channel 1 with optional via path. +# You probably want to put in a transmit delay on the APRStt channel so it +# it doesn't start sending a response before the user releases PTT. +# This is in 10 ms units so 100 means 1000 ms = 1 second. + +#TTOBJ 0 1 WIDE1-1 +#CHANNEL 0 +#DWAIT 100 + +# Advertise gateway position with beacon. + +# OBEACON DELAY=0:15 EVERY=10:00 VIA=WIDE1-1 OBJNAME=WB2OSZ-tt SYMBOL=APRStt LAT=42^37.14N LONG=71^20.83W COMMENT="APRStt Gateway" + + +# Sample speech responses. +# Default is Morse code "R" for received OK and "?" for all errors. + +#TTERR OK SPEECH Message Received. +#TTERR D_MSG SPEECH D not implemented. +#TTERR INTERNAL SPEECH Internal error. +#TTERR MACRO_NOMATCH SPEECH No definition for digit sequence. +#TTERR BAD_CHECKSUM SPEECH Bad checksum on call. +#TTERR INVALID_CALL SPEECH Invalid callsign. +#TTERR INVALID_OBJNAME SPEECH Invalid object name. +#TTERR INVALID_SYMBOL SPEECH Invalid symbol. +#TTERR INVALID_LOC SPEECH Invalid location. +#TTERR NO_CALL SPEECH No call or object name. +#TTERR SATSQ SPEECH Satellite square must be 4 digits. +#TTERR SUFFIX_NO_CALL SPEECH Send full call before using suffix. diff --git a/groundstation/direwolf/direwolf.conf b/groundstation/direwolf/direwolf.conf new file mode 100644 index 00000000..ce8b6823 --- /dev/null +++ b/groundstation/direwolf/direwolf.conf @@ -0,0 +1 @@ +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=b1,DEV=0 diff --git a/groundstation/fox-download.desktop b/groundstation/fox-download.desktop new file mode 100644 index 00000000..d58827d0 --- /dev/null +++ b/groundstation/fox-download.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Exec=/home/pi/CubeSatSim/groundstation/fox-download.sh +Name=FoxTelem Download +Comment=FIAB-v3 +Icon=/home/pi/Icons/FoxTelemDownload.png +Path=/home/pi +Terminal=true +Categories=HamRadio +Keywords=Ham Radio;AMSAT diff --git a/groundstation/fox-download.sh b/groundstation/fox-download.sh new file mode 100755 index 00000000..da9ab5cc --- /dev/null +++ b/groundstation/fox-download.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# script to run FoxTelem Download + +#sudo killall -9 java &>/dev/null + +echo "Running FoxTelem with database download of all server data" +echo +# /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData-Download +SCRIPTPATH=$(dirname "$0") +cd /home/pi/FoxTelem +echo Starting $SCRIPTPATH/current_foxtelem/FoxTelem.jar +setsid java -Xmx512M -jar FoxTelem.jar "/home/pi/FoxTelemetryData-Download" < /dev/null > /dev/null & + +sleep 10 diff --git a/groundstation/fox-profile.sh b/groundstation/fox-profile.sh index be0074e4..d51e7ccb 100755 --- a/groundstation/fox-profile.sh +++ b/groundstation/fox-profile.sh @@ -7,6 +7,8 @@ echo sudo rm /home/pi/FoxTelemetryData/.foxprofile -/home/pi/CubeSatSim/groundstation/fox-startup.sh +/home/pi/CubeSatSim/groundstation/fox-run.sh -$SHELL +sleep 5 + +#$SHELL diff --git a/groundstation/fox-run.sh b/groundstation/fox-run.sh new file mode 100755 index 00000000..fd9d7b84 --- /dev/null +++ b/groundstation/fox-run.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# script to run FoxTelem + +echo "Startup script to run FoxTelem for FIAB v3" + +echo + +sudo killall -9 FoxTelem &>/dev/null + +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") + + 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" = "Fox-in-a-Box" ] ; then + + echo "You have chosen the Fox-in-a-Box profile." + echo "b" > /home/pi/FoxTelemetryData/.foxprofile + echo + + 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 Ground Station profile." + echo "c" > /home/pi/FoxTelemetryData/.foxprofile + + 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 + + else + + echo "Please enter only 1 or 2" + + 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/fox.sh +else + echo "Fox-in-a-box profile is set!" + echo +# /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData + SCRIPTPATH=$(dirname "$0") + cd /home/pi/FoxTelem + echo Starting $SCRIPTPATH/current_foxtelem/FoxTelem.jar + setsid java -Xmx512M -jar FoxTelem.jar "/home/pi/FoxTelemetryData" < /dev/null > /dev/null & + +fi + +sleep 10 + +#$SHELL diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index b4504388..cb035116 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -8,87 +8,8 @@ echo sudo killall -9 FoxTelem &>/dev/null FILE=/home/pi/FoxTelemetryData/.foxprofile -if [ ! -f "$FILE" ]; then - 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 - - if [ "$ANS" = "1" ]; then - - echo "You have chosen the Fox-in-a-Box profile." - echo "b" > /home/pi/FoxTelemetryData/.foxprofile - echo - - 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 CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" - read callsign - - if [ -n "$callsign" ]; then - sudo sed -i "s/callsign=.*/callsign=$callsign/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" ]; then - - echo "You have chosen the CubeSatSim Ground Station profile." - echo "c" > /home/pi/FoxTelemetryData/.foxprofile - - 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 - - else - - echo "Please enter only 1 or 2" - - fi - -fi +#if [ ! -f "$FILE" ]; then +if [ -f "$FILE" ]; then value=`cat /home/pi/FoxTelemetryData/.foxprofile` echo "$value" > /dev/null @@ -107,8 +28,12 @@ else SCRIPTPATH=$(dirname "$0") cd /home/pi/FoxTelem echo Starting $SCRIPTPATH/current_foxtelem/FoxTelem.jar - java -Xmx512M -jar FoxTelem.jar "/home/pi/FoxTelemetryData" < /dev/null > /dev/null & + setsid java -Xmx512M -jar FoxTelem.jar "/home/pi/FoxTelemetryData" < /dev/null > /dev/null & fi -$SHELL +sleep 10 + +fi + +#$SHELL diff --git a/groundstation/fox.sh b/groundstation/fox.sh index eb2289dd..3cf98207 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -21,8 +21,23 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 qsstv &>/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 -/home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim +#/home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim + +SCRIPTPATH=$(dirname "$0") +cd /home/pi/FoxTelem +echo Starting $SCRIPTPATH/current_foxtelem/FoxTelem.jar +setsid java -Xmx512M -jar FoxTelem.jar "/home/pi/FoxTelemetryData-CubeSatSim" < /dev/null > /dev/null & + +sleep 10 -$SHELL +#$SHELL diff --git a/groundstation/foxtelem.desktop b/groundstation/foxtelem.desktop index e8e5b548..9dc42ab9 100644 --- a/groundstation/foxtelem.desktop +++ b/groundstation/foxtelem.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Type=Application -Exec=/home/pi/CubeSatSim/groundstation/fox-startup.sh +Exec=/home/pi/CubeSatSim/groundstation/fox-run.sh Name=FoxTelem Comment=FIAB-v3 Icon=/home/pi/Downloads/foxtelem.png diff --git a/groundstation/klatrack.desktop b/groundstation/klatrack.desktop new file mode 100644 index 00000000..1c1cabe9 --- /dev/null +++ b/groundstation/klatrack.desktop @@ -0,0 +1,11 @@ + +[Desktop Entry] +Type=Application +Exec=/home/pi/Desktop/KlaTrack_1.01d_linux/KlaTrack +Name=G0KLA Tracker +Comment=ISS and Satellite Tracker +Icon=/home/pi/Icons/KLAtracker.png +Path=/home/pi +Terminal=false +Categories=HamRadio +Keywords=Ham Radio;AMSAT diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index fdd8af82..64c47bbd 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -10,50 +10,67 @@ import maidenhead as mh latitude = 0 longitude = 0 +location = "My Location" grid = "" return_value = 0 +altitude = 0 +dquote = '\\"' -print("\nIn order to track the satellites as they fly over your location and upload your satellite telemetry data to the AMSAT servers, we need to know your location") +print("\nIn order to track the satellites as they fly over your location and upload your satellite telemetry data to the AMSAT servers, you need to set your location.") print("\nYou can enter:\n") print("1. Location name (e.g. country or city, state, etc)") print("2. Grid square (e.g. FM29ha)") print("3. Latitude and longitude") -print("4. No location\n") +print("4. Leave location unchanged\n") -choice = input ("Enter your choice (1 -4): ") +choice = input ("Enter your choice (1 - 4): ") -if (choice == '2'): - regex = '[A-Z]+[A-Z]+[0-9]+[0-9]+[a-z]+[a-z]' - - grid = input("\nType your 6 character character grid square (i.e. FM29ha): ") +if (choice == '2'): + + regex = '[A-Za-z]+[A-Za-z]+[0-9]+[0-9]+[A-Za-z]+[A-Za-z]' - if re.search(regex, grid): - print("grid is valid!") - print mh.to_location(grid) - else: - print("grid is not valid!") - grid = "" + for i in list(range(3)): + grid = input("\nEnter your 6 character character grid square (i.e. FM29ha): ") + + if re.search(regex, grid): + print("grid is valid!") + print (mh.to_location(grid)[0]) + print (mh.to_location(grid)[1]) + latitude = mh.to_location(grid)[0] + longitude = mh.to_location(grid)[1] + location = input("\nEnter the name of your location (or hit Return to leave blank): ") + break + else: + print("grid is not valid!") + grid = "" + elif (choice == '3'): - - lat = input("\nType your latitude: ") - try: + + for i in list(range(3)): + lat = input("\nType your latitude (South is negative): ") + try: latitude = float(lat) print(latitude) - except ValueError: + break + except ValueError: print("Not a number!") - long = input("\nType your longitude: ") - try: + + for i in list(range(3)): + long = input("\nType your longitude (West is negative): ") + try: longitude = float(long) print(longitude) - except ValueError: + break + except ValueError: print("Not a number!") - + location = input("\nEnter the name of your location (or hit Return to leave blank): ") + elif (choice == '1'): URL = "https://geocode.search.hereapi.com/v1/geocode" - print("\nEnter your location including country. \n\n") - location = input("Type your location: ") #taking user input + #print("\nEnter your location including country. \n\n") + location = input("Enter your location including country: ") #taking user input api_key = '' # Acquire from developer.here.com PARAMS = {'apikey':api_key,'q':location} @@ -71,59 +88,106 @@ elif (choice == '1'): print(longitude) except: - print("There is a problem with the location API. Please try again") + print("There is a problem with the location API. Try setting your location by latitude and longitude or grid square.") else: - print("\nYou have chosen not to enter your location.") + print("\nYour location is unchanged.") print("To track satellites and upload telemetry data,") print("you can set your location in Settings in FoxTelem.") #file = open(r"/home/pi/CubeSatSim/groundstation/.profile","w+") -if ((latitude != 0) and (longitude != 0) or grid): +if (latitude != 0) and (longitude != 0): - if not grid: - latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' - #print (latSedStr) - system(latSedStr) + latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (latSedStr) + system(latSedStr) - longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' - #print (longSedStr) - system(longSedStr) + longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (longSedStr) + system(longSedStr) - print("\nFoxTelem configuration updated with your latitude and longitude") + print("\nFoxTelem configuration updated with your latitude and longitude") - return_value = 1 - - else: - latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' - #print (latSedStr) - system(latSedStr) + latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/KLATrack/klatracker.properties' + #print (latSedStr) + system(latSedStr) - longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' - #print (longSedStr) - system(longSedStr) + longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/KLATrack/klatracker.properties' + #print (longSedStr) + system(longSedStr) - - gridSedStr = 'sed -i "s/maidenhead=.*/maidenhead=' + grid + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' - #print (gridSedStr) - system(gridSedStr) - - print("\nFoxTelem configuration updated with your maidenhead grid square") + print("\nKLAtracker configuration updated with your latitude and longitude") - return_value = 1 - - alt = input("\nType your altitude in integer meters: ") - try: - altitude = int(alt) - #print(altitude) - altSedStr = 'sed -i "s/altitude=.*/altitude=' + str(altitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' - #print (altSedStr) - system(altSedStr) + receiver_gpsSedStr = 'sudo sed -i "s/ ' + dquote + 'lat' + dquote + ': .*/ ' + dquote + 'lat' + dquote + ': ' + str(latitude) + ',/g" /var/lib/openwebrx/settings.json' + #print (receiver_gpsSedStr) + system(receiver_gpsSedStr) + + receiver_gpsSedStr = 'sudo sed -i "s/ ' + dquote + 'lon' + dquote + ': .*/ ' + dquote + 'lon' + dquote + ': ' + str(longitude) + '/g" /var/lib/openwebrx/settings.json' + #print (receiver_gpsSedStr) + system(receiver_gpsSedStr) + + nameSedStr = 'sudo sed -i "s/ ' + dquote + 'receiver_location' + dquote + ': .*/ ' + dquote + 'receiver_location' + dquote + ': ' + dquote + location + dquote + ',/g" /var/lib/openwebrx/settings.json' + #print (nameSedStr) + system(nameSedStr) + + print("\nOpenWebRX configuration updated with your latitude and longitude") + + return_value = 1 + + for i in list(range(3)): + alt = input("\nType your altitude in integer meters: ") + try: + altitude = int(alt) + if (altitude >= 0): + #print(altitude) + altSedStr = 'sed -i "s/altitude=.*/altitude=' + str(altitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (altSedStr) + system(altSedStr) - print("\nFoxTelem configuration updated with your alitude") - - except ValueError: - print("Not an integer!") + print("\nFoxTelem configuration updated with your alitude") + + altSedStr = 'sed -i "s/altitude=.*/altitude=' + str(altitude) + '/g" /home/pi/KLATrack/klatracker.properties' + #print (altSedStr) + system(altSedStr) + + print("\nKLAtracker configuration updated with your alitude") + + aslSedStr = 'sudo sed -i "s/ ' + dquote + 'receiver_asl' + dquote + ': .*/ ' + dquote + 'receiver_asl' + dquote + ': ' + str(altitude) + ',/g" /var/lib/openwebrx/settings.json' + #print (receiver_gpsSedStr) + system(aslSedStr) + + print("\nOpenWebRX configuration updated with your alitude") + + break + else: + print("\nAltitude cannot be negative!") + altitude = 0 + except ValueError: + print("\nAltitude must be an integer!") + + if ((latitude != 0) and (longitude != 0)): + file = open(r"/home/pi/.config/Gpredict/MyLocation.qth","w+") + + str1 = "[QTH]\n" + str2 = "LOCATION=" + location + "\n" + str3 = "LAT=" + str(latitude) + "\n" + str4 = "LON=" + str(longitude) + "\n" + str5 = "ALT=" + str(altitude) + "\n" + str6 = "WX=\n" + str7 = "QTH_TYPE=0\n" + + file.write(str1) + file.write(str2) + file.write(str3) + file.write(str4) + file.write(str5) + file.write(str6) + file.write(str7) + + file.close() + + print("\nGpredict configuration updated with your latitude and longitude and altitude\n") + sys.exit(return_value) diff --git a/groundstation/loc.sh b/groundstation/loc.sh index 3042a781..5a227a37 100755 --- a/groundstation/loc.sh +++ b/groundstation/loc.sh @@ -1,6 +1,10 @@ #!/bin/bash # -python3 /home/pi/CubeSatSim/groundstation/loc.py +sudo killall -9 java &>/dev/null + +sudo killall -9 gpredict &>/dev/null + +python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py /usr/bin/gpredict diff --git a/groundstation/packet.sh b/groundstation/packet.sh new file mode 100755 index 00000000..b14f150a --- /dev/null +++ b/groundstation/packet.sh @@ -0,0 +1,197 @@ +#!/bin/bash + +# script to auto decode packet using rtl_fm and Direwolf + +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 cubicsdr-packet.sh &>/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 sstv_decode_prompt| grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/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 packets on $frequency Hz" + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.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 + +sleep 5 diff --git a/groundstation/rtl-tcp-d.sh b/groundstation/rtl-tcp-d.sh index 5fdd67d7..b3305644 100755 --- a/groundstation/rtl-tcp-d.sh +++ b/groundstation/rtl-tcp-d.sh @@ -27,10 +27,22 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 qsstv &>/dev/null +sudo killall -9 direwolf &>/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 + sudo systemctl stop rtl_tcp sleep 5 sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ") -D 2' -$SHELL +sleep 5 + +#$SHELL diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index 3e267f34..ae19ad5c 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -39,6 +39,20 @@ sudo killall -9 rtl_tcp &>/dev/null sudo killall -9 qsstv &>/dev/null -sudo systemctl start rtl_tcp +sudo killall -9 direwolf &>/dev/null -$SHELL +#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 + +#sudo systemctl start rtl_tcp + +sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")' + +sleep 5 + +#$SHELL diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh index 27aa41c7..d15cdaf7 100755 --- a/groundstation/sdr.sh +++ b/groundstation/sdr.sh @@ -3,11 +3,18 @@ echo "Script to run Web SDR for ARISS Radio Pi" +echo + +echo "The Chromium browser will load in a few seconds with OpenWebRX." + +echo "You can also use another web browser if you are on the same network as your Pi." + + echo ip=$(hostname -I|cut -f1 -d ' ') -echo "IP Address to use in web browsers is: $ip:8073" +echo "IP Address to use in web browser is: $ip:8073" echo @@ -21,16 +28,30 @@ sudo killall -9 java &>/dev/null sudo killall -9 rtl_fm &>/dev/null +sudo killall -9 rtl_tcp &>/dev/null + sudo killall -9 CubicSDR &>/dev/null sudo killall -9 qsstv &>/dev/null +sudo killall -9 direwolf &>/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 + sudo systemctl stop rtl_tcp sudo systemctl restart openwebrx sleep 10 -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://127.0.0.1:8073 &>/dev/null & + +sleep 10 -$SHELL +#$SHELL diff --git a/groundstation/sstv_decode.desktop b/groundstation/sstv_decode.desktop new file mode 100644 index 00000000..de386616 --- /dev/null +++ b/groundstation/sstv_decode.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=SSTV Decode using QSSTV +GenericName=Decodes SSTV using rtl_fm and QSSTV +Comment=SSTV signals +Exec=/home/pi/CubeSatSim/groundstation/sstv_decode_prompt.sh +Icon=/usr/share/qsstv/qsstv.png +Terminal=true +Type=Application +Categories=HamRadio; +Keywords=SSTV;ISS; diff --git a/groundstation/sstv_decode.sh b/groundstation/sstv_decode.sh index c7afae2e..b539d2b0 100755 --- a/groundstation/sstv_decode.sh +++ b/groundstation/sstv_decode.sh @@ -1,5 +1,5 @@ #!/bin/bash -# script to decode SSTV using rtl_fm and QSSTV from the CubeSatSim +# script to decode SSTV using rtl_fm and QSSTV from the C echo "Script to decode SSTV from the CubeSatSim for ARISS Radio Pi" @@ -27,6 +27,7 @@ qsstv & sleep 5 -rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 & +#rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,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 $SHELL diff --git a/groundstation/sstv_decode_iss.desktop b/groundstation/sstv_decode_iss.desktop deleted file mode 100644 index f74418cb..00000000 --- a/groundstation/sstv_decode_iss.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Name=SSTV Decode ISS -GenericName=Decodes SSTV from ISS using rtl_fm and QSSTV -Comment=145.8 MHz SSTV signals -Exec=/home/pi/CubeSatSim/groundstation/sstv_decode_iss.sh -Icon=/usr/share/qsstv/qsstv.png -Terminal=true -Type=Application -Categories=HamRadio; -Keywords=SSTV;ISS; diff --git a/groundstation/sstv_decode_iss.sh b/groundstation/sstv_decode_iss.sh index da19a72b..c72ee286 100755 --- a/groundstation/sstv_decode_iss.sh +++ b/groundstation/sstv_decode_iss.sh @@ -37,5 +37,9 @@ value=`aplay -l | grep "Loopback"` echo "$value" > /dev/null set -- $value -rtl_fm -M fm -f 145.8M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -$SHELL +#rtl_fm -M fm -f 145.8M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f 145.8M -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 + +#$SHELL diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh new file mode 100755 index 00000000..8dc4a3ff --- /dev/null +++ b/groundstation/sstv_decode_prompt.sh @@ -0,0 +1,143 @@ +#!/bin/bash + +echo "Script to decode SSTV using QSSTV with rtl_fm" + +echo + +sudo systemctl stop openwebrx + +sudo modprobe snd-aloop + +sudo killall -9 qsstv &>/dev/null + +sudo killall -9 rtl_fm &>/dev/null + +sudo killall -9 aplay &>/dev/null + +sudo killall -9 direwolf &>/dev/null + +sudo systemctl stop rtl_tcp + +pkill -o chromium &>/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 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 killall -9 zenity &>/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") + +echo $frequency + +if [ -z "$frequency" ]; then + +echo "No choice made. Exiting." + +sleep 3 + +exit + +#echo "Choose the number for the frequency for SSTV decoding:" +#echo "1. ISS (145800Hz)" +#echo "2. CubeSatSim (434900 kHz)" +#echo "3. Enter a frequency in kiloHertz" +#echo "4. Play an SSTV WAV file to test" +#echo + +#read -r choice + +fi + +if [ "$choice" = "1" ] || [ "$frequency" = "145800" ]; then + +frequency=145800000 +echo "Frequency is" $frequency +echo +echo "If the ISS is overhead (check Gpredict) and in SSTV mode (see social media), you can receive images." + +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 "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 + +echo + +echo "Enter the frequency in kiloHertz" + +echo + +read -r frequency + +frequency=$frequency"000" + +elif [ "$choice" = "4" ] || [ "$frequency" = "SSTV" ]; then + + echo "A recorded Scottie 2 SSTV WAV file will play and you should see an image 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 5 && aplay -D hw:0,0 /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg.wav); done) & + + #aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 5 && aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg.wav); done) & + + qsstv + +fi + + +if [ "$choice" != "4" ] && [ "$frequency" != "SSTV" ]; then + +#echo $frequency + +echo + +echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." + +echo + +echo -e "Auto decoding SSTV on $frequency Hz" + +sleep 2 + +qsstv & + +sleep 5 + +#sudo systemctl restart cubesatsim + + +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +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 + +sleep 5 + +fi + +#$SHELL diff --git a/groundstation/sstv_decode_sim.sh b/groundstation/sstv_decode_sim.sh index 300895ee..3b72c7a4 100755 --- a/groundstation/sstv_decode_sim.sh +++ b/groundstation/sstv_decode_sim.sh @@ -41,6 +41,9 @@ value=`aplay -l | grep "Loopback"` echo "$value" > /dev/null 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 | 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 -$SHELL +sleep 5 + +#$SHELL