diff --git a/config b/config index b5917680..5c3ca9eb 100755 --- a/config +++ b/config @@ -1424,7 +1424,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 @@ -1442,6 +1442,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 @@ -1451,11 +1453,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 @@ -1812,16 +1828,23 @@ 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 "Do you want to change the transmit frequency (for example to 434.9 MHz)?" + + read input + echo + + if [ "$input" = "y" ] || [ "$input" = "yes" ] ; then + /home/pi/CubeSatSim/config -F n + fi + fi elif [ "$1" = "-I" ]; then @@ -1855,18 +1878,6 @@ elif [ "$1" = "-I" ]; then fi fi - -# if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then -# FILE=/home/pi/CubeSatSim/battery_saver -# if [ -f "$FILE" ]; then -# restart=1 -# else -# reboot=1 -# fi -# else -# restart=1 -# fi - elif [ "$1" = "-k" ]; then echo diff --git a/groundstation/aprs-cubesatsim.sh b/groundstation/aprs-cubesatsim.sh index f71a70e3..dfc30e03 100755 --- a/groundstation/aprs-cubesatsim.sh +++ b/groundstation/aprs-cubesatsim.sh @@ -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 diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index 427c36cb..358d8bf6 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -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 diff --git a/groundstation/autostart/chromium.desktop b/groundstation/autostart/chromium.desktop index 5fd6bef0..f6e74ffd 100644 --- a/groundstation/autostart/chromium.desktop +++ b/groundstation/autostart/chromium.desktop @@ -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/ diff --git a/groundstation/chromium.desktop.autostart b/groundstation/chromium.desktop.autostart index da2a350e..76d785f9 100644 --- a/groundstation/chromium.desktop.autostart +++ b/groundstation/chromium.desktop.autostart @@ -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 diff --git a/groundstation/cubicsdr-packet.sh b/groundstation/cubicsdr-packet.sh index c5f0a1e8..a14fa706 100755 --- a/groundstation/cubicsdr-packet.sh +++ b/groundstation/cubicsdr-packet.sh @@ -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 diff --git a/groundstation/cubicsdr.sh b/groundstation/cubicsdr.sh index 3b125dc6..0db3a88e 100755 --- a/groundstation/cubicsdr.sh +++ b/groundstation/cubicsdr.sh @@ -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 diff --git a/groundstation/fctelem.sh b/groundstation/fctelem.sh index 0b4c92a3..b61b9a4e 100755 --- a/groundstation/fctelem.sh +++ b/groundstation/fctelem.sh @@ -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 @@ -174,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 diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 27050f9a..0065548e 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -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 diff --git a/groundstation/packet.sh b/groundstation/packet.sh index c8fdef00..627d04da 100755 --- a/groundstation/packet.sh +++ b/groundstation/packet.sh @@ -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 diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 85db5762..e61d3fc1 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -36,6 +36,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" @@ -44,7 +53,7 @@ else echo "TXC not present" txc=0 - timeout 1 rtl_test &> out.txt + timeout 1 timeout 1 rtl_test &> out.txt if [[ $(grep "No supported" out.txt) ]] ; then echo "No RTL-SDR detected" rtl=0 @@ -155,6 +164,7 @@ set -- $value callsign="$1" txfrequency="$7e3" rxfrequency="$8e3" +frequency="$8e6" echo -n "Callsign is " echo $callsign @@ -186,6 +196,8 @@ sudo systemctl stop rtl_tcp >/dev/null 2>&1 pkill -o chromium &>/dev/null +pkill -o firefox &>/dev/null + sudo killall -9 rtl_fm &>/dev/null #sudo killall -9 direwolf &>/dev/null @@ -211,6 +223,20 @@ sudo killall -9 zenity &>/dev/null sudo usermod -a -G gpio pi +if [ "$lpf" = "0" ] && [ "$txc" = "0" ] ; then + loopback=1 + + 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 -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 & + +fi + if [ "$loopback" = "1" ] ; then echo "Using Audio Loopback" diff --git a/groundstation/rtl-tcp-d.sh b/groundstation/rtl-tcp-d.sh index b19539b7..2bda312a 100755 --- a/groundstation/rtl-tcp-d.sh +++ b/groundstation/rtl-tcp-d.sh @@ -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 diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index 3d49d11d..3260b865 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -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 diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh index 11298cd9..b4c5504c 100755 --- a/groundstation/sdr.sh +++ b/groundstation/sdr.sh @@ -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 --password-store=basic --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 diff --git a/groundstation/sdrpp.sh b/groundstation/sdrpp.sh index 2dd97fd1..e8f83e3e 100755 --- a/groundstation/sdrpp.sh +++ b/groundstation/sdrpp.sh @@ -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 diff --git a/groundstation/sstv_decode.sh b/groundstation/sstv_decode.sh index b539d2b0..7c3f64aa 100755 --- a/groundstation/sstv_decode.sh +++ b/groundstation/sstv_decode.sh @@ -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 diff --git a/groundstation/sstv_decode_iss.sh b/groundstation/sstv_decode_iss.sh index c72ee286..46e64498 100755 --- a/groundstation/sstv_decode_iss.sh +++ b/groundstation/sstv_decode_iss.sh @@ -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 diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index 5a398622..79c794c2 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -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 diff --git a/groundstation/sstv_decode_sim.sh b/groundstation/sstv_decode_sim.sh index 3b72c7a4..f4451d30 100755 --- a/groundstation/sstv_decode_sim.sh +++ b/groundstation/sstv_decode_sim.sh @@ -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