From 0d80dbdd9ee37187a1d527bc1e11dd5a2f17d6c2 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 30 Jul 2023 14:32:18 -0400 Subject: [PATCH] read status from command_tx --- rpitx.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index e23c4ca1..c9bc9699 100644 --- a/rpitx.py +++ b/rpitx.py @@ -16,7 +16,7 @@ ptt = 20 txc = 7 squelch = 6 -command_tx = True +# command_tx = True GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) @@ -102,6 +102,16 @@ if __name__ == "__main__": print("Mode is: ") print(mode) + try: + file = open("/home/pi/CubeSatSim/command_tx") + command_tx = file.readline().split(" ")[0] + except: + command_tx = True + if (debug_mode == 1): + print("Can't open command_tx file, defaulting to True") + print("Command_tx: ") + print(command_tx) + try: file = open("/home/pi/CubeSatSim/sim.cfg") callsign = file.readline().split(" ")[0]