From 4e39d7fcea366e5ac990199573672321ccee6b54 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Jun 2021 09:15:28 -0400 Subject: [PATCH 1/7] removed subprocess import and changed time.sleep to sleep --- rpitx.py | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/rpitx.py b/rpitx.py index 60743990..31a62f92 100644 --- a/rpitx.py +++ b/rpitx.py @@ -1,8 +1,9 @@ #!/usr/bin/env python import RPi.GPIO as GPIO -import subprocess -import time +#import subprocess +#import time +from time import sleep #import os import sys from os import system @@ -83,10 +84,10 @@ if __name__ == "__main__": else: 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 && 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") - time.sleep(4); # was 8 + sleep(4); # was 8 GPIO.output(txLed, txLedOff) - time.sleep(1) + sleep(1) if (transmit): @@ -97,7 +98,7 @@ if __name__ == "__main__": # print("There are arguments!") if (mode == 'a'): print("AFSK") - time.sleep(5) + sleep(5) try: file = open("/home/pi/CubeSatSim/t.txt") file.close() @@ -109,9 +110,9 @@ if __name__ == "__main__": 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") - time.sleep(0.2) + sleep(0.2) GPIO.output(txLed, txLedOff) - time.sleep(3.8) + sleep(3.8) while True: try: f = open("/home/pi/CubeSatSim/ready") @@ -123,12 +124,12 @@ if __name__ == "__main__": GPIO.output(txLed, txLedOff) f.close() system("sudo rm ready") - time.sleep(0.5) + sleep(0.5) except: - time.sleep(0.5) + sleep(0.5) elif (mode == 'm'): print("CW") -# time.sleep(4) +# sleep(4) try: file = open("/home/pi/CubeSatSim/cw.txt") file.close() @@ -152,9 +153,9 @@ if __name__ == "__main__": GPIO.output(txLed, txLedOff) f.close() system("sudo rm cwready") - time.sleep(1) + sleep(1) except: - time.sleep(1) + sleep(1) elif (mode == 's'): print("SSTV") try: @@ -183,7 +184,7 @@ if __name__ == "__main__": 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) - # time.sleep(1) + # sleep(1) except: print("image 2 did not load - copy from CubeSatSim/sstv directory") while 1: @@ -197,7 +198,7 @@ if __name__ == "__main__": 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) - time.sleep(1) + sleep(1) else: try: file = open("/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg") @@ -210,7 +211,7 @@ if __name__ == "__main__": 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) - time.sleep(1) + sleep(1) except: print("image 1 did not load - copy from CubeSatSim/sstv directory") try: @@ -225,15 +226,15 @@ if __name__ == "__main__": 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) - time.sleep(5) + 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) - time.sleep(60) + sleep(60) GPIO.output(txLed, txLedOff) - time.sleep(1) + sleep(1) elif (mode == 'b'): print("BPSK") @@ -241,18 +242,18 @@ if __name__ == "__main__": print("Turning LED on/off") while 1: GPIO.output(txLed, txLedOff) - time.sleep(0.5) + sleep(0.5) GPIO.output(txLed, txLedOn) - time.sleep(4.0) + 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) - time.sleep(0.5) + sleep(0.5) GPIO.output(txLed, txLedOn) - time.sleep(4.0) + 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") @@ -260,4 +261,4 @@ if __name__ == "__main__": else: print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") while 1: - time.sleep(5) + sleep(5) From 8335582f0c95c80682fae069da2785ff588b8b1b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Jun 2021 09:18:40 -0400 Subject: [PATCH 2/7] try changing GPIO.output to output --- rpitx.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index 31a62f92..7e0b0742 100644 --- a/rpitx.py +++ b/rpitx.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import RPi.GPIO as GPIO +from RPi.GPIO import output #import subprocess #import time from time import sleep @@ -41,7 +42,7 @@ else: txLedOff = 0 GPIO.setup(txLed, GPIO.OUT) -GPIO.output(txLed, txLedOff) +output(txLed, txLedOff) # print(txLedOn) print(txLed) @@ -78,14 +79,14 @@ if __name__ == "__main__": print("Can't read callsign from sim.cfg file, defaulting to AMSAT") print(callsign) - GPIO.output(txLed, txLedOn) + output(txLed, txLedOn) if (debug_mode == 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 && 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("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 && 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") sleep(4); # was 8 - GPIO.output(txLed, txLedOff) + output(txLed, txLedOff) sleep(1) From 5ad16f77101ce87594c72f38760d0a82ebc2c977 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Jun 2021 09:27:45 -0400 Subject: [PATCH 3/7] changed all GPIO.output to output --- rpitx.py | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) 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") From 1414d7b7da5a61442fd04b3afd2eeb7c3e0a0e05 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Jun 2021 10:19:25 -0400 Subject: [PATCH 4/7] moved I2C bus tests to the start, removed duplicate bus test --- main.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/main.c b/main.c index e5bd1e6c..3b3a7d02 100644 --- a/main.c +++ b/main.c @@ -22,7 +22,18 @@ #include "main.h" int main(int argc, char * argv[]) { + + printf("Test bus 1\n"); + fflush(stdout); + i2c_bus1 = (test_i2c_bus(1) != -1) ? ON : OFF; + printf("Test bus 3\n"); + fflush(stdout); + i2c_bus3 = (test_i2c_bus(3) != -1) ? ON : OFF; + printf("Finished testing\n"); + fflush(stdout); + sleep(2); + FILE * rpitx_restart = popen("sudo systemctl restart rpitx", "r"); pclose(rpitx_restart); @@ -222,7 +233,7 @@ int main(int argc, char * argv[]) { if (vB4) { map[BAT] = BUS; map[BUS] = BAT; - snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); + snprintf(busStr, 10, "%d %d", i2c_bus1, test_i2c_bus(0)); } else if (vB5) { map[MINUS_X] = MINUS_Y; map[PLUS_Z] = MINUS_X; @@ -232,31 +243,17 @@ int main(int argc, char * argv[]) { printf("/dev/i2c-11 is present\n\n"); snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(11)); } else { - snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(3)); + snprintf(busStr, 10, "%d %d", i2c_bus1, i2c_bus3); } } else { map[BUS] = MINUS_Z; map[BAT] = BUS; map[PLUS_Z] = BAT; map[MINUS_Z] = PLUS_Z; - snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); + snprintf(busStr, 10, "%d %d", i2c_bus1, test_i2c_bus(0)); voltageThreshold = 8.0; } - // test i2c buses - fflush(stdout); - //printf("Test bus 0\n"); - //fflush(stdout); - //i2c_bus0 = (test_i2c_bus(0) != -1) ? ON : OFF; - printf("Test bus 1\n"); - fflush(stdout); - i2c_bus1 = (test_i2c_bus(1) != -1) ? ON : OFF; - printf("Test bus 3\n"); - fflush(stdout); - i2c_bus3 = (test_i2c_bus(3) != -1) ? ON : OFF; - printf("Finished testing\n"); - fflush(stdout); - // check for camera // char cmdbuffer1[1000]; FILE * file4 = popen("vcgencmd get_camera", "r"); From f57fcb140f91bcdfd03daf5b4be8ef9ffc9a6ff7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Jun 2021 10:22:27 -0400 Subject: [PATCH 5/7] try 2 second i2c bus test --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 3b3a7d02..347c8ca0 100644 --- a/main.c +++ b/main.c @@ -1792,7 +1792,7 @@ int test_i2c_bus(int bus) if (access(busDev, W_OK | R_OK) >= 0) { // Test if I2C Bus is present // printf("bus is present\n\n"); char result[128]; - const char command_start[] = "timeout 5 i2cdetect -y "; // was 10 + const char command_start[] = "timeout 2 i2cdetect -y "; // was 5 10 char command[50]; strcpy (command, command_start); strcat (command, busS); From 31995f0a0855921b313606ecc658889410f46b94 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Jun 2021 10:28:58 -0400 Subject: [PATCH 6/7] add stop before rpitx restart --- main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.c b/main.c index 347c8ca0..c9e166c0 100644 --- a/main.c +++ b/main.c @@ -23,6 +23,9 @@ int main(int argc, char * argv[]) { + FILE * rpitx_stop = popen("sudo systemctl stop rpitx", "r"); + pclose(rpitx_stop); + printf("Test bus 1\n"); fflush(stdout); i2c_bus1 = (test_i2c_bus(1) != -1) ? ON : OFF; From 0ccac768c2150a4a27a07bdc91eecc62480dfccd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Jun 2021 10:36:43 -0400 Subject: [PATCH 7/7] removed extra sleep(2) --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index c9e166c0..4f5ab606 100644 --- a/main.c +++ b/main.c @@ -35,7 +35,7 @@ int main(int argc, char * argv[]) { printf("Finished testing\n"); fflush(stdout); - sleep(2); +// sleep(2); FILE * rpitx_restart = popen("sudo systemctl restart rpitx", "r"); pclose(rpitx_restart);