added command on and off for stored image sstv

fm-rx
Alan Johnston 2 years ago committed by GitHub
parent 7ff992efcf
commit 3e332658cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -332,6 +332,7 @@ if __name__ == "__main__":
system("sudo rm /home/pi/CubeSatSim/camera_out.jpg > /dev/null 2>&1") system("sudo rm /home/pi/CubeSatSim/camera_out.jpg > /dev/null 2>&1")
output(pd, 1) output(pd, 1)
sleep(1)
if GPIO.input(squelch) == False: if GPIO.input(squelch) == False:
print("carrier received!") print("carrier received!")
command_tx = not command_tx command_tx = not command_tx
@ -377,6 +378,8 @@ if __name__ == "__main__":
file = open("/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg") file = open("/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg")
print("First SSTV stored image detected") print("First SSTV stored image detected")
system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg") system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg")
if (command_tx == True):
print ("Sending SSTV image") print ("Sending SSTV image")
output(txLed, txLedOn) output(txLed, txLedOn)
output(pd, 1) output(pd, 1)
@ -401,6 +404,30 @@ if __name__ == "__main__":
print("Second SSTV stored image detected") print("Second SSTV stored image detected")
system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /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")
while 1: while 1:
output(pd, 1)
sleep(1)
if GPIO.input(squelch) == False:
print("carrier received!")
command_tx = not command_tx
print(command_tx)
output(green, txLedOff)
sleep(0.03)
output(green, txLedOn)
if (command_tx == True):
print("Turning on transmit")
system("echo > command_tx True")
# output(txLed, txLedOn)
# sleep(0.5)
# output(txLed, txLedff)
else:
print("Turning off transmit")
system("echo > command_tx False")
output(pd, 0)
if (command_tx == True):
print ("Sending SSTV image") print ("Sending SSTV image")
output(txLed, txLedOn) output(txLed, txLedOn)
output(pd, 1) output(pd, 1)
@ -421,8 +448,11 @@ if __name__ == "__main__":
except: except:
print("image 2 did not load - copy from CubeSatSim/sstv directory") print("image 2 did not load - copy from CubeSatSim/sstv directory")
if (txc == False): if (txc == False):
if (command_tx == True):
system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &")
while 1: while 1:
if (command_tx == True):
output(txLed, txLedOn) output(txLed, txLedOn)
output(pd, 1) output(pd, 1)
output (ptt, 0) output (ptt, 0)

Loading…
Cancel
Save

Powered by TurnKey Linux.