From 6a25bd055ef0bba95c9251ec2552f25f20eacb2f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 2 Feb 2025 20:31:45 -0500 Subject: [PATCH] Update transmit.py add FC image --- transmit.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/transmit.py b/transmit.py index 9e37acf7..48cd7e33 100644 --- a/transmit.py +++ b/transmit.py @@ -756,6 +756,7 @@ if __name__ == "__main__": # system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.9e6 -t float &") system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f " + tx + "e6 -t float &") print("Turning LED on/off and listening for carrier") + image_index = 0; while 1: output(txLed, txLedOff) sleep(0.4) @@ -771,10 +772,26 @@ if __name__ == "__main__": output(txLed, txLedOn) # print(txLed) # print(txLedOn) + if (mode == 'b'): - sleep(4.2) - else: - sleep(4.6) + sleep(4.2) + else: # FunCube mode image + try: + file = open("/home/pi/CubeSatSim/image_file.bin") + file.close() + image_present = True + except: + image_present = False + + if (!image_present): + system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") + print("Photo taken") + system("/home/pi/ssdv/ssdv -e -c CALLSIGN -i " + image_index + " -q 3 -J camera_out.jpg image_file.bin") + print("image_index " + image_index + "\n") + image_index = ( index_image + 1 ) % 256 + sleep(2) + else: + sleep(4.6) elif (mode == 'e'): # code based on https://zr6aic.blogspot.com/2016/11/creating-2m-fm-repeater-with-raspberry.html print("Repeater") print("Stopping command and control")