From 28a0e5dc56103186550e5c905838127011552e37 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Feb 2026 09:15:04 -0500 Subject: [PATCH 1/5] Update transmit.py add os_status print --- transmit.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/transmit.py b/transmit.py index f319397b..f4454929 100644 --- a/transmit.py +++ b/transmit.py @@ -461,6 +461,22 @@ if __name__ == "__main__": # card = "Headphones" # default using pcm audio output of Pi Zero card = "Device" # using USB sound card for audio output + query = ["grep", "bookworm", "/etc/os-release"] + try: + result = subprocess.run(query, capture_output=True, text=True, check=True) + print(f"Command run was: {query}") + os_status = result.stdout.strip() + print(f"Output of the command (stdout): {os_status}") + except subprocess.CalledProcessError as e: +# print(f"Command failed with return code: {e.returncode}") + print(f"Command run was: {e.cmd}") + os_status = e.stdout.strip() + print(f"Output of the command (stdout): {e.stdout}") +# print(f"Error output of the command (stderr): {e.stderr}") + if os_status != "bookworm": + os_status = "bullseye" + print (os_status) + query = ["sudo", "systemctl", "is-active", "gpsd.socket"] try: result = subprocess.run(query, capture_output=True, text=True, check=True) From bddc7e9d92b652a936e40bb0e38a2465da19c33a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Feb 2026 09:21:53 -0500 Subject: [PATCH 2/5] Update transmit.py add camera if --- transmit.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/transmit.py b/transmit.py index f4454929..39173317 100644 --- a/transmit.py +++ b/transmit.py @@ -134,11 +134,15 @@ def increment_mode(): def camera_photo(): global cam_fail + global os_status sim_failure_check() system("sudo rm /home/pi/CubeSatSim/camera_out.jpg") stored_image = False try: - system("rpicam-still -o /home/pi/CubeSatSim/camera_out.jpg --width 320 --height 256") # > /dev/null 2>&1") + if os_status == "bookworm": + system("rpicam-still -o /home/pi/CubeSatSim/camera_out.jpg --width 320 --height 256") # > /dev/null 2>&1") + else: + system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") f = open("/home/pi/CubeSatSim/camera_out.jpg") f.close() print("Photo taken") @@ -461,7 +465,7 @@ if __name__ == "__main__": # card = "Headphones" # default using pcm audio output of Pi Zero card = "Device" # using USB sound card for audio output - query = ["grep", "bookworm", "/etc/os-release"] + query = ["grep", "bullseye", "/etc/os-release"] try: result = subprocess.run(query, capture_output=True, text=True, check=True) print(f"Command run was: {query}") @@ -473,8 +477,8 @@ if __name__ == "__main__": os_status = e.stdout.strip() print(f"Output of the command (stdout): {e.stdout}") # print(f"Error output of the command (stderr): {e.stderr}") - if os_status != "bookworm": - os_status = "bullseye" + if os_status != "bullseye": + os_status = "bookworm" print (os_status) query = ["sudo", "systemctl", "is-active", "gpsd.socket"] From 4de06e4868741f5add82ca51cf463294e48deacd Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Feb 2026 09:31:54 -0500 Subject: [PATCH 3/5] Update transmit.py fix camera check --- transmit.py | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/transmit.py b/transmit.py index 39173317..bc7cdf1f 100644 --- a/transmit.py +++ b/transmit.py @@ -178,6 +178,10 @@ def camera_photo(): draw.text((110, 10), telem_string, font=font2, fill='white') # was 120 img.save(file) + return True + else: + return False + print("CubeSatSim v2.2 transmit.py starting...") pd = 21 @@ -682,24 +686,17 @@ if __name__ == "__main__": print("SSTV") # command_control_check() output (ptt, 1) - output(pd, 1) - try: -# from picamera import PiCamera -# from pysstv.sstv import SSTV -# camera = PiCamera() - print("Testing for camera") - system("rpicam-still -o /home/pi/CubeSatSim/camera_out.jpg --width 320 --height 256") - f = open("/home/pi/CubeSatSim/camera_out.jpg") - f.close() - print("Camera present") + output(pd, 1) + + print("Testing for camera") + if camera_photo(): camera_present = 1 -# camera.close() - except: + print("camera present") + else: + camera_present = 0 print("No camera available") print(" -> if camera plugged in, is software enabled?") - camera_present = 0 - -# while 1: + try: output(txLed, txLedOff) except: From 6eca0273c400f7ef6ba8d28153a63b5ffa68823d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Feb 2026 09:40:03 -0500 Subject: [PATCH 4/5] Update transmit.py fix OS test --- transmit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index bc7cdf1f..edb5d9c6 100644 --- a/transmit.py +++ b/transmit.py @@ -481,8 +481,10 @@ if __name__ == "__main__": os_status = e.stdout.strip() print(f"Output of the command (stdout): {e.stdout}") # print(f"Error output of the command (stderr): {e.stderr}") - if os_status != "bullseye": + if os_status != "VERSION_CODENAME=bullseye": os_status = "bookworm" + else: + os_status = "bullseye" print (os_status) query = ["sudo", "systemctl", "is-active", "gpsd.socket"] From 2d95f272e86b7923209b8dc0b720dca7d9e9fdd0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 16 Feb 2026 09:41:52 -0500 Subject: [PATCH 5/5] Update transmit.py fix bullseye test --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index edb5d9c6..9ad167f0 100644 --- a/transmit.py +++ b/transmit.py @@ -469,7 +469,7 @@ if __name__ == "__main__": # card = "Headphones" # default using pcm audio output of Pi Zero card = "Device" # using USB sound card for audio output - query = ["grep", "bullseye", "/etc/os-release"] + query = ["grep", "VERSION_CODENAME=bullseye", "/etc/os-release"] try: result = subprocess.run(query, capture_output=True, text=True, check=True) print(f"Command run was: {query}")