From bc9739fb02b581548889f90aa37dfcc4d21b5d2f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 09:24:33 -0500 Subject: [PATCH 01/12] Update transmit.py change tx and power LED to wiringpi --- transmit.py | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/transmit.py b/transmit.py index 9ad167f0..a2456d64 100644 --- a/transmit.py +++ b/transmit.py @@ -65,9 +65,9 @@ def battery_saver_check(): def blink(times): powerPin = 16 for i in range(times): - GPIO.output(powerPin, 0) # blink two times + system("gpio -g write " + str(powerPin) + " 0") # blink two times sleep(0.1) - GPIO.output(powerPin, 1) + system("gpio -g write " + str(powerPin) + " 1") sleep(0.1) def increment_mode(): @@ -115,12 +115,12 @@ def increment_mode(): print(".mode file written") GPIO.setwarnings(False) - GPIO.output(txLed, 0) - GPIO.output(powerPin, 0) + system("gpio -g write " + str(txLed) + " 0") + system("gpio -g write " + str(powerPin) + " 0") print("sudo reboot -h now") GPIO.setwarnings(False) - GPIO.setup(powerPin, GPIO.OUT) - GPIO.output(powerPin, 0); + system("gpio -g mode " + str(powerPin) + " out") + system("gpio -g write " + str(powerPin) + " 0"); # system("reboot -h now") # release = True; @@ -200,11 +200,11 @@ try: GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(txc_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(green, GPIO.OUT) - GPIO.output(powerPin, 1) + system("gpio -g write " + str(powerPin) + " 1") GPIO.setup(27, GPIO.IN) except: - print("GPIO setup problem") - system("gpio -g mode 27 IN") + print("gpio -g setup problem") + system("gpio -g -g mode 27 IN") try: GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP) except: @@ -222,13 +222,13 @@ else: print("No LPF") -# GPIO.setup(txLed, GPIO.OUT) +# system("gpio -g mode " + str(txLed) + " out") # output(txLed, txLedOff) GPIO.setmode(GPIO.BCM) # Repeat to make LED work on Pi 4 GPIO.setwarnings(False) try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") except: print("Can't set txLed") @@ -462,7 +462,7 @@ if __name__ == "__main__": try: print(txLed) print(txLedOn) - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") except: print("Can't set txLed") @@ -534,7 +534,7 @@ if __name__ == "__main__": if (((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'j')) and (command_tx == True) and (skip == False)) or ((mode == 'e') and (command_tx == True)): # battery_saver_mode GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") @@ -570,7 +570,7 @@ if __name__ == "__main__": if (mode == 'a'): print("AFSK") else: -# GPIO.output(powerPin, 0) +# system("gpio -g write " + str(powerPin) + " 0") print("Transmit APRS Commands") system("sudo systemctl stop command") # while True: @@ -589,7 +589,7 @@ if __name__ == "__main__": if (command_tx == True): GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") @@ -652,7 +652,7 @@ if __name__ == "__main__": ## chan = chan + 1 if (command_tx == True): GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") try: output(txLed, txLedOn) except: @@ -716,7 +716,7 @@ if __name__ == "__main__": print ("Sending SSTV image") GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") @@ -755,7 +755,7 @@ if __name__ == "__main__": print ("Sending SSTV image") GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") @@ -798,7 +798,7 @@ if __name__ == "__main__": print ("Sending SSTV image") GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") @@ -841,7 +841,7 @@ if __name__ == "__main__": print ("Sending SSTV image") try: GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") @@ -877,7 +877,7 @@ if __name__ == "__main__": GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") @@ -912,7 +912,7 @@ if __name__ == "__main__": output(ptt, 1) try: GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") except: print("Can't set txLed") @@ -938,7 +938,7 @@ if __name__ == "__main__": if (command_tx == True): GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") @@ -981,12 +981,12 @@ if __name__ == "__main__": output(ptt, 1) GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") except: print("Can't set txLed") -# GPIO.setup(powerPin, GPIO.OUT) +# system("gpio -g mode " + str(powerPin) + " out") GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected -# GPIO.output(powerPin, 1) # was 0 +# system("gpio -g write " + str(powerPin) + " 1") # was 0 # txf = float(tx) - 288.9 # print("Transmit frequency: ",txf) if (command_tx != True): @@ -998,7 +998,7 @@ if __name__ == "__main__": print("Carrier detected, starting repeater") GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") @@ -1029,7 +1029,7 @@ if __name__ == "__main__": try: GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") except: print("Can't set txLed") @@ -1050,7 +1050,7 @@ if __name__ == "__main__": if (command_tx == True): try: GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 - GPIO.setup(txLed, GPIO.OUT) + system("gpio -g mode " + str(txLed) + " out") output(txLed, txLedOn) except: print("Can't set txLed") From de5839c5d5ae16f0975ca78c3d3008ac689d22bb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 09:31:03 -0500 Subject: [PATCH 02/12] fix -g -g --- transmit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transmit.py b/transmit.py index a2456d64..0869d1eb 100644 --- a/transmit.py +++ b/transmit.py @@ -194,17 +194,17 @@ powerPin = 16 command_tx = True try: + system("gpio -g write " + str(powerPin) + " 1") GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(txc_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(green, GPIO.OUT) - system("gpio -g write " + str(powerPin) + " 1") GPIO.setup(27, GPIO.IN) except: - print("gpio -g setup problem") - system("gpio -g -g mode 27 IN") + print("gpio setup problem") + system("gpio -g mode 27 IN") try: GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP) except: From 7a09dc974c2415e0c444cf98cce3e1a0c8e88dae Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 09:34:42 -0500 Subject: [PATCH 03/12] Update transmit.py replace remaining GPIO --- transmit.py | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/transmit.py b/transmit.py index 0869d1eb..e1c22304 100644 --- a/transmit.py +++ b/transmit.py @@ -223,7 +223,7 @@ else: # system("gpio -g mode " + str(txLed) + " out") -# output(txLed, txLedOff) +# system("gpio -g write " + str(txLed) + " 0") ) GPIO.setmode(GPIO.BCM) # Repeat to make LED work on Pi 4 GPIO.setwarnings(False) @@ -248,9 +248,9 @@ else: # txc = False # forcing it off try: - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") sleep(1) - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") @@ -535,7 +535,7 @@ if __name__ == "__main__": GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") print("Transmit CW ID") @@ -549,7 +549,7 @@ if __name__ == "__main__": else: system("echo 'hi hi de " + callsign + status + "' > 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 " + tx + "e3 > /dev/null 2>&1") try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") @@ -590,7 +590,7 @@ if __name__ == "__main__": GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") # output(pd, 1) @@ -619,7 +619,7 @@ if __name__ == "__main__": # output (ptt, 1) # output(pd, 0) try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") system("sudo rm /home/pi/CubeSatSim/ready") @@ -654,7 +654,7 @@ if __name__ == "__main__": GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 system("gpio -g mode " + str(txLed) + " out") try: - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") @@ -673,7 +673,7 @@ if __name__ == "__main__": 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") try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") @@ -700,7 +700,7 @@ if __name__ == "__main__": print(" -> if camera plugged in, is software enabled?") try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") # output (ptt, 1) @@ -717,7 +717,7 @@ if __name__ == "__main__": GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") # battery_saver_check() @@ -736,7 +736,7 @@ if __name__ == "__main__": 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 " + tx + "e3 > /dev/null 2>&1") try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") @@ -756,7 +756,7 @@ if __name__ == "__main__": GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") # battery_saver_check() @@ -775,7 +775,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 " + tx + "e3 > /dev/null 2>&1") try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") # output (ptt, 1) @@ -799,7 +799,7 @@ if __name__ == "__main__": GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") @@ -818,7 +818,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 " + tx + "e3 > /dev/null 2>&1") try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") # output (ptt, 1) @@ -842,7 +842,7 @@ if __name__ == "__main__": try: GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") # battery_saver_check() @@ -860,7 +860,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 " + tx + "e3 > /dev/null 2>&1") try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") # output (ptt, 1) @@ -878,7 +878,7 @@ if __name__ == "__main__": GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") @@ -894,7 +894,7 @@ if __name__ == "__main__": else: sleep(60) try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") # output (ptt, 1) @@ -925,21 +925,21 @@ if __name__ == "__main__": while 1: # print ("LED on") try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") sleep(0.4) # if (command_tx == False): -# output(txLed, txLedOn) +# system("gpio -g write " + str(txLed) + " 1") # sleep(0.03) -# output(txLed, txLedOff) +# system("gpio -g write " + str(txLed) + " 0") ) # command_control_check() if (command_tx == True): GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") # print(txLed) @@ -999,7 +999,7 @@ if __name__ == "__main__": GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 try: system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1 &") @@ -1009,7 +1009,7 @@ if __name__ == "__main__": sleep(1) print("No carrier detected, stopping repeater") try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") system("sudo rpitx -i null > /dev/null 2>&1") @@ -1038,20 +1038,20 @@ if __name__ == "__main__": print("Turning LED on/off and listening for carrier") while 1: try: - output(txLed, txLedOff) + system("gpio -g write " + str(txLed) + " 0") ) except: print("Can't set txLed") sleep(0.4) # if (command_tx == False): -# output(txLed, txLedOn) +# system("gpio -g write " + str(txLed) + " 1") # sleep(0.03) -# output(txLed, txLedOff) +# system("gpio -g write " + str(txLed) + " 0") ) # command_control_check() if (command_tx == True): try: GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 system("gpio -g mode " + str(txLed) + " out") - output(txLed, txLedOn) + system("gpio -g write " + str(txLed) + " 1") except: print("Can't set txLed") # print(txLed) From 37711b6a7772169b54c95c6a07ca48b848340fa2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 09:36:05 -0500 Subject: [PATCH 04/12] Update transmit.py remove extra ) --- transmit.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/transmit.py b/transmit.py index e1c22304..8ede6736 100644 --- a/transmit.py +++ b/transmit.py @@ -223,7 +223,7 @@ else: # system("gpio -g mode " + str(txLed) + " out") -# system("gpio -g write " + str(txLed) + " 0") ) +# system("gpio -g write " + str(txLed) + " 0") GPIO.setmode(GPIO.BCM) # Repeat to make LED work on Pi 4 GPIO.setwarnings(False) @@ -250,7 +250,7 @@ else: try: system("gpio -g write " + str(txLed) + " 1") sleep(1) - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") @@ -549,7 +549,7 @@ if __name__ == "__main__": else: system("echo 'hi hi de " + callsign + status + "' > 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 " + tx + "e3 > /dev/null 2>&1") try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") @@ -619,7 +619,7 @@ if __name__ == "__main__": # output (ptt, 1) # output(pd, 0) try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") system("sudo rm /home/pi/CubeSatSim/ready") @@ -673,7 +673,7 @@ if __name__ == "__main__": 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") try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") @@ -700,7 +700,7 @@ if __name__ == "__main__": print(" -> if camera plugged in, is software enabled?") try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") # output (ptt, 1) @@ -736,7 +736,7 @@ if __name__ == "__main__": 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 " + tx + "e3 > /dev/null 2>&1") try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") @@ -775,7 +775,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 " + tx + "e3 > /dev/null 2>&1") try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") # output (ptt, 1) @@ -818,7 +818,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 " + tx + "e3 > /dev/null 2>&1") try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") # output (ptt, 1) @@ -860,7 +860,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 " + tx + "e3 > /dev/null 2>&1") try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") # output (ptt, 1) @@ -894,7 +894,7 @@ if __name__ == "__main__": else: sleep(60) try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") # output (ptt, 1) @@ -925,14 +925,14 @@ if __name__ == "__main__": while 1: # print ("LED on") try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") sleep(0.4) # if (command_tx == False): # system("gpio -g write " + str(txLed) + " 1") # sleep(0.03) -# system("gpio -g write " + str(txLed) + " 0") ) +# system("gpio -g write " + str(txLed) + " 0") # command_control_check() if (command_tx == True): @@ -1009,7 +1009,7 @@ if __name__ == "__main__": sleep(1) print("No carrier detected, stopping repeater") try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") system("sudo rpitx -i null > /dev/null 2>&1") @@ -1038,14 +1038,14 @@ if __name__ == "__main__": print("Turning LED on/off and listening for carrier") while 1: try: - system("gpio -g write " + str(txLed) + " 0") ) + system("gpio -g write " + str(txLed) + " 0") except: print("Can't set txLed") sleep(0.4) # if (command_tx == False): # system("gpio -g write " + str(txLed) + " 1") # sleep(0.03) -# system("gpio -g write " + str(txLed) + " 0") ) +# system("gpio -g write " + str(txLed) + " 0") # command_control_check() if (command_tx == True): try: From 1e97592a120be0533ed085b1d03cf7fa0c23f2e5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 09:39:48 -0500 Subject: [PATCH 05/12] Update transmit.py change back to txLed 27 --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 8ede6736..9a249d82 100644 --- a/transmit.py +++ b/transmit.py @@ -211,8 +211,8 @@ except: print("Can't set txLed") transmit = False -# txLed = 27 -txLed = 17 +txLed = 27 +# txLed = 17 txLedOn = 1 txLedOff = 0 if GPIO.input(12) == False: From 6d3aae36490cd2aacfdb2509c462549a97445a5f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 10:11:19 -0500 Subject: [PATCH 06/12] Update main.c add os test --- main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 51959a58..eb12ce98 100644 --- a/main.c +++ b/main.c @@ -322,7 +322,14 @@ int main(int argc, char * argv[]) { } else { snprintf(busStr, 10, "%d %d", i2c_bus1, i2c_bus3); } - + + FILE * file4 = popen("cat /etc/os-release", "r"); + fgets(cmdbuffer, 1000, file4); + printf("os-release: %s\n", cmdbuffer); + char os_present[] = "bookworm"; + // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); + int os_status = (strstr( (const char *)& cmdbuffer, os_present) != NULL) ? ON : OFF; + printf(os_status); // check for camera // char cmdbuffer1[1000]; @@ -331,6 +338,8 @@ int main(int argc, char * argv[]) { char camera_present[] = "supported=1 detected=1"; // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF; + + printf("Camera result:%s camera: %d \n", & cmdbuffer, camera); pclose(file4); From 73ea641ab962b20bf55ab34c4f02bf220d28328f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 10:12:38 -0500 Subject: [PATCH 07/12] Update main.c change file desc --- main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index eb12ce98..e80ae81f 100644 --- a/main.c +++ b/main.c @@ -323,13 +323,14 @@ int main(int argc, char * argv[]) { snprintf(busStr, 10, "%d %d", i2c_bus1, i2c_bus3); } - FILE * file4 = popen("cat /etc/os-release", "r"); - fgets(cmdbuffer, 1000, file4); + FILE * os-test = popen("cat /etc/os-release", "r"); + fgets(cmdbuffer, 1000, os-test); printf("os-release: %s\n", cmdbuffer); char os_present[] = "bookworm"; // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); int os_status = (strstr( (const char *)& cmdbuffer, os_present) != NULL) ? ON : OFF; - printf(os_status); + printf(os_status); + pclose (os-test); // check for camera // char cmdbuffer1[1000]; From a63c5aa656ee4a60124a2586509cffb405299923 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 10:13:49 -0500 Subject: [PATCH 08/12] Update main.c change file desc name --- main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index e80ae81f..94561044 100644 --- a/main.c +++ b/main.c @@ -323,14 +323,14 @@ int main(int argc, char * argv[]) { snprintf(busStr, 10, "%d %d", i2c_bus1, i2c_bus3); } - FILE * os-test = popen("cat /etc/os-release", "r"); - fgets(cmdbuffer, 1000, os-test); - printf("os-release: %s\n", cmdbuffer); + FILE * os_test = popen("cat /etc/os-release", "r"); + fgets(cmdbuffer, 1000, os_test); + printf("os-release: %s\n" cmdbuffer); char os_present[] = "bookworm"; // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); int os_status = (strstr( (const char *)& cmdbuffer, os_present) != NULL) ? ON : OFF; printf(os_status); - pclose (os-test); + pclose (os_test); // check for camera // char cmdbuffer1[1000]; From 752ecae33736408c68663a0c6e89cb9b50efac90 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 10:14:22 -0500 Subject: [PATCH 09/12] Update main.c missing , --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 94561044..259f5b28 100644 --- a/main.c +++ b/main.c @@ -325,7 +325,7 @@ int main(int argc, char * argv[]) { FILE * os_test = popen("cat /etc/os-release", "r"); fgets(cmdbuffer, 1000, os_test); - printf("os-release: %s\n" cmdbuffer); + printf("os-release: %s\n", cmdbuffer); char os_present[] = "bookworm"; // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); int os_status = (strstr( (const char *)& cmdbuffer, os_present) != NULL) ? ON : OFF; From 2a73e5469311cc841fb5933662a55c5e17e1c835 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 10:16:35 -0500 Subject: [PATCH 10/12] Update main.c fix printf --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 259f5b28..bbbe2151 100644 --- a/main.c +++ b/main.c @@ -329,8 +329,8 @@ int main(int argc, char * argv[]) { char os_present[] = "bookworm"; // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); int os_status = (strstr( (const char *)& cmdbuffer, os_present) != NULL) ? ON : OFF; - printf(os_status); - pclose (os_test); + printf("os_status: %d\n", os_status); + pclose(os_test); // check for camera // char cmdbuffer1[1000]; From b70ea5c993d56dbcfcdcd8ad9576ee7d71458667 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 13:36:41 -0500 Subject: [PATCH 11/12] Update main.c tes for camera based on os --- main.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index bbbe2151..748c9853 100644 --- a/main.c +++ b/main.c @@ -331,18 +331,27 @@ int main(int argc, char * argv[]) { int os_status = (strstr( (const char *)& cmdbuffer, os_present) != NULL) ? ON : OFF; printf("os_status: %d\n", os_status); pclose(os_test); - - // check for camera -// char cmdbuffer1[1000]; - FILE * file4 = popen("vcgencmd get_camera", "r"); - fgets(cmdbuffer, 1000, file4); - char camera_present[] = "supported=1 detected=1"; - // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); - camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF; + // check for camera + FILE *cam_test; + if (os_status == ON) { // bookworm + cam_test = popen("sudo rpicam-hello --list-cameras | grep 'No cameras available!'", "r"); + fgets(cmdbuffer, 1000, cam_test); + char no_camera_present[] = "No cameras available!"; + // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); + camera = (strstr( (const char *)& cmdbuffer, no_camera_present) != NULL) ? OFF : ON; + } + else // bullseye + { + cam_test = popen("vcgencmd get_camera", "r"); + fgets(cmdbuffer, 1000, cam_test); + char camera_present[] = "supported=1 detected=1"; + // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); + camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF; + } printf("Camera result:%s camera: %d \n", & cmdbuffer, camera); - pclose(file4); + pclose(cam_test); #ifdef DEBUG_LOGGING printf("INFO: I2C bus status 0: %d 1: %d 3: %d camera: %d\n", i2c_bus0, i2c_bus1, i2c_bus3, camera); From 7559f63f47144181286012c8a39d3673a3a6d58e Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 17 Feb 2026 13:50:47 -0500 Subject: [PATCH 12/12] Update main.c cleanup --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 748c9853..573ccb5f 100644 --- a/main.c +++ b/main.c @@ -350,7 +350,7 @@ int main(int argc, char * argv[]) { camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF; } - printf("Camera result:%s camera: %d \n", & cmdbuffer, camera); + printf("Camera result: %s camera: %d \n", & cmdbuffer, camera); pclose(cam_test); #ifdef DEBUG_LOGGING