Update rpitx.py HAB mode CW ID with txc, no stored sstv images

beta-hab
Alan Johnston 2 years ago committed by GitHub
parent 11731a3ece
commit 9ca49d0b72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -334,6 +334,16 @@ if __name__ == "__main__":
print(rx) print(rx)
else: else:
rx = '435.0000' rx = '435.0000'
if len(config) > 8:
if (config[8] == 'y') or (config[8] == 'yes'):
hab_mode = True
print("HAB Mode set - CW ID using FM Transceiver, only camera images in SSTV mode")
else:
hab_mode = False
print("HAB Mode not set")
else:
hab_mode = False
print(config) print(config)
print print
# print(callsign) # print(callsign)
@ -397,16 +407,17 @@ if __name__ == "__main__":
if (mode != 'm'): if (mode != 'm'):
# battery_saver_mode # battery_saver_mode
output(txLed, txLedOn) output(txLed, txLedOn)
# if (txc): if (txc and hab_mode):
# output(pd, 1) print("HAB Mode is true, CW ID using FM transceiver")
# output (ptt, 0) output(pd, 1)
# sleep(0.1) output (ptt, 0)
# system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav") sleep(0.1)
# sleep(0.1) system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav")
# output (ptt, 1) sleep(0.1)
# output(pd, 0) output (ptt, 1)
# else: output(pd, 0)
if (True): else:
# if (True):
if (debug_mode == 1): if (debug_mode == 1):
# system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") # system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3")
system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3") system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3")
@ -537,34 +548,35 @@ if __name__ == "__main__":
# output (ptt, 1) # output (ptt, 1)
# output(pd, 0) # output(pd, 0)
if (camera_present == 1): if (camera_present == 1):
try: if (hab_mode == False):
file = open("/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg") try:
print("First SSTV stored image detected") file = open("/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg")
system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg") print("First SSTV stored image detected")
command_control_check() system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg")
command_control_check()
if (command_tx == True): if (command_tx == True):
print ("Sending SSTV image") print ("Sending SSTV image")
output(txLed, txLedOn) output(txLed, txLedOn)
# battery_saver_check() # battery_saver_check()
if (txc): if (txc):
output(pd, 1) output(pd, 1)
output (ptt, 0) output (ptt, 0)
system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav") system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav")
output (ptt, 1) output (ptt, 1)
output(pd, 0) output(pd, 0)
else:
if (debug_mode == 1):
system("cat /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3")
else: else:
system("cat /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1") if (debug_mode == 1):
system("cat /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3")
else:
system("cat /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1")
output(txLed, txLedOff) output(txLed, txLedOff)
# sleep(1) # sleep(1)
except: except:
print("image 2 did not load - copy from CubeSatSim/sstv directory") print("image 2 did not load - copy from CubeSatSim/sstv directory")
while 1: while 1:
command_control_check() command_control_check()

Loading…
Cancel
Save

Powered by TurnKey Linux.