From f9f142dad36ce4083cb636478138ea04e1444521 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 10:19:54 -0500 Subject: [PATCH 01/39] Update main.c add cw0.txt to cw6.txt --- main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 2846dc73..4c165c51 100644 --- a/main.c +++ b/main.c @@ -1122,7 +1122,7 @@ void get_tlm(void) { char footer_str1[] = "\' > t.txt"; // char footer_str[] = "-11>APCSS:010101/hi hi ' >> t.txt && touch /home/pi/CubeSatSim/ready"; // transmit is done by rpitx.py char footer_str[] = " && echo 'AMSAT-11>APCSS:010101/hi hi ' >> t.txt && touch /home/pi/CubeSatSim/ready"; // transmit is done by rpitx.py - char footer_str2[] = " && touch /home/pi/CubeSatSim/ready"; + char footer_str2[] = " && touch /home/pi/CubeSatSim/ready"; if (ax5043) { strcpy(str, header_str); @@ -1161,7 +1161,11 @@ void get_tlm(void) { strcat(str, header_str2b); } else { // CW mode strcat(str, header_str4); - strcat(str, call); + strcat(str, call); + + sprintf(tlm_str, "%s' > cw0.txt", &str); + FILE * cw_file = popen(tlm_str, "r"); + pclose(cw_file); } // } @@ -1169,11 +1173,11 @@ void get_tlm(void) { if (mode == CW) { int channel; for (channel = 1; channel < 7; channel++) { - sprintf(tlm_str, "%d%d%d %d%d%d %d%d%d %d%d%d ", + sprintf(tlm_str, "echo '%d%d%d %d%d%d %d%d%d %d%d%d' > cw%1d.txt", channel, upper_digit(tlm[channel][1]), lower_digit(tlm[channel][1]), channel, upper_digit(tlm[channel][2]), lower_digit(tlm[channel][2]), channel, upper_digit(tlm[channel][3]), lower_digit(tlm[channel][3]), - channel, upper_digit(tlm[channel][4]), lower_digit(tlm[channel][4])); + channel, upper_digit(tlm[channel][4]), lower_digit(tlm[channel][4]), channel); // printf("%s",tlm_str); //#ifdef HAB @@ -1182,6 +1186,9 @@ void get_tlm(void) { // if ((!hab_mode) || ((hab_mode) && (mode != AFSK))) strcat(str, tlm_str); + FILE * cw_file = popen(tlm_str, "r"); + pclose(cw_file); + } } else { // APRS //#ifdef HAB From 0f8293f236f027c1eeb38c9b5220d3d6ec675760 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 10:32:55 -0500 Subject: [PATCH 02/39] Update main.c change to just touch cwready --- main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 4c165c51..01f4cd2d 100644 --- a/main.c +++ b/main.c @@ -1260,16 +1260,17 @@ void get_tlm(void) { // char cw_header2[] = "echo '"; // char cw_footer2[] = "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat 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.897e3"; char cw_footer3[] = "' > cw.txt && touch /home/pi/CubeSatSim/cwready"; // transmit is done by rpitx.py + char cwready[] = "touch /home/pi/CubeSatSim/cwready"; // cw frame is complete. transmit is done by rpitx.py // printf("Str str: %s \n", str); // fflush(stdout); strcat(str, cw_footer3); // printf("Str: %s \n", str); // fflush(stdout); - printf("CW string to execute: %s\n", str); + printf("CW string to execute: %s\n", cwready); fflush(stdout); - FILE * cw_file = popen(str, "r"); + FILE * cw_file = popen(cwready, "r"); pclose(cw_file); while ((cw_file = fopen("/home/pi/CubeSatSim/cwready", "r")) != NULL) { // wait for rpitx to be done From f15703d9acccce2339c2eda4aab450b9d145dc2d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 10:35:11 -0500 Subject: [PATCH 03/39] Update rpitx.py send cw0.txt --- rpitx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index 7bd6ba95..598dd3c9 100644 --- a/rpitx.py +++ b/rpitx.py @@ -515,7 +515,7 @@ 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/cw.txt -r 48000 > /dev/null 2>&1") + system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw0.txt -r 48000 > /dev/null 2>&1") system("sudo rm /home/pi/CubeSatSim/cwready") if (command_tx == True): @@ -528,9 +528,9 @@ if __name__ == "__main__": system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav") else: 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 " + tx + "e3") + 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("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 " + tx + "e3 > /dev/null 2>&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 > /dev/null 2>&1") sleep(0.1) output(txLed, txLedOff) From 881e83c70d3a69558a60b8f1684f5a7232522b9f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 10:41:29 -0500 Subject: [PATCH 04/39] Update rpitx.py remove extra cw transmits --- rpitx.py | 57 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/rpitx.py b/rpitx.py index 598dd3c9..1fccdc9e 100644 --- a/rpitx.py +++ b/rpitx.py @@ -480,35 +480,35 @@ if __name__ == "__main__": elif (mode == 'm'): print("CW") # sleep(4) - try: - file = open("/home/pi/CubeSatSim/cw.txt") - 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") - output(pd, 1) - - if (command_tx == True): - output(txLed, txLedOn) +# try: +# file = open("/home/pi/CubeSatSim/cw.txt") +# 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") +# output(pd, 1) +# +# if (command_tx == True): +# output(txLed, txLedOn) # battery_saver_check() - - if (txc): - output (pd, 1) - output (ptt, 0) - sleep(0.1) - - system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw.txt -r 48000 > /dev/null 2>&1 && aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav") - sleep(0.1) - output (ptt, 1) - output (pd, 0) - else: - 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 " + tx + "e3") - 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 " + tx + "e3 > /dev/null 2>&1") - - output(txLed, txLedOff) +# +# if (txc): +# output (pd, 1) +# output (ptt, 0) +# sleep(0.1) +# +# system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw.txt -r 48000 > /dev/null 2>&1 && aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav") +# sleep(0.1) +# output (ptt, 1) +# output (pd, 0) +# else: +# 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 " + tx + "e3") +# 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 " + tx + "e3 > /dev/null 2>&1") +# +# output(txLed, txLedOff) # output (ptt, 1) - sleep(5) +# sleep(5) while True: command_control_check() @@ -539,7 +539,8 @@ if __name__ == "__main__": f.close() # system("sudo rm /home/pi/CubeSatSim/cwready") sleep(5) - except: + except: + command_control_check() sleep(1) elif (mode == 's'): print("SSTV") From d6fa37cfd137ca91184620378186011158e6cd52 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 10:50:08 -0500 Subject: [PATCH 05/39] Update rpitx.py prints --- rpitx.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpitx.py b/rpitx.py index 1fccdc9e..86355bad 100644 --- a/rpitx.py +++ b/rpitx.py @@ -517,6 +517,8 @@ if __name__ == "__main__": f.close() system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw0.txt -r 48000 > /dev/null 2>&1") system("sudo rm /home/pi/CubeSatSim/cwready") + print("Sending cw0.txt") + system("cat /home/pi/CubeSatSim/cw0.txt") if (command_tx == True): output(txLed, txLedOn) From 4f886e2bab9886f612ba125cc042c5996a391e64 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 10:55:34 -0500 Subject: [PATCH 06/39] Update rpitx.py don't remove cwready --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 86355bad..ed98f400 100644 --- a/rpitx.py +++ b/rpitx.py @@ -516,7 +516,7 @@ if __name__ == "__main__": f = open("/home/pi/CubeSatSim/cwready") f.close() system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw0.txt -r 48000 > /dev/null 2>&1") - system("sudo rm /home/pi/CubeSatSim/cwready") +### system("sudo rm /home/pi/CubeSatSim/cwready") print("Sending cw0.txt") system("cat /home/pi/CubeSatSim/cw0.txt") From 70f7fa333477e3baf36d3d76a58e60f5010595c2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 10:59:13 -0500 Subject: [PATCH 07/39] Update rpitx.py cw1 debug --- rpitx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index ed98f400..ecf5acfb 100644 --- a/rpitx.py +++ b/rpitx.py @@ -515,10 +515,10 @@ 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/cw0.txt -r 48000 > /dev/null 2>&1") + 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 cw0.txt") - system("cat /home/pi/CubeSatSim/cw0.txt") + print("Sending cw1.txt") + system("cat /home/pi/CubeSatSim/cw1.txt") if (command_tx == True): output(txLed, txLedOn) From f59813a97561835199daee72307d861baced6d65 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:03:57 -0500 Subject: [PATCH 08/39] Update rpitx.py add pd 1 to cw transmit --- rpitx.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index ecf5acfb..6e8b5a25 100644 --- a/rpitx.py +++ b/rpitx.py @@ -515,15 +515,16 @@ 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") + 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 (ptt, 0) + output (pd, 1) sleep(0.1) + output (ptt, 0) # battery_saver_check() if (txc): From 082d8d496f4ddb5d0b716dbcd995fa84ebc13f25 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:11:30 -0500 Subject: [PATCH 09/39] 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) From f0b27917edb9fb62cca16e758162e61edd2dfcae Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:19:00 -0500 Subject: [PATCH 10/39] Update rpitx.py print channel --- rpitx.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 3cf82d57..a30e9cc3 100644 --- a/rpitx.py +++ b/rpitx.py @@ -517,7 +517,9 @@ if __name__ == "__main__": f.close() system("sudo rm /home/pi/CubeSatSim/cwready") channel = 0 - while (channel < 7): + print(channel) + while channel < 7: + print(channel) 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") From b415dc10321e14cdad9ae74e0b160c5fea07e3b8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:22:05 -0500 Subject: [PATCH 11/39] Update rpitx.py try for --- rpitx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpitx.py b/rpitx.py index a30e9cc3..6592772f 100644 --- a/rpitx.py +++ b/rpitx.py @@ -518,10 +518,10 @@ if __name__ == "__main__": system("sudo rm /home/pi/CubeSatSim/cwready") channel = 0 print(channel) - while channel < 7: + for channel in range(7): print(channel) 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 +# channel += 1 # print("Sending cw1.txt") # system("cat /home/pi/CubeSatSim/cw1.txt") From b3a08e35ae2d2325ef32514ee9f38f40a3ce0b67 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:29:18 -0500 Subject: [PATCH 12/39] Update rpitx.py more prints --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 6592772f..d3ff8328 100644 --- a/rpitx.py +++ b/rpitx.py @@ -543,8 +543,9 @@ if __name__ == "__main__": sleep(0.1) output(txLed, txLedOff) output (ptt, 1) - + print(channel) command_control_check() + print(channel) f.close() # system("sudo rm /home/pi/CubeSatSim/cwready") sleep(5) From 393792fe690104b32b3da76974a51913d906cbe5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:31:25 -0500 Subject: [PATCH 13/39] Update rpitx.py try channel 1 --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index d3ff8328..9df8110d 100644 --- a/rpitx.py +++ b/rpitx.py @@ -516,7 +516,7 @@ if __name__ == "__main__": f = open("/home/pi/CubeSatSim/cwready") f.close() system("sudo rm /home/pi/CubeSatSim/cwready") - channel = 0 + channel = 1 print(channel) for channel in range(7): print(channel) From b42317908973789bc018dfd6e2b1470ef38e070b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:34:41 -0500 Subject: [PATCH 14/39] Update rpitx.py try chan --- rpitx.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpitx.py b/rpitx.py index 9df8110d..3d0a1fc6 100644 --- a/rpitx.py +++ b/rpitx.py @@ -518,8 +518,8 @@ if __name__ == "__main__": system("sudo rm /home/pi/CubeSatSim/cwready") channel = 1 print(channel) - for channel in range(7): - print(channel) + for chan in range(7): + print(chan) 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") @@ -543,9 +543,9 @@ if __name__ == "__main__": sleep(0.1) output(txLed, txLedOff) output (ptt, 1) - print(channel) + print(chan) command_control_check() - print(channel) + print(chan) f.close() # system("sudo rm /home/pi/CubeSatSim/cwready") sleep(5) From bb700f0f8649ec29cdf6483dd9791584268d2127 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:38:05 -0500 Subject: [PATCH 15/39] Update rpitx.py chan and channel --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 3d0a1fc6..764b3c8b 100644 --- a/rpitx.py +++ b/rpitx.py @@ -519,9 +519,10 @@ if __name__ == "__main__": channel = 1 print(channel) for chan in range(7): + print(channel) print(chan) 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 + channel = channel + 1 # print("Sending cw1.txt") # system("cat /home/pi/CubeSatSim/cw1.txt") From 2b9ed7cd079ba75471f3b81a6cc41476a3a209b3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 11:58:00 -0500 Subject: [PATCH 16/39] Update rpitx.py prints --- rpitx.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpitx.py b/rpitx.py index 764b3c8b..04b8587a 100644 --- a/rpitx.py +++ b/rpitx.py @@ -378,6 +378,7 @@ if __name__ == "__main__": print(ser.portstr) uhf_string = "AT+DMOSETGROUP=0," + rx +"," + tx + ",0,3,0,0\r\n" for i in range(6): + print(i) # ser.write(b"AT+DMOSETGROUP=0,435.0000,434.9000,0,3,0,0\r\n") ser.write(uhf_string.encode()) sleep(0.1) @@ -521,6 +522,8 @@ if __name__ == "__main__": for chan in range(7): print(channel) print(chan) + print("done for") + for chan in range(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 = channel + 1 # print("Sending cw1.txt") @@ -547,6 +550,7 @@ if __name__ == "__main__": print(chan) command_control_check() print(chan) + print("done 2nd for") f.close() # system("sudo rm /home/pi/CubeSatSim/cwready") sleep(5) From cd031e9560614d244d8f516f39e67b29a464380b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:02:43 -0500 Subject: [PATCH 17/39] Update rpitx.py lots of prints --- rpitx.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 04b8587a..7c13699d 100644 --- a/rpitx.py +++ b/rpitx.py @@ -523,13 +523,18 @@ if __name__ == "__main__": print(channel) print(chan) print("done for") - for chan in range(7): + for chan in range(7): + print("for loop") system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + channel + ".txt -r 48000 > /dev/null 2>&1") + print("for loop1") channel = channel + 1 + print("for loop2") + # print("Sending cw1.txt") # system("cat /home/pi/CubeSatSim/cw1.txt") if (command_tx == True): + print("for loop3") output(txLed, txLedOn) output (pd, 1) sleep(0.1) @@ -547,8 +552,11 @@ if __name__ == "__main__": sleep(0.1) output(txLed, txLedOff) output (ptt, 1) + print("for loop4") + print("for loop5") print(chan) command_control_check() + print("for loop6") print(chan) print("done 2nd for") f.close() From 57b31f3e48e16a0730aea6896557f9e3612b937f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:04:23 -0500 Subject: [PATCH 18/39] Update rpitx.py try ch --- rpitx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index 7c13699d..ceb78c37 100644 --- a/rpitx.py +++ b/rpitx.py @@ -517,7 +517,7 @@ if __name__ == "__main__": f = open("/home/pi/CubeSatSim/cwready") f.close() system("sudo rm /home/pi/CubeSatSim/cwready") - channel = 1 + ch = 1 print(channel) for chan in range(7): print(channel) @@ -525,9 +525,9 @@ if __name__ == "__main__": print("done for") for chan in range(7): print("for loop") - system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + channel + ".txt -r 48000 > /dev/null 2>&1") + system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + ch + ".txt -r 48000 > /dev/null 2>&1") print("for loop1") - channel = channel + 1 + ch = ch + 1 print("for loop2") # print("Sending cw1.txt") From fe0b7a8440cc5c7802dc6e2ae8b57e0c6e06d705 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:06:57 -0500 Subject: [PATCH 19/39] Update rpitx.py don't command control check --- rpitx.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpitx.py b/rpitx.py index ceb78c37..dd4de9f2 100644 --- a/rpitx.py +++ b/rpitx.py @@ -555,7 +555,8 @@ if __name__ == "__main__": print("for loop4") print("for loop5") print(chan) - command_control_check() +# command_control_check() + print("dont command control check") print("for loop6") print(chan) print("done 2nd for") @@ -563,7 +564,8 @@ if __name__ == "__main__": # system("sudo rm /home/pi/CubeSatSim/cwready") sleep(5) except: - command_control_check() +# command_control_check() + print("dont command control check") sleep(1) elif (mode == 's'): print("SSTV") From 5b1170b66040c63c490ddf566a6710d3b792b05d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:08:28 -0500 Subject: [PATCH 20/39] Update rpitx.py more prints --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index dd4de9f2..4cd66baf 100644 --- a/rpitx.py +++ b/rpitx.py @@ -511,7 +511,8 @@ if __name__ == "__main__": # output (ptt, 1) # sleep(5) while True: - command_control_check() +# command_control_check() + print("don't command control check 0") try: f = open("/home/pi/CubeSatSim/cwready") From f2c3ac1233ae676cee108faa4ac575526a0e0305 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:11:20 -0500 Subject: [PATCH 21/39] Update rpitx.py after rm print --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 4cd66baf..59317e79 100644 --- a/rpitx.py +++ b/rpitx.py @@ -518,6 +518,7 @@ if __name__ == "__main__": f = open("/home/pi/CubeSatSim/cwready") f.close() system("sudo rm /home/pi/CubeSatSim/cwready") + print("after rm") ch = 1 print(channel) for chan in range(7): @@ -566,7 +567,7 @@ if __name__ == "__main__": sleep(5) except: # command_control_check() - print("dont command control check") + print("dont command control check 1") sleep(1) elif (mode == 's'): print("SSTV") From f13d26dd345558442b2d8585b04cb3dad71eb784 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:12:40 -0500 Subject: [PATCH 22/39] Update rpitx.py more prints --- rpitx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rpitx.py b/rpitx.py index 59317e79..1b9a414b 100644 --- a/rpitx.py +++ b/rpitx.py @@ -520,6 +520,7 @@ if __name__ == "__main__": system("sudo rm /home/pi/CubeSatSim/cwready") print("after rm") ch = 1 + print("after ch") print(channel) for chan in range(7): print(channel) From 3c6df815181062d52fafc6fc59a549d3994901f9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:14:05 -0500 Subject: [PATCH 23/39] Update rpitx.py remove a print --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 1b9a414b..ac6d0b1c 100644 --- a/rpitx.py +++ b/rpitx.py @@ -521,7 +521,7 @@ if __name__ == "__main__": print("after rm") ch = 1 print("after ch") - print(channel) +# print(channel) for chan in range(7): print(channel) print(chan) From 8b2d941e193bc01d7211ff35c8e6561958447403 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:15:32 -0500 Subject: [PATCH 24/39] Update rpitx.py remove another print --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index ac6d0b1c..b887d2bb 100644 --- a/rpitx.py +++ b/rpitx.py @@ -523,8 +523,9 @@ if __name__ == "__main__": print("after ch") # print(channel) for chan in range(7): - print(channel) +# print(channel) print(chan) + print("after for chan") print("done for") for chan in range(7): print("for loop") From 2a38e8665e03954a39fa996c463f5e512de7b185 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:18:36 -0500 Subject: [PATCH 25/39] Update rpitx.py string only in system call --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index b887d2bb..68f49bd4 100644 --- a/rpitx.py +++ b/rpitx.py @@ -529,7 +529,8 @@ if __name__ == "__main__": print("done for") for chan in range(7): print("for loop") - system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + ch + ".txt -r 48000 > /dev/null 2>&1") + command = "gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + ch + ".txt -r 48000 > /dev/null 2>&1" + system(command) print("for loop1") ch = ch + 1 print("for loop2") From d140fc9fc404377be46155bf01fb175f4685ca96 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:20:50 -0500 Subject: [PATCH 26/39] Update rpitx.py more prints --- rpitx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rpitx.py b/rpitx.py index 68f49bd4..389d61cb 100644 --- a/rpitx.py +++ b/rpitx.py @@ -530,6 +530,7 @@ if __name__ == "__main__": for chan in range(7): print("for loop") command = "gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + ch + ".txt -r 48000 > /dev/null 2>&1" + print("after command assignment") system(command) print("for loop1") ch = ch + 1 From 82cdf640beef4e77c241e17a6d28c324cb4ad2ed Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:22:28 -0500 Subject: [PATCH 27/39] Update rpitx.py use str --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 389d61cb..464d15ab 100644 --- a/rpitx.py +++ b/rpitx.py @@ -529,7 +529,7 @@ if __name__ == "__main__": print("done for") for chan in range(7): print("for loop") - command = "gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + ch + ".txt -r 48000 > /dev/null 2>&1" + command = "gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + str(ch) + ".txt -r 48000 > /dev/null 2>&1" print("after command assignment") system(command) print("for loop1") From a55e459b3dcb5cb33734a6f88b0d15c73f4b5e5c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 12:24:14 -0500 Subject: [PATCH 28/39] Update rpitx.py do c&c checks --- rpitx.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rpitx.py b/rpitx.py index 464d15ab..dc039370 100644 --- a/rpitx.py +++ b/rpitx.py @@ -511,8 +511,8 @@ if __name__ == "__main__": # output (ptt, 1) # sleep(5) while True: -# command_control_check() - print("don't command control check 0") + command_control_check() +# print("don't command control check 0") try: f = open("/home/pi/CubeSatSim/cwready") @@ -561,8 +561,8 @@ if __name__ == "__main__": print("for loop4") print("for loop5") print(chan) -# command_control_check() - print("dont command control check") + command_control_check() +# print("dont command control check") print("for loop6") print(chan) print("done 2nd for") @@ -570,8 +570,8 @@ if __name__ == "__main__": # system("sudo rm /home/pi/CubeSatSim/cwready") sleep(5) except: -# command_control_check() - print("dont command control check 1") + command_control_check() +# print("dont command control check 1") sleep(1) elif (mode == 's'): print("SSTV") From 027afa409ae3706fd76d8397cbca01c5d7bd1708 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 13:00:19 -0500 Subject: [PATCH 29/39] Update rpitx.py extra command and control checks --- rpitx.py | 81 ++++++++------------------------------------------------ 1 file changed, 11 insertions(+), 70 deletions(-) diff --git a/rpitx.py b/rpitx.py index dc039370..c1e3ee06 100644 --- a/rpitx.py +++ b/rpitx.py @@ -372,7 +372,6 @@ if __name__ == "__main__": print("Programming FM module!\n"); output(pd, 1) output (ptt, 1) - try: ser = serial.Serial("/dev/ttyAMA0", 9600) print(ser.portstr) @@ -385,12 +384,13 @@ if __name__ == "__main__": except: print("Error in serial write") ser.close() - output(pd, 0) sleep(10) # delay so cubesatsim code catches up - system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1") + system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1") + + command_control_check() # if (mode != 'a') and (command_tx == True): if (command_tx == True): @@ -426,14 +426,9 @@ if __name__ == "__main__": # if (len(sys.argv)) > 1: # print("There are arguments!") if (mode == 'a'): + command_control_check() # output(pd, 1) print("AFSK") -# sleep(5) -## try: -## file = open("/home/pi/CubeSatSim/t.txt") -## file.close() -## 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") while True: try: f = open("/home/pi/CubeSatSim/ready") @@ -480,72 +475,23 @@ if __name__ == "__main__": sleep(1) elif (mode == 'm'): print("CW") -# sleep(4) -# try: -# file = open("/home/pi/CubeSatSim/cw.txt") -# 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") -# output(pd, 1) -# -# if (command_tx == True): -# output(txLed, txLedOn) -# battery_saver_check() -# -# if (txc): -# output (pd, 1) -# output (ptt, 0) -# sleep(0.1) -# -# system("gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw.txt -r 48000 > /dev/null 2>&1 && aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav") -# sleep(0.1) -# output (ptt, 1) -# output (pd, 0) -# else: -# 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 " + tx + "e3") -# 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 " + tx + "e3 > /dev/null 2>&1") -# -# output(txLed, txLedOff) -# output (ptt, 1) -# sleep(5) while True: command_control_check() -# print("don't command control check 0") try: f = open("/home/pi/CubeSatSim/cwready") f.close() system("sudo rm /home/pi/CubeSatSim/cwready") - print("after rm") ch = 1 - print("after ch") -# print(channel) for chan in range(7): -# print(channel) - print(chan) - print("after for chan") - print("done for") - for chan in range(7): - print("for loop") - command = "gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + str(ch) + ".txt -r 48000 > /dev/null 2>&1" - print("after command assignment") + command = "gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + str(chan) + ".txt -r 48000 > /dev/null 2>&1" system(command) - print("for loop1") - ch = ch + 1 - print("for loop2") - -# print("Sending cw1.txt") -# system("cat /home/pi/CubeSatSim/cw1.txt") - + chan = chan + 1 if (command_tx == True): - print("for loop3") 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") @@ -558,23 +504,15 @@ if __name__ == "__main__": sleep(0.1) output(txLed, txLedOff) output (ptt, 1) - print("for loop4") - print("for loop5") - print(chan) command_control_check() -# print("dont command control check") - print("for loop6") - print(chan) - print("done 2nd for") f.close() -# system("sudo rm /home/pi/CubeSatSim/cwready") sleep(5) except: command_control_check() -# print("dont command control check 1") sleep(1) elif (mode == 's'): print("SSTV") + command_control_check() try: # from picamera import PiCamera # from pysstv.sstv import SSTV @@ -600,6 +538,7 @@ if __name__ == "__main__": 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") + command_control_check() if (command_tx == True): print ("Sending SSTV image") @@ -756,7 +695,7 @@ if __name__ == "__main__": 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 " + tx + "e3 &") while 1: if (command_tx == True): - + command_control_check() output(txLed, txLedOn) # battery_saver_check() @@ -773,7 +712,9 @@ if __name__ == "__main__": # output (ptt, 1) # output(pd, 0) sleep(1) + elif (mode == 'b'): + command_control_check() print("BPSK") print("turn on FM rx") output(pd, 1) From 82140095c2813ab4a424d18a15e6dc9488984c6a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 13:03:37 -0500 Subject: [PATCH 30/39] Update main.c add pause before and after each channel --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 01f4cd2d..34653fb8 100644 --- a/main.c +++ b/main.c @@ -1173,7 +1173,7 @@ void get_tlm(void) { if (mode == CW) { int channel; for (channel = 1; channel < 7; channel++) { - sprintf(tlm_str, "echo '%d%d%d %d%d%d %d%d%d %d%d%d' > cw%1d.txt", + sprintf(tlm_str, "echo ' %d%d%d %d%d%d %d%d%d %d%d%d ' > cw%1d.txt", channel, upper_digit(tlm[channel][1]), lower_digit(tlm[channel][1]), channel, upper_digit(tlm[channel][2]), lower_digit(tlm[channel][2]), channel, upper_digit(tlm[channel][3]), lower_digit(tlm[channel][3]), From c0f0380630c996938e249039144e8aa43fd89477 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 13:04:18 -0500 Subject: [PATCH 31/39] Update rpitx.py remove print --- rpitx.py | 1 - 1 file changed, 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index c1e3ee06..a451afb8 100644 --- a/rpitx.py +++ b/rpitx.py @@ -377,7 +377,6 @@ if __name__ == "__main__": print(ser.portstr) uhf_string = "AT+DMOSETGROUP=0," + rx +"," + tx + ",0,3,0,0\r\n" for i in range(6): - print(i) # ser.write(b"AT+DMOSETGROUP=0,435.0000,434.9000,0,3,0,0\r\n") ser.write(uhf_string.encode()) sleep(0.1) From c5baa06a540c13e51d09ea1231e04ae711c78bc0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 13:13:40 -0500 Subject: [PATCH 32/39] Update rpitx.py longer carrier before CW --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index a451afb8..657915ae 100644 --- a/rpitx.py +++ b/rpitx.py @@ -489,7 +489,7 @@ if __name__ == "__main__": if (command_tx == True): output(txLed, txLedOn) output (pd, 1) - sleep(0.1) + sleep(0.3) output (ptt, 0) if (txc): From d3aff374539559aa2a01e83a3369395e465eaeea Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 13:31:34 -0500 Subject: [PATCH 33/39] Update main.c --- main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 34653fb8..a6536dec 100644 --- a/main.c +++ b/main.c @@ -1163,7 +1163,8 @@ void get_tlm(void) { strcat(str, header_str4); strcat(str, call); - sprintf(tlm_str, "%s' > cw0.txt", &str); + sprintf(tlm_str, "%s' > cw0.txt", &str); + printf("CW string to execute: %s\n", &tlm_str); FILE * cw_file = popen(tlm_str, "r"); pclose(cw_file); @@ -1184,8 +1185,10 @@ void get_tlm(void) { // if (mode != AFSK) //#endif // if ((!hab_mode) || ((hab_mode) && (mode != AFSK))) - strcat(str, tlm_str); - + strcat(str, tlm_str); + + printf("CW string to execute: %s\n", &tlm_str); + FILE * cw_file = popen(tlm_str, "r"); pclose(cw_file); From 34007d411a56f7501b285a4e9e8e5555c2e050ad Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 13:38:13 -0500 Subject: [PATCH 34/39] Update rpitx.py print cw command --- rpitx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rpitx.py b/rpitx.py index 657915ae..53afca53 100644 --- a/rpitx.py +++ b/rpitx.py @@ -484,6 +484,7 @@ if __name__ == "__main__": ch = 1 for chan in range(7): command = "gen_packets -M 20 -o /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/cw" + str(chan) + ".txt -r 48000 > /dev/null 2>&1" + print(command) system(command) chan = chan + 1 if (command_tx == True): From 745fe341b5e8480be41c07e472e900f80c50b0bf Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 2 Mar 2024 15:50:39 -0500 Subject: [PATCH 35/39] Update main.c do full cw --- main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index a6536dec..9958c06f 100644 --- a/main.c +++ b/main.c @@ -1270,11 +1270,14 @@ void get_tlm(void) { strcat(str, cw_footer3); // printf("Str: %s \n", str); // fflush(stdout); - printf("CW string to execute: %s\n", cwready); + printf("CW string to execute: %s\n", str); fflush(stdout); - FILE * cw_file = popen(cwready, "r"); - pclose(cw_file); + FILE * cw_file = popen(str, "r"); + pclose(cw_file); + +// FILE * cw_file = popen(cwready, "r"); +// pclose(cw_file); while ((cw_file = fopen("/home/pi/CubeSatSim/cwready", "r")) != NULL) { // wait for rpitx to be done fclose(cw_file); From e887647b6136bf8bb4b53b2538c8c530ac3d6650 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 3 Mar 2024 10:40:38 -0500 Subject: [PATCH 36/39] Update rpitx.py don't change mode for testing! --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 53afca53..50ac5326 100644 --- a/rpitx.py +++ b/rpitx.py @@ -173,7 +173,7 @@ def increment_mode(): print("Changing mode now") # system("/home/pi/CubeSatSim/config -" + mode) - system("reboot -h now") +### system("reboot -h now") sleep(10); except: From 47b63aa32de4711ebfc8827de5a91360dd7993af Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 3 Mar 2024 10:42:11 -0500 Subject: [PATCH 37/39] Update rpitx.py don't do initial CW ID if CW mode --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 50ac5326..ffb8e981 100644 --- a/rpitx.py +++ b/rpitx.py @@ -392,7 +392,8 @@ if __name__ == "__main__": command_control_check() # if (mode != 'a') and (command_tx == True): - if (command_tx == True): +# if (command_tx == True): + if (mode != CW): # battery_saver_mode output(txLed, txLedOn) # if (txc): From 8db86c2aa53c38ad6cae91c95c46c623703df8ef Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 3 Mar 2024 10:50:44 -0500 Subject: [PATCH 38/39] Update rpitx.py don't CW ID if CW --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index ffb8e981..24d08aef 100644 --- a/rpitx.py +++ b/rpitx.py @@ -393,7 +393,7 @@ if __name__ == "__main__": # if (mode != 'a') and (command_tx == True): # if (command_tx == True): - if (mode != CW): + if (mode != 'm'): # battery_saver_mode output(txLed, txLedOn) # if (txc): From 1f31f1a0eb6a5017370bfb42ee164614326f9830 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 3 Mar 2024 10:56:40 -0500 Subject: [PATCH 39/39] Update rpitx.py restore reboot in c&c mode change --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 24d08aef..b46c4e46 100644 --- a/rpitx.py +++ b/rpitx.py @@ -173,7 +173,7 @@ def increment_mode(): print("Changing mode now") # system("/home/pi/CubeSatSim/config -" + mode) -### system("reboot -h now") + system("reboot -h now") sleep(10); except: