diff --git a/rpitx.py b/rpitx.py index 7e0b0742..8e367608 100644 --- a/rpitx.py +++ b/rpitx.py @@ -106,23 +106,23 @@ if __name__ == "__main__": except: system("echo '" + callsign + "-11>APCSS:hi hi 100 199 199 199 298 299 299 278 380 350 300 300 439 400 400 400 500 500 500 500 600 600 600 650' > /home/pi/CubeSatSim/t.txt && echo 'AMSAT>APCSS:010101/hi hi ' >> /home/pi/CubeSatSim/t.txt") for x in range(5): - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) if (debug_mode == 1): system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/telem.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") else: system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/telem.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 > /dev/null 2>&1") sleep(0.2) - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) sleep(3.8) while True: try: f = open("/home/pi/CubeSatSim/ready") - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) if (debug_mode == 1): system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/telem.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") else: system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/telem.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 > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) f.close() system("sudo rm ready") sleep(0.5) @@ -136,22 +136,22 @@ if __name__ == "__main__": file.close() except: system("echo 'hi hi 100 199 199 199 298 299 299 278 380 350 300 300 439 400 400 400 500 500 500 500 600 600 600 650' > /home/pi/CubeSatSim/cw.txt") - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) if (debug_mode == 1): system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw.txt -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") else: system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw.txt -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 > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) while True: try: f = open("/home/pi/CubeSatSim/cwready") - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) if (debug_mode == 1): system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw.txt -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") else: system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw.txt -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 > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) f.close() system("sudo rm cwready") sleep(1) @@ -172,19 +172,19 @@ if __name__ == "__main__": camera_present = 0 # while 1: - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) if (camera_present == 1): try: file = open("/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg") print("First SSTV stored image detected") system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg") print ("Sending SSTV image") - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) 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 434.9e3") 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 434.9e3 > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) # sleep(1) except: print("image 2 did not load - copy from CubeSatSim/sstv directory") @@ -193,12 +193,12 @@ if __name__ == "__main__": print("Photo taken") system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/camera_out.jpg") print ("Sending SSTV image") - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) 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 434.9e3") else: 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 434.9e3 > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) sleep(1) else: try: @@ -206,12 +206,12 @@ if __name__ == "__main__": 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") print ("Sending SSTV image") - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) 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 434.9e3") else: 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 434.9e3 > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) sleep(1) except: print("image 1 did not load - copy from CubeSatSim/sstv directory") @@ -221,20 +221,20 @@ if __name__ == "__main__": system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg") while 1: print ("Sending SSTV image") - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) 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 434.9e3") 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 434.9e3 > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) sleep(5) except: print("image 2 did not load - copy from CubeSatSim/sstv directory") 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: - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) sleep(60) - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) sleep(1) elif (mode == 'b'): @@ -242,18 +242,18 @@ 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 &") print("Turning LED on/off") while 1: - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) sleep(0.5) - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) sleep(4.0) else: print("FSK") system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 &") print("Turning LED on/off") while 1: - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) sleep(0.5) - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) sleep(4.0) # else: # print("FSK")