Update rpitx.py enable rx all the time for all modes

pull/317/head
Alan Johnston 2 years ago committed by GitHub
parent 33a9d164be
commit e2449d4ceb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -481,7 +481,8 @@ if __name__ == "__main__":
print("CW") print("CW")
while True: while True:
command_control_check() command_control_check()
output (pd, 1)
output (ptt, 1)
try: try:
f = open("/home/pi/CubeSatSim/cwready") f = open("/home/pi/CubeSatSim/cwready")
f.close() f.close()
@ -496,7 +497,7 @@ if __name__ == "__main__":
output(txLed, txLedOn) output(txLed, txLedOn)
if (txc): if (txc):
output (pd, 1) # output (pd, 1)
sleep(0.3) sleep(0.3)
output (ptt, 0) output (ptt, 0)
system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav") system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav")
@ -519,6 +520,8 @@ if __name__ == "__main__":
elif (mode == 's'): elif (mode == 's'):
print("SSTV") print("SSTV")
command_control_check() command_control_check()
output (ptt, 1)
output(pd, 1)
try: try:
# from picamera import PiCamera # from picamera import PiCamera
# from pysstv.sstv import SSTV # from pysstv.sstv import SSTV
@ -552,11 +555,11 @@ if __name__ == "__main__":
# 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: else:
if (debug_mode == 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") 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")
@ -610,11 +613,11 @@ if __name__ == "__main__":
# 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/camera_out.jpg.wav") system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/camera_out.jpg.wav")
output(ptt, 1) output(ptt, 1)
output (pd, 0) # output (pd, 0)
else: else:
if (debug_mode == 1): if (debug_mode == 1):
system("cat /home/pi/CubeSatSim/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3") system("cat /home/pi/CubeSatSim/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3")
@ -645,11 +648,11 @@ if __name__ == "__main__":
# 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_1_320_x_256.jpg.wav") system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg.wav")
output(ptt, 1) output(ptt, 1)
output (pd, 0) # output (pd, 0)
else: else:
if (debug_mode == 1): if (debug_mode == 1):
system("cat /home/pi/CubeSatSim/sstv_image_1_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") system("cat /home/pi/CubeSatSim/sstv_image_1_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")
@ -679,11 +682,11 @@ if __name__ == "__main__":
# 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_1_320_x_256.jpg.wav") system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg.wav")
output(ptt, 1) output(ptt, 1)
output (pd, 0) # output (pd, 0)
else: else:
if (debug_mode == 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") 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")
@ -706,11 +709,11 @@ if __name__ == "__main__":
# 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.wav") system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/sstv.wav")
output(ptt, 1) output(ptt, 1)
output (pd, 0) # output (pd, 0)
else: else:
sleep(60) sleep(60)

Loading…
Cancel
Save

Powered by TurnKey Linux.