Compare commits

...

142 Commits

Author SHA1 Message Date
Alan Johnston 624add1aa8
Update pacsat.sh fix rpitx
23 hours ago
Alan Johnston 26cf1cd58e
Update pacsat.sh typo ]
23 hours ago
Alan Johnston 9d8e6635fa
Update pacsat.sh added 2a and 3a for no sound card
23 hours ago
Alan Johnston f1e340b06f
Update pacsat.sh change safe to rpitx and add v1 case
24 hours ago
Alan Johnston a771e9ba2c
Update pacsat.sh fix PTT
24 hours ago
Alan Johnston 55f31ff6bc
Update pacsat.sh fix rtl_fm and direwolf configs
1 day ago
Alan Johnston f364c6fe1e
Update pacsat.sh major rewrite of tx and rx devices
1 day ago
Alan Johnston f2052b11cd
Update pacsat.sh add -P+ -D1 and -g 48 to direwolf
1 day ago
Alan Johnston 1b0b2daac4
Update pacsat.sh fixing rtl, not sure of other modes
1 day ago
Alan Johnston 56fdd00c82
Update pacsat.sh fix RTL-SDR Loopback
1 day ago
Alan Johnston d51257dc4b
Update pacsat.sh fix RTL-SDR test
1 day ago
Alan Johnston 3c828362b4
Update config fix RTL-SDR detection
1 day ago
Alan Johnston c43f91312a
Update config don't prompt in -G or -I comands
1 day ago
Alan Johnston 825105f7cf
Merge pull request #430 from alanbjohnston/fiabv4-auto-tune-p
1 day ago
Alan Johnston a2d872f9be
Update config add > /dev/null 2>&1 to rm in -g
2 days ago
Alan Johnston 445fd85fda
Update config fix -G freq check
2 days ago
Alan Johnston 4fc65dfa4e
Update config fix tx check in -G
2 days ago
Alan Johnston 592dc69296
Update config for -g reset pacsat and ground station settings
2 days ago
Alan Johnston 71746d8beb
Update config make -g reset everything and not always shutdown
2 days ago
Alan Johnston 421566cec5
Update pacsat.sh frequency in Hz
2 days ago
Alan Johnston dfde8d18b4
Update pacsat.sh add extra timeout 1
2 days ago
Alan Johnston 5a3f90710d
Update pacsat.sh add rtl loopback
2 days ago
Alan Johnston 7aa52a6dfa
Update pacsat.sh add pkill firefox
2 days ago
Alan Johnston bb2e0e414a
Update sdrpp.sh pkill firefox
2 days ago
Alan Johnston 94ab6b4b40
Update chromium.desktop x-www-browser
2 days ago
Alan Johnston 7c2dc05162
Update rtl-tcp-d.sh pkill firefox
2 days ago
Alan Johnston 50cee71fb1
Update aprs-cubesatsim.sh pkill firefox
2 days ago
Alan Johnston 7b7eb5c7a3
Update sstv_decode.sh pkill firefox
2 days ago
Alan Johnston 11d25702f1
Update packet.sh pkill firefox
2 days ago
Alan Johnston f27b1a65f9
Update aprs.sh pkill firefox
2 days ago
Alan Johnston e62dc68390
Update sstv_decode_sim.sh pkill firefox
2 days ago
Alan Johnston 36d38536f3
Update cubicsdr-packet.sh pkill firefox
2 days ago
Alan Johnston 9f672e4d3c
Update sstv_decode_iss.sh pkill firefox
2 days ago
Alan Johnston 747c8bd204
Update fctelem.sh x-www-browser
2 days ago
Alan Johnston 086a5341cf
Update rtl-tcp.sh pkill firefox
2 days ago
Alan Johnston e043590076
Update sstv_decode_prompt.sh pkill firefox
2 days ago
Alan Johnston bb051ccfa3
Update cubicsdr.sh pkill firefox
2 days ago
Alan Johnston 2034ee330e
Update sdr.sh x-www-browser
2 days ago
Alan Johnston 04bcd4499a
Update fox.sh pkill firefox
2 days ago
Alan Johnston 01334ee163
Update chromium.desktop.autostart x-www-browser
2 days ago
Alan Johnston 9935ceac33
Merge pull request #429 from alanbjohnston/fiabv4-auto-tune-p
3 days ago
Alan Johnston 92bd0f06ce
Update install change pi_pacsat to mine
3 days ago
Alan Johnston 7c07d57fa0
Update command.sh change size
3 days ago
Alan Johnston 562c853b4f
Update command.sh don't print mode
3 days ago
Alan Johnston 1d842ab5e7
Update command.sh do all modes
3 days ago
Alan Johnston 964d18045a
Update command.sh check for mode
3 days ago
Alan Johnston 3796521563 made executable
3 days ago
Alan Johnston 55dfe8c842
Create command.sh
3 days ago
Alan Johnston 5d7eb919fc
Update fox-startup.sh don't start FoxTelem if PacSat GS mode
3 days ago
Alan Johnston 9b73b28512
Update pacsat.sh don't prompt to change mode y/n
4 days ago
Alan Johnston e0001319e2
Update pacsatsim.sh simple dire wolf output
4 days ago
Alan Johnston 1b63681505
Update config -k restart not reboot
4 days ago
Alan Johnston bebab685b8
Update pacsatsim.sh copy don't wget zip files
4 days ago
Alan Johnston bacd17b8da
Update pacsat.sh dire wolf don't decode APRS
4 days ago
Alan Johnston 2c91f11ec5
Update pacsat.sh dire wolf white background
4 days ago
Alan Johnston 34a8fb8fb6
Update pacsat.sh cp don't wget
4 days ago
Alan Johnston ce273a1624
Update pacsat.sh don't quit if change mode
4 days ago
Alan Johnston e66b54ffdd
Update config add check restart for PacSat Ground
4 days ago
Alan Johnston d0ff780a4d
Update config try no reboot for PacSat modes
4 days ago
Alan Johnston b55fdec26e
Merge pull request #428 from alanbjohnston/fiabv4-auto-tune-p
5 days ago
Alan Johnston 7a48f51be4
Update pacsat-run.sh don't kill dire wolf on exit
6 days ago
Alan Johnston 2b9c828d47
Update sdr.sh add --password-store=basic to avoid keychain prompt in Chromium
6 days ago
Alan Johnston e48df7ce5e
Update pacsatsim.sh don't do rtl_test
6 days ago
Alan Johnston 6a9da94b09
Update pacsat.sh fix Loop unzip
6 days ago
Alan Johnston 17270c255a
Update config don't check for rtl_sdr
7 days ago
Alan Johnston a5a3f5c137
Update install add libraspberrypi-dev for rpitx
7 days ago
Alan Johnston 404695d347
Update pacsat.sh make sure rtl_test is killed at end
1 week ago
Alan Johnston 08b31d5407
Update pacsat.sh only do rtl_test if no TXC
1 week ago
Alan Johnston c4b2fd95c6
Update pacsat.sh fix unzip on PacSatGround, Loop not fixed yet
1 week ago
Alan Johnston e96723422b
Merge pull request #427 from alanbjohnston/master-b-w
1 week ago
Alan Johnston 1b309f0e53
Merge pull request #426 from alanbjohnston/master-b
1 week ago
Alan Johnston 92ca8ce413
Update install add cd to wiringpi 3
1 week ago
Alan Johnston 122aa7d912
Update install wiringpi v3 not v2
1 week ago
Alan Johnston 0c5b0abd6f
Update pacsat.sh change filename to master-b
1 week ago
Alan Johnston b8d53baf73
Merge pull request #425 from alanbjohnston/master-b-q
1 week ago
Alan Johnston d844961dd0
Update install change to cpus=2
1 week ago
Alan Johnston 37ffbaf4e6
Update config offer to change frequency when change to PacSat Ground mode
1 week ago
Alan Johnston 5ef6f3c994
Update pacsat.sh fix sed escaping
1 week ago
Alan Johnston 4d823c6964
Update pacsat.sh change properties to point to Loop
1 week ago
Alan Johnston 2eb80cce5a
Update pacsat.sh fix zip changes
1 week ago
Alan Johnston 4a9e3aa2d8
Update pacsat.sh PacSatGroundLoop same zip file as non loop
1 week ago
Alan Johnston 2c8ca5aca8
Update pacsat.sh copy existing PacSatSim file if present
1 week ago
Alan Johnston 0eecf68b47
Add files via upload
1 week ago
Alan Johnston a8aff5fa87
Update pacsatsim.sh fix pi_pacsat unzip
1 week ago
Alan Johnston 26d8ce051f
Update pacsatsim.sh remove -d from unzip
2 weeks ago
Alan Johnston 90d2442add
Update pacsatsim.sh remove full path
2 weeks ago
Alan Johnston fe50979489
Update pacsatsim.sh change pacsatsim files to v0.2
2 weeks ago
Alan Johnston ea8e0780e7
Update pacsatsim.sh typo in callsign print
2 weeks ago
Alan Johnston 566708f930
Update install 0.46q pacsat ground station install
2 weeks ago
Alan Johnston 028ca47cd2
Update install add maxcpus=1 if not present
4 weeks ago
Alan Johnston 4aaa8daabe
Update auto-tune.py catch rtl failure
7 months ago
Alan Johnston 52c0a2a930
Update fctelem.sh 5 second delay
7 months ago
Alan Johnston 8efbdcb941
Update fctelem.sh 10 sec delay
7 months ago
Alan Johnston 07fc9aeb7f
Update fctelem.sh add auto-tune
7 months ago
Alan Johnston 8a3a1a07f2
Update packet.sh add tries increment
7 months ago
Alan Johnston bbe606672d
Update sstv_decode_prompt.sh increment tries
7 months ago
Alan Johnston ec1c707164
Update sstv_decode_prompt.sh subtract 2 second delay
7 months ago
Alan Johnston 249887715b
Update sstv_decode_prompt.sh fix echos
7 months ago
Alan Johnston 3293b75c6a
Update sstv_decode_prompt.sh add starting auto tune message
7 months ago
Alan Johnston 27cbf1a822
Update packet.sh add auto-tune text
7 months ago
Alan Johnston a8f1a4095f
Update packet.sh remove delay
7 months ago
Alan Johnston 14de415089
Update packet.sh turn on autotune
7 months ago
Alan Johnston cdc8c2f607
Update packet.sh add auto-tune
7 months ago
Alan Johnston b9e3fdf2f4
Update sstv_decode_prompt.sh autotune while loop
7 months ago
Alan Johnston 9f8d7e1e1e
Update sstv_decode_prompt.sh prompt window size
7 months ago
Alan Johnston c4310cee67
Update sstv_decode_prompt.sh prompt window size
7 months ago
Alan Johnston 842c4623ba
Update sstv_decode_prompt.sh change prints
7 months ago
Alan Johnston 128f7410af
Update sstv_decode_prompt.sh prompt window larger
7 months ago
Alan Johnston 73bfd12ab6
Update sstv_decode_prompt.sh retry in 5 sec
7 months ago
Alan Johnston dcab91164a
Update sstv_decode_prompt.sh add auto-tune prompt option
7 months ago
Alan Johnston 992648f19b
Update sstv_decode_prompt.sh auto-tune failed message
7 months ago
Alan Johnston 6ebfc9c462
Update sstv_decode_prompt.sh only print autotune when above threshold
7 months ago
Alan Johnston be27ae69e8
Update sstv_decode_prompt.sh change to less than or equal
7 months ago
Alan Johnston bd901a424e
Update sstv_decode_prompt.sh confidence threshold 1
7 months ago
Alan Johnston 21f36f6ccf
Update auto-tune.py gain to 47
7 months ago
Alan Johnston 5a08dc8372
Update auto-tune.py revert
7 months ago
Alan Johnston 5d0d29aa86
Update auto-tune.py switch to 1e6
7 months ago
Alan Johnston e3decd1098
Update sstv_decode_prompt.sh check 3 times, only change if high confidence
7 months ago
Alan Johnston 327e000820
Update auto-tune.py change to 2000
7 months ago
Alan Johnston 920a76cf42
Update sstv_decode_prompt.sh fix frequency set
7 months ago
Alan Johnston 910d02b597
Update sstv_decode_prompt.sh add venv
7 months ago
Alan Johnston 7b3b54f4d8
Update sstv_decode_prompt.sh cat auto-tune.txt
7 months ago
Alan Johnston cd91412ee1
Update auto-tune.py scale by 100
7 months ago
Alan Johnston 8a1382f3de
Update auto-tune.py add 4k offset
7 months ago
Alan Johnston 732d887dcb
Update auto-tune.py change gain to 29
7 months ago
Alan Johnston 082d8de589
Update sstv_decode_prompt.sh integer threshold
7 months ago
Alan Johnston 844a077daa
Update auto-tune.py change max value to integer
7 months ago
Alan Johnston 06bc2b3db5
Update sstv_decode_prompt.sh fix -lt
7 months ago
Alan Johnston 3d8b5a0567
Update sstv_decode_prompt.sh add autotune
7 months ago
Alan Johnston 20c2c53a73
Update auto-tune.py fix format
7 months ago
Alan Johnston 54466634cf
Update auto-tune.py format output
7 months ago
Alan Johnston f2c44413a6
Update auto-tune.py only print results
7 months ago
Alan Johnston e219ab4285
Update auto-tune.py fix 200k
7 months ago
Alan Johnston ff9d9754b5
Update auto-tune.py add 200k offset
7 months ago
Alan Johnston a29525c8cf
Update auto-tune.py add sys
7 months ago
Alan Johnston 93265df16a
Update auto-tune.py more indent
7 months ago
Alan Johnston bf98365e68
Update auto-tune.py more indents
7 months ago
Alan Johnston 5b70b566d5
Update auto-tune.py fix indentation
7 months ago
Alan Johnston 20090e5cf9
Update auto-tune.py fix name
7 months ago
Alan Johnston a0dbfdc646
Update auto-tune.py add parameters
7 months ago
Alan Johnston 873f789b42
Update auto-tune.py add .real
7 months ago
Alan Johnston 465ea04df2
Create auto-tune.py
7 months ago

@ -95,9 +95,10 @@ function check_restart {
echo "$value" > /dev/null
set -- $value
if [ "$1" = "p" ] || [ "$1" = "P" ] ; then
reboot=1
elif [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then
# if [ "$1" = "p" ] || [ "$1" = "P" ] ; then
# reboot=1
#el
if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then
FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; then
restart=1
@ -355,13 +356,12 @@ if [ "$1" = "" ]; then
txc=0
fi
timeout 1 rtl_test &> out.txt
if [[ $(grep "No supported" out.txt) ]] ; then
# echo "No RTL-SDR detected"
rtl=0
else
if [[ $(lsusb | grep "RTL") ]] ; then
echo "RTL-SDR detected"
rtl=1
else
echo "No RTL-SDR detected"
rtl=0
fi
echo
@ -1423,7 +1423,7 @@ elif [ "$1" = "-g" ]; then
if [ "$rset" = "y" ] || [ "$rset" = "yes" ] ; then
echo "Resetting and shutting down."
echo "Resetting"
echo "AMSAT 0 0 0 no 3 434.9 435 no 0 0" > /home/pi/CubeSatSim/sim.cfg
@ -1441,6 +1441,8 @@ elif [ "$1" = "-g" ]; then
sudo rm /home/pi/CubeSatSim/failure_mode.txt > /dev/null 2>&1
sudo rm /home/pi/CubeSatSim/transmit_dtmf > /dev/null 2>&1
sudo systemctl stop cubesatsim
sudo systemctl stop transmit
sudo systemctl stop command
@ -1450,11 +1452,25 @@ elif [ "$1" = "-g" ]; then
sudo journalctl --rotate
sudo journalctl --vacuum-time=1s
rm -rf ~/.config/chromium/Singleton*
rm -rf ~/.config/chromium/Singleton* > /dev/null 2>&1
cat /dev/null > ~/.bash_history && history -c
sudo shutdown now
sudo systemctl stop pacsatsim &>/dev/null
sudo rm -r /home/pi/PacSat > /dev/null 2>&1
sudo rm -r /home/pi/PacSatGround > /dev/null 2>&1
sudo rm -r /home/pi/PacSatGroundLoop > /dev/null 2>&1
if [ "$noreboot" = "0" ] ; then
echo "Shutting down."
sudo shutdown now
else
echo
echo "Shutdown or reboot to complete the operation."
echo
fi
# reboot=1
else
@ -1811,16 +1827,24 @@ elif [ "$1" = "-G" ]; then
reboot=1
sudo echo "p" > /home/pi/CubeSatSim/.mode
# if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then
# FILE=/home/pi/CubeSatSim/battery_saver
# if [ -f "$FILE" ]; then
# restart=1
# else
# reboot=1
# fi
# else
# restart=1
# fi
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
set -- $value
if [ "${7}" != "434.9" ] && [ "${7}" != "434.900" ] ; then
echo "The default transmit frequency of 434.9 MHz is NOT set."
echo
echo "To change the transmit frequency (for example to 434.9 MHz) use the CubeSatSim/config -F command."
sleep 5
# read input
# echo
#
# if [ "$input" = "y" ] || [ "$input" = "yes" ] ; then
# /home/pi/CubeSatSim/config -F n
# fi
fi
elif [ "$1" = "-I" ]; then
@ -1833,18 +1857,26 @@ elif [ "$1" = "-I" ]; then
# echo "changing CubeSatSim to Pacsat mode"
reboot=1
# reboot=1
check_restart
sudo echo "P" > /home/pi/CubeSatSim/.mode
# if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then
# FILE=/home/pi/CubeSatSim/battery_saver
# if [ -f "$FILE" ]; then
# restart=1
# else
# reboot=1
# fi
# else
# restart=1
# fi
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
set -- $value
if [ "${7}" = "434.9" ] && [ "${8}" = "435" ]; then
echo "The default transmit frequency of 434.9 MHz is set"
echo
echo "To change it (for example to 435 MHz) use the CubeSatSim/config -F command."
# read input
# echo
#
# if [ "$input" = "y" ] || [ "$input" = "yes" ] ; then
# /home/pi/CubeSatSim/config -F n
# fi
fi
elif [ "$1" = "-k" ]; then
@ -1853,7 +1885,8 @@ elif [ "$1" = "-k" ]; then
echo
sudo systemctl stop pacsatsim &>/dev/null
sudo rm -r /home/pi/PacSat
reboot=1
# reboot=1
sudo systemctl restart pacsatsim
elif [ "$1" = "-h" ]; then

@ -9,6 +9,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 direwolf &>/dev/null

@ -9,6 +9,8 @@ sudo systemctl stop rtl_tcp &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 rtl_fm &>/dev/null

@ -0,0 +1,93 @@
from rtlsdr import RtlSdr
import numpy as np
import matplotlib.pyplot as plt
import sys
if __name__ == "__main__":
graph = 'n'
center_frequency = 434.7e6
if (len(sys.argv)) > 0:
# print("There are arguments!")
center_frequency = float(sys.argv[1]) - 200e3
if (center_frequency == 0):
center_frequency = 434.7e6
if (len(sys.argv)) > 1:
# print("There are more arguments")
if (sys.argv[2] == 'g') or (sys.argv[2] == '-g'):
graph = 'y'
sampling_rate = 1024e3 # 250e3 # Hz
duration = 65536/sampling_rate # 1 # seconds
try:
sdr = RtlSdr()
# configure device
sdr.sample_rate = sampling_rate # 250e3 # 2.4e6
#center_frequency = 434.8e6
sdr.center_freq = center_frequency
sdr.gain = 47
sdr.direct_sampling = False
# signal = sdr.read_samples(64*1024) #256
signal = sdr.read_samples(duration*sampling_rate).real #256
# print(f"Center frequency is {center_frequency}")
sdr.close()
# Compute the FFT
fft_result = np.fft.fft(signal)
# Calculate the frequencies corresponding to the FFT output
n = len(signal)
frequencies = np.fft.fftfreq(n, d=1/sampling_rate)
# Take the absolute value for amplitude spectrum and consider only the positive frequencies
positive_frequencies_indices = np.where(frequencies >= 0)
positive_frequencies = frequencies[positive_frequencies_indices]
amplitude_spectrum = 2/n * np.abs(fft_result[positive_frequencies_indices]) # Normalize for amplitude
if (graph == 'y'):
# Plotting the results
t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)
plt.figure(figsize=(12, 6))
plt.subplot(1, 2, 1)
plt.plot(t, signal)
plt.title('Time Domain Signal')
plt.xlabel('Time (s)')
plt.ylabel('Amplitude')
plt.subplot(1, 2, 2)
plt.stem(positive_frequencies, amplitude_spectrum, markerfmt=" ", basefmt="-b")
plt.title('Frequency Domain (FFT)')
plt.xlabel('Frequency (Hz)')
plt.ylabel('Amplitude')
plt.grid(True)
plt.tight_layout()
plt.show()
# print(amplitude_spectrum)
x = amplitude_spectrum
# print(x)
min_value = min(x)
max_value = max(x) * 100
#freq_min = np.argmax(min_value)
# print(np.argmax(x))
# print(np.argmax(x)*(150e3 - 10e3)/(9770 - 709))
# print(sampling_rate)
# print(center_frequency)
offset = (np.argmax(x)*(150e3 - 10e3)/(9770 - 709))
freq_max = center_frequency + offset + 2000
except: # if no RTL-SDR or in use, stop scanning with high max value and center frequency
max_value = 100
freq_max = center_frequency + 200e3 # should be 434900000
print(f" {freq_max:.0f} {max_value:.0f}")

@ -1,5 +1,5 @@
[Desktop Entry]
Type=Application
Name=Chromium with WebSDR
Exec=chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars --app=http://localhost:8073
Name=Browser with WebSDR
Exec=x-www-browser http://localhost:8073/

@ -1,4 +1,4 @@
[Desktop Entry]
Type=Application
Name=Chromium with WebSDR
Exec=chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8073
Exec=x-www-browser http://127.0.0.1:8073

@ -0,0 +1,41 @@
#!/bin/bash
# script to send APRS or DTMR commands to a CubeSatSim
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
if [ "$1" != "n" ]; then
echo "You are not in Transmit Commands mode"
sleep 10
exit
fi
sudo killall -9 zenity &>/dev/null
echo
autotune=0
mode=$(zenity --timeout=20 --list 2>/dev/null --width=300 --height=360 --title="Transmit Command" --text="Choose the command to transmit" --column="Mode" --column="Result" a "APRS Mode" f "FSK Mode" b "BPSK Mode" s "SSTV Mode" m "CM Mode" e "Repeater Mode" j "FUNcube Mode" o "Beacon On/Off")
# echo $mode
if [ -z "$mode" ]; then
echo "No choice made."
sleep 10
exit
fi
/home/pi/CubeSatSim/config -$mode
sleep 10

@ -8,6 +8,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 direwolf &>/dev/null

@ -17,6 +17,8 @@ sudo systemctl stop rtl_tcp &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 rtl_fm &>/dev/null

@ -5,7 +5,7 @@ echo "Script to run FUNcube CubeSatSim Telemetry"
echo
echo "The Chromium browser will load in a few seconds with fctelem."
echo "The browser will load in a few seconds with fctelem."
echo "You can also use another web browser if you are on the same network as your Pi."
@ -34,6 +34,8 @@ sudo killall -9 python3 &>/dev/null
#pkill -o chromium &>/dev/null
#pkill -o firefox &>/dev/null
#sudo killall -9 rtl_tcp &>/dev/null
#sudo killall -9 CubicSDR &>/dev/null
@ -80,8 +82,9 @@ else
echo
fi
autotune=0
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=180 --title="FUNcube Telem Decoding" --text="Choose the frequency for FUNcube decoding:" --column="kHz" --column="Use" 434900 "CubeSatSim" Other "Choose another frequency")
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=220 --title="FUNcube Telem Decoding" --text="Choose the frequency for FUNcube decoding:" --column="kHz" --column="Use" 434900 "CubeSatSim" Auto-tune "CubeSatSim Auto-tune" Other "Choose another frequency")
echo $frequency
@ -96,6 +99,11 @@ if [ "$frequency" = "434900" ]; then
frequency=434900000
elif [ "$frequency" = "Auto-tune" ]; then
frequency=434900000
autotune=1
elif [ "$frequency" = "Other" ]; then
echo
@ -110,6 +118,39 @@ elif [ "$frequency" = "Other" ]; then
fi
if [ "$autotune" = "1" ]; then
threshold=1
delay=5
retries=5
echo "Starting Auto-tune scanning"
echo "Scan will stop when confidence exceeds threshold value of" $threshold "or after" $retries "retries"
tries=0
confidence=0
delay=$((delay-2)) # subtract 2 second built in delay
while [ $tries -le $retries ] && [ "$confidence" -le "$threshold" ]; do
sleep $delay
source /home/pi/venv/bin/activate
python3 /home/pi/CubeSatSim/groundstation/auto-tune.py 434900000 n 2> null > /home/pi/CubeSatSim/groundstation/auto-tune.txt
# echo "auto-tune.txt"
# cat /home/pi/CubeSatSim/groundstation/auto-tune.txt
confidence=$(awk '{print $2}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune confidence:" $confidence
tries=$((tries+1))
done
if [ "$confidence" -gt "$threshold" ]; then
frequency=$(awk '{print $1}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune frequency:" $frequency
else
echo "Auto tune failed, frequency unchanged"
fi
sleep 5
fi
echo "Frequency is" $frequency
echo
echo "If your CubeSatSim is transmitting in FUNcube mode (mode 7) you should get some frames after 30 seconds"
@ -135,7 +176,8 @@ cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg ./image_file.jpeg
python3 -m http.server 8002 &
setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8002 &>/dev/null &
#setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8002 &>/dev/null &
setsid x-www-browser http://127.0.0.1:8002/
cd /home/pi/fctelem

@ -5,6 +5,12 @@ echo "Startup script to run FoxTelem for FIAB v4"
echo
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
echo $1
if [ "$1" != "P" ] ; then
sudo killall -9 FoxTelem &>/dev/null
FILE=/home/pi/FoxTelemetryData/.foxprofile
@ -36,4 +42,10 @@ sleep 10
fi
else
echo "Don't run FoxTelem since PacSat Ground Station mode is set"
# /home/pi/CubeSatSim/groundstation/pacsat-run.sh
fi
#$SHELL

@ -11,6 +11,8 @@ sudo systemctl stop rtl_tcp &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null

@ -12,6 +12,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 sdrpp &>/dev/null
@ -39,7 +41,9 @@ sudo /etc/init.d/alsa-utils start
echo
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" APRS "Test APRS decoding with CubeSatSim WAV file")
autotune=0
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=400 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" Auto-tune "CubeSatSim Auto-tune" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" APRS "Test APRS decoding with CubeSatSim WAV file")
#echo $frequency
@ -77,6 +81,11 @@ elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then
echo "If your CubeSatSim is transmitting in APRS mode (mode 1) then you should see packets."
echo
elif [ "$frequency" = "Auto-tune" ] ; then
frequency=434900000
autotune=1
elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then
frequency=144800000
@ -157,7 +166,41 @@ echo
#fi
sleep 5
#sleep 5
if [ "$autotune" = "1" ]; then
threshold=1
delay=1
retries=30
echo "Starting Auto-tune scanning"
echo "Scan will stop when confidence exceeds threshold value of " $threshold " or after " $retries " retries"
tries=0
confidence=0
while [ $tries -le $retries ] && [ "$confidence" -le "$threshold" ]; do
# sleep $delay
source /home/pi/venv/bin/activate
python3 /home/pi/CubeSatSim/groundstation/auto-tune.py 434900000 n 2> null > /home/pi/CubeSatSim/groundstation/auto-tune.txt
# echo "auto-tune.txt"
# cat /home/pi/CubeSatSim/groundstation/auto-tune.txt
confidence=$(awk '{print $2}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune confidence: " $confidence
tries=$((tries+1))
done
if [ "$confidence" -gt "$threshold" ]; then
frequency=$(awk '{print $1}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune frequency: " $frequency
else
echo "Auto tune failed, frequency unchanged"
fi
echo
echo "If your CubeSatSim is transmitting in APRS mode (mode 1) then you should see packets."
echo
fi
value=`aplay -l | grep "Loopback"`
echo "$value" > /dev/null

@ -78,7 +78,7 @@ sudo killall -9 direwolf &>/dev/null
fi
sudo killall -9 direwolf &>/dev/null
# sudo killall -9 direwolf &>/dev/null
sleep 10

@ -1,32 +1,46 @@
#!/bin/bash
function start-rtl {
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 -r 48000 -t raw -f S16_LE -c 1
rtl_fm -g 48 -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 &
}
# script to auto decode packets using Direwolf and FM TXC and run Pacsat Ground Station
sudo pkill -f "/home/pi/CubeSatSim/groundstation/direwolf-pacsat-tmp.conf"
loopback=0
vox=0
safe=0
card=0
pwm=0
#rpitx=0
#card=0
#pwm=0
if [ "$1" = "l" ] ; then
loopback=1
elif [ "$1" = "v" ] ; then
vox=1
#elif [ "$1" = "c" ] ; then
# card=1
#else
# pwm=1
fi
elif [ "$1" = "c" ] ; then
card=1
if [[ $(lsusb | grep "RTL") ]] ; then
echo "RTL-SDR detected"
rtl=1
else
pwm=1
fi
echo "No RTL-SDR detected"
rtl=0
# pwm=1
fi
if [[ $(arecord -l | grep "USB Audio Device") ]] ; then
echo "USB Sound Card detected"
@ -36,6 +50,15 @@ else
soundcard=0
fi
gpio -g mode 12 up
if [[ $(gpio -g read 12 | grep 0) ]] ; then
echo "LPF is present"
lpf=1
else
echo "LPF not present"
lpf=0
fi
gpio -g mode 7 up
if [[ $(gpio -g read 7 | grep 0) ]] ; then
echo "TXC is present"
@ -43,24 +66,27 @@ if [[ $(gpio -g read 7 | grep 0) ]] ; then
else
echo "TXC not present"
txc=0
fi
timeout 1 rtl_test &> out.txt
if [[ $(grep "No supported" out.txt) ]] ; then
echo "No RTL-SDR detected"
rtl=0
else
echo "RTL-SDR detected."
rtl=1
fi
FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; then
safe=1
rpitx=1
elif [ "$txc" = "0" ] && [ "$lpf" = "1" ]; then
rpitx=1
else
rpitx=0
fi
if [ "$soundcard" = "0" ] && [ "$rtl" = "0" ]; then
echo "Won't work since can't receive with Sound Card or RTL-SDR"
sleep 10
exit
fi
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
@ -68,29 +94,27 @@ set -- $value
MODE=$1
if [ ! "$MODE" = "P" ] && [ ! "$loopback" = "1" ] ; then
echo
echo "Changing to PacSat Ground Station Mode."
echo "You might reboot"
echo
sleep 5
/home/pi/CubeSatSim/config -I
fi
echo
echo "Mode is not PacSat Ground Station"
echo
echo "Would you like to change to PacSat Ground Station mode and reboot? (y/n)?"
read -r ANS
if [ "$ANS" = "y" ]; then
/home/pi/CubeSatSim/config -I
exit
else
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
set -- $value
echo
echo "You can run the PacSat Ground Station after you change mode and reboot."
sleep 10
exit
fi
callsign="$1"
txfrequency="$7e3"
rxfrequency="$8e3"
frequency="$8e6"
elif [ "$loopback" = "1" ] ; then
echo -n "Callsign is "
echo $callsign
if [ "$loopback" = "1" ] ; then
# if [ ! "$MODE" = "p" ] ; then
echo
@ -104,18 +128,40 @@ elif [ "$loopback" = "1" ] ; then
cd
sudo rm PacSatGroundLoop.zip &>/dev/null
wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p/spacecraft/PacSatGround_0.46o/PacSatGroundLoop.zip
unzip PacSatGroundLoop.zip -d PacSatGroundLoop
sudo rm PacSatGroundLoop.zip
echo
echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign"
sleep 10
# wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b/spacecraft/PacSatGround_0.46o/PacSatGround.zip
cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/PacSatGround.zip .
unzip PacSatGround.zip -d PacSatGroundLoop
sudo rm PacSatGround.zip
mkdir PacSatGroundLoop/spacecraft
mv PacSatGroundLoop/PacSatGround/spacecraft/PacSatSim.properties PacSatGroundLoop/spacecraft/PacSatSim.properties
mv PacSatGroundLoop/PacSatGround/stp.dat PacSatGroundLoop/stp.dat
mv PacSatGroundLoop/PacSatGround/seq.dat PacSatGroundLoop/seq.dat
mv PacSatGroundLoop/PacSatGround/PacSatGround.properties PacSatGroundLoop/PacSatGround.properties
sudo sed -i 's/logfile_dir=\/home\/pi\/PacSatGround/logfile_dir=\/home\/pi\/PacSatGroundLoop/g' /home/pi/PacSatGroundLoop/PacSatGround.properties
FILE=/home/pi/Desktop/PacsatGround/spacecraft/PacSatSim.properties
if [ -f "$FILE" ]; then
FILE2=/home/pi/PacSatGroundLoop/spacecraft/PacSatSim.properties
sudo rm $FILE2
cp $FILE $FILE2
else
echo
echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign"
sleep 10
fi
fi
sudo sed -i "s/TNC_TX_DELAY=.*$/TNC_TX_DELAY=750/g" /home/pi/PacSatGroundLoop/PacSatGround.properties
else
echo -n "Transmit Frequency is "
echo $txfrequency
echo -n "Receive Frequency is "
echo $rxfrequency
sleep 2
echo
echo "Mode is PacSat Ground Station"
echo
@ -124,48 +170,30 @@ else
cd
sudo rm PacSatGround.zip &>/dev/null
wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p/spacecraft/PacSatGround_0.46o/PacSatGround.zip
unzip PacSatGround.zip -d PacSatGround
# wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b/spacecraft/PacSatGround_0.46o/PacSatGround.zip
cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/PacSatGround.zip .
unzip PacSatGround.zip
sudo rm PacSatGround.zip
echo
echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign"
sleep 10
FILE=/home/pi/Desktop/PacsatGround/spacecraft/PacSatSim.properties
if [ -f "$FILE" ]; then
FILE2=/home/pi/PacSatGround/spacecraft/PacSatSim.properties
sudo rm $FILE2
cp $FILE $FILE2
else
echo
echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign"
sleep 10
fi
fi
sudo sed -i "s/TNC_TX_DELAY=.*$/TNC_TX_DELAY=750/g" /home/pi/PacSatGround/PacSatGround.properties
fi
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
set -- $value
callsign="$1"
txfrequency="$7e3"
rxfrequency="$8e3"
echo -n "Callsign is "
echo $callsign
echo -n "Transmit Frequency is "
echo $txfrequency
echo -n "Receive Frequency is "
echo $rxfrequency
echo
sleep 2
sudo sed -i "s/TNC_TX_DELAY=.*$/TNC_TX_DELAY=750/g" /home/pi/PacSatGround/PacSatGround.properties
sudo sed -i "s/TNC_TX_DELAY=.*$/TNC_TX_DELAY=750/g" /home/pi/PacSatGroundLoop/PacSatGround.properties
sudo modprobe snd-aloop
#sudo systemctl stop cubesatsim >/dev/null 2>&1
#sudo systemctl stop transmit >/dev/null 2>&1
sudo systemctl stop command >/dev/null 2>&1
#/home/pi/CubeSatSim/config -I
sudo systemctl stop command >/dev/null 2>&1
sudo systemctl stop openwebrx >/dev/null 2>&1
@ -174,14 +202,12 @@ sudo systemctl stop rtl_tcp >/dev/null 2>&1
pkill -o chromium &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
pkill -o firefox &>/dev/null
#sudo killall -9 direwolf &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 sdrpp &>/dev/null
#sudo killall -9 aplay &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
@ -192,77 +218,107 @@ sudo killall -9 CubicSDR &>/dev/null
sudo killall -9 zenity &>/dev/null
#sudo systemctl restart pacsatsim
#sudo /etc/init.d/alsa-utils stop
#sudo /etc/init.d/alsa-utils start
sudo usermod -a -G gpio pi
if [ "$loopback" = "1" ] ; then
echo "Using Audio Loopback"
echo "1: Using Audio Loopback, No Transmit or Receive"
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1"
PTT="PTT GPIOD gpiochip0 17"
elif [ "$safe" = "1" ] ; then
else
ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
if [ "$lpf" = "1" ] ; then
if [ ! "$txc" = "1" ] ; then
echo "Safe mode - battery saver won't work since no TXC present"
sleep 5
elif [ ! "$soundcard" = "1" ] ; then
echo "Safe mode - battery saver won't work since no sound card present"
sleep 5
else
echo "Safe mode - battery saver"
fi
if [ "$txc" = "1" ] && [ "$soundcard" = "1" ] ; then
if [ "$rpitx" = "1" ] ; then
elif [ "$vox" = "1" ] ; then
echo "2: Using FM for Receive and rpitx for Transmit"
ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
else
ADEVICE="ADEVICE plughw:CARD=Device,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
echo "3: Using FM for Receive and Transmit"
ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0"
PTT="PTT GPIOD gpiochip0 -20"
fi
elif [ "$txc" = "1" ] && [ "$soundcard" = "0" ] ; then
if [ "$rtl" = "1" ]; then
if [ "$rpitx" = "1" ]; then
if [ "$soundcard" = "1" ] ; then
echo "Using Soundcard Audio TX and RX (VOX, no PTT)"
else
echo "Soundcard Audio TX and RX (VOX, no PTT) will not work since no sound card present"
sleep 5
fi
echo "2b: Using RTL-SDR for Receive and rpitx for Transmit"
start-rtl
# ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
else
elif [ "$pwm" = "1" ] ; then
echo "3b: RTL-SDR for Receive Only"
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1"
PTT="#PTT GPIOD gpiochip0 17"
ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0"
PTT="PTT GPIOD gpiochip0 -20"
fi
else
echo "Won't work since can't receive with Sound Card or RTL-SDR"
sleep 10
exit
fi
else
if [ "$rtl" = "1" ]; then
echo "4: Using RTL-SDR for Receive and rpitx for Transmit"
start-rtl
# ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
else
echo "5: Using Sound Card for Receive and rpitx for Transmit"
ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
fi
fi
if [ ! "$txc" = "1" ] ; then
echo "FM TXC using Soundcard input (JP13), PWM output won't work since no TXC present"
sleep 5
elif [ ! "$soundcard" = "1" ] ; then
echo "FM TXC using Soundcard input (JP13), PWM output won't work since no sound card present"
sleep 5
else
echo "FM TXC using Soundcard input (JP13), PWM output"
fi
else
if [ "$txc" = "1" ] ; then
echo "6: Using FM for Receive Only"
ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0"
PTT="#PTT GPIOD gpiochip0 -20"
echo "FM TXC using Soundcard input (JP13) and output (JP14)"
ADEVICE="ADEVICE shared_mic plughw:CARD=Device,DEV=0"
PTT="PTT GPIOD gpiochip0 -20"
else
if [ "$rtl" = "1" ] ; then
if [ ! "$txc" = "1" ] ; then
echo "FM TXC using Soundcard input (JP13) and output (JP14) won't work since no TXC present"
sleep 5
elif [ ! "$soundcard" = "1" ] ; then
echo "FM TXC using Soundcard input (JP13), output (JP14) won't work since no sound card present"
sleep 5
else
echo "FM TXC using Soundcard input (JP13), output JP14"
start-rtl
echo "7: Using RTL-SDR for Receive Only"
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1"
PTT="#PTT GPIOD gpiochip0 17"
else
echo "8: Using Sound Card for Receive and Transmit"
ADEVICE="ADEVICE plughw:CARD=Device,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
fi
fi
fi
fi
DIREWOLF_CONF="/home/pi/CubeSatSim/groundstation/direwolf-pacsat-tmp.conf"
@ -278,7 +334,7 @@ echo
cat $DIREWOLF_CONF
echo
direwolf -r 48000 -c $DIREWOLF_CONF -t 0 &
direwolf -P+ -D1 -qd -r 48000 -c $DIREWOLF_CONF &
cd /home/pi/Desktop/PacsatGround/

@ -23,6 +23,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 java &>/dev/null
sudo killall -9 rtl_fm &>/dev/null

@ -29,6 +29,8 @@ sleep 2
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo systemctl stop rtl_tcp &>/dev/null
sudo killall -9 sdrpp &>/dev/null

@ -5,7 +5,7 @@ echo "Script to run Web SDR for ARISS Radio Pi"
echo
echo "The Chromium browser will load in a few seconds with OpenWebRX."
echo "The 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."
@ -32,6 +32,8 @@ sudo killall -9 rtl_fm &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
sudo killall -9 CubicSDR &>/dev/null
@ -59,7 +61,8 @@ sudo systemctl restart openwebrx
sleep 10
setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars --app=http://localhost:8073 &>/dev/null &
#setsid chromium-browser --password-store=basic --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars --app=http://localhost:8073 &>/dev/null &
setsid x-www-browser http://localhost:8073/
sleep 10

@ -15,6 +15,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 direwolf &>/dev/null

@ -15,6 +15,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
sudo killall -9 java &>/dev/null

@ -21,6 +21,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null

@ -22,6 +22,8 @@ sudo systemctl stop rtl_tcp &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
sudo killall -9 java &>/dev/null
@ -39,7 +41,9 @@ sudo killall -9 rtl_fm &>/dev/null
#echo "s" >> .mode
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=220 --title="SSTV Decoding using QSSTV" --text="Choose the frequency for SSTV decoding:" --column="kHz" --column="Use" 145800 "ISS" 434900 "CubeSatSim" Other "Choose another frequency" SSTV "Test SSTV decoding with WAV file")
autotune=0
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=270 --title="SSTV Decoding using QSSTV" --text="Choose the frequency for SSTV decoding:" --column="kHz" --column="Use" 145800 "ISS" 434900 "CubeSatSim" Auto-tune "CubeSatSim Auto-tune" Other "Choose another frequency" SSTV "Test SSTV decoding with WAV file")
echo $frequency
@ -75,6 +79,11 @@ echo
echo "If your CubeSatSim is transmitting in SSTV mode (mode 4) you should get images."
echo "Note: if you see and hear an SSTV signal but don't get any images, the CubeSatSim signal might have a frequency offset. Try rebooting the CubeSatSim to fix."
elif [ "$frequency" = "Auto-tune" ]; then
frequency=434900000
autotune=1
elif [ "$choice" = "3" ] || [ "$frequency" = "Other" ]; then
echo
@ -120,14 +129,48 @@ echo
echo -e "Auto decoding SSTV on $frequency Hz"
sleep 2
#sleep 2
setsid qsstv &
sleep 5
#sleep 5
if [ "$autotune" = "1" ]; then
threshold=1
delay=5
retries=5
echo "Starting Auto-tune scanning"
echo "Scan will stop when confidence exceeds threshold value of" $threshold "or after" $retries "retries"
tries=0
confidence=0
delay=$((delay-2)) # subtract 2 second built in delay
while [ $tries -le $retries ] && [ "$confidence" -le "$threshold" ]; do
sleep $delay
source /home/pi/venv/bin/activate
python3 /home/pi/CubeSatSim/groundstation/auto-tune.py 434900000 n 2> null > /home/pi/CubeSatSim/groundstation/auto-tune.txt
# echo "auto-tune.txt"
# cat /home/pi/CubeSatSim/groundstation/auto-tune.txt
confidence=$(awk '{print $2}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune confidence:" $confidence
tries=$((tries+1))
done
if [ "$confidence" -gt "$threshold" ]; then
frequency=$(awk '{print $1}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune frequency:" $frequency
else
echo "Auto tune failed, frequency unchanged"
fi
echo
echo "If your CubeSatSim is transmitting in SSTV mode (mode 4) you should get images."
echo
#sudo systemctl restart cubesatsim
fi
#sudo systemctl restart cubesatsim
value=`aplay -l | grep "Loopback"`
echo "$value" > /dev/null

@ -21,6 +21,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null

@ -65,10 +65,10 @@ if [[ $(grep '11.' /etc/debian_version) ]]; then
sudo sed -i 's/console=serial0,115200 //g' /boot/cmdline.txt
# sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2
sudo sed -i 's/console=tty1 maxcpus=1 r/console=tty1 r/g' /boot/cmdline.txt
sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=2 r/g' /boot/cmdline.txt # single core if Pi Zero 2
# sudo sed -i 's/console=tty1 maxcpus=1 r/console=tty1 r/g' /boot/cmdline.txt
# sudo sed -i 's/maxcpus=2/maxcpus=1/g' /boot/cmdline.txt # single core if Pi Zero 2
sudo sed -i 's/maxcpus=1/maxcpus=2/g' /boot/cmdline.txt # single core if Pi Zero 2
sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/config.txt
@ -163,11 +163,10 @@ if [[ $(grep 'bookworm' /etc/os-release) ]]; then
sudo sed -i 's/console=serial0,115200 //g' /boot/firmware/cmdline.txt
# sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/firmware/cmdline.txt # single core if Pi Zero 2
sudo sed -i 's/console=tty1 maxcpus=1 r/console=tty1 r/g' /boot/firmware/cmdline.txt
sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=2 r/g' /boot/firmware/cmdline.txt # single core if Pi Zero 2
# sudo sed -i 's/console=tty1 maxcpus=1 r/console=tty1 r/g' /boot/firmware/cmdline.txt
# sudo sed -i 's/maxcpus=2/maxcpus=1/g' /boot/firmware/cmdline.txt # single core if Pi Zero 2
sudo sed -i 's/maxcpus=1/maxcpus=2/g' /boot/firmware/cmdline.txt # single core if Pi Zero 2
sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/firmware/config.txt
@ -405,12 +404,21 @@ fi
sudo systemctl disable gpsd
sudo systemctl disable gpsd.socket
if [ ! -d "/home/pi/WiringPi" ]; then
#if [ ! -d "/home/pi/WiringPi" ]; then
# cd
# git clone https://github.com/alanbjohnston/WiringPi
# cd WiringPi
# ./build debian
# sudo dpkg -i debian-template/wiringpi-2.61-1.deb
#fi
if [ ! -d "/home/pi/WiringPi3" ]; then
cd
git clone https://github.com/alanbjohnston/WiringPi
cd WiringPi
git clone https://github.com/WiringPi/WiringPi.git WiringPi3
cd WiringPi3
./build debian
sudo dpkg -i debian-template/wiringpi-2.61-1.deb
mv debian-template/wiringpi*.deb .
sudo apt install ./wiringpi*.deb
fi
cd
@ -508,8 +516,8 @@ FILE=/home/pi/pi_pacsat/Debug/pi_pacsat # code has already been compiled
if [ ! -f "$FILE" ]; then
cd
#git clone https://github.com/alanbjohnston/pi_pacsat.git
git clone https://github.com/ac2cz/pi_pacsat.git
git clone https://github.com/alanbjohnston/pi_pacsat.git
#git clone https://github.com/ac2cz/pi_pacsat.git
cd pi_pacsat
#git checkout master-debug
cd Debug
@ -587,10 +595,10 @@ sudo raspi-config nonint do_vnc 0
if [ ! -d "/home/pi/Desktop/PacsatGround" ]; then
cd /tmp
wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46o.tar.gz
tar -xzf PacsatGround_unix_0_46o.tar.gz -C /home/pi/Desktop
rm PacsatGround_unix_0_46o.tar.gz
cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/* /home/pi/Desktop/PacsatGround/spacecraft/
wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46q.tar.gz
tar -xzf PacsatGround_unix_0_46q.tar.gz -C /home/pi/Desktop
rm PacsatGround_unix_0_46q.tar.gz
# cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/* /home/pi/Desktop/PacsatGround/spacecraft/
# mkdir /home/pi/PacSatGround
sudo usermod -a -G gpio pi
sudo apt-get install default-jdk -y
@ -612,6 +620,7 @@ fi
if [ ! -d "/home/pi/rpitx" ]; then
sudo apt install -y libraspberrypi-dev
cd
git clone https://github.com/alanbjohnston/rpitx.git
cd rpitx

@ -50,14 +50,14 @@ else
txc=0
fi
timeout 1 rtl_test &> out.txt
if [[ $(grep "No supported" out.txt) ]] ; then
echo "No RTL-SDR detected"
rtl=0
else
echo "RTL-SDR detected."
rtl=1
fi
#timeout 1 rtl_test &> out.txt
#if [[ $(grep "No supported" out.txt) ]] ; then
# echo "No RTL-SDR detected"
# rtl=0
#else
# echo "RTL-SDR detected."
# rtl=1
#fi
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
@ -67,7 +67,7 @@ callsign="$1"
txfrequency="$7e3"
rxfrequency="$8e3"
echo -n "PacSat allsign is "
echo -n "PacSat callsign is "
echo $callsign
echo -n "Transmit Frequency is "
echo $txfrequency
@ -84,11 +84,12 @@ if [ ! -d "/home/pi/PacSat" ]; then
cd
sudo rm pacsat-dir.zip
mkdir PacSat
mkdir PacSat/pacsat
mkdir PacSat/pacsat/dir
wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.1/pacsat-dir.zip
unzip pacsat-dir.zip -d PacSat/pacsat/dir
mkdir /home/pi/PacSat
mkdir /home/pi/PacSat/pacsat
mkdir /home/pi/PacSat/pacsat/dir
# wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.2/pacsat-dir.zip
cp /home/pi/pi_pacsat/zip/pacsat-dir.zip .
unzip pacsat-dir.zip
sudo rm pacsat-dir.zip
cd
@ -96,8 +97,9 @@ if [ ! -d "/home/pi/PacSat" ]; then
sudo rm /home/pi/pi_pacsat/Debug/pacsat.state
sudo rm /home/pi/pi_pacsat/Debug/pacsat_upload_table.dat
sudo rm pi_pacsat.zip
wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.1/pi_pacsat.zip
unzip pi_pacsat.zip -d /home/pi/pi_pacsat/Debug
# wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.2/pi_pacsat.zip
cp /home/pi/pi_pacsat/zip/pi_pacsat.zip .
unzip pi_pacsat.zip -d /
sudo rm pi_pacsat.zip
# mkdir /home/pi/PacSat
@ -296,7 +298,8 @@ echo
cat $DIREWOLF_CONF
echo
direwolf -P+ -D1 -qd -dp -r 48000 -c $DIREWOLF_CONF -t 0 &
#direwolf -P+ -D1 -qd -dp -r 48000 -c $DIREWOLF_CONF -t 0 &
direwolf -qd -r 48000 -c $DIREWOLF_CONF &
# arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 &
## arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 4000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 &

Loading…
Cancel
Save

Powered by TurnKey Linux.