diff --git a/command b/command index f4c96b1d..4021f59b 100755 --- a/command +++ b/command @@ -2,6 +2,8 @@ echo -e "\nCommand and Control script for CubeSatSim v2.1\n" +sudo modprobe snd-aloop + sudo modprobe snd-aloop FILE=/home/pi/CubeSatSim/command_control @@ -58,11 +60,11 @@ if [[ $(arecord -l | grep "USB Audio Device") ]] && [ -f "$FILE" ]; then echo "debug mode" - direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d + direwolf -P+ -D1 -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d else - direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py + direwolf -P+ -D1 -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py fi else diff --git a/config b/config index 134819d1..0a5993d3 100755 --- a/config +++ b/config @@ -43,6 +43,9 @@ function transmit_command { j) number=7 ;; + p) + number=8 + ;; o) number=10 ;; @@ -92,7 +95,9 @@ function check_restart { echo "$value" > /dev/null set -- $value - if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then + if [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 + elif [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] || [ "$1" == "j" ] ; then FILE=/home/pi/CubeSatSim/battery_saver if [ -f "$FILE" ]; then restart=1 @@ -162,6 +167,10 @@ if [ "$1" = "" ]; then else echo -n "APRS" fi + elif [ "$1" = "p" ]; then + echo "Mode is Pacsat" + elif [ "$1" = "P" ]; then + echo "Mode is Pacsat Ground Station" else echo fi @@ -383,7 +392,11 @@ elif [ "$1" = "-f" ]; then echo "changing CubeSatSim to FSK mode" sudo echo "f" > /home/pi/CubeSatSim/.mode - restart=1 + if [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 + else + restart=1 + fi fi elif [ "$1" = "-b" ]; then @@ -400,7 +413,11 @@ elif [ "$1" = "-b" ]; then echo "changing CubeSatSim to BPSK mode" sudo echo "b" > /home/pi/CubeSatSim/.mode - restart=1 + if [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 + else + restart=1 + fi fi elif [ "$1" = "-s" ]; then @@ -482,8 +499,10 @@ elif [ "$1" = "-c" ]; then echo "$value" > /dev/null set -- $value + oldcallsign="$1" + echo "Current value of CALLSIGN is" - echo $1 + echo $oldcallsign echo # echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${12} ${13} @@ -669,6 +688,7 @@ elif [ "$1" = "-C" ]; then sudo systemctl stop cubesatsim sudo systemctl stop transmit sudo systemctl stop command + sudo systemctl stop pacsatsim sudo mv -f /home/pi/CubeSatSim/telem.txt /home/pi/CubeSatSim/telem.txt.bk @@ -1239,7 +1259,10 @@ elif [ "$1" = "-e" ]; then echo "changing CubeSatSim to Repeater mode" sudo echo "e" > /home/pi/CubeSatSim/.mode - restart=1 + if [ "$1" = "p" ] || [ "$1" = "P" ] ; then + reboot=1 + else + restart=1 fi elif [ "$1" = "-n" ]; then @@ -1262,6 +1285,10 @@ elif [ "$1" = "-n" ]; then echo "Switching to mode "$new sudo echo $new > /home/pi/CubeSatSim/.mode restart=1 + elif [ "$1" = "p" ] || [ "$1" = "P" ] ; then + echo "Switching to PacSat mode" + sudo echo $new > /home/pi/CubeSatSim/.mode + reboot=1 else echo "Switching to BPSK mode" sudo echo "b" > /home/pi/CubeSatSim/.mode @@ -1314,7 +1341,7 @@ elif [ "$1" = "-A" ]; then sudo systemctl stop cubesatsim sudo systemctl stop transmit - sudo python3 -u /home/pi/CubeSatSim/transmit.py x > /dev/null 2>&1 & # Force APRS mode +# sudo python3 -u /home/pi/CubeSatSim/transmit.py x > /dev/null 2>&1 & # Force APRS mode fi sudo systemctl stop command @@ -1323,7 +1350,7 @@ elif [ "$1" = "-A" ]; then while [ "$MODE" != "x" ]; do - echo "Enter the mode to change: a=APRS, f=FSK, b=BPSK, s=SSTV, m=CW, e=Repeater, j=FUNcube, o=Beacon on/off x=Exit this mode" + echo "Enter the mode to change: a=APRS, f=FSK, b=BPSK, s=SSTV, m=CW, e=Repeater, j=FUNcube, p=PacSat, o=Beacon on/off x=Exit this mode" read MODE if [ "$MODE" != "x" ]; then @@ -1747,6 +1774,61 @@ reboot=1 fi +elif [ "$1" = "-G" ]; then + + echo "Changing to PacSatSim mode" + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + +# echo "changing CubeSatSim to Pacsat mode" + + reboot=1 + sudo echo "p" > /home/pi/CubeSatSim/.mode +# if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then +# FILE=/home/pi/CubeSatSim/battery_saver +# if [ -f "$FILE" ]; then +# restart=1 +# else +# reboot=1 +# fi +# else +# restart=1 +# fi + +elif [ "$1" = "-I" ]; then + + echo "Changing to PacSat Ground Station mode" + echo + echo "Run the Pacsat Ground Station in the Desktop" + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + +# echo "changing CubeSatSim to Pacsat mode" + + reboot=1 + sudo echo "P" > /home/pi/CubeSatSim/.mode +# if [ "$1" == "f" ] || [ "$1" == "b" ] || [ "$1" == "e" ] ; then +# FILE=/home/pi/CubeSatSim/battery_saver +# if [ -f "$FILE" ]; then +# restart=1 +# else +# reboot=1 +# fi +# else +# restart=1 +# fi + +elif [ "$1" = "-k" ]; then + + echo + echo "Reset PacSatSim configuration" + echo + sudo systemctl stop pacsatsim &>/dev/null + sudo rm -r /home/pi/PacSat + reboot=1 + elif [ "$1" = "-h" ]; then echo "config OPTION" @@ -1762,13 +1844,16 @@ elif [ "$1" = "-h" ]; then echo " -j Change to FUNcube mode" echo " -n Change to Transmit Commands mode" echo " -e Change to Repeater mode" + echo " -j Change to FUNcube mode" + echo " -G Change to PacSatSim mode" + echo " -I Change to PacSat Ground Station mode" echo " -i Restart CubeSatsim software" echo " -c Change the CALLSIGN in the configuration file sim.cfg" echo " -t Change the Simulated Telemetry setting in sim.cfg" echo " -r Change the Resets Count in the configuration file sim.cfg" echo " -l Change the Latitude and Longitude in the configuration file sim.cfg" echo " -S Scan both I2C buses on the Raspberry Pi" - echo " -C Clear logs" + echo " -C Clear logs and reboot" echo " -T Change command and control state" echo " -d Change command and control Direwolf state" echo " -R Change the Commands Count in the file command_count.txt" @@ -1779,7 +1864,7 @@ elif [ "$1" = "-h" ]; then echo " -H Change the Balloon (HAB) mode" echo " -p Display payload sensor data for 3 seconds" echo " -v Display voltage and current data" - echo " -P Change the PL (Private Line) CTCSS/CDCSS codes for RX and TX" + echo " -P Change the PL (Private Line) CTCSS/CDCSS codes for FM RX and TX" echo " -A Transmit APRS control packets to control another CubeSatSim" echo " -D Change Transmit Commands state APRS or DTMF" echo " -o Change telemetry beacon transmit state" @@ -1789,6 +1874,8 @@ elif [ "$1" = "-h" ]; then echo " -U Change the random failure mode setting" echo " -N Set next mode or failure" echo " -u Change gpsd state" + echo " -k Reset the PacSatSim Configuration" + echo exit diff --git a/direwolf-cc.conf b/direwolf-cc.conf index 26f8805b..af71089d 100644 --- a/direwolf-cc.conf +++ b/direwolf-cc.conf @@ -1,2 +1,9 @@ ADEVICE shared_mic hw:CARD=Loopback,DEV=1 DTMF +MYCALL AMSAT +CHANNEL 0 +MODEM 1200 +FULLDUP OFF +TXDELAY 0 +AGWPORT 8200 +KISSPORT 8201 diff --git a/direwolf/direwolf-pacsatsim-jp14-half.conf b/direwolf/direwolf-pacsatsim-jp14-half.conf new file mode 100644 index 00000000..d6a05876 --- /dev/null +++ b/direwolf/direwolf-pacsatsim-jp14-half.conf @@ -0,0 +1,9 @@ +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +#PTT GPIO 20 +MYCALL AMSAT-12 +CHANNEL 0 +MODEM 1200 +#FULLDUP ON +FULLDUP OFF +TXDELAY 15 +#FIX_BITS 1 AX25 diff --git a/direwolf/direwolf-pacsatsim-jp14-loop.conf b/direwolf/direwolf-pacsatsim-jp14-loop.conf new file mode 100644 index 00000000..bd04ddbc --- /dev/null +++ b/direwolf/direwolf-pacsatsim-jp14-loop.conf @@ -0,0 +1,15 @@ +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Loopback,DEV=0 +#PTT GPIO -20 +MYCALL AMSAT-12 +CHANNEL 0 +MODEM 1200 +#FULLDUP ON +TXDELAY 15 +#FIX_BITS 1 AX25 +# +DWAIT 0 +SLOTTIME 10 +PERSIST 63 +TXDELAY 1000 +TXTAIL 10 +FULLDUP OFF diff --git a/direwolf/direwolf-pacsatsim-jp14.conf b/direwolf/direwolf-pacsatsim-jp14.conf new file mode 100644 index 00000000..750c0fee --- /dev/null +++ b/direwolf/direwolf-pacsatsim-jp14.conf @@ -0,0 +1,19 @@ +#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +ADEVICE shared_mic plughw:CARD=Device,DEV=0 +PTT GPIO -20 +MYCALL AMSAT-12 +CHANNEL 0 +MODEM 1200 +##FULLDUP ON +##TXDELAY 15 +#FIX_BITS 1 AX25 + +# +DWAIT 0 +SLOTTIME 10 +PERSIST 63 +TXDELAY 1000 +#TXDELAY 100 +TXTAIL 10 +#TXTAIL 1 +FULLDUP OFF diff --git a/direwolf/direwolf-pacsatsim-loopback.conf b/direwolf/direwolf-pacsatsim-loopback.conf new file mode 100644 index 00000000..f2ebf026 --- /dev/null +++ b/direwolf/direwolf-pacsatsim-loopback.conf @@ -0,0 +1,18 @@ +ADEVICE plughw:CARD=Loopback,DEV=0 plughw:CARD=Loopback,DEV=0 +PTT GPIO -20 +MYCALL AMSAT-12 +CHANNEL 0 +MODEM 1200 +##FULLDUP ON +##TXDELAY 15 +#FIX_BITS 1 AX25 + +# +DWAIT 0 +SLOTTIME 10 +PERSIST 63 +TXDELAY 1000 +#TXDELAY 100 +TXTAIL 10 +#TXTAIL 1 +FULLDUP OFF diff --git a/direwolf/direwolf-pacsatsim-pwm.conf b/direwolf/direwolf-pacsatsim-pwm.conf new file mode 100644 index 00000000..58667777 --- /dev/null +++ b/direwolf/direwolf-pacsatsim-pwm.conf @@ -0,0 +1,19 @@ +#ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +ADEVICE shared_mic plughw:CARD=Headphones,DEV=0 +PTT GPIO -20 +MYCALL AMSAT-12 +CHANNEL 0 +MODEM 1200 +##FULLDUP ON +##TXDELAY 15 +#FIX_BITS 1 AX25 + +# +DWAIT 0 +SLOTTIME 10 +PERSIST 63 +TXDELAY 1000 +#TXDELAY 100 +TXTAIL 10 +#TXTAIL 1 +FULLDUP OFF diff --git a/direwolf/direwolf-pacsatsim.conf b/direwolf/direwolf-pacsatsim.conf new file mode 100644 index 00000000..87f09de1 --- /dev/null +++ b/direwolf/direwolf-pacsatsim.conf @@ -0,0 +1,6 @@ +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +PTT GPIO 20 +MYCALL AMSAT +CHANNEL 0 +MODEM 1200 +FULLDUP OFF diff --git a/direwolf/direwolf-transmit-dtmf.conf b/direwolf/direwolf-transmit-dtmf.conf index a2fdd69c..f5853dff 100644 --- a/direwolf/direwolf-transmit-dtmf.conf +++ b/direwolf/direwolf-transmit-dtmf.conf @@ -1,4 +1,5 @@ ADEVICE hw:CARD=Loopback,DEV=0 hw:CARD=Headphones,DEV=0 +PTT GPIO 20 MYCALL AMSAT CHANNEL 0 MODEM 1200 diff --git a/dtmf_aprs_cc.py b/dtmf_aprs_cc.py index cd883f5a..6afef09e 100644 --- a/dtmf_aprs_cc.py +++ b/dtmf_aprs_cc.py @@ -1,7 +1,7 @@ import sys from os import system -# import RPi.GPIO as GPIO -# from RPi.GPIO import output +#import RPi.GPIO as GPIO +#from RPi.GPIO import output from time import sleep import logging logging.basicConfig(format='%(message)s') @@ -27,154 +27,167 @@ if __name__ == "__main__": if ('d' == sys.argv[1]): debug_mode = True - try: - for line in sys.stdin: - # if (debug_mode): - print(line, end =" ") - logging.warning(line) - - # if '^c' == line.rstrip(): - # break - - if ((line.find("MODE=a")) > 0): - system("echo '\nAPRS Mode!!\n'") - mode = 'a' - change_mode = True - if ((line.find("DTMF>APDW15:t1#")) > 0): - system("echo '\nAPRS Mode!!\n'") - mode = 'a' - change_mode = True - if ((line.find("MODE=f")) > 0): - system("echo '\nFSK Mode!!\n'") - mode = 'f' - change_mode = True - if ((line.find("DTMF>APDW15:t2#")) > 0): - system("echo '\nFSK Mode!!\n'") - mode = 'f' - change_mode = True - if ((line.find("MODE=b")) > 0): - system("echo '\nBPSK Mode!!\n'") - mode = 'b' - change_mode = True - if ((line.find("DTMF>APDW15:t3#")) > 0): - system("echo '\nBPSK Mode!!\n'") - mode = 'b' - change_mode = True - if ((line.find("MODE=s")) > 0): - system("echo '\nSSTV Mode!!\n'") - mode = 's' - change_mode = True - if ((line.find("DTMF>APDW15:t4#")) > 0): - system("echo '\nSSTV Mode!!\n'") - mode = 's' - change_mode = True - if ((line.find("MODE=m")) > 0): - system("echo '\nCW Mode!!\n'") - mode = 'm' - change_mode = True - if ((line.find("DTMF>APDW15:t5#")) > 0): - system("echo '\nCW Mode!!\n'") - mode = 'm' - change_mode = True - if ((line.find("MODE=e")) > 0): - system("echo '\nRepeater Mode!!\n'") - mode = 'e' - change_mode = True - if ((line.find("DTMF>APDW15:t6#")) > 0): - system("echo '\nRepeater Mode!!\n'") - mode = 'e' - change_mode = True - if ((line.find("MODE=j")) > 0): - system("echo '\nFUNcube Mode!!\n'") - mode = 'j' - change_mode = True - if ((line.find("DTMF>APDW15:t7#")) > 0): - system("echo '\nFUNcube Mode!!\n'") - mode = 'j' - change_mode = True - if ((line.find("MODE=n")) > 0): - system("echo '\nTransmit Commands Mode!!\n'") - mode = 'n' - change_mode = True - if ((line.find("DTMF>APDW15:t11#")) > 0): - system("echo '\nTransmit Commands Mode!!\n'") - mode = 'n' - change_mode = True - if ((line.find("MODE=o")) > 0): - counter = (counter + 1) % 2 # Direwolf prints it twice, only do once - if (counter == 1): + while True: + try: + for line in sys.stdin: + # if (debug_mode): + print(line, end =" ") + logging.warning(line) + + # if '^c' == line.rstrip(): + # break + + if ((line.find("MODE=a")) > 0): + system("echo '\nAPRS Mode!!\n'") + mode = 'a' + change_mode = True + + if ((line.find(":t1#")) > 0): + system("echo '\nAPRS Mode!!\n'") + mode = 'a' + change_mode = True + if ((line.find("MODE=f")) > 0): + system("echo '\nFSK Mode!!\n'") + mode = 'f' + change_mode = True + + if ((line.find(":t2#")) > 0): + system("echo '\nFSK Mode!!\n'") + mode = 'f' + change_mode = True + if ((line.find("MODE=b")) > 0): + system("echo '\nBPSK Mode!!\n'") + mode = 'b' + change_mode = True + + if ((line.find(":t3#")) > 0): + system("echo '\nBPSK Mode!!\n'") + mode = 'b' + change_mode = True + if ((line.find("MODE=s")) > 0): + system("echo '\nSSTV Mode!!\n'") + mode = 's' + change_mode = True + + if ((line.find(":t4#")) > 0): + system("echo '\nSSTV Mode!!\n'") + mode = 's' + change_mode = True + + if ((line.find("MODE=m")) > 0): + system("echo '\nCW Mode!!\n'") + mode = 'm' + change_mode = True + + if ((line.find(":t5#")) > 0): + system("echo '\nCW Mode!!\n'") + mode = 'm' + change_mode = True + + if ((line.find("MODE=e")) > 0): + system("echo '\nRepeater Mode!!\n'") + mode = 'e' + change_mode = True + + if ((line.find(":t6#")) > 0): + system("echo '\nFUNcube Mode!!\n'") + mode = 'j' + change_mode = True + + if ((line.find("MODE=G")) > 0): + system("echo '\nPacSatSim Mode!!\n'") + mode = 'p' + change_mode = True + + if ((line.find(":t8#")) > 0): + system("echo '\nPacSatSim Mode!!\n'") + mode = 'p' + change_mode = True + + if ((line.find("MODE=n")) > 0): + system("echo '\nTransmit Commands Mode!!\n'") + mode = 'n' + change_mode = True + + if ((line.find(":t11#")) > 0): + system("echo '\nTransmit Commands Mode!!\n'") + mode = 'n' + change_mode = True + + if ((line.find("MODE=o")) > 0): system("echo '\nBeacon Mode toggle!!\n'") mode = 'o' change_mode = True - counter = 1 - if ((line.find("DTMF>APDW15:t10#")) > 0): - system("echo '\nBeacon Mode toggle!!\n'") - mode = 'o' - change_mode = True - - # if ((debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice - if (debug_mode == False) and (change_mode == True): # skip every other APRS command since Direwolf prints them twice - if (mode == 'f'): - blink(2) - sleep(1) - - elif (mode == 'b'): - blink(3) - sleep(1) - - elif (mode == 's'): - blink(4) - sleep(1) - - elif (mode == 'm'): - blink(5) - sleep(1) - - elif (mode == 'e'): - blink(6) - sleep(1) - - elif (mode == 'j'): - blink(7) - sleep(1) - - elif (mode == 'a'): - mode = 'a' - blink(1) - sleep(1) - - try: - file = open("/home/pi/CubeSatSim/command_count.txt", "r") - string = file.read() - file.close() - command_count = int(string) - command_count += 1 - filec = open("/home/pi/CubeSatSim/command_count.txt", "w") - command_count_string = str(command_count) - print(command_count_string) - string = filec.write(command_count_string) - filec.close() - except: - print("Can't write command_count file!") - print("Command_count: ") - print(command_count) - - # GPIO.output(txLed, 0) - # GPIO.output(powerPin, 0) - system("gpio write 27 1") - system("gpio write 0 0") - system("gpio write 2 0") - - system("sudo systemctl stop transmit") - # system("sudo systemctl stop cubesatsim") + counter = (counter + 1) % 2 + + if ((line.find(":t10#")) > 0): + system("echo '\nBeacon Mode toggle!!\n'") + mode = 'o' + change_mode = True + + if (debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice + + if (mode == 'f'): + blink(2) + sleep(1) - print("\n/home/pi/CubeSatSim/config -" + mode) - system("/home/pi/CubeSatSim/config -" + mode) + elif (mode == 'b'): + blink(3) + sleep(1) + + elif (mode == 's'): + blink(4) + sleep(1) - change_mode = False + elif (mode == 'm'): + blink(5) + sleep(1) + + elif (mode == 'e'): + blink(6) + sleep(1) + + elif (mode == 'j'): + blink(7) + sleep(1) + + elif (mode == 'p'): + blink(8) + sleep(1) + + elif (mode == 'a'): + blink(1) + sleep(1) + + try: + file = open("/home/pi/CubeSatSim/command_count.txt", "r") + string = file.read() + file.close() + command_count = int(string) + command_count += 1 + filec = open("/home/pi/CubeSatSim/command_count.txt", "w") + command_count_string = str(command_count) + print(command_count_string) + string = filec.write(command_count_string) + filec.close() + except: + print("Can't write command_count file!") + print("Command_count: ") + print(command_count) + + GPIO.output(txLed, 0) + GPIO.output(powerPin, 0) + system("sudo systemctl stop transmit") + # system("sudo systemctl stop cubesatsim") + + print("\n/home/pi/CubeSatSim/config -" + mode) + system("/home/pi/CubeSatSim/config -" + mode) + + + change_mode = False except: print("Error reading line (probably due to UTF-8 issue)") - + print("Waiting 5 seconds to allow unplug and plug of soundcard") sleep(5) print("Done") diff --git a/groundstation/SDRpp.desktop b/groundstation/SDRpp.desktop new file mode 100644 index 00000000..f4f4ba38 --- /dev/null +++ b/groundstation/SDRpp.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Exec=/home/pi/CubeSatSim/groundstation/sdrpp.sh +Name=SDRpp +Comment=SDRpp +Icon=/home/pi/Icons/sdrpp.png +Path=/home/pi +Terminal=true +Categories=HamRadio +Keywords=Ham Radio;SDR diff --git a/groundstation/aprs.desktop b/groundstation/aprs.desktop index b9ee2512..a7d0062a 100644 --- a/groundstation/aprs.desktop +++ b/groundstation/aprs.desktop @@ -2,7 +2,7 @@ Name=APRS Decode using Direwolf GenericName=Decodes APRS using rtl_fm and Direwolf Comment=APRS signals -Exec=/home/pi/CubeSatSim/groundstation/aprs.sh +Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/packet.sh" Icon=/home/pi/Icons/aprs.png Terminal=true Type=Application diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index 2e1c6873..427c36cb 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -3,12 +3,14 @@ sudo modprobe snd-aloop -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 rtl_fm &>/dev/null sudo killall -9 direwolf &>/dev/null @@ -78,7 +80,7 @@ echo -e "Auto decoding APRS packets on $frequency Hz" #sudo rtl_fm -f 144.39M -s 22050 -g 48 - | multimon-ng -a AFSK1200 -A -t raw - -direwolf -r 48000 -t 0 & +direwolf -c /home/pi/CubeSatSim/groundstation/direwolf.conf -r 48000 -t 0 & sleep 5 @@ -87,6 +89,7 @@ echo "$value" > /dev/null set -- $value #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 sleep 5 diff --git a/groundstation/autostart/chromium.desktop b/groundstation/autostart/chromium.desktop index fc57834e..5fd6bef0 100644 --- a/groundstation/autostart/chromium.desktop +++ b/groundstation/autostart/chromium.desktop @@ -2,4 +2,4 @@ [Desktop Entry] Type=Application Name=Chromium with WebSDR -Exec=chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8073 +Exec=chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars --app=http://localhost:8073 diff --git a/groundstation/bookmarks.json b/groundstation/bookmarks.json index f8bae496..b3c55a2c 100644 --- a/groundstation/bookmarks.json +++ b/groundstation/bookmarks.json @@ -1,137 +1,57 @@ [ - { - "name": "ISS APRS", - "frequency": 145825000, - "modulation": "nfm" - }, - { - "name": "ISS SSTV/Voice", - "frequency": 145800000, - "modulation": "nfm" - }, - { - "name": "ARISS Repeater Downlink", - "frequency": 437800000, - "modulation": "nfm" - }, - { - "name": "AO-27", - "frequency": 436795000, - "modulation": "nfm" - }, - { - "name": "AO-73", - "frequency": 145815000, - "modulation": "usb" - }, - { - "name": "Fox-1B AO-91", - "frequency": 145960000, - "modulation": "nfm" - }, - { - "name": "Fox-1D AO-92", - "frequency": 145880000, - "modulation": "nfm" - }, - { - "name": "HuskySat-1 HO-107", - "frequency": 435800000, - "modulation": "usb" - }, - { - "name": "Fox-1E", - "frequency": 435750000, - "modulation": "usb" - }, - { - "name": "MAX VALIER", - "frequency": 145860000, - "modulation": "usb" - }, - { - "name": "NOAA WX Radio 1", - "frequency": 162400000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 2", - "frequency": 162425000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 3", - "frequency": 162450000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 4", - "frequency": 162475000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 5", - "frequency": 162500000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 6", - "frequency": 162525000, - "modulation": "nfm" - }, - { - "name": "NOAA WX Radio 7", - "frequency": 162550000, - "modulation": "nfm" - }, - { - "name": "CAS-4A", - "frequency": 145855000, - "modulation": "usb" - }, - { - "name": "CAS-4B", - "frequency": 145910000, - "modulation": "usb" - }, - { - "name": "XW-2A", - "frequency": 145660000, - "modulation": "usb" - }, - { - "name": "XW-2B", - "frequency": 145725000, - "modulation": "usb" - }, - { - "name": "XW-2C", - "frequency": 145790000, - "modulation": "usb" - }, - { - "name": "XW-2F", - "frequency": 145975000, - "modulation": "usb" - }, - { - "name": "NOAA-19", - "frequency": 137100000, - "modulation": "nfm" - }, - { - "name": "NOAA-18", - "frequency": 137912500, - "modulation": "nfm" - }, - { - "name": "NOAA-15", - "frequency": 137620000, - "modulation": "nfm" - }, - { - "name": "CubeSatSim", - "frequency": 434900000, - "modulation": "packet" - } + { + "name": "NOAA WX Radio 1", + "frequency": 162400000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 2", + "frequency": 162425000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 3", + "frequency": 162450000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 4", + "frequency": 162475000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 5", + "frequency": 162500000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 6", + "frequency": 162525000, + "modulation": "nfm" + }, + { + "name": "NOAA WX Radio 7", + "frequency": 162550000, + "modulation": "nfm" + }, + { + "name": "CubeSatSim", + "frequency": 434900000, + "modulation": "packet" + }, + { + "name": "ISS SSTV/Voice", + "frequency": 145800000, + "modulation": "nfm" + }, + { + "name": "ISS APRS", + "frequency": 145825000, + "modulation": "packet" + }, + { + "name": "ISS Voice Repeater", + "frequency": 437800000, + "modulation": "nfm" + } ] diff --git a/groundstation/cubicsdr.desktop b/groundstation/cubicsdr.desktop index 1599f5df..2cf19759 100644 --- a/groundstation/cubicsdr.desktop +++ b/groundstation/cubicsdr.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/cubicsdr.sh Name=SDR FM Broadcast Comment=CubicSDR FM Broadcast -Icon=/home/pi/Downloads/cubicsdr.png +Icon=/home/pi/Icons/cubicsdr.png Path=/home/pi Terminal=true Categories=HamRadio diff --git a/groundstation/cubicsdr.sh b/groundstation/cubicsdr.sh index 5d66f4c3..3b125dc6 100755 --- a/groundstation/cubicsdr.sh +++ b/groundstation/cubicsdr.sh @@ -9,19 +9,21 @@ echo "Note: Select Generic RTL2832 device then click Start to begin" echo -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null sudo killall -9 java &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 rtl_fm &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 qsstv &>/dev/null @@ -39,11 +41,28 @@ sudo killall -9 sdrpp &>/dev/null sudo killall -9 zenity &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + sudo killall -9 rtl_fm &>/dev/null zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen click on a signal in the watefall to listen." & +sleep 5 + +setsid CubicSDR + +sleep 10 +#$SHELL +#sudo kill `ps -aux | grep sstv_decode_prompt| grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null + +sudo killall -9 zenity &>/dev/null + +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + +zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select Generic RTL2832U device then click Start to begin.\n\nThen click on a signal in the watefall to listen." & sleep 5 diff --git a/groundstation/direwolf.conf b/groundstation/direwolf.conf index ce8b6823..d70427b9 100644 --- a/groundstation/direwolf.conf +++ b/groundstation/direwolf.conf @@ -1 +1 @@ -ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=b1,DEV=0 +ADEVICE plughw:CARD=Loopback,DEV=1 default diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14-device.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14-device.conf new file mode 100644 index 00000000..df741a62 --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14-device.conf @@ -0,0 +1,10 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +#PTT GPIO 20 +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +FULLDUP OFF +TXDELAY 30 +#FIX_BITS 1 AX25 diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14-loop.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14-loop.conf new file mode 100644 index 00000000..cac3fffe --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14-loop.conf @@ -0,0 +1,10 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Loopback,DEV=0 +#PTT GPIO 20 +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +FULLDUP OFF +TXDELAY 30 +#FIX_BITS 1 AX25 diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14-ptt.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14-ptt.conf new file mode 100644 index 00000000..279b7e0e --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14-ptt.conf @@ -0,0 +1,10 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +PTT GPIO 20 +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +FULLDUP OFF +TXDELAY 30 +#FIX_BITS 1 AX25 diff --git a/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf new file mode 100644 index 00000000..5df8f59e --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf @@ -0,0 +1,19 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Device,DEV=0 +#PTT GPIO -20 +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +#FULLDUP OFF +#TXDELAY 30 +#FIX_BITS 1 AX25 + +#DWAIT 0 +DWAIT 20 +SLOTTIME 300 +PERSIST 63 +TXDELAY 1000 +#TXDELAY 150 +#TXTAIL 10 +FULLDUP OFF diff --git a/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf new file mode 100644 index 00000000..c1d5f5f9 --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf @@ -0,0 +1,19 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +PTT GPIO -20 27 #Transmit LED +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +#FULLDUP OFF +#TXDELAY 30 +#FIX_BITS 1 AX25 + +#DWAIT 0 +DWAIT 20 +SLOTTIME 300 +PERSIST 63 +TXDELAY 1000 +#TXDELAY 150 +#TXTAIL 10 +FULLDUP OFF diff --git a/groundstation/direwolf/direwolf-fm-pacsat.conf b/groundstation/direwolf/direwolf-fm-pacsat.conf new file mode 100644 index 00000000..53524acb --- /dev/null +++ b/groundstation/direwolf/direwolf-fm-pacsat.conf @@ -0,0 +1,7 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Device,DEV=0 plughw:CARD=Headphones,DEV=0 +PTT GPIO 20 +KISSPORT 8100 +FULLDUP OFF +CHANNEL 0 +MODEM 1200 diff --git a/groundstation/direwolf/direwolf-pacsat-loopback.conf b/groundstation/direwolf/direwolf-pacsat-loopback.conf new file mode 100644 index 00000000..6cd3d988 --- /dev/null +++ b/groundstation/direwolf/direwolf-pacsat-loopback.conf @@ -0,0 +1,19 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=1 +PTT GPIO -20 27 #Transmit LED +CHANNEL 0 +MODEM 1200 +KISSPORT 8100 +AGWPORT 8002 +#FULLDUP OFF +#TXDELAY 30 +#FIX_BITS 1 AX25 + +#DWAIT 0 +DWAIT 20 +SLOTTIME 300 +PERSIST 63 +TXDELAY 1000 +#TXDELAY 150 +#TXTAIL 10 +FULLDUP OFF diff --git a/groundstation/direwolf/direwolf-pacsat.conf b/groundstation/direwolf/direwolf-pacsat.conf new file mode 100644 index 00000000..e526e272 --- /dev/null +++ b/groundstation/direwolf/direwolf-pacsat.conf @@ -0,0 +1,5 @@ +MYCALL AMSAT +ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Headphones,DEV=0 +PTT GPIO 20 +KISSPORT 8100 +FULLDUP OFF diff --git a/groundstation/fox-download.desktop b/groundstation/fox-download.desktop index d58827d0..4e4bcf40 100644 --- a/groundstation/fox-download.desktop +++ b/groundstation/fox-download.desktop @@ -2,7 +2,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/fox-download.sh Name=FoxTelem Download -Comment=FIAB-v3 +Comment=FIAB-v4 Icon=/home/pi/Icons/FoxTelemDownload.png Path=/home/pi Terminal=true diff --git a/groundstation/fox-profile.desktop b/groundstation/fox-profile.desktop index c03f40d4..8b7aaabe 100644 --- a/groundstation/fox-profile.desktop +++ b/groundstation/fox-profile.desktop @@ -2,8 +2,8 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/fox-profile.sh Name=Change FoxTelem Profile -Comment=FIAB-v3 -Icon=/home/pi/Downloads/foxtelem.png +Comment=FIAB-v4 +Icon=/home/pi/Icons/foxtelem.png Path=/home/pi Terminal=true Categories=HamRadio diff --git a/groundstation/fox-run.sh b/groundstation/fox-run.sh index fa456cd1..d321719d 100755 --- a/groundstation/fox-run.sh +++ b/groundstation/fox-run.sh @@ -5,6 +5,8 @@ echo "Startup script to run FoxTelem for FIAB v4" echo +source /home/pi/venv/bin/activate + sudo killall -9 FoxTelem &>/dev/null sudo killall -9 zenity &>/dev/null @@ -12,7 +14,7 @@ sudo killall -9 zenity &>/dev/null FILE=/home/pi/FoxTelemetryData/.foxprofile if [ ! -f "$FILE" ]; then - profile=$(zenity --text="Choose your default FoxTelem profile:" --list 2>/dev/null --width=410 --height=120 --title="Set FoxTelem Profile" --column="Profile" --column="Receive and decode telemetry from" Fox-in-a-Box "AMSAT Fox satellites" "CubeSatSim" "AMSAT CubeSat Simulator") + profile=$(zenity --text="Choose your default FoxTelem profile:" --list 2>/dev/null --width=410 --height=120 --title="Set FoxTelem Profile" --column="Profile" --column="Receive and decode telemetry from" Fox-in-a-Box "AMSAT Satellites" "CubeSatSim" "AMSAT CubeSat Simulator") echo $profile diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 9e1f4130..27050f9a 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -5,12 +5,14 @@ echo "Script to run FoxTelem for ARISS Radio Pi" echo -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 rtl_tcp &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -23,12 +25,15 @@ sudo killall -9 sdrpp &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 qsstv &>/dev/null sudo killall -9 zenity &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + sudo killall -9 rtl_fm &>/dev/null sleep 5 diff --git a/groundstation/foxtelem.desktop b/groundstation/foxtelem.desktop index 9dc42ab9..c01913be 100644 --- a/groundstation/foxtelem.desktop +++ b/groundstation/foxtelem.desktop @@ -2,8 +2,8 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/fox-run.sh Name=FoxTelem -Comment=FIAB-v3 -Icon=/home/pi/Downloads/foxtelem.png +Comment=FIAB-v4 +Icon=/home/pi/Icons/foxtelem.png Path=/home/pi Terminal=true Categories=HamRadio diff --git a/groundstation/gpredict.desktop b/groundstation/gpredict.desktop index 20a6ab49..69d11ecb 100644 --- a/groundstation/gpredict.desktop +++ b/groundstation/gpredict.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/usr/bin/gpredict Name=Gpredict Comment=ISS and Satellite Tracking for ARISS Radio Pi -Icon=/home/pi/Downloads/gpredict.png +Icon=/home/pi/Icons/gpredict.png Path=/home/pi Terminal=false Categories=HamRadio diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 64c47bbd..1f4279cc 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -118,6 +118,16 @@ if (latitude != 0) and (longitude != 0): system(longSedStr) print("\nKLAtracker configuration updated with your latitude and longitude") + + latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/PacSatGround/PacSatGround.properties' + #print (latSedStr) + system(latSedStr) + + longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/PacSatGround/PacSatGround.properties' + #print (longSedStr) + system(longSedStr) + + print("\nPacsat configuration updated with your latitude and longitude") receiver_gpsSedStr = 'sudo sed -i "s/ ' + dquote + 'lat' + dquote + ': .*/ ' + dquote + 'lat' + dquote + ': ' + str(latitude) + ',/g" /var/lib/openwebrx/settings.json' #print (receiver_gpsSedStr) diff --git a/groundstation/loc.sh b/groundstation/loc.sh index bdbedc77..94558962 100755 --- a/groundstation/loc.sh +++ b/groundstation/loc.sh @@ -12,4 +12,3 @@ python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py #/usr/bin/gpredict nohup /usr/bin/gpredict /dev/null 2>&1 & - diff --git a/groundstation/packet.sh b/groundstation/packet.sh index 803e988a..2213b052 100755 --- a/groundstation/packet.sh +++ b/groundstation/packet.sh @@ -14,6 +14,8 @@ pkill -o chromium &>/dev/null sudo killall -9 rtl_fm &>/dev/null +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 direwolf &>/dev/null sudo killall -9 aplay &>/dev/null @@ -166,5 +168,4 @@ rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t r rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 - sleep 5 diff --git a/groundstation/pacsat-config.sh b/groundstation/pacsat-config.sh new file mode 100755 index 00000000..6a2ce55c --- /dev/null +++ b/groundstation/pacsat-config.sh @@ -0,0 +1,187 @@ +#!/bin/bash +# script to run FoxTelem + +echo "Script to configure the PacSat Ground Station for FIAB v4" + +echo + +#source /home/pi/venv/bin/activate + +sudo killall -9 java &>/dev/null + +sudo killall -9 zenity &>/dev/null + +sudo killall -9 direwolf &>/dev/null + +#FILE=/home/pi/.pacsatprofile +#if [ ! -f "$FILE" ]; then + +# profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" --column="Choice" --column="Result" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") +# echo $profile + + echo "Here are the PacSat configuration choices:" + echo + echo " 1. PacSat Ground Station Configuration" + echo + echo " 2. PacSat Ground Station Simulation Configuration" + echo + echo " 3. Set Frequencies" + echo + echo " 4. Reset PacSat Satellite" + echo + echo "Which do you choose? Enter 1 - 4" + + read -r ANS + + if [ -z "$ANS" ]; then + + echo "No choice made. Exiting." + + sleep 3 + + exit + + fi + + if [ "$ANS" = "1" ] || [ "$ANS" = "2" ] ; then + + if [ "$ANS" = "1" ] ; then + echo "Here are your PacSat Ground Station Configuration choices:" + else + echo "Here are your PacSat Ground Station Simulation Configuration choices:" + fi + echo + echo " 1. PacSat Ground Station Callsign" + echo + echo " 2. Set Remote PacSat Satellite Callsign in Ground Station configuration" + echo + echo " 3. Reset PacSat Ground Station Configuration" + + read -r CH + + + if [ -z "$CH" ]; then + + echo "No choice made. Exiting." + + sleep 3 + + exit + + fi + + if [ "$CH" = "1" ] ; then + + echo + if [ "$ANS" = "1" ] ; then + oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGround/PacSatGround.properties) + else + oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGroundLoop/PacSatGround.properties) + fi + echo "Callsign in PacSatGround.properties is " + echo $oldcallsign + + echo "Enter new callsign in all capitals: " + read callsign + + if [ -z $callsign ] ; then + + callsign="$1" + echo "Keeping value of" $oldcallsign + + else + + echo "Configured callsign is " + echo $callsign + + if [ ! "$callsign" = "$oldcallsign" ] ; then + + if [ "$ANS" = "1" ] ; then + sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties + cat /home/pi/PacSatGround/PacSatGround.properties + else + sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGroundLoop/PacSatGround.properties + cat /home/pi/PacSatGroundLoop/PacSatGround.properties + fi + + fi + fi + + elif [ "$CH" = "2" ] ; then + + echo "You have chosen to set the remote CubeSatSim PacSat Satellite callsign in ground station configuration" + echo + + if [ "$ANS" = "1" ] ; then + oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGround/spacecraft/PacSatSim.properties) + else + oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGroundLoop/spacecraft/PacSatSim.properties) + fi + echo "Current value of remote PacSat callsign is" + echo $oldcallsign + echo + + echo "Enter new callsign in all capitals: " + read callsign + + if [ -z $callsign ] ; then + + callsign="$1" + echo "Keeping value of" $oldcallsign + + else + if [ "$ANS" = "1" ] ; then + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties + else + sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGroundLoop/spacecraft/PacSatSim.properties + fi + echo + echo "Changing callsign to " + echo $callsign + echo + echo "You will see the change next time you run the PacSat Ground Station" + echo + fi + + elif [ "$CH" = "3" ] ; then + + echo "You have chosen to reset the PacSat Ground Station Configuration" + echo + echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft" + echo + + if [ "$ANS" = "1" ] ; then + sudo rm -r /home/pi/PacSatGround + else + sudo rm -r /home/pi/PacSatGroundLoop + fi + else + + echo "Please choose an option 1-3" + + fi + + elif [ "$ANS" = "3" ] ; then + + echo "You have chosen to set the Frequency of the PacSat Ground Station" + echo + + /home/pi/CubeSatSim/config -F n + + elif [ "$ANS" = "4" ] ; then + + echo "You have chosen to reset the PacSat Satellite" + echo + + /home/pi/CubeSatSim/config -k n + + else + + echo "Please enter only 1 to 4" + + fi + + +# sleep 10 + +#$SHELL diff --git a/groundstation/pacsat-d.sh b/groundstation/pacsat-d.sh new file mode 100755 index 00000000..a794108c --- /dev/null +++ b/groundstation/pacsat-d.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo modprobe snd-aloop + +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 diff --git a/groundstation/pacsat-df.sh b/groundstation/pacsat-df.sh new file mode 100755 index 00000000..99ffc988 --- /dev/null +++ b/groundstation/pacsat-df.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +pwm=1 + +sudo modprobe snd-aloop + +#gpio -g mode 20 out + +#gpio -g write 20 1 + +#direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 + +if [ "$pwm" = "1" ] ; then + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-pwm.conf -t 0 + +else + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 + +fi diff --git a/groundstation/pacsat-dj.sh b/groundstation/pacsat-dj.sh new file mode 100755 index 00000000..7a49576e --- /dev/null +++ b/groundstation/pacsat-dj.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +/usr/bin/x-terminal-emulator --geometry=120x40 -e "direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0" + + + diff --git a/groundstation/pacsat-run.sh b/groundstation/pacsat-run.sh new file mode 100755 index 00000000..37704d0f --- /dev/null +++ b/groundstation/pacsat-run.sh @@ -0,0 +1,83 @@ +#!/bin/bash +# script to run FoxTelem + +echo "Startup script to run the PacSat Ground Station for FIAB v4" + +echo + +# source /home/pi/venv/bin/activate + +sudo killall -9 java &>/dev/null + +sudo killall -9 zenity &>/dev/null + +sudo killall -9 direwolf &>/dev/null + +#FILE=/home/pi/.pacsatprofile +#if [ ! -f "$FILE" ]; then + + profile=$(zenity --text="Choose what you want to do:" --list 2>/dev/null --width=410 --height=170 --title="PacSat Ground Station" --column="Choice" --column="Result" "PacSat" "Run PacSat Ground Station" "Configure" "Configure the Pacsat Ground Station" "Simulate" "Run a Locally Simulated PacSat") + + echo $profile + + if [ -z "$profile" ]; then + + echo "No choice made. Exiting." + + sleep 3 + + exit + + #echo "You need to choose your default FoxTelem profile." + #echo + #echo "The choices are:" + #echo + #echo "1. Fox-in-a-Box. Use this profile if you want to receive and decode telemetry from the AMSAT Fox satellites. If you enter a callsign and a grid square, you can upload to the AMSAT telemetry server." + #echo + #echo "2. CubeSatSim Ground Station. Use this profile if you want to receive and decode telemetry from an AMSAT CubeSatSim or CubeSatSim Lite." + #echo + #echo "Which profile do you choose? Enter 1 or 2" + + #read -r ANS + + fi + + if [ "$ANS" = "1" ] || [ "$profile" = "PacSat" ] ; then + + echo "You have chosen to run the PacSat Ground Station" + # echo "p" > /home/pi/.pacsatprofile + echo + + /home/pi/CubeSatSim/groundstation/pacsat.sh + + + elif [ "$ANS" = "2" ] || [ "$profile" = "Configure" ] ; then + + echo "You have chosen to configure the PacSat Ground Station" + echo + + /home/pi/CubeSatSim/groundstation/pacsat-config.sh + + elif [ "$ANS" = "3" ] || [ "$profile" = "Simulate" ] ; then + + echo "You have chosen the PacSat Ground Station with Local Simulated Satellite" + + sleep 1 + + /usr/bin/x-terminal-emulator --geometry=120x40 -e "bash /home/pi/CubeSatSim/pacsatsim.sh l" + + sleep 1 + + /home/pi/CubeSatSim/groundstation/pacsat.sh l + + else + + echo "Please enter only 1 or 2 or 3" + + fi + +sudo killall -9 direwolf &>/dev/null + +sleep 10 + +#$SHELL diff --git a/groundstation/pacsat.desktop b/groundstation/pacsat.desktop new file mode 100644 index 00000000..7097509e --- /dev/null +++ b/groundstation/pacsat.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Pacsat +GenericName=Pacsat Loopback +Comment=Pacsat +Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-run.sh" +Icon=/home/pi/Icons/pacsat.png +Terminal=true +Type=Application +Categories=HamRadio; +Keywords=APRS; diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh new file mode 100755 index 00000000..321907d2 --- /dev/null +++ b/groundstation/pacsat.sh @@ -0,0 +1,170 @@ +#!/bin/bash + +# script to auto decode packet using rtl_fm and Direwolf and run Pacsat Ground Station + +loopback=0 +vox=0 +if [ "$1" = "l" ] ; then + + loopback=1 + echo "PacSat Ground Station with Loopback" + +elif [ "$1" = "v" ] ; then + + vox=1 + echo "PacSat Ground Station with Soundcard (VOX)" + +fi + +if [ ! -d "/home/pi/PacSatGround" ] ; then + + mkdir /home/pi/PacSatGround + + echo + echo "The first time you run the Ground Station, you will need to install the Pacsatsim spacecraft file and set the Delay to 750ms and Port to 8100 and restart the Pacsat Ground Station" + + sleep 10 + +fi + +if [ ! -d "/home/pi/PacSatGroundLoop" ] ; then + + mkdir /home/pi/PacSatGroundLoop + + echo + echo "The first time you run the Ground Station, you will need to install the Pacsatsim spacecraft file and set the Delay to 750ms and Port to 8100 and restart the Pacsat Ground Station" + + sleep 10 + +fi + +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 + +sudo systemctl stop rtl_tcp >/dev/null 2>&1 + +pkill -o chromium &>/dev/null + +sudo killall -9 rtl_fm &>/dev/null + +#sudo killall -9 direwolf &>/dev/null + +sudo killall -9 sdrpp &>/dev/null + +#sudo killall -9 aplay &>/dev/null + +sudo killall -9 qsstv &>/dev/null + +sudo killall -9 rtl_tcp &>/dev/null + +sudo killall -9 java &>/dev/null + +sudo killall -9 CubicSDR &>/dev/null + +sudo killall -9 zenity &>/dev/null + +echo + +#sudo systemctl restart pacsatsim + +#sudo /etc/init.d/alsa-utils stop +#sudo /etc/init.d/alsa-utils start + + +#echo "Waiting 10 seconds for Pacsatsim to start" + +#sleep 10 + +#value=`cat /home/pi/CubeSatSim/sim.cfg` +#echo "$value" > /dev/null +#set -- $value + +#echo "Receive frequency is $8 MHz" +#echo "Transmit frequency is $7 MHz" +#echo +#echo "To change, quit and type CubeSatSim/config -F" +#echo + +#frequency="$8e6" + +#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." + +#echo + +echo +echo "The Pacsat Ground Station is running on this Pi using FM receiver or RTL-SDR" +echo + +#cd /home/pi/Desktop/PacSatGround_0.46m_linux/ + +#setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & + +#direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0 # & +#/usr/bin/x-terminal-emulator --geometry=120x40 -e "direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat-loopback.conf -t 0" + +sudo usermod -a -G gpio pi + +if [ "$loopback" = "1" ]; then +#/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-df.sh" + + echo "Using Audio Loopback" + /home/pi/CubeSatSim/groundstation/pacsat-d.sh & + +elif [ "$vox" = "1" ]; then + + echo "Using Soundcard Audio TX RX (VOX)" + /home/pi/CubeSatSim/groundstation/pacsat-dj.sh & + +else + + echo "Using TXC FM Transceiver" + /home/pi/CubeSatSim/groundstation/pacsat-df.sh & + +fi + +# arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 435045 & +##arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 4000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 435045 & + +# echo "Don't close the direwolf window or the Pacsatsim will stop running." + +cd /home/pi/Desktop/PacsatGround/ + +if [ "$loopback" = "1" ]; then + + setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGroundLoop" # removed & + +else + + setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed & + +fi +#cd /home/pi/Desktop/PacSatGround_0.46m_linux/ + +#sudo setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" + +cd + +#sudo systemctl stop pacsatsim + +sleep 10 + +#echo "Stopping Pacsatsim" + +#$SHELL + + + diff --git a/groundstation/pacsatlog.desktop b/groundstation/pacsatlog.desktop new file mode 100644 index 00000000..b3032884 --- /dev/null +++ b/groundstation/pacsatlog.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Pacsat Log +GenericName=Pacsat Loopback +Comment=Pacsat +Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/log -p" +Icon=/home/pi/Icons/pacsat.png +Terminal=true +Type=Application +Categories=HamRadio; +Keywords=APRS; diff --git a/groundstation/reset_pacsat.sh b/groundstation/reset_pacsat.sh new file mode 100755 index 00000000..34e153a3 --- /dev/null +++ b/groundstation/reset_pacsat.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# script to clear Pacsat Ground Station and Pacsatsim state + +echo "Clearing all Pacsat Ground Station and Pacsatsim state" + +echo + +sudo systemctl stop pacsatsim + +#sudo killall -9 direwolf &>/dev/null + +sudo killall -9 java &>/dev/null + +cd + +cd pi_pacsat + +cd Debug + +sudo rm -r /home/pi/PacSat + +mkdir /home/pi/PacSat +mkdir /home/pi/PacSat/pacsat +mkdir /home/pi/PacSat/pacsat/dir + +#value=`cat /home/pi/CubeSatSim/sim.cfg` +#echo "$value" > /dev/null +#set -- $value + +echo "bit_rate=9600" > pacsat.config +echo "bbs_callsign=AMSAT-12" >> pacsat.config +echo "broadcast_callsign=AMSAT-11" >> pacsat.config +echo "digi_callsign=AMSAT-1" >> pacsat.config +echo "max_frames_in_tx_buffer=5" >> pacsat.config + +sudo rm pacsat_last_command_time.dat +sudo rm pacsat_upload_table.dat +sudo rm pacsat.state + +echo "pb_open=1" > pacsat.state +echo "uplink_open=1" >> pacsat.state +echo "pb_max_period_for_client_in_seconds=60" >> pacsat.state +echo "uplink_max_period_for_client_in_seconds=60" >> pacsat.state + +touch /home/pi/pi_pacsat/Debug/pacsat_upload_table.dat + +sudo rm -r /home/pi/PacSatGround + +mkdir /home/pi/PacSatGround + +echo + +echo "You will need to install the Pacsatsim spacecraft file and set the Delay to 750ms and Port to 8100 and restart the Pacsat Ground Station" + diff --git a/groundstation/rtl-tcp.desktop b/groundstation/rtl-tcp.desktop index 117acb9c..7ae3c038 100644 --- a/groundstation/rtl-tcp.desktop +++ b/groundstation/rtl-tcp.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/rtl-tcp.sh Name=RTL-TCP Comment=RTL-TCP for SDR# -Icon=/home/pi/Downloads/SDRSharp.png +Icon=/home/pi/Icons/SDRSharp.png Path=/home/pi Terminal=true Categories=HamRadio diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index dc10376c..3d49d11d 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -23,13 +23,15 @@ echo "Note: you need to be on the Wifi network: $ssid" echo -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null sleep 2 pkill -o chromium &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null + +sudo killall -9 sdrpp &>/dev/null sudo killall -9 java &>/dev/null @@ -45,10 +47,13 @@ sudo killall -9 qsstv &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 zenity &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + sudo killall -9 rtl_fm &>/dev/null sudo /bin/sh -c 'rtl_tcp -a $(hostname -I|cut -f1 -d " ")' diff --git a/groundstation/rtl_tcp.service b/groundstation/rtl_tcp.service index 403425a3..ff899e9b 100644 --- a/groundstation/rtl_tcp.service +++ b/groundstation/rtl_tcp.service @@ -3,7 +3,7 @@ Description=RTL-TCP [Service] TimeoutStopSec = 5 -ExecStart=/bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I)' +ExecStart=/bin/sh -c 'rtl_tcp -a $(hostname -I|cut -f1 -d " ")' WorkingDirectory=/home/pi StandardOutput=inherit StandardError=inherit diff --git a/groundstation/rtltcp.socket b/groundstation/rtltcp.socket new file mode 100644 index 00000000..d8a67a14 --- /dev/null +++ b/groundstation/rtltcp.socket @@ -0,0 +1,9 @@ +[Unit] +Description=RTL TCP Socket +PartOf=rtltcp.service + +[Socket] +ListenStream=[::]:1234 + +[Install] +WantedBy=sockets.target diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh index 4603b153..54ddb7a3 100755 --- a/groundstation/sdr.sh +++ b/groundstation/sdr.sh @@ -24,6 +24,8 @@ echo "Note: you need to be on the Wifi network: $ssid" echo +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 java &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -38,13 +40,18 @@ sudo killall -9 sdrpp &>/dev/null sudo killall -9 qsstv &>/dev/null -sudo killall -9 aplay &>/dev/null +#sudo killall -9 aplay &>/dev/null sudo killall -9 direwolf &>/dev/null sudo killall -9 zenity &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null + +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + +sudo killall -9 rtl_fm &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -52,7 +59,7 @@ sudo systemctl restart openwebrx sleep 10 -setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8073 &>/dev/null & +setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars --app=http://localhost:8073 &>/dev/null & sleep 10 diff --git a/groundstation/sdrpp.sh b/groundstation/sdrpp.sh new file mode 100755 index 00000000..2dd97fd1 --- /dev/null +++ b/groundstation/sdrpp.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# script to run sdrpp + +echo "Script to run SDRpp for ARISS Radio Pi" + +echo + +sudo systemctl stop openwebrx + +sudo killall -9 java &>/dev/null + +sudo killall -9 sdrpp &>/dev/null + +sudo systemctl stop rtl_tcp + +pkill -o chromium &>/dev/null + +sudo killall -9 rtl_fm &>/dev/null + +sudo killall -9 direwolf &>/dev/null + +#sudo killall -9 aplay &>/dev/null + +sudo killall -9 qsstv &>/dev/null + +sudo killall -9 rtl_tcp &>/dev/null + +sudo killall -9 CubicSDR &>/dev/null + +#sudo kill `ps -aux | grep cubicsdr-packet | grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null + +#sudo kill `ps -aux | grep packet | grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null + +#sudo kill `ps -aux | grep sstv_decode_prompt| grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null + +sudo killall -9 zenity &>/dev/null + +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + +sleep 5 + +setsid sdrpp & + +sleep 10 + +#$SHELL diff --git a/groundstation/set location.desktop b/groundstation/set location.desktop index e2b80016..9adc6f66 100644 --- a/groundstation/set location.desktop +++ b/groundstation/set location.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/loc.sh Name=Set My Location Comment=Set Location for Gpredict -Icon=/home/pi/Downloads/gpredict.png +Icon=/home/pi/Icons/gpredict.png Path=/home/pi Terminal=true Categories=HamRadio diff --git a/groundstation/settings.json b/groundstation/settings.json new file mode 100644 index 00000000..69033009 --- /dev/null +++ b/groundstation/settings.json @@ -0,0 +1,808 @@ +{ + "version": 8, + "sdrs": { + "rtlsdr": { + "name": "RTL-SDR", + "type": "rtl_sdr", + "profiles": { + "70cm": { + "name": "70cm Ham Band 435 MHz (CubeSatSim)", + "center_freq": 435000000, + "rf_gain": 10.0, + "samp_rate": 2400000, + "start_freq": 434900000, + "start_mod": "nfm", + "tuning_step": 1000, + "direct_sampling": 0 + }, + "2m": { + "name": "WX Band 161 MHz", + "center_freq": 162400000, + "rf_gain": 29, + "samp_rate": 2048000, + "start_freq": 157000000, + "start_mod": "nfm" + }, + "e59a4765-4139-4ab8-89c5-d8ac3343ba70": { + "name": "2m Ham Band 146 MHz (ISS)", + "center_freq": 145000000, + "samp_rate": 2400000, + "start_freq": 145000000, + "start_mod": "nfm", + "rf_gain": 42.0, + "direct_sampling": 0 + }, + "faf80b0b-1a96-4a9b-96fa-ce40b109c7e0": { + "name": "70cm Ham Band 438 MHz (ISS)", + "rf_gain": 29.0, + "center_freq": 438000000, + "samp_rate": 2400000, + "start_freq": 437800000, + "start_mod": "nfm" + }, + "a4fd4a5d-d2d0-4949-87e2-bda83cd83a37": { + "name": "FM Band 95 MHz", + "rf_gain": 29.0, + "center_freq": 95000000, + "samp_rate": 2400000, + "start_freq": 94000000, + "start_mod": "wfm" + }, + "ce2bca29-78cb-45d8-ab46-8dea3135981c": { + "name": "10m Ham Band 28 MHz", + "rf_gain": 29.0, + "center_freq": 28000000, + "samp_rate": 2400000, + "start_freq": 28000000, + "start_mod": "usb", + "direct_sampling": 0 + }, + "d6cdbf2d-74e4-4cac-aaa8-e793103a8e89": { + "name": "6m Ham Band 51 MHz", + "rf_gain": 29.0, + "center_freq": 51000000, + "samp_rate": 2400000, + "start_freq": 51000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "e2aba387-1d3b-4ca8-b280-e119282b8812": { + "name": "90 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 90000000, + "samp_rate": 2400000, + "start_freq": 90000000, + "start_mod": "wfm" + }, + "f700b99d-3c51-4524-b151-a0809b868ecc": { + "name": "92 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 92000000, + "samp_rate": 2400000, + "start_freq": 92000000, + "start_mod": "wfm" + }, + "dc6af94f-d607-4fee-a522-7f375f66a62c": { + "name": "94 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 94000000, + "samp_rate": 2400000, + "start_freq": 94000000, + "start_mod": "wfm" + }, + "6887e85a-a4dc-4245-810f-99801fc5e824": { + "name": "96 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 96000000, + "samp_rate": 2400000, + "start_freq": 96000000, + "start_mod": "wfm" + }, + "a2182ed6-70a8-4377-b233-ac6f8ccc91d7": { + "name": "98 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 96000000, + "samp_rate": 2400000, + "start_freq": 96000000, + "start_mod": "wfm" + }, + "57e38353-fb86-4935-899b-e365228b8ae5": { + "name": "100 MHz FM Band", + "center_freq": 100000000, + "samp_rate": 2400000, + "start_freq": 100000000, + "start_mod": "wfm" + }, + "5e9ec6dd-905d-4781-bd13-9cb702f58e84": { + "name": "102 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 102000000, + "samp_rate": 2400000, + "start_freq": 102000000, + "start_mod": "wfm" + }, + "ef2c703c-2e22-4e87-82b5-581420d704bd": { + "name": "104 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 104000000, + "samp_rate": 2400000, + "start_freq": 104000000, + "start_mod": "wfm" + }, + "34cc3ddf-8018-4288-acb9-29e6940bc37e": { + "name": "106 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 106000000, + "samp_rate": 2400000, + "start_freq": 106000000, + "start_mod": "wfm" + }, + "b4693683-ccf5-474d-a2d9-9a47b0a18ee2": { + "name": "108 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 108000000, + "samp_rate": 2400000, + "start_freq": 108000000, + "start_mod": "wfm" + }, + "34224d77-7b61-467c-b78f-18c7f3af1a0c": { + "name": "110 MHz FM Band", + "rf_gain": 29.0, + "center_freq": 110000000, + "samp_rate": 2400000, + "start_freq": 110000000, + "start_mod": "wfm" + }, + "8dd82d97-73db-4fa7-ac41-263c3026ea1d": { + "name": "112 MHz", + "rf_gain": 29.0, + "center_freq": 112000000, + "samp_rate": 2400000, + "start_freq": 112000000, + "start_mod": "nfm" + }, + "79304b30-f10d-469e-9617-50a19bfdb435": { + "name": "114 MHz", + "rf_gain": 29.0, + "center_freq": 114000000, + "samp_rate": 2400000, + "start_freq": 114000000, + "start_mod": "nfm" + }, + "c00bf096-27b8-4262-832c-df1a308d7eb9": { + "name": "116 MHz", + "rf_gain": 29.0, + "center_freq": 116000000, + "samp_rate": 2400000, + "start_freq": 116000000, + "start_mod": "nfm" + }, + "669d25a6-6c15-4131-a330-3c33dd2147f0": { + "name": "118 Mhz Air Band", + "rf_gain": 29.0, + "center_freq": 118000000, + "samp_rate": 2400000, + "start_freq": 118000000, + "start_mod": "am" + }, + "948248fa-43d9-4e7d-bf86-afaadd391779": { + "name": "120 MHz Air Band", + "rf_gain": 29.0, + "center_freq": 120000000, + "samp_rate": 2400000, + "start_freq": 120000000, + "start_mod": "am" + }, + "b634273b-8fc8-4e87-b5c4-e6226d4be0ac": { + "name": "122 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 122000000, + "samp_rate": 2400000, + "start_freq": 121000000, + "start_mod": "nfm" + }, + "c55289a2-8286-4a3d-a505-37ba2867571a": { + "name": "124 Mhz Air Band", + "rf_gain": 42.0, + "center_freq": 124000000, + "samp_rate": 2400000, + "start_freq": 124000000, + "start_mod": "am" + }, + "4fe488b7-f369-43ba-bb49-91e1a185be7a": { + "name": "126 MHz Air Band", + "rf_gain": 29.0, + "center_freq": 126000000, + "samp_rate": 2400000, + "start_freq": 126000000, + "start_mod": "am" + }, + "e79639a2-1384-4e92-8e46-f6e5670ec9fd": { + "name": "128 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 128000000, + "samp_rate": 2400000, + "start_freq": 128000000, + "start_mod": "am" + }, + "319f3fb2-b98a-4620-85a7-a99d5a722bd5": { + "name": "130 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 130000000, + "samp_rate": 2400000, + "start_freq": 130000000, + "start_mod": "am" + }, + "63c5c2ce-07de-496c-81f6-b188a7adbf39": { + "name": "132 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 132000000, + "samp_rate": 2400000, + "start_freq": 132000000, + "start_mod": "am" + }, + "386bdc7b-eb10-4e05-972a-69d730a23cd8": { + "name": "134 MHz Air Band", + "rf_gain": 29.0, + "center_freq": 134000000, + "samp_rate": 2400000, + "start_freq": 134000000, + "start_mod": "am" + }, + "ae8ea8b1-23de-45ef-b8c4-3b83a188e65d": { + "name": "136 MHz Air Band", + "rf_gain": 42.0, + "center_freq": 136000000, + "samp_rate": 2400000, + "start_freq": 136000000, + "start_mod": "am" + }, + "c0b1a28c-5e07-400a-a5f3-07c62db27587": { + "name": "138 MHz NOAA Weather Satellite Band", + "rf_gain": 42.0, + "center_freq": 138000000, + "samp_rate": 2400000, + "start_freq": 138000000, + "start_mod": "nfm" + }, + "20f7ce56-fd85-4b3e-8fac-94cbe9ba0e1d": { + "name": "140 MHz ", + "rf_gain": 42.0, + "center_freq": 140000000, + "samp_rate": 2400000, + "start_freq": 140000000, + "start_mod": "nfm" + }, + "882079f8-5697-428a-ae9d-bcc091269c7f": { + "name": "142 MHz ", + "rf_gain": 42.0, + "center_freq": 142000000, + "samp_rate": 2400000, + "start_freq": 142000000, + "start_mod": "nfm" + }, + "da1b3f12-2eba-40e9-8c62-33493adf74b3": { + "name": "144 MHz 2m Ham Band", + "rf_gain": 42.0, + "center_freq": 144000000, + "samp_rate": 2400000, + "start_freq": 144000000, + "start_mod": "nfm" + }, + "8d9cf1e1-44c5-41c4-bcea-7b1c69446e62": { + "name": "146 MHz 2m Ham Band", + "rf_gain": 42.0, + "center_freq": 146000000, + "samp_rate": 2400000, + "start_freq": 146000000, + "start_mod": "nfm" + }, + "eec8aa0d-3485-43d2-baa4-82f7d9e14df6": { + "name": "148 MHz 2m Ham Band", + "rf_gain": 42.0, + "center_freq": 148000000, + "samp_rate": 2400000, + "start_freq": 148000000, + "start_mod": "nfm" + }, + "bf66a908-1988-4aec-b998-06e2bc7d0a84": { + "name": "150 MHz", + "rf_gain": 42.0, + "center_freq": 150000000, + "samp_rate": 2400000, + "start_freq": 150000000, + "start_mod": "nfm" + }, + "0389f270-b919-4aae-a313-f73697059f70": { + "name": "152 MHz", + "rf_gain": 42.0, + "center_freq": 152000000, + "samp_rate": 2400000, + "start_freq": 152000000, + "start_mod": "nfm" + }, + "6ef9d955-76aa-46c0-8463-2c23def5e37b": { + "name": "154 MHz", + "rf_gain": 42.0, + "center_freq": 154000000, + "samp_rate": 2400000, + "start_freq": 154000000, + "start_mod": "nfm" + }, + "5d0a64c7-3bce-408e-94d9-c8315bef7540": { + "name": "156 MHz", + "rf_gain": 42.0, + "center_freq": 156000000, + "samp_rate": 2400000, + "start_freq": 156000000, + "start_mod": "nfm" + }, + "5b869cae-ffa7-4554-96af-7acd497bbaf3": { + "name": "158 MHz", + "rf_gain": 42.0, + "center_freq": 158000000, + "samp_rate": 2400000, + "start_freq": 158000000, + "start_mod": "nfm" + }, + "0de7c5d4-14fc-4655-9a81-2bcebb2f4147": { + "name": "160 MHz", + "rf_gain": 42.0, + "center_freq": 160000000, + "samp_rate": 2400000, + "start_freq": 160000000, + "start_mod": "nfm" + }, + "8ca54821-8b80-4938-a35c-9fe25e2320d1": { + "name": "162 MHz", + "rf_gain": 42.0, + "center_freq": 162000000, + "samp_rate": 2400000, + "start_freq": 162000000, + "start_mod": "nfm" + }, + "f74d262d-9e98-4030-86b2-45676121ff1e": { + "name": "164 MHz", + "rf_gain": 42.0, + "center_freq": 164000000, + "samp_rate": 2400000, + "start_freq": 164000000, + "start_mod": "nfm" + }, + "bfc9c686-6c06-4de2-b1d5-c8f012131042": { + "name": "168 MHz", + "rf_gain": 42.0, + "center_freq": 168000000, + "samp_rate": 2400000, + "start_freq": 167000000, + "start_mod": "nfm" + }, + "5468e597-d529-42fe-9fcf-0ff4fa9e2d06": { + "name": "170 MHz", + "rf_gain": 42.0, + "center_freq": 170000000, + "samp_rate": 2400000, + "start_freq": 170000000, + "start_mod": "nfm" + }, + "e124cc6e-7177-4d5f-ae5b-2ec6a6fa2956": { + "name": "172 MHz", + "rf_gain": 42.0, + "center_freq": 172000000, + "samp_rate": 2400000, + "start_freq": 172000000, + "start_mod": "nfm" + }, + "1ce0f3ed-4763-4f00-916a-4f72d29ba410": { + "name": "174 MHz ", + "rf_gain": 42.0, + "center_freq": 174000000, + "samp_rate": 2400000, + "start_freq": 174000000, + "start_mod": "nfm" + }, + "639b1496-a2b9-4a42-ad28-3cda89fbe2fb": { + "name": "420 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 420000000, + "samp_rate": 2400000, + "start_freq": 420000000, + "start_mod": "nfm" + }, + "bbc9b57e-ea86-43ef-be65-cb2337615ae5": { + "name": "422 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 422000000, + "samp_rate": 2400000, + "start_freq": 422000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "3aed286d-7d13-4338-8621-d1c0dfdf3ac6": { + "name": "424 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 424000000, + "samp_rate": 2400000, + "start_freq": 424000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "9ae664b4-48f3-410a-8995-edc60127d746": { + "name": "426 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 426000000, + "samp_rate": 2400000, + "start_freq": 426000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "24d2467b-6740-42b5-8d3f-8f389fc0860b": { + "name": "428 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 428000000, + "samp_rate": 2400000, + "start_freq": 428000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "debbc3ab-081d-41e7-80fe-7d564838154e": { + "name": "430 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 430000000, + "samp_rate": 2400000, + "start_freq": 430000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "649233e0-fc85-415d-b88e-94750f49ca4b": { + "name": "432 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 432000000, + "samp_rate": 2400000, + "start_freq": 432000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "bed3b482-fd3b-45ee-b924-200aa4223ace": { + "name": "434 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 434000000, + "samp_rate": 2400000, + "start_freq": 434000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "58dfac9e-6030-4bb3-ba28-465285baa25e": { + "name": "436 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 436000000, + "samp_rate": 2400000, + "start_freq": 436000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "4c293b84-cd43-495f-95a5-1fcabfe4e4c7": { + "name": "438 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 438000000, + "samp_rate": 2400000, + "start_freq": 438000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "0e763161-a0e8-411a-abe6-c1af13045f27": { + "name": "440 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 440000000, + "samp_rate": 2400000, + "start_freq": 440000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "6dda77d3-e859-41b7-9b0b-22c2dee47472": { + "name": "442 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 442000000, + "samp_rate": 2400000, + "start_freq": 442000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "285813ef-aa6d-433f-a316-074f47e02073": { + "name": "444 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 444000000, + "samp_rate": 2400000, + "start_freq": 444000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "e0842b63-6857-4554-874b-fad99e4db03a": { + "name": "446 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 446000000, + "samp_rate": 2400000, + "start_freq": 446000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "c7b21c80-cfef-42e8-a6fe-c5eea4556c7e": { + "name": "448 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 448000000, + "samp_rate": 2400000, + "start_freq": 448000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "d98b4d4a-8247-4a99-9fc7-89780e5e1fef": { + "name": "450 MHz 70cm Ham Band", + "rf_gain": 42.0, + "center_freq": 450000000, + "samp_rate": 2400000, + "start_freq": 450000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "a09a546f-c56f-41b5-ae34-c5511afbcef5": { + "name": "460 MHz", + "rf_gain": 42.0, + "center_freq": 460000000, + "samp_rate": 2400000, + "start_freq": 460000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "232b2ae6-88dd-4e58-b489-37f310e5e204": { + "name": "462 MHz FRS/GMRS", + "rf_gain": 42.0, + "center_freq": 462000000, + "samp_rate": 2400000, + "start_freq": 462000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "41db9b38-87d7-40a0-9f90-1f0c77c054d9": { + "name": "464 MHz FRS/GMRS", + "rf_gain": 42.0, + "center_freq": 464000000, + "samp_rate": 2400000, + "start_freq": 464000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "e9bb7781-eb9b-4314-b399-2d96c52716f0": { + "name": "466 MHz FRS/GMRS", + "rf_gain": 42.0, + "center_freq": 466000000, + "samp_rate": 2400000, + "start_freq": 466000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "5d9e07e8-eb42-4832-82c9-016f05d89027": { + "name": "468 MHz FRS/GMRS", + "rf_gain": 42.0, + "center_freq": 468000000, + "samp_rate": 2400000, + "start_freq": 468000000, + "start_mod": "nfm", + "direct_sampling": 0 + }, + "20m": { + "name": "20m", + "center_freq": 14150000, + "samp_rate": 384000, + "start_freq": 14070000, + "start_mod": "usb", + "tuning_step": "500", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "30m": { + "name": "30m", + "center_freq": 10125000, + "samp_rate": 192000, + "start_freq": 10142000, + "start_mod": "usb", + "tuning_step": "500", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "40m": { + "name": "40m", + "center_freq": 7100000, + "samp_rate": 256000, + "start_freq": 7070000, + "start_mod": "lsb", + "tuning_step": "500", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "80m": { + "name": "80m", + "center_freq": 3650000, + "samp_rate": 384000, + "start_freq": 3570000, + "start_mod": "lsb", + "tuning_step": "500", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "49m": { + "name": "49m Broadcast", + "center_freq": 6050000, + "samp_rate": 384000, + "start_freq": 6070000, + "start_mod": "am", + "tuning_step": "1000", + "rf_gain": 42.0, + "direct_sampling": 1 + }, + "c1982ce1-7504-455e-908c-dc097fa031a8": { + "name": "1090 MHz ADS-B Band", + "rf_gain": 42.0, + "center_freq": 1090000000, + "samp_rate": 2400000, + "start_freq": 1090000000, + "start_mod": "adsb", + "tuning_step": 1, + "direct_sampling": 0 + }, + "cb7f2f8e-e317-4a5e-9504-826dd3781791": { + "name": "978 MHz ADS-B Band", + "rf_gain": 42.0, + "center_freq": 978000000, + "samp_rate": 2400000, + "start_freq": 978000000, + "start_mod": "adsb", + "tuning_step": 1 + } + } + }, + "airspy": { + "name": "Airspy HF+", + "type": "airspyhf", + "rf_gain": "auto", + "profiles": { + "20m": { + "name": "20m", + "center_freq": 14150000, + "samp_rate": 384000, + "start_freq": 14070000, + "start_mod": "usb", + "tuning_step": "500" + }, + "30m": { + "name": "30m", + "center_freq": 10125000, + "samp_rate": 192000, + "start_freq": 10142000, + "start_mod": "usb", + "tuning_step": "500" + }, + "40m": { + "name": "40m", + "center_freq": 7100000, + "samp_rate": 256000, + "start_freq": 7070000, + "start_mod": "lsb", + "tuning_step": "500" + }, + "80m": { + "name": "80m", + "center_freq": 3650000, + "samp_rate": 384000, + "start_freq": 3570000, + "start_mod": "lsb", + "tuning_step": "500" + }, + "49m": { + "name": "49m Broadcast", + "center_freq": 6050000, + "samp_rate": 384000, + "start_freq": 6070000, + "start_mod": "am", + "tuning_step": "1000" + } + } + }, + "sdrplay": { + "name": "SDRPlay device", + "type": "sdrplay", + "antenna": "Antenna A", + "rf_gain": "auto", + "profiles": { + "20m": { + "name": "20m", + "center_freq": 14150000, + "samp_rate": 500000, + "start_freq": 14070000, + "start_mod": "usb", + "tuning_step": "500" + }, + "30m": { + "name": "30m", + "center_freq": 10125000, + "samp_rate": 250000, + "start_freq": 10142000, + "start_mod": "usb", + "tuning_step": "500" + }, + "40m": { + "name": "40m", + "center_freq": 7100000, + "samp_rate": 500000, + "start_freq": 7070000, + "start_mod": "lsb", + "tuning_step": "500" + }, + "80m": { + "name": "80m", + "center_freq": 3650000, + "samp_rate": 500000, + "start_freq": 3570000, + "start_mod": "lsb", + "tuning_step": "500" + }, + "49m": { + "name": "49m Broadcast", + "center_freq": 6000000, + "samp_rate": 500000, + "start_freq": 6070000, + "start_mod": "am", + "tuning_step": "1000" + } + } + } + }, + "receiver_name": "ARISS Radio Pi", + "receiver_location": "Budapest, Hungary", + "receiver_asl": 200, + "receiver_admin": "example@example.com", + "receiver_gps": { + "lat": 39.95233, + "lon": -75.16379 + }, + "photo_title": "Panorama of Budapest from Sch\u00f6nherz Zolt\u00e1n Dormitory", + "photo_desc": "", + "max_clients": 20, + "keep_files": 20, + "session_timeout": 0, + "usage_policy_url": "policy", + "allow_chat": true, + "allow_audio_recording": true, + "allow_center_freq_changes": false, + "magic_key": "memagic", + "receiver_keys": [], + "waterfall_scheme": "GoogleTurboWaterfall", + "fft_fps": 9, + "fft_size": 4096, + "fft_voverlap_factor": 0.3, + "waterfall_levels": { + "min": -88.0, + "max": -20.0 + }, + "waterfall_auto_levels": { + "min": 3.0, + "max": 10.0 + }, + "waterfall_auto_level_default_mode": false, + "waterfall_auto_min_range": 50, + "audio_compression": "adpcm", + "fft_compression": "adpcm", + "tuning_precision": 2, + "eibi_bookmarks_range": 0, + "repeater_range": 0, + "map_type": "google", + "google_maps_api_key": "", + "openweathermap_api_key": "", + "map_position_retention_time": 7200, + "map_ignore_indirect_reports": false, + "map_prefer_recent_reports": true, + "callsign_url": "https://www.qrzcq.com/call/{}", + "vessel_url": "https://www.vesselfinder.com/vessels/details/{}", + "flight_url": "https://flightaware.com/live/flight/{}", + "modes_url": "https://flightaware.com/live/modes/{}/redirect" +} + diff --git a/groundstation/sstv_decode_prompt.sh b/groundstation/sstv_decode_prompt.sh index dab0f18a..07c4cf05 100755 --- a/groundstation/sstv_decode_prompt.sh +++ b/groundstation/sstv_decode_prompt.sh @@ -4,10 +4,12 @@ echo "Script to decode SSTV using QSSTV with rtl_fm" echo -sudo systemctl stop openwebrx +sudo systemctl stop openwebrx &>/dev/null sudo modprobe snd-aloop +sudo killall -9 sdrpp &>/dev/null + sudo killall -9 qsstv &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -16,7 +18,7 @@ sudo killall -9 aplay &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo systemctl stop rtl_tcp +sudo systemctl stop rtl_tcp &>/dev/null pkill -o chromium &>/dev/null @@ -30,6 +32,9 @@ sudo killall -9 sdrpp &>/dev/null sudo killall -9 zenity &>/dev/null +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + sudo killall -9 rtl_fm &>/dev/null #echo "s" >> .mode diff --git a/groundstation/webSDR.desktop b/groundstation/webSDR.desktop index 277bbae2..387dfd95 100644 --- a/groundstation/webSDR.desktop +++ b/groundstation/webSDR.desktop @@ -3,7 +3,7 @@ Type=Application Exec=/home/pi/CubeSatSim/groundstation/sdr.sh Name=Web SDR Comment=openwebrx for Web SDR -Icon=/home/pi/Downloads/openwebrx.png +Icon=/home/pi/Icons/openwebrx.png Path=/home/pi Terminal=true Categories=HamRadio diff --git a/install b/install index a49022a0..adbc9fc1 100755 --- a/install +++ b/install @@ -332,6 +332,8 @@ sudo apt-get update && sudo apt-get dist-upgrade -y # sudo apt install -y python3-pip # fi +cp /home/pi/CubeSatSim/groundstation/pacsat.desktop /home/pi/Desktop/pacsat.desktop + if [ ! -d "/home/pi/venv" ]; then cd @@ -356,11 +358,14 @@ sudo apt-get install -y git libasound2-dev i2c-tools build-essential libgd-dev l if [ ! -d "/home/pi/direwolf" ]; then cd - git clone https://github.com/alanbjohnston/direwolf.git - cd direwolf - make -j - sudo make install - make install-rpi + git clone https://github.com/wb2osz/direwolf.git + cd direwolf + mkdir build + cd build + cmake .. + make -j4 + sudo make install + make install-conf fi sudo apt-get install -y gpsd gpsd-clients libgps-dev python3-gps @@ -438,6 +443,79 @@ fi cd +FILE=/home/pi/pi_pacsat/Debug/pi_pacsat # code has already been compiled +if [ ! -f "$FILE" ]; then + cd + git clone https://github.com/alanbjohnston/g0kla_common.git + cd g0kla_common/Debug/ + make all + sudo ./install.sh + + cd + #git clone https://github.com/alanbjohnston/pi_pacsat.git + git clone https://github.com/ac2cz/pi_pacsat.git + cd pi_pacsat + #git checkout master-debug + cd Debug + make all + + mkdir /home/pi/PacSat + mkdir /home/pi/PacSat/pacsat + mkdir /home/pi/PacSat/pacsat/dir + + export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + + #value=`cat /home/pi/CubeSatSim/sim.cfg` + #echo "$value" > /dev/null + #set -- $value + + echo "bit_rate=9600" > pacsat.config + echo "bbs_callsign=AMSAT-12" >> pacsat.config + echo "broadcast_callsign=AMSAT-11" >> pacsat.config + echo "digi_callsign=AMSAT-1" >> pacsat.config + echo "max_frames_in_tx_buffer=5" >> pacsat.config + + echo "pb_open=1" > pacsat.state + echo "uplink_open=1" >> pacsat.state + echo "pb_max_period_for_client_in_seconds=60" >> pacsat.state + echo "uplink_max_period_for_client_in_seconds=60" >> pacsat.state +fi + +FILE=/home/pi/pacsat_telem/Debug/pacsat_telem # code has already been compiled +if [ ! -f "$FILE" ]; then + cd + sudo apt-get install -y libbsd-dev + git clone https://github.com/alanbjohnston/pacsat_telem.git + cd pacsat_telem + git checkout master-fox + cd Debug + make all +fi + +sudo sed -i 's/#hdmi_group=1/hdmi_group=2/g' /boot/config.txt +sudo sed -i 's/#hdmi_mode=1/hdmi_mode=16/g' /boot/config.txt +sudo sed -i 's/#hdmi_force_hotplug=1/hdmi_force_hotplug=1/g' /boot/config.txt + +sudo raspi-config nonint do_vnc 0 + +cd /tmp + +wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46o.tar.gz + +tar -xzf PacsatGround_unix_0_46o.tar.gz -C /home/pi/Desktop + +rm PacsatGround_unix_0_46o.tar.gz + +cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/* /home/pi/Desktop/PacsatGround/spacecraft/ + +mkdir /home/pi/PacSatGround + +sudo usermod -a -G gpio pi + +sudo apt-get install default-jdk -y + +cd + if [ ! -d "/home/pi/PiSSTVpp" ]; then sudo apt-get update -y @@ -523,6 +601,22 @@ else FLAG=1 fi +FILE=/etc/systemd/system/pacsatsim.service +if [ -f "$FILE" ]; then + if [[ $(diff /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service) ]]; then + echo "changed pacsatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + FLAG=1 + else + echo "no change to pacsatsim.service." + fi +else + echo "creating pacsatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + sudo systemctl enable command + FLAG=1 +fi + FILE=/etc/asound.conf if [ -f "$FILE" ]; then if [[ $(diff /home/pi/CubeSatSim/asound.conf /etc/asound.conf) ]]; then diff --git a/log b/log index 2a3ce9d7..a516a3c0 100755 --- a/log +++ b/log @@ -2,16 +2,65 @@ echo -e "\nLog file script for CubeSatSim\n" -if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then - sudo journalctl -a -u transmit > /home/pi/CubeSatSim/logt.txt - cat /home/pi/CubeSatSim/logt.txt - echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" -elif [ "$1" = "-c" ]; then - sudo journalctl -a -u command > /home/pi/CubeSatSim/logc.txt - cat /home/pi/CubeSatSim/logc.txt - echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" +if [ "$1" = "-h" ] ; then + echo "Displays systemd logs for the chose process. The choices are:" + echo " -d cubesatsim (also no choice gives you this)" + echo " -t transmit" + echo " -c command and control" + echo " -p pacsat" + echo "Default is the log is dumpted to the screen and written to a file." + echo "If an additional r is included, the log is realtime, and exits with a Control-C" + echo + exit +fi + +REALTIME=0 +if [ "$2" = "r" ] ; then + REALTIME=1 +fi + +if [ "$REALTIME" = "1" ] ; then + + echo "To exit, type Control-C" + echo + sleep 2 + + if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then + sudo journalctl -af -u transmit # > /home/pi/CubeSatSim/logt.txt + # cat /home/pi/CubeSatSim/logt.txt + # echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" + elif [ "$1" = "-c" ]; then + sudo journalctl -af -u command # > /home/pi/CubeSatSim/logc.txt + cat /home/pi/CubeSatSim/logc.txt + # echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" + elif [ "$1" = "-p" ]; then + sudo journalctl -af -u pacsatsim # > /home/pi/CubeSatSim/logp.txt + cat /home/pi/CubeSatSim/logp.txt + # echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" + else + sudo journalctl -af -u cubesatsim # > /home/pi/CubeSatSim/log.txt + # cat /home/pi/CubeSatSim/log.txt + # echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" + fi + else - sudo journalctl -a -u cubesatsim > /home/pi/CubeSatSim/log.txt - cat /home/pi/CubeSatSim/log.txt - echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" + + if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then + sudo journalctl -a -u transmit > /home/pi/CubeSatSim/logt.txt + cat /home/pi/CubeSatSim/logt.txt + echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" + elif [ "$1" = "-c" ]; then + sudo journalctl -a -u command > /home/pi/CubeSatSim/logc.txt + cat /home/pi/CubeSatSim/logc.txt + echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" + elif [ "$1" = "-p" ]; then + sudo journalctl -a -u pacsatsim > /home/pi/CubeSatSim/logp.txt + cat /home/pi/CubeSatSim/logp.txt + echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" + else + sudo journalctl -a -u cubesatsim > /home/pi/CubeSatSim/log.txt + cat /home/pi/CubeSatSim/log.txt + echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" + fi + fi diff --git a/main.c b/main.c index 573ccb5f..26bb93ff 100644 --- a/main.c +++ b/main.c @@ -261,13 +261,28 @@ int main(int argc, char * argv[]) { printf("Mode is Repeater\n"); } else if ( mode_string == 'n') { mode = TXCOMMAND; - printf("Mode is Transmit Command\n"); - } else { + printf("Mode is Transmit Command\n"); + } else if ( mode_string == 'p') { + mode = PACSAT; + printf("Mode is Pacsat\n"); + } else if ( mode_string == 'P') { + mode = PACSATGND; + printf("Mode is Pacsat Ground Station\n"); + } else { printf("Mode is BPSK\n"); } } } + if ( mode == PACSAT) { + FILE * pacsat_file = popen("sudo systemctl restart pacsatsim", "r"); + pclose(pacsat_file); + } + else { + FILE * pacsat_file = popen("sudo systemctl stop pacsatsim", "r"); + pclose(pacsat_file); + } + // Open telemetry file with STEM Payload Data telem_file = fopen("/home/pi/CubeSatSim/telem.txt", "a"); if (telem_file == NULL) @@ -503,8 +518,9 @@ int main(int argc, char * argv[]) { printf("\n FSK Mode, %d bits per frame, %d bits per second, %d ms per frame, %d ms sample period\n", bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod); - - } else if (mode == BPSK) { +// } else if (mode == BPSK) { + } else { + bitRate = 1200; rsFrames = 3; payloads = 6; @@ -526,8 +542,11 @@ int main(int argc, char * argv[]) { frameTime = ((float)((float)bufLen / (samples * frameCnt * bitRate))) * 1000; // frame time in ms - printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d ms per frame %d ms sample period\n", - bufLen, bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod); + if (mode == BPSK) + printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d ms per frame %d ms sample period\n", + bufLen, bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod); + else + printf("\n dataLen: %d \n", dataLen); sin_samples = S_RATE/freq_Hz; // printf("Sin map: "); @@ -580,12 +599,7 @@ int main(int argc, char * argv[]) { memset(sensor, 0, sizeof(sensor)); memset(other, 0, sizeof(other)); -// if (((mode == FSK) || (mode == BPSK))) // && !sim_mode) - if (mode == FSK) { // && !sim_mode) - get_tlm_fox(); -// get_tlm_fox(); - } - if (mode == BPSK) { // && !sim_mode) + if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT)) // && !sim_mode) get_tlm_fox(); // fill transmit buffer with reset count 0 packets that will be ignored // get_tlm_fox(); } @@ -1028,6 +1042,7 @@ int main(int argc, char * argv[]) { } if (sim_mode) { // simulated telemetry + printf("Simulated telemetry mode\n"); double time = ((long int)millis() - time_start) / 1000.0; @@ -1066,9 +1081,9 @@ int main(int argc, char * argv[]) { // float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0)); // current[map[BAT]] = ((current[map[BAT2]] * voltage[map[BAT2]]) / batt) - charging; - current[map[BAT]] = rnd_float(320, 510) - charging; + current[map[BAT]] = rnd_float(320, 510) - charging; - printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BAT2]], batt, voltage[map[BAT2]]); + printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BAT2]], batt, voltage[map[BAT2]]); batt -= (batt > 3.5) ? current[map[BAT]] / 300000 : current[map[BAT]] / 30000; if (batt < 3.6) { @@ -1275,11 +1290,11 @@ int main(int argc, char * argv[]) { sleep(rand_sleep); // fprintf(stderr, "INFO: Sleeping for extra %d sec\n", rand_sleep); - } else if ((mode == FSK) || (mode == BPSK)) {// FSK or BPSK + } else if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT)) {// FSK or BPSK get_tlm_fox(); } else if ((mode == FC)) { get_tlm_fc(); - } else { // SSTV + } else { // SSTV or PACSATGND // fprintf(stderr, "Sleeping\n"); sleep(30); } @@ -1560,6 +1575,8 @@ void get_tlm_fox() { smaller = (int)(S_RATE / (2 * freq_Hz)); +// if (mode == PACSAT) +// dataLen = 78; short int b[dataLen]; short int b_max[dataLen]; short int b_min[dataLen]; @@ -1629,7 +1646,10 @@ void get_tlm_fox() { sampleTime = (unsigned int)millis(); } else - printf("first or second time - no sleep\n"); + { + printf("first time - no sleep\n"); + firstTime = OFF; + } printf("++++ Loop time: %5.3f sec +++++\n", (millis() - loopTime) / 1000.0); fflush(stdout); @@ -1640,7 +1660,6 @@ void get_tlm_fox() { for (int count1 = 0; count1 < 8; count1++) { if (voltage[count1] < voltage_min[count1]) voltage_min[count1] = voltage[count1]; if (current[count1] < current_min[count1]) current_min[count1] = current[count1]; - if (voltage[count1] > voltage_max[count1]) voltage_max[count1] = voltage[count1]; if (current[count1] > current_max[count1]) current_max[count1] = current[count1]; @@ -1998,8 +2017,8 @@ void get_tlm_fox() { encodeB(b, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); encodeA(b, 53 + head_offset, groundCommandCount); - if (mode == BPSK) { - encodeA(b_max, 51 + head_offset, status); + if ((mode == BPSK) || (mode == PACSAT)) { + encodeA(b_max, 51 + head_offset, status); encodeA(b_min, 51 + head_offset, status); encodeB(b_max, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); encodeB(b_min, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); @@ -2020,8 +2039,38 @@ void get_tlm_fox() { encodeA(b, 65 + head_offset, val >> 8); encodeA(b, 63 + head_offset, 0x00); encodeA(b, 62 + head_offset, 0x01); - encodeB(b, 74 + head_offset, 0xfff); + encodeB(b, 74 + head_offset, 0xfff); } + + if (mode == PACSAT) + { + FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb"); + if (telem_binary != NULL) { + + int bytes_written = 4; + unsigned int now = (unsigned int)time(0); + fwrite(&now, sizeof(now), 1, telem_binary); + + int count; + char byte; + printf("b is: \n"); + for (count = 0; count < dataLen; count++) { + byte = b[count]; + fwrite(&byte, 1, 1, telem_binary); + printf("%02X ", byte); + bytes_written++; + } + printf("\n"); + printf("Writing %d bytes to tlm.bin\n", bytes_written + 4); + fclose(telem_binary); + } + else + printf("Error opening tlm.bin\n"); + } + else + { // extra bracket for some reason? + { + short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; @@ -2310,22 +2359,25 @@ void get_tlm_fox() { // max -= 1; } - /// if (sock_ret == -1) { - /// printf("Error: %s \n", strerror(errno)); - /// socket_open = 0; - // transmitStatus = -1; - /// } - /// } + if (socket_open == 1) + firstTime = 0; +// else if (frames_sent > 0) //5) +// firstTime = 0; + + } + } // extra bracket for some reason? + if (!transmit) { fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n"); fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); } - /// if (socket_open == 1) - /// firstTime = 0; - // else if (frames_sent > 0) //5) - // firstTime = 0; - +// if (firstTime && (mode == PACSAT)) +// { +// firstTime = OFF; +// fprintf(stderr, "No longer first time\n"); +// fflush(stdout); +// } return; } @@ -2664,9 +2716,8 @@ if (setting == ON) { FILE *command = popen("touch /home/pi/CubeSatSim/battery_saver", "r"); pclose(command); fprintf(stderr,"Turning Safe Mode ON\n"); - fprintf(stderr,"Turning Battery saver mode ON\n"); - battery_saver_mode = ON; - if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) { + fprintf(stderr,"Turning Battery saver mode ON\n"); + if ((mode == AFSK) || (mode == SSTV) || (mode == CW) || (mode == PACSAT)) { command = popen("echo 'reboot due to turning ON Safe Mode!' | wall", "r"); pclose(command); command = popen("sudo reboot now", "r"); @@ -2682,6 +2733,7 @@ if (setting == ON) { FILE *command = popen("rm /home/pi/CubeSatSim/battery_saver", "r"); pclose(command); fprintf(stderr,"Turning Battery saver mode OFF\n"); + if ((mode == AFSK) || (mode == SSTV) || (mode == CW) || (mode == PACSAT)) { battery_saver_mode = OFF; if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) { command = popen("echo 'reboot due to turning OFF Safe Mode!' | wall", "r"); diff --git a/main.h b/main.h index 442c1bd7..058c0012 100644 --- a/main.h +++ b/main.h @@ -125,7 +125,25 @@ FILE *image_file; #define CW 5 #define FC 6 #define REPEATER 7 +#define PACSAT 8 +#define REPEATER 11 #define TXCOMMAND 12 +#define PACSATGND 13 + +#define FAIL_COUNT 11 +#define FAIL_NONE -1 +#define FAIL_UNPLUG 1 +#define FAIL_SOLAR 2 +#define FAIL_DEGRADE 3 +#define FAIL_SHORT 4 +#define FAIL_I2C1 5 +#define FAIL_I2C3 6 +#define FAIL_CAMERA 7 +#define FAIL_PAYLOAD 8 +#define FAIL_BME 9 +#define FAIL_MPU 10 +#define FAIL_AUDIO 11 +int failureMode = FAIL_NONE; #define FAIL_COUNT 11 #define FAIL_NONE -1 diff --git a/pacsat-test.sh b/pacsat-test.sh new file mode 100755 index 00000000..dd43979c --- /dev/null +++ b/pacsat-test.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +/usr/bin/x-terminal-emulator --geometry=120x40 -e "bash /home/pi/CubeSatSim/pacsatsim-d.sh" + +sleep 1 + +/usr/bin/x-terminal-emulator --geometry=120x40 -e "bash /home/pi/CubeSatSim/pacsatsim.sh" + +sleep 1 + +/usr/bin/x-terminal-emulator --geometry=120x40 -e "direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-loopback.conf -t 0" + +sleep 1 + +/usr/bin/x-terminal-emulator --geometry=120x40 -e "bash /home/pi/CubeSatSim/groundstation/pacsat.sh" + + diff --git a/pacsatsim-d.sh b/pacsatsim-d.sh new file mode 100755 index 00000000..7480af0c --- /dev/null +++ b/pacsatsim-d.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo modprobe snd-aloop + +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 diff --git a/pacsatsim-df.sh b/pacsatsim-df.sh new file mode 100755 index 00000000..5abc76d1 --- /dev/null +++ b/pacsatsim-df.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +pwm=1 + +sudo modprobe snd-aloop + +if [ "$pwm" = "1" ] ; then + + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm.conf -t 0 + +else + + direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 + +fi diff --git a/pacsatsim-dj.sh b/pacsatsim-dj.sh new file mode 100755 index 00000000..888124e6 --- /dev/null +++ b/pacsatsim-dj.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo modprobe snd-aloop + +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14-half.conf -t 0 diff --git a/pacsatsim-djf.sh b/pacsatsim-djf.sh new file mode 100755 index 00000000..1d0c3036 --- /dev/null +++ b/pacsatsim-djf.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo modprobe snd-aloop + +direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-fm-pacsat-jp14.conf -t 0 diff --git a/pacsatsim-f.sh b/pacsatsim-f.sh new file mode 100755 index 00000000..2a8bb965 --- /dev/null +++ b/pacsatsim-f.sh @@ -0,0 +1,211 @@ +#!/bin/bash + +# script to auto decode packet using rtl_fm and Direwolf and run Pacsat + +export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + +#sudo systemctl stop cubesatsim + +#sudo systemctl stop transmit + +sudo systemctl stop command &>/dev/null + +sudo modprobe snd-aloop + +#sudo systemctl stop openwebrx + +#sudo systemctl stop rtl_tcp &>/dev/null + +#pkill -o chromium &>/dev/null + +#sudo killall -9 rtl_fm &>/dev/null + +#sudo killall -9 direwolf &>/dev/null + +#udo killall -9 aplay &>/dev/null + +#sudo killall -9 qsstv &>/dev/null + +#sudo killall -9 rtl_tcp &>/dev/null + +#sudo killall -9 java &>/dev/null + +#sudo killall -9 CubicSDR &>/dev/null + +#sudo killall -9 zenity &>/dev/null + +echo + +#frequency=$(zenity --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" 437100 "Serenity CubeSat 4800 bps" Serenity "Test Serenity CubeSat decoding with WAV file" APRS "Test APRS decoding with CubeSatSim WAV file") + +#echo $frequency + +#if [ -z "$frequency" ]; then + +#echo "No choice made. Exiting." + +#sleep 3 + +#exit + +#echo "Choose the number for the packet decoding option:" +#echo +#echo "1. APRS US 2m (144390 kHz)" +#echo "2. CubeSatSim (434900 kHz)" +#echo "3. APRS European 2m (144800 kHz)" +#echo "4. APRS Australian 2m (145175 kHz)" +#echo "5. APRS on another frequency" +#echo "6. APRS on ISS (145825 kHz)" +#echo "7. Serenity CubeSat 4800 bps (437.1 MHz)" +#echo "8. Test Serenity CubeSat decoding with WAV file" +#echo "9. Test APRS decoding with CubeSatSim WAV file" +#echo + +#read -r choice + +choice=2 + +#fi + +if [ "$choice" = "1" ] || [ "$frequency" = "144390" ]; then + + frequency=144390000 + +elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then + + frequency=434900000 + echo + echo "If your Pacsat Ground Station is transmitting packets, you will see them here" + echo + +elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then + + frequency=144800000 + +elif [ "$choice" = "4" ] || [ "$frequency" = "145175" ]; then + + frequency=145175000 + +elif [ "$choice" = "5" ] || [ "$frequency" = "Other" ] ; then + + echo + + echo "Enter the frequency in kiloHertz" + + echo + + read -r frequency + + frequency=$frequency"000" + + #echo $frequency + +elif [ "$choice" = "6" ] || [ "$frequency" = "145825" ] ; then + + frequency=145825000 + echo + echo "If the ISS is overhead and in APRS mode (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "7" ] || [ "$frequency" = "437100" ] ; then + + frequency=437100000 + echo + echo "If the Serenity CubeSat is overhead and transmitting (see tracking application such as Gpredict), you will see packets." + echo + +elif [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] ; then + + echo "A recorded WAV file will play and you should see some packets decoded" + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + +# aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & +# aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/SDRSharp_20210830_200034Z_437097377Hz_AF.wav & + aplay -D hw:0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/groundstation/WAV/beacon_test_2.wav & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +elif [ "$choice" = "8" ] || [ "$frequency" = "APRS" ] ; then + + echo "A recorded APRS WAV file from the CubeSatSim will play and you should see a packet decoded." + + echo + + value=`aplay -l | grep "Loopback"` + echo "$value" > /dev/null + set -- $value + + #aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + #aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav & + (while true; do (sleep 2 && aplay -D hw:${2:0:1},0,0 /home/pi/CubeSatSim/telem.wav &>/dev/null); done) & + + timeout 30 direwolf -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf.conf -r 48000 -t 0 + + echo + + echo "Test complete. This window will close in 10 seconds." + + sleep 5 + + exit + +#fi + +fi + +#echo + +#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." + +echo + +if [ "$choice" = "7" ] || [ "$choice" = "8" ] || [ "$frequency" = "Serenity" ] || [ "$frequency" = "437100000" ] ; then + + echo -e "Auto decoding 4800 bps AX.25 packets on $frequency Hz" + + direwolf -r 48000 -c /home/pi/CubeSatSim/groundstation/direwolf/direwolf-4800.conf -t 0 & + +else + +# echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" + +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + + /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-df.sh" + +### arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 & + + echo "Don't close the direwolf window or the Pacsatsim will stop running." + + echo +fi + +sleep 5 + +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & + +cd /home/pi/pi_pacsat/Debug + +./pi_pacsat -c pacsat.config -d /home/pi/PacSat + +sleep 5 diff --git a/pacsatsim.sh b/pacsatsim.sh new file mode 100755 index 00000000..1ea856b1 --- /dev/null +++ b/pacsatsim.sh @@ -0,0 +1,181 @@ +#!/bin/bash + +# script to run PacsatSim + +loopback=0 +vox=0 +if [ "$1" = "l" ] ; then + + loopback=1 + +elif [ "$1" = "v" ] ; then + + vox=1 + +fi + +if [ ! -d "/home/pi/PacSat" ]; then + + echo "Setting up PacSatSim default configuration" + echo + + mkdir /home/pi/PacSat + mkdir /home/pi/PacSat/pacsat + mkdir /home/pi/PacSat/pacsat/dir + + cd /home/pi/pi_pacsat/Debug + + sudo rm pacsat_last_command_time.dat + sudo rm pacsat_upload_table.dat + sudo rm pacsat.state + + echo "bit_rate=9600" > pacsat.config + echo "bbs_callsign=AMSAT-12" >> pacsat.config + echo "broadcast_callsign=AMSAT-11" >> pacsat.config + echo "digi_callsign=AMSAT-1" >> pacsat.config + echo "max_frames_in_tx_buffer=5" >> pacsat.config + + echo "pb_open=1" > pacsat.state + echo "uplink_open=1" >> pacsat.state + echo "pb_max_period_for_client_in_seconds=60" >> pacsat.state + echo "uplink_max_period_for_client_in_seconds=60" >> pacsat.state + + touch /home/pi/pi_pacsat/Debug/pacsat_upload_table.dat + +fi + +value=`cat /home/pi/CubeSatSim/sim.cfg` +echo "$value" > /dev/null +set -- $value + +callsign="$1" + +echo "Configured callsign is " +echo $callsign + +oldcallsign=$(grep -oP '(?<=bbs_callsign=).*(?=-)' /home/pi/pi_pacsat/Debug/pacsat.config) + +echo "Callsign in pacsat.config is " +echo $oldcallsign + +if [ ! "$callsign" = "$oldcallsign" ] ; then + + sudo sed -i "s/bbs_callsign=$oldcallsign/bbs_callsign=$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config + sudo sed -i "s/broadcast_callsign=$oldcallsign/broadcast_callsign=$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config + sudo sed -i "s/digi_callsign=$oldcallsign/digi_callsign=$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config + + echo "New pacsat.confg is" + echo + + cat /home/pi/pi_pacsat/Debug/pacsat.config + +fi + + + +sudo /etc/init.d/alsa-utils stop +sudo /etc/init.d/alsa-utils start + +# export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + +export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH + +#sudo systemctl stop cubesatsim + +#sudo systemctl stop transmit + +#sudo systemctl stop command &>/dev/null + +sudo modprobe snd-aloop + +#sudo systemctl stop openwebrx + +#sudo systemctl stop rtl_tcp &>/dev/null + +#pkill -o chromium &>/dev/null + +#sudo killall -9 rtl_fm &>/dev/null + +#sudo killall -9 direwolf &>/dev/null + +#udo killall -9 aplay &>/dev/null + +#sudo killall -9 qsstv &>/dev/null + +#sudo killall -9 rtl_tcp &>/dev/null + +#sudo killall -9 java &>/dev/null + +#sudo killall -9 CubicSDR &>/dev/null + +#sudo killall -9 zenity &>/dev/null + +sudo killall -9 pacsat_telem &>/dev/null + +sudo killall -9 pi_pacsat &>/dev/null + +echo + + +#choice=2 + +#fi + + +# frequency=434900000 + echo + echo "If your Pacsat Ground Station is transmitting packets, you will see them here" + echo + + +#echo + +#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work." + + +# echo -e "Auto decoding APRS Pacsat packets on $frequency Hz" + +# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 & + + # /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-df.sh" + + + +if [ "$loopback" = "1" ]; then + + echo "Using audio loopback" + sudo /home/pi/CubeSatSim/pacsatsim-d.sh & + +elif [ "$vox" = "1" ]; then + + echo "Using Soundcard Audio TX and RX (VOX)" + sudo /home/pi/CubeSatSim/pacsatsim-dj.sh & + +else + + echo "Using TXC FM transceiver" + sudo /home/pi/CubeSatSim/pacsatsim-df.sh & + +fi + +# arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 & +## arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 4000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 & + +## echo "Don't close the direwolf window or the Pacsatsim will stop running." + + +sudo /home/pi/pacsat_telem/Debug/pacsat_telem -v -d /home/pi/PacSat/pacsat & + +sleep 5 + +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 & + +cd /home/pi/pi_pacsat/Debug + +./pi_pacsat -c pacsat.config -d /home/pi/PacSat + +sleep 5 diff --git a/spacecraft/PacSatGround_0.46m/PacSatSim.dat b/spacecraft/PacSatGround_0.46m/PacSatSim.dat new file mode 100644 index 00000000..92ae8f93 --- /dev/null +++ b/spacecraft/PacSatGround_0.46m/PacSatSim.dat @@ -0,0 +1,15 @@ +Pacsat Telemetry Decoder Properties +#Sat Nov 26 18:12:20 EST 2016 +numberOfLookupTables=0 +measurementsFileName=measurements.csv +model=1 +layout0.filename=PACSAT_rttelemetry.csv +layout0.name=TLMI_LAYOUT +passMeasurementsFileName=passmeasurements.csv +name=PacSatSim +description=PacSatSim +numberOfLayouts=1 +satId=3 +catalogNumber=0 +conversionCoefficients=pacsat-coef.csv +layoutsUseBits=True diff --git a/spacecraft/PacSatGround_0.46m/PacSatSim.properties b/spacecraft/PacSatGround_0.46m/PacSatSim.properties new file mode 100644 index 00000000..e4ccad24 --- /dev/null +++ b/spacecraft/PacSatGround_0.46m/PacSatSim.properties @@ -0,0 +1,20 @@ +#PacSat Ground Station Properties +#Sun Feb 17 18:25:06 EST 2019 +sequence_num=3 +name=PacSatSim +digiCallsign=AMSAT-1 +description=PacSatSim +broadcastCallsign=AMSAT-11 +DIR_AGE=10 +bbsCallsign=AMSAT-12 +telemLayoutFile=PacSatSim.dat +telem_server=tlm.amsatfox.org +web_site_url=http://CubeSatSim.org +show_system_files_on_dir_tab=false +show_user_files=true +supports_file_upload=true +norad_id=30776 +psf_header_check_sums=false +commandsFile=pacsat.commands +is_command_station=true +secret_key=ScKQLp2ZMvCaCTK5jAmOmKmA0JiSyJ6Y15+Yfg\=\= diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv new file mode 100644 index 00000000..48187077 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim-coef.csv @@ -0,0 +1,40 @@ +0,-,NONE,0,1,0,0,0,0,None,0,4096,None +1,-,Boolean,0,1,0,0,0,0,Boolean,0,1,A Boolean value that prints TRUE or FALSE +2,-,Counts,0,1,0,0,0,0,Counts,0,4096,An integer count value +3,-,Date,0,1,0,0,0,0,Date,0,4096,A Unix epoch date time integer +4,-,TXPower,0,1,0,0,0,0,None,0,4096,None +5,-,IHUSpeed,0,0.1,0,0,0,0,None,0,4096,None +6,-,RSSI_1,0,-1,0,0,0,0,Counts,0,4096,Signed 8 bit +7,-,Mode,0,0,0,0,0,0,Enum,0,4096,SAFE:CREW:TELEM:X BAND RPT:APRS:SSTV:FS +8,-,Battery,0,0.001,0,0,0,0,None,0,4096,Battery Voltage +9,-,IHUTemp,0,0.1,0,0,0,0,None,0,4096,None +10,-,Mode,0,1,0,0,0,0,None,0,4096,The spacecraft Mode +11,-,FS_BYTES_PER_BLK,0,128,0,0,0,0,Counts,0,4096,The number of bytes per block in RED FS +12,-,FS_FILE_NUMBER,-4,1,0,0,0,0,Counts,0,4096,The number of files in the FS excluding core OS folders +13,-,SHTC3Temp,-45,0.002670288,0,0,0,0,None,0,4096,SHTC3 Temperature sensor +14,-,SHTC3Humidity,0,0.001525879,0,0,0,0,None,0,4096,SHTC3 Humidity sensor +15,-,LPS22Pressure,0,0.000244141,0,0,0,0,None,0,4096,LPS22 Pressure sensor +16,-,LPS22Temp,0,0.01,0,0,0,0,None,0,4096,LPS22 Temperature of sensor +17,-,IMUTemp,0,0.00390625,0,0,0,0,None,0,4096,Temperature of IMU = raw/256 +18,-,Acc,0,6.10E-05,0,0,0,0,Sint16,0,4096,Accelerometer is 2g full scale +19,-,Gyro,0,0.000976563,0,0,0,0,Sint16,0,4096,Gyro scale for 32dps +20,-,Mag,0,0.149975574,0,0,0,0,Sint16,0,4096,Mag is 4912 full scale +21,-,AntMode,0,0,0,0,0,0,Enum,0,4096,MANUAL:AUTO:ORBIT +22,-,ResetReason,0,0,0,0,0,0,Enum,0,4096,NONE:SHUTDOWN:REBOOT:RADIO:TNC:TNC LISTEN:RUN TWICE:RADIO REBOOT:TNC PS REBOOT:TNC REBOOT:SOFT:THERMAL +23,-,LogLevel,0,0,0,0,0,0,Enum,0,4096,NONE:ERROR:WARN:INFO +24,-,O2FromVolts,86.434,-0.0354,0,0,0,0,None,0,4096,O2 Conc from raw voltage as a percentage +25,-,SensorState,0,0,0,0,0,0,Enum,0,4096,OFF:ON:ERR +26,-,SPARE2,0,0,0,0,0,0,Counts,0,4096,SPARE +27,-,O2Conc,0,0.01,0,0,0,0,Sint16,0,4096,O2 concentration as percentage +28,-,SSTVMode,0,0,0,0,0,0,Enum,0,4096,MartinM1:MartinM2:ScottieS1:ScottieS2:Robot36:PasokonP3:PasokonP5:PasokonP7:PD90:PD120:PD160:PD180:PD240:PD290:Robot8BW:Robot24BW +29,-,DivideBy100,0,0.01,0,0,0,0,None,0,4096,Divide by 100 +30,-,DivideBy100Offset,-20.48,0.01,0,0,0,0,None,0,4096,Divide by 100 with Offset +31,-,Offset,-2048,1,0,0,0,0,None,0,4096,Offset +32,-,DivideBy10Offset,-204.8,0.1,0,0,0,0,None,0,4096,Divide by 10 with Offset +33,-,Status,0,0,0,0,0,0,Enum,0,4096,OFF:ON +34,-,CommandStatus,0,0,0,0,0,0,Enum,0,4096,OFF:Carrier:DTMF/APRS +35,-,FailStatus,0,0,0,0,0,0,Enum,0,4096,OK:FAIL +36,-,AntStatus,0,0,0,0,0,0,Enum,0,4096,STOWED:DEPLOYED +NOTES:,,,,,,,,,,,, +Serial,Ignore,name,a,b,c,d,e,f,format,low limit,high limit,Comment +Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,,,,,,,,,,, diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.commands b/spacecraft/PacSatGround_0.46o/PacSatSim.commands new file mode 100644 index 00000000..4e7a8073 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.commands @@ -0,0 +1,37 @@ +# This is a list of commands that can be sent to the spacecraft +# args are 16 bit except the special code 99099099 which is replaced with the unix time, or when special code MSB32BIT is used to combine two fields +LIST, namespaces, None, Operations, Telem, File System +LIST, IMAGE FOLDER, sstv_queue 1, sstv_queue 2, sstv_queue 3, sstv_queue 4, sstv_queue 5, sstv_queue 6, sstv_queue 7, sstv_queue 8, sstv_queue 9 +LIST, FOLDER, bin, lib, config, PACSAT dir, upload queue, wod queue, log queue, text queue, sensor wod queue, data1, data2, data3, data4, data5, data6, data7, data8, data9 +LIST, ENABLE, false, true +LIST, ROLL AT STARTUP, false, true +LIST, OVERWRITE, false, true +LIST, FSK, false, true +LIST, REMOVE ORPHAN FILES, false, true +LIST, STATE, stop, start +LIST, UPLINK MODE, Off, All stations, Command Stations Only +LIST, FILENAME, use id for file name, user file name +LIST, SHUTDOWN, reboot, shutdown +LIST, RESET, reboot +LIST, RATE, 1200, 9600 +LIST, FEC, Off, On +LIST, FULL DUPLEX, false, true +LIST, LOG NAME, Log, WOD +LIST, LOG LEVEL, None, Error, Warnings, Info +# Name, Name space, cmd, arg0, arg1, arg2, arg3, argName0, argName1, argName2, argName3, confirm, use reset/uptime, description +# +# PACSAT +# +Pacsat Broadcast,3,1,0,0,0,0,State,Period(sec),Timeout(sec),NONE,false,false,Enable or disable the Pacsat Broadcast module. The directory entries and individual files will be broadcast based on commands from ground stations. +File Uploads,3,2,0,0,0,0,Uplink Mode,Period(sec),Timeout(sec),NONE,false,false,Enable or disable File Uploads. Limit file uploads to command stations that authenticate with a secret key. +Install File,3,3,0,0,0,0,FileId,MSB32BIT,Folder,NONE,false,false,Copy a file from the PACSAT Directory to a folder and name it with a 4 byte hex name that matches the id or the user filename. +Execute File,3,13,0,0,0,0,FileId,MSB32BIT,Arg1,Arg2,true,false,Execute a file on the ARISS-PI. The file must already be installed in the bin folder +Delete File,3,4,0,0,0,0,FileId,MSB32BIT,Folder,NONE,true,false,Delete a file on the ARISS-PI. Typically this leaves the original copy in the PACSAT dir. To delete the original copy specify the PACSAT Dir folder +Delete Folder Contents,3,5,0,0,0,0,Folder,Remove Orphan Files,NONE,NONE,true,false,Remove all files from the folder. The original files will remain in the PACSAT Directory unless deleted seperately. Orphan files are files in a folder without a corresponding Pacsat Dir file. NB: Deleting the entire Pacsat Dir is a desperate measure perhaps only useful in testing! +Default File Expiry Period,3,6,0,0,0,0,Period(days),NONE,NONE,NONE,false,false,Set the default expiry period for files without a specific expiry time. The new value will be applied to all files. +File Expiry Period,3,7,0,0,0,0,FileId,MSB32BIT,Date,MSB32BIT,false,false,Set the expiry date for a specific file`. +Directory Maintenence Period,3,8,0,0,0,0,Period(s),NONE,NONE,NONE,false,false,Period between checks to each node in the directory for file expiry. +Uplink queue maintenance Period,3,9,0,0,0,0,Period(s),NONE,NONE,NONE,false,false,Period to check the entire uplink queue for expired files. +Int File Que Check Period,3,10,0,0,0,0,Period(s),NONE,NONE,NONE,false,false,Period to check the ingestion queues for newly generated internal files. +Max File Size,3,11,0,0,0,0,Size(kb),NONE,NONE,NONE,false,false,Maximum size for an uploaded file +Max Upload File Age,3,12,0,0,0,0,Age(days),NONE,NONE,NONE,false,false,Partially uploaded files not modified for more than this period will be removed from the upload queue. diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.dat b/spacecraft/PacSatGround_0.46o/PacSatSim.dat new file mode 100644 index 00000000..1e5abfff --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.dat @@ -0,0 +1,18 @@ +#Pacsat Telemetry Decoder Properties +#Fri Feb 6 18:12:20 EST 2026 +numberOfLookupTables=0 +measurementsFileName=measurements.csv +model=1 +layoutsUseToCallsignAsType=true +numberOfLayouts=2 +layout0.filename=PacSatSim_rttelemetry.csv +layout0.name=TLMP1 +layout1.filename=PacSatSim_rttelemetry.csv +layout1.name=WOD +passMeasurementsFileName=passmeasurements.csv +name=ISS +description=PacSatSim +satId=3 +catalogNumber=0 +conversionCoefficients=PacSatSim-coef.csv +layoutsUseBits=True diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim.properties b/spacecraft/PacSatGround_0.46o/PacSatSim.properties new file mode 100644 index 00000000..8ff5be50 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim.properties @@ -0,0 +1,21 @@ +#PacSat Ground Station Properties +#Fri Feb 6 18:25:06 EST 2026 +sequence_num=3 +name=PacSatSim +digiCallsign=AMSAT-1 +description=PacSatSim +broadcastCallsign=AMSAT-11 +DIR_AGE=10 +bbsCallsign=AMSAT-12 +telemLayoutFile=PacSatSim.dat +telem_server=tlm.amsatfox.org +web_site_url=http://CubeSatSim.org +show_system_files_on_dir_tab=false +show_user_files=true +supports_file_upload=true +norad_id=30776 +psf_header_check_sums=false +is_command_station=true +secret_key=Not-required +commandsFile=PacSatSim.commands +echo_to_stdout=true diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_Type1_HEALTH.frame b/spacecraft/PacSatGround_0.46o/PacSatSim_Type1_HEALTH.frame new file mode 100644 index 00000000..050ff88a --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_Type1_HEALTH.frame @@ -0,0 +1,13 @@ +number_of_payloads=6 +payload0.name=rttelemetry +payload0.length=78 +payload1.name=rttelemetry +payload1.length=78 +payload2.name=rttelemetry +payload2.length=78 +payload3.name=rttelemetry +payload3.length=78 +payload4.name=rttelemetry +payload4.length=78 +payload5.name=wodtelemetry +payload5.length=78 diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_Type2_MINMAX.frame b/spacecraft/PacSatGround_0.46o/PacSatSim_Type2_MINMAX.frame new file mode 100644 index 00000000..a69be045 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_Type2_MINMAX.frame @@ -0,0 +1,13 @@ +number_of_payloads=6 +payload0.name=rttelemetry +payload0.length=78 +payload1.name=rttelemetry +payload1.length=78 +payload2.name=rttelemetry +payload2.length=78 +payload3.name=maxtelemetry +payload3.length=78 +payload4.name=mintelemetry +payload4.length=78 +payload5.name=wodtelemetry +payload5.length=78 diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_conversion_curves.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_conversion_curves.csv new file mode 100644 index 00000000..30f05985 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_conversion_curves.csv @@ -0,0 +1,13 @@ +CurveName,a,bx,cx^2,dx^3,ex^4,fx^5,Description +cubesatsim_voltage,0,0.01,0,0,0,0,Converts voltages read from the INA219 sensors +cubesatsim_current,-2048,1,0,0,0,0,Converts positive and negative currents read from the INA219 sensors +cubesatsim_temperature,0,0.1,0,0,0,0,Converts temperature of Pi +cubesatsim_rotation,-2048,1,0,0,0,0,Converts positive and negative dps rotation +cubesatsim_acceleration,-20.48,0.01,0,0,0,0,Converts positive and negative g acceleration +cubesatsim_altitude,0,0.1,0,0,0,0,Converts altitude +cubesatsim_pressure,0,1,0,0,0,0,Converts pressure +cubesatsim_sensor1,0,1,0,0,0,0,Conversion of Sensor 1 +cubesatsim_sensor2,-2048,1,0,0,0,0,Conversion of Sensor 2 +cubesatsim_sensor3,-20.48,0.01,0,0,0,0,Conversion of Sensor 3 +cubesatsim_rpm,-204.8,0.1,0,0,0,0,Conversion of calculated RPM +cubesatsim_rssi,-2048,1,0,0,0,0,Conversion of Received Signal Strength diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv new file mode 100644 index 00000000..7713c778 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_maxtelemetry.csv @@ -0,0 +1,64 @@ +62,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,long,timestamp,32,Sec,0,NONE,0,0,0,timestamp,This is the unix time in seconds +1,MAX,Sensor 2,12,integer,1,NONE,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +2,MAX,Sensor 3,12,integer,1,NONE,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +3,MAX,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Battery Voltage,INA219 Battery Voltage +4,MAX,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +5,MAX,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +6,MAX,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +7,MAX,BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Battery Current,INA219 Battery Current +8,MAX,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature +9,MAX,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,INA219 +X solar panel Voltage +10,MAX,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,INA219 +Y solar panel Voltage +11,MAX,posZv,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,INA219 +Z solar panel Voltage +12,MAX,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,INA219 -X solar panel Voltage +13,MAX,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,INA219 -Y solar panel Voltage +14,MAX,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,INA219 -Z solar panel Voltage +15,MAX,posXi,12,mA,cubesatsim_current,NONE,7,2,3,Current,INA219 +X solar panel Current +16,MAX,posYi,12,mA,cubesatsim_current,NONE,8,2,3,Current,INA219 +Y solar panel Current +17,MAX,posZi,12,mA,cubesatsim_current,NONE,9,2,3,Current,INA219 +Z solar panel Current +18,MAX,negXi,12,mA,cubesatsim_current,NONE,10,2,3,Current,INA219 -X solar panel Current +19,MAX,negYi,12,mA,cubesatsim_current,NONE,11,2,3,Current,INA219 -Y solar panel Current +20,MAX,negZi,12,mA,cubesatsim_current,NONE,12,2,3,Current,INA219 -Z solar panel Current +21,MAX,BATT2_V,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Battery 2 Voltage,INA219 Battery 2 Voltage +22,MAX,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +23,MAX,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +24,MAX,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude +25,MAX,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +26,MAX,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +27,MAX,IHUcpuTemp,12,C,cubesatsim_temperature,NONE,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi +28,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +29,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +30,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +31,MAX,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,BME280 Humidity,BME280 Humidity +32,MAX,BAT2_I,12,mA,cubesatsim_current,NONE,5,2,3,Battery 2 Current,INA219 Battery 2 Current +33,MAX,DiodeTemp,12,C,cubesatsim_rpm,NONE,6,6,3,Diode Temp,STEM Payload Diode Temperature +34,MAX,Sensor 1,12,integer,1,NONE,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +35,MAX,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator +36,MAX,SafeMode,1,-,STATUS_ON_OFF,NONE,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +37,MAX,SimulatedTelemetry,1,-,STATUS_ON_OFF,NONE,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator +38,MAX,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator +39,MAX,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +40,MAX,I2CBus1Failure,1,-,17,NONE,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +41,MAX,I2CBus3Failure,1,-,17,NONE,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +42,MAX,CameraFailure,1,-,17,NONE,2,4,0,Camera,Camera failure indicator +43,MAX,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received +44,MAX,RxAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status +45,MAX,TxAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status +46,MAX,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status +47,MAX,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +48,MAX,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +49,MAX,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +50,MAX,rf6,12,-,0,NONE,0,0,0,None,None +51,MAX,rf7,12,-,0,NONE,0,0,0,None,None +52,MAX,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +53,MAX,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +54,MAX,pad,4,-,34,NONE,0,0,0,None,Unused +55,MAX,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +56,MAX,pad1,1,-,0,NONE,0,0,0,NONE,Filler +57,MAX,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +58,MAX,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +59,MAX,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +60,MAX,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +61,MAX,pad2,27,-,0,NONE,0,0,0,NONE,Filler + diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_mintelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_mintelemetry.csv new file mode 100644 index 00000000..adf24a04 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_mintelemetry.csv @@ -0,0 +1,62 @@ +61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,MIN,Sensor 2,12,integer,1,NONE,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +1,MIN,Sensor 3,12,integer,1,NONE,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +2,MIN,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Battery Voltage,INA219 Battery Voltage +3,MIN,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +4,MIN,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +5,MIN,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +6,MIN,BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Battery Current,INA219 Battery Current +7,MIN,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature +8,MIN,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,INA219 +X solar panel Voltage +9,MIN,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,INA219 +Y solar panel Voltage +10,MIN,posZv,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,INA219 +Z solar panel Voltage +11,MIN,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,INA219 -X solar panel Voltage +12,MIN,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,INA219 -Y solar panel Voltage +13,MIN,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,INA219 -Z solar panel Voltage +14,MIN,posXi,12,mA,cubesatsim_current,NONE,7,2,3,Current,INA219 +X solar panel Current +15,MIN,posYi,12,mA,cubesatsim_current,NONE,8,2,3,Current,INA219 +Y solar panel Current +16,MIN,posZi,12,mA,cubesatsim_current,NONE,9,2,3,Current,INA219 +Z solar panel Current +17,MIN,negXi,12,mA,cubesatsim_current,NONE,10,2,3,Current,INA219 -X solar panel Current +18,MIN,negYi,12,mA,cubesatsim_current,NONE,11,2,3,Current,INA219 -Y solar panel Current +19,MIN,negZi,12,mA,cubesatsim_current,NONE,12,2,3,Current,INA219 -Z solar panel Current +20,MIN,BATT2_V,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Battery 2 Voltage,INA219 Battery 2 Voltage +21,MIN,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,MIN,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +23,MIN,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude +24,MIN,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,MIN,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +26,MIN,IHUcpuTemp,12,C,cubesatsim_temperature,NONE,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi +27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +30,MIN,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,BME280 Humidity,BME280 Humidity +31,MIN,BAT2_I,12,mA,cubesatsim_current,NONE,5,2,3,Battery 2 Current,INA219 Battery 2 Current +32,MIN,DiodeTemp,12,C,cubesatsim_rpm,NONE,6,6,3,Diode Temp,STEM Payload Diode Temperature +33,MIN,Sensor 1,12,integer,1,NONE,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +34,MIN,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator +35,MIN,SafeMode,1,-,STATUS_ON_OFF,NONE,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +36,MIN,SimulatedTelemetry,1,-,STATUS_ON_OFF,NONE,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator +37,MIN,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator +38,MIN,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,MIN,I2CBus1Failure,1,-,17,NONE,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +40,MIN,I2CBus3Failure,1,-,17,NONE,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +41,MIN,CameraFailure,1,-,17,NONE,2,4,0,Camera,Camera failure indicator +42,MIN,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received +43,MIN,RxAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status +44,MIN,TxAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status +45,MIN,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status +46,MIN,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +47,MIN,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +48,MIN,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +49,MIN,rf6,12,-,0,NONE,0,0,0,None,None +50,MIN,rf7,12,-,0,NONE,0,0,0,None,None +51,MIN,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +52,MIN,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +53,MIN,pad,4,-,34,NONE,0,0,0,None,Unused +54,MIN,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +55,MIN,pad1,1,-,0,NONE,0,0,0,NONE,Filler +56,MIN,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +57,MIN,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +58,MIN,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +59,MIN,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +60,MIN,pad2,27,-,0,NONE,0,0,0,NONE,Filler diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv new file mode 100644 index 00000000..ca11e389 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_rttelemetry.csv @@ -0,0 +1,63 @@ +62,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,long,timestamp,32,Sec,0,NONE,0,0,0,timestamp,This is the unix time in seconds +1,int,Sensor 2,12,integer,2,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2 +2,int,Sensor 3,12,integer,2,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3 +3,float,BATT_V,12,V,29,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage +4,float,SatelliteXAxisAcceleration,12,g,30,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis +5,float,SatelliteYAxisAcceleration,12,g,30,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis +6,float,SatelliteZAxisAcceleration,12,g,30,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis +7,int,BATT_I,12,mA,31,Battery,4,2,3,Battery Current,INA219 Battery Current +8,float,Temperature,12,C,5,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature +9,float,posXv,12,V,29,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage +10,float,posYv,12,V,29,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage +11,float,posZv,12,V,29,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage +12,float,negXv,12,V,29,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage +13,float,negYv,12,V,29,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage +14,float,negZv,12,V,29,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage +15,int,posXi,12,mA,31,+X Panel,7,2,3,Current,INA219 +X solar panel Current +16,int,posYi,12,mA,31,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current +17,int,posZi,12,mA,31,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current +18,int,negXi,12,mA,31,-X Panel,10,2,3,Current,INA219 -X solar panel Current +19,int,negYi,12,mA,31,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current +20,int,negZi,12,mA,31,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current +21,float,BATT2_V,12,V,29,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage +22,float,spin,12,rpm,32,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +23,int,Pressure,12,hPa,0,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure +24,float,Altitude,12,m,12,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude +25,float,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +26,float,rssi,12,dBm,31,Radio,1,1,3,RSSI,Received Signal Strength Indication +27,float,IHUcpuTemp,12,C,5,Computer Hardware,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi +28,float,SatelliteXAxisAngularVelocity,12,dps,31,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis +29,float,SatelliteYAxisAngularVelocity,12,dps,31,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis +30,float,SatelliteZAxisAngularVelocity,12,dps,31,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis +31,float,Humidity,12,%,5,Experiments,6,5,3,BME280 Humidity,BME280 Humidity +32,int,BAT2_I,12,mA,31,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current +33,float,DiodeTemp,12,C,32,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature +34,int,Sensor 1,12,integer,2,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1 +35,float,STEMPayloadStatus,1,-,35,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator +36,float,SafeMode,1,-,33,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage) +37,float,SimulatedTelemetry,1,-,33,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator +38,float,PayloadStatus1,1,-,35,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator +39,float,I2CBus0Failure,1,-,35,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +40,float,I2CBus1Failure,1,-,35,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator +41,float,I2CBus3Failure,1,-,35,Computer Hardware,2,3,0,I2C Bus 3,I2C bus 3 failure indicator +42,float,CameraFailure,1,-,35,Computer Hardware,2,4,0,Camera,Camera failure indicator +43,int,GroundCommands,4,-,2,Computer Software,3,3,0,Ground Commands,Number of ground commands received +44,float,RxAntenna,1,-,36,Radio,1,3,0,RX Antenna,Receive antenna status +45,float,TxAntenna,1,-,36,Radio,1,2,0,TX Antenna,Transmit antenna status +46,float,C2CStatus,2,-,34,Computer Software,3,5,0,Command Control, Command & Control Status +47,float,ICR3VProt,12,V,0,NONE,7,2,3,3V Prot,ICR 3V Proteted +48,float,ICR2dot5V,12,V,0,NONE,7,3,3,2.5V,ICR 2.5V +49,float,ICR2dot5VProt,12,V,0,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +50,float,rf6,12,-,0,NONE,0,0,0,None,None +51,float,rf7,12,-,0,NONE,0,0,0,None,None +52,float,MuxTest,12,V,0,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +53,float,LtVGACtl,12,V,0,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +54,float,pad,4,-,34,NONE,0,0,0,None,Unused +55,float,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +56,float,pad1,1,-,0,NONE,0,0,0,NONE,Filler +57,float,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +58,float,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +59,float,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +60,float,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +61,float,pad2,27,-,0,NONE,0,0,0,NONE,Filler diff --git a/spacecraft/PacSatGround_0.46o/PacSatSim_wodtelemetry.csv b/spacecraft/PacSatGround_0.46o/PacSatSim_wodtelemetry.csv new file mode 100644 index 00000000..d1b53340 --- /dev/null +++ b/spacecraft/PacSatGround_0.46o/PacSatSim_wodtelemetry.csv @@ -0,0 +1,62 @@ +61,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,WOD,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A,Battery A voltage (0-2.5V scale) +1,WOD,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,2,3,Cell A+B,Battery A+B voltage (0-3.3V scale) +2,WOD,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,WOD,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,Acceleration around X Axis +4,WOD,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,Acceleration around Y Axis +5,WOD,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,Acceleration around Z Axis +6,WOD,battCurr,12,mA,cubesatsim_current,Battery,4,2,4,Current,Total Battery DC current +7,WOD,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,Temperature,STEM Payload Sensor Temperature +8,WOD,posXv,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,+X solar Panel voltage +9,WOD,posYv,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,+Y solar Panel voltage +10,WOD,posZv,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,+Z solar Panel voltage +11,WOD,negXv,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,-X solar Panel voltage +12,WOD,negYv,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,-Y solar Panel voltage +13,WOD,negZv,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,-Z solar Panel voltage +14,WOD,posXi,12,mA,cubesatsim_current,+X Panel,7,2,4,Current,+X solar Panel current +15,WOD,posYi,12,mA,cubesatsim_current,+Y Panel,8,2,4,Current,+Y solar Panel current +16,WOD,posZi,12,mA,cubesatsim_current,+Z Panel,9,2,4,Current,+Z solar Panel current +17,WOD,negXi,12,mA,cubesatsim_current,-X Panel,10,2,4,Current,-X solar Panel current +18,WOD,negYi,12,mA,cubesatsim_current,-Y Panel,11,2,4,Current,-Y solar Panel current +19,WOD,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,4,Current,-Z solar Panel current +20,WOD,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,PSU,5,1,3,Voltage,Power Supply Voltage +21,WOD,spin,12,rpm,12,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,WOD,Pressure,12,bar,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload Sensor Pressure +23,WOD,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,Altitude,STEM Payload Sensor Altitude +24,WOD,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,WOD,rssi,12,dBm,14,Radio,1,1,3,RSSI,Received Signal Strength Indication +26,WOD,IHUcpuTemp,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,Temperature,Internal Temperature of IHU +27,WOD,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular Veolcity around X Axis +28,WOD,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular Veolcity around Y Axis +29,WOD,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular Veolcity around Z Axis +30,WOD,Sensor1,12,raw,cubesatsim_sensor1|INT,Experiments,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +31,WOD,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current +32,WOD,Sensor2,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 +33,WOD,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +34,WOD,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload Board Failure Indicator +35,WOD,Nominal Mode,1,-,17,Computer Software,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +36,WOD,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator +37,WOD,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator +38,WOD,I2CBus0Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,WOD,I2CBus1Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 1,I2C bus 1 failure indicator +40,WOD,I2CBus3Failure,1,-,17,Computer Hardware,2,4,0,I2C Bus 3,I2C bus 3 failure indicator +41,WOD,CameraFailure,1,-,17,Computer Hardware,2,5,0,Camera,Camera failure indicator +42,WOD,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received +43,WOD,RxAntDeploy,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status +44,WOD,TxAntDeploy,2,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status +45,WOD,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +46,WOD,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +47,WOD,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +48,WOD,rf6,12,-,0,NONE,0,0,0,None,None +49,WOD,rf7,12,-,0,NONE,0,0,0,None,None +50,WOD,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +51,WOD,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +52,WOD,pad,4,-,34,NONE,0,0,0,None,Unused +53,WOD,WODTimeStampReset,16,-,1,NONE,0,0,0,MAX Timestamp Uptime, Time Whole Orbit Data was collected +54,WOD,pad1,17,-,0,NONE,0,0,0,NONE,Filler +55,WOD,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +56,WOD,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +57,WOD,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +58,WOD,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +59,WOD,WODTimeStampUpTime,25,s,1,NONE,0,0,0,MAX Timestamp Uptime, Time Whole Orbit Data was collected +60,WOD,pad2,3,-,0,NONE,0,0,0,NONE,Filler diff --git a/systemd/pacsatsim.service b/systemd/pacsatsim.service new file mode 100644 index 00000000..d5163bd6 --- /dev/null +++ b/systemd/pacsatsim.service @@ -0,0 +1,14 @@ +[Unit] +Description=PacsatSim + +[Service] +TimeoutStopSec=5 +ExecStart=/home/pi/CubeSatSim/pacsatsim.sh +WorkingDirectory=/home/pi/CubeSatSim +StandardOutput=inherit +StandardError=inherit +Restart=always +User=pi + +[Install] +WantedBy=default.target diff --git a/systemd/transmit.service b/systemd/transmit.service index ab6dd815..0b77ff50 100644 --- a/systemd/transmit.service +++ b/systemd/transmit.service @@ -8,7 +8,7 @@ WorkingDirectory=/home/pi/CubeSatSim StandardOutput=inherit StandardError=inherit Restart=always -User=root +User=pi [Install] WantedBy=default.target diff --git a/transmit.py b/transmit.py index 66973178..57feed85 100644 --- a/transmit.py +++ b/transmit.py @@ -218,7 +218,7 @@ def camera_photo(): img = Image.open(file) draw = ImageDraw.Draw(img) # draw.text((10, 10), callsign, font=font2, fill='white') - # draw.text((120, 10), telem_string, font=font2, fill='white') + # draw.text((120, 10), telem_string, font=font2, fill='white') draw.text((12, 12), callsign, font=font1, fill='black') draw.text((10, 10), callsign, font=font1, fill='white') draw.text((112, 12), telem_string, font=font2, fill='black') # was 122 @@ -346,6 +346,7 @@ if __name__ == "__main__": print("Can't open .mode file, defaulting to FSK") print("Mode is: ") print(mode) +# system("sudo systemctl stop pacsatsim") try: file = open("/home/pi/CubeSatSim/beacon_off") @@ -394,18 +395,6 @@ if __name__ == "__main__": sim_config = True print("Simulated telemetry mode is configured") else: -# query = ["timeout", "2", "i2cdetect", "-y", "3"] # Test if Solar board is present -# try: -# result = subprocess.run(query, capture_output=True, text=True, check=True) -# print(f"Command run was: {query}") -# print("Sucess!") -# print(f"Output of the command (stdout): {result}") -# except subprocess.CalledProcessError as e: -# print(f"Command failed with return code: {e.returncode}") -# print(f"Command run was: {e.cmd}") -# print(f"Output of the command (stdout): {e.stdout}") -# print(f"Error output of the command (stderr): {e.stderr}") - try: if path.isfile("/home/pi/CubeSatSim/sim_mode_auto"): print("Simulated telemetry mode automatically turned on!") @@ -414,11 +403,10 @@ if __name__ == "__main__": except: if (debug_mode == 1): print("/home/pi/CubeSatSim/sim_mode_auto not found") - if len(config) > 5: - sq = config[5] - if (mode == 'p') or (mode == 'P'): - sq = 0 # turn off squelch for Pacsat - print(sq) + if len(config) > 5: + if (mode != 'p') and (mode != 'P'): # squelch off for Pacsat + sq = config[5] + print(f'squelch: {sq}') if len(config) > 6: txf = float(config[6]) if (mode == 'e'): @@ -485,7 +473,6 @@ if __name__ == "__main__": except: print("command and control not activated") - print(callsign) # GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 # print(txLed) @@ -557,7 +544,7 @@ if __name__ == "__main__": if (hab_mode == True) and (mode == 'a'): print("Don't transmit CW ID since APRS HAB mode is active") else: - if (((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'j')) and (command_tx == True) and (skip == False)) or ((mode == 'e') and (command_tx == True)): # battery_saver_mode + if (((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'j') or (mode == 'p') or (mode == 'P')) and (command_tx == True) and (skip == False)) or ((mode == 'e') and (command_tx == True)): # battery_saver_mode # GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 # setup(txLed, "out") output(txLed, 1) @@ -583,12 +570,38 @@ if __name__ == "__main__": # if (len(sys.argv)) > 1: # print("There are arguments!") - if (mode == 'a') or (mode == 'x') or (mode == 'n'): + if (mode == 'a') or (mode == 'x') or (mode == 'n') or (mode == 'p') or (mode == 'P'): # command_control_check() output(pd, 1) output(ptt, 1) if (mode == 'a'): print("AFSK") + elif (mode == 'p') or (mode == 'P'): + if (mode == 'P'): + print("Pacsat Ground Station") + else: + print("Pacsat") +# system("sudo systemctl restart pacsatsim") +# txPin = 27 + pttPin = 20 + + GPIO.setmode(GPIO.BCM) + GPIO.setwarnings(False) + GPIO.setup(txLed, GPIO.OUT) + GPIO.output(txLed, 0) + print("0") + + GPIO.setup(pttPin, GPIO.IN) + + while (True): + sleep(0.1) + GPIO.wait_for_edge(pttPin, GPIO.FALLING) + GPIO.output(txLed, 1) + print("1") + sleep(0.1) + GPIO.wait_for_edge(pttPin, GPIO.RISING) + GPIO.output(txLed, 0) + print("0") else: # GPIO.output(powerPin, 0) print("Transmit APRS Commands") @@ -621,7 +634,7 @@ if __name__ == "__main__": sleep(0.1) # add delay before transmit output (ptt, 0) sleep(0.3) # add even more time at start - system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/telem.wav") + system("aplay -D plughw:CARD=" + card + ",DEV=0 /home/pi/CubeSatSim/telem.wav") sleep(0.2) # add more time at end output (ptt, 1) # output(pd, 0) @@ -665,7 +678,7 @@ if __name__ == "__main__": system(command) ## chan = chan + 1 if (command_tx == True): -# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 # setup(txLed, "out") output(txLed, 1) @@ -682,7 +695,7 @@ if __name__ == "__main__": if (debug_mode == 1): system("cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3") else: - system("cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") + system("cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") output(txLed, 0) # command_control_check() @@ -705,7 +718,7 @@ if __name__ == "__main__": if os_status == "bookworm": system("rpicam-still -o /home/pi/CubeSatSim/camera_out.jpg --width 320 --height 256") # > /dev/null 2>&1") else: - system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") + system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") f = open("/home/pi/CubeSatSim/camera_out.jpg") f.close() print("Camera present") @@ -838,7 +851,7 @@ if __name__ == "__main__": if (command_tx == True): print ("Sending SSTV image") -# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 # setup(txLed, "out") output(txLed, 1) # battery_saver_check() @@ -869,7 +882,7 @@ if __name__ == "__main__": if (command_tx == True): # command_control_check() -# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 +# GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 # setup(txLed, "out") output(txLed, 1) diff --git a/txLED.py b/txLED.py new file mode 100644 index 00000000..af9b6d51 --- /dev/null +++ b/txLED.py @@ -0,0 +1,25 @@ +import RPi.GPIO as GPIO +import subprocess +import time +import os +from time import sleep + +txPin = 27 +pttPin = 20 + +GPIO.setmode(GPIO.BCM) +GPIO.setwarnings(False) +GPIO.setup(txPin, GPIO.OUT) +GPIO.output(txPin, 0) +print("0") +GPIO.setup(pttPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) + +while (True): + sleep(0.1) + GPIO.wait_for_edge(pttPin, GPIO.FALLING) + GPIO.output(txPin, 1) + sleep(0.1) + print("1") + GPIO.wait_for_edge(pttPin, GPIO.RISING) + GPIO.output(txPin, 0) + print("0") diff --git a/update b/update deleted file mode 120000 index f7ffc47a..00000000 --- a/update +++ /dev/null @@ -1 +0,0 @@ -install \ No newline at end of file diff --git a/update b/update new file mode 100755 index 00000000..3ae8add9 --- /dev/null +++ b/update @@ -0,0 +1,479 @@ +#!/bin/bash + +echo -e "\nupdate script for CubeSatSim v2.2\n" + +if [ "$1" = "n" ] ; then +# if [ -z "$2" ] ; then + noreboot=1 +else + noreboot=0 +fi + +# echo "No reboot" +# echo $noreboot + +sudo rm /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/id.txt /home/pi/CubeSatSim/cw.txt > /dev/null 2>&1 + +if [ "$1" = "u" ]; then + +# sudo apt-get update && sudo apt-get dist-upgrade -y + sudo apt-get update -y + + sudo apt-get install -y git libasound2-dev i2c-tools build-essential libgd-dev libmagic-dev python3-pip minicom + +fi + +sudo apt-get install -y python3-smbus cmake + +sudo sed -i 's/update.sh/update /g' /etc/motd + +sudo sed -i 's/installed and/installed\nand/g' /etc/motd + +sudo sed -i 's/more information/more\ninformation/g' /etc/motd + +sudo sed -i 's/update to/update\nto/g' /etc/motd + +#sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2 +sudo sed -i 's/console=tty1 maxcpus=1 r/console=tty1 r/g' /boot/cmdline.txt # remove single core + +cd /home/pi/CubeSatSim + +git pull --no-rebase > .updated + +make debug + +FILE=/home/pi/CubeSatSim/command_tx +if [ -f "$FILE" ]; then + echo "$FILE exists." +else + echo "creating $FILE" + echo "True\n" > /home/pi/CubeSatSim/command_tx +fi + +FILE=/home/pi/CubeSatSim/command_count.txt +if [ -f "$FILE" ]; then + echo "$FILE exists." +else + echo "creating $FILE" + echo "0\n" > /home/pi/CubeSatSim/command_count.txt +fi + +FLAG=0 + +if [[ $(diff systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then + echo "changed cubesatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service + FLAG=1 +else + echo "no changes to cubesatsim.service." +fi + +FILE=/etc/systemd/system/rpitx.service +if [ -f "$FILE" ]; then + sudo systemctl disable rpitx + sudo rm /etc/systemd/system/rpitx.service +fi + +FILE=/etc/systemd/system/transmit.service +if [ -f "$FILE" ]; then + if [[ $(diff systemd/transmit.service /etc/systemd/system/transmit.service) ]]; then + echo "changed transmit.service." + sudo cp /home/pi/CubeSatSim/systemd/transmit.service /etc/systemd/system/transmit.service + FLAG=1 + else + echo "no change to transmit.service." + fi +else + echo "creating transmit.service." + sudo cp /home/pi/CubeSatSim/systemd/transmit.service /etc/systemd/system/transmit.service + FLAG=1 +fi + +FILE=/etc/systemd/system/command.service +if [ -f "$FILE" ]; then + if [[ $(diff systemd/command.service /etc/systemd/system/command.service) ]]; then + echo "changed command.service." + sudo cp /home/pi/CubeSatSim/systemd/command.service /etc/systemd/system/command.service + FLAG=1 + else + echo "no change to command.service." + fi +else + echo "creating command.service." + sudo cp /home/pi/CubeSatSim/systemd/command.service /etc/systemd/system/command.service + sudo systemctl enable command + FLAG=1 +fi + +FILE=/etc/systemd/system/pacsatsim.service +if [ -f "$FILE" ]; then + if [[ $(diff systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service) ]]; then + echo "changed command.service." + sudo cp /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + FLAG=1 + else + echo "no change to pacsatsim.service." + fi +else + echo "creating pacsatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/pacsatsim.service /etc/systemd/system/pacsatsim.service + sudo systemctl enable pacsatsim + FLAG=1 +fi + +FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 1." + cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +fi + +FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 2." + cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +fi + +grep 'update' /home/pi/CubeSatSim/.updated +if [[ $(grep 'update' /home/pi/CubeSatSim/.updated) ]]; then + echo "update script updated, running again" + /home/pi/CubeSatSim/update +fi + +if [ ! -d "/home/pi/PiSSTVpp" ]; then + +# sudo apt-get update && sudo apt-get dist-upgrade -y + sudo apt-get update -y + + sudo apt-get install -y python-picamera python3-picamera build-essential libgd-dev libmagic-dev + + + cd + + git clone https://github.com/alanbjohnston/PiSSTVpp.git + + cd PiSSTVpp + + make pisstvpp + + cd + + + sudo raspi-config nonint do_camera 0 + + + FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg + if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 1." + cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg + fi + + FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg + if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 2." + cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg + fi + +# echo "You need to reboot to complete this update. Reboot now (y/n)?" + +# read -r ANS + +# if [ "$ANS" = "y" ]; then + +# sudo reboot now + +# else + +# echo "The CubeSatSim software may not work correctly until you reboot." + +# fi + +fi + +if [ ! -d "/home/pi/rpitx" ]; then + + cd + git clone https://github.com/alanbjohnston/rpitx.git + cd rpitx + ./install.sh + cd +else + + if [[ $(grep 'SYNCWITHPWM' /home/pi/rpitx/src/librpitx/src/fskburst.h) ]]; then + echo "rpitx library already updated" + else + echo "updating rpitx" + cd /home/pi/rpitx + git pull + ./update.sh + cd + fi +fi + +if [ ! -d "/home/pi/WiringPi" ]; then + + cd + + git clone https://github.com/PinkFreud/WiringPi + cd WiringPi + ./build debian + + sudo dpkg -i debian-template/wiringpi-2.61-1.deb + + cd + + cd CubeSatSim + make debug + + FLAG=1 + + cd + +fi + +cd /home/pi/pi-power-button + +git checkout master + + + git pull --no-rebase > .updated_p + + grep 'changed' /home/pi/pi-power-button/.updated_p + if [[ $(grep 'changed' /home/pi/pi-power-button/.updated_p) ]]; then + + echo "updating pi-power-button." + + script/install + + FLAG=1 + + + else + echo "nothing to do for pi-power-button." + fi + + if [[ $(grep 'dtparam=audio=on' /boot/config.txt) ]]; then + echo "dtparam=audio=on already in /boot/config.txt" + else + echo "adding dtparam=audio=on to /boot/config.txt" + sudo sh -c 'echo "\ndtparam=audio=on" >> /boot/config.txt' + FLAG=1 + fi + + if [[ $(grep 'dtoverlay=audremap,enable_jack=on' /boot/config.txt) ]]; then + echo "dtoverlay=audremap,enable_jack=on already in /boot/config.txt" + else + echo "adding dtoverlay=audremap,enable_jack=on to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=audremap,enable_jack=on" >> /boot/config.txt' + FLAG=1 + fi + + if [[ $(grep 'dtoverlay=pwm,pin=18,func=2' /boot/config.txt) ]]; then + echo "dtoverlay=pwm,pin=18,func=2 already in /boot/config.txt" + else + echo "adding dtoverlay=pwm,pin=18,func=2 to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=pwm,pin=18,func=2" >> /boot/config.txt' + FLAG=1 + + cd /home/pi/pi-power-button + git pull --no-rebase + git checkout reboot-mode-change + script/install + +# sudo apt-get update && sudo apt-get dist-upgrade -y + sudo apt-get update -y + sudo apt-get install -y libjpeg-dev zlib1g-dev libfreetype6-dev liblcms1-dev libopenjp2-7 libtiff5 python3-pil + sudo pip3 install adafruit-blinka RPI.GPIO adafruit-extended-bus adafruit-circuitpython-ina219 pillow + + fi + + if [[ $(grep 'disable_splash=1' /boot/config.txt) ]]; then + echo "disable_splash=1 already in /boot/config.txt" + else + echo "adding to /boot/config.txt" + sudo sh -c 'echo "\ndisable_splash=1" >> /boot/config.txt' + FLAG=1 + fi + + if [[ $(grep 'boot_delay=0' /boot/config.txt) ]]; then + echo "boot_delay=0 already in /boot/config.txt" + else + echo "adding to /boot/config.txt" + sudo sh -c 'echo "\nboot_delay=0" >> /boot/config.txt' + FLAG=1 + fi + + if ! grep -q force_turbo=1 /boot/config.txt ; then + sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt' + FLAG=1 + fi + +#if [ ! -f "/home/pi/CubeSatSim/telem_string.txt" ]; then + +# sudo apt-get update && sudo apt-get dist-upgrade -y + +# sudo apt-get install -y libjpeg-dev zlib1g-dev libfreetype6-dev liblcms1-dev libopenjp2-7 libtiff5 -y + +# sudo pip3 install pillow + +#fi + +if [ ! -d "/home/pi/pi_pacsat" ]; then + + FLAG=1 + + cd + + git clone https://github.com/alanbjohnston/g0kla_common.git + + cd g0kla_common/Debug/ + + make all + + sudo ./install.sh + + cd + + git clone https://github.com/ac2cz/pi_pacsat.git + + cd pi_pacsat/Debug + + make all + + mkdir /home/pi/PacSat + mkdir /home/pi/PacSat/pacsat + mkdir /home/pi/PacSat/pacsat/dir + +# export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH + + export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo "bit_rate=9600" > pacsat.config + echo "bbs_callsign=$1-12" >> pacsat.config + echo "broadcast_callsign=$1-11" >> pacsat.config + echo "digi_callsign=$1-1" >> pacsat.config + echo "max_frames_in_tx_buffer=5" >> pacsat.config + + echo "pb_open=1" > pacsat.state + echo "uplink_open=1" >> pacsat.state + + sudo sed -i 's/#hdmi_group=1/hdmi_group=2/g' /boot/config.txt + sudo sed -i 's/#hdmi_mode=1/hdmi_mode=16/g' /boot/config.txt + sudo sed -i 's/#hdmi_force_hotplug=1/hdmi_force_hotplug=1/g' /boot/config.txt + + sudo raspi-config nonint do_vnc 0 + +fi + +if [ ! -d "/home/pi/Desktop/PacsatGround" ]; then + + echo "Installing PacSat Ground Station!" + + if [ ! -d "/home/pi/Desktop" ]; then + + echo + echo "You won't be able to run the PacSat Ground Station as this Pi OS does not seem to have the Desktop GUI installed." + echo + + else + + cd /tmp + + wget https://www.g0kla.com/pacsat/downloads/test/PacsatGround_unix_0_46o.tar.gz + + tar -xzf PacsatGround_unix_0_46o.tar.gz -C /home/pi/Desktop + + rm PacsatGround_unix_0_46o.tar.gz + + cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46m/* /home/pi/Desktop/PacsatGround/spacecraft/ + + mkdir /home/pi/PacSatGround + + sudo usermod -a -G gpio pi + + sudo apt-get install default-jdk -y + + fi + +cd + +fi + +cd /home/pi/direwolf + +#git status + +#git status | grep 'invert' + +if [[ ! $(git status | grep 'master-sync-invert') ]]; then + + echo "updating direwolf to master-sync-invert version" + + git pull --no-rebase + git checkout master-sync-invert + mkdir build + cd build + cmake .. + make -j4 + sudo make install + make install-conf + cd + +fi + +changed=0 +value=`cat /home/pi/CubeSatSim/sim.cfg` +# echo "$value" +echo "$value" > /dev/null +set -- $value + +if [ -z "$1" ] ; then n1="AMSAT" ; changed=1 ; else n1=$1 ; fi # callsign +if [ -z "$2" ] ; then n2="0" ; changed=1 ; else n2=$2 ; fi # reset count +if [ -z "$3" ] ; then n3="0" ; changed=1 ; else n3=$3 ; fi # lat +if [ -z "$4" ] ; then n4="0" ; changed=1 ; else n4=$4 ; fi # lon +if [ -z "$5" ] ; then n5="no" ; changed=1 ; else n5=$5 ; fi # sim mode +if [ -z "$6" ] ; then n6="3" ; changed=1 ; else n6=$6 ; fi # squelch +if [ -z "$7" ] ; then n7="434.9000" ; changed=1 ; else n7=$7 ; fi # transmit frequency +if [ -z "$8" ] ; then n8="435.0000" ; changed=1 ; else n8=$8 ; fi # receive frequency +if [ -z "$9" ] ; then n9="no" ; changed=1 ; else n9=$9 ; fi # hab mode +if [ -z "${10}" ] ; then m1="0" ; changed=1 ; else m1=${10} ; fi # rx pl code +if [ -z "${11}" ] ; then m2="0" ; changed=1 ; else m2=${11} ; fi # tx pl code + +if [ $changed -eq 1 ]; then + echo -e "Current sim.cfg configuration file:" + echo + echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} + echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" + echo + echo $n1 $n2 $n3 $n4 $n5 $n6 $n7 $n8 $n9 $m1 $m2 + echo $n1 $n2 $n3 $n4 $n5 $n6 $n7 $n8 $n9 $m1 $m2 > /home/pi/CubeSatSim/sim.cfg + echo +fi + +if [ "$noreboot" = "0" ] ; then + + if [ $FLAG -eq 1 ]; then + echo "systemctl daemon-reload and reboot" + sudo systemctl daemon-reload + sudo reboot -h now +# sudo cubesatsim + else + grep 'changed' /home/pi/CubeSatSim/.updated + if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then + echo "reboot due to code changes " | wall + sudo reboot -h now +# sudo cubesatsim + else + echo "nothing to do." + fi + fi +else + if [ $FLAG -eq 1 ]; then + echo "reboot needed for changes to take effect" + fi +fi + +echo "CubeSatSim update complete."