From 082d8d496f4ddb5d0b716dbcd995fa84ebc13f25 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:11:30 -0500 Subject: [PATCH] Update rpitx.py cycle through channels 0 - 6 --- rpitx.py | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/rpitx.py b/rpitx.py index 6e8b5a25..3cf82d57 100644 --- a/rpitx.py +++ b/rpitx.py @@ -515,30 +515,34 @@ if __name__ == "__main__": try: f = open("/home/pi/CubeSatSim/cwready") f.close() - system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw1.txt -r 48000 > /dev/null 2>&1") system("sudo rm /home/pi/CubeSatSim/cwready") - print("Sending cw1.txt") - system("cat /home/pi/CubeSatSim/cw1.txt") - - if (command_tx == True): - output(txLed, txLedOn) - output (pd, 1) - sleep(0.1) - output (ptt, 0) -# battery_saver_check() - - if (txc): - system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav") - else: - if (debug_mode == 1): - system("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") + channel = 0 + while (channel < 7): + system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + channel + ".txt -r 48000 > /dev/null 2>&1") + channel += 1 +# print("Sending cw1.txt") +# system("cat /home/pi/CubeSatSim/cw1.txt") + + if (command_tx == True): + output(txLed, txLedOn) + output (pd, 1) + sleep(0.1) + output (ptt, 0) + # battery_saver_check() + + if (txc): + system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav") else: - system("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 > /dev/null 2>&1") - - sleep(0.1) - output(txLed, txLedOff) - output (ptt, 1) + if (debug_mode == 1): + system("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") + else: + system("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 > /dev/null 2>&1") + sleep(0.1) + output(txLed, txLedOff) + output (ptt, 1) + + command_control_check() f.close() # system("sudo rm /home/pi/CubeSatSim/cwready") sleep(5)