Update transmit.py try twice and return if failed

master-b3
Alan Johnston 1 month ago committed by GitHub
parent 973c40a10f
commit 348795b429
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -360,29 +360,40 @@ def update_doppler(fm="yes"):
with open("/home/pi/CubeSatSim/frequency.txt", "r") as file: with open("/home/pi/CubeSatSim/frequency.txt", "r") as file:
frequencies = file.read().split() frequencies = file.read().split()
except Exception as e: except Exception as e:
print(f"An error 3 occurred: {e}") print(f"An error 1 occurred: {e}")
print("reading frequency.txt failed") print("reading file frequency.txt failed")
if frequencies is None: try:
tx_frequency = int(frequencies[0])
rx_frequency = int(frequencies[1])
except Exception as e:
print(f"An error 2 occurred: {e}")
print("reading frequency.txt failed")
sleep(0.1) sleep(0.1)
try: try:
with open("/home/pi/CubeSatSim/frequency.txt", "r") as file: with open("/home/pi/CubeSatSim/frequency.txt", "r") as file:
frequencies = file.read().split() frequencies = file.read().split()
except Exception as e:
print(f"An error 3 occurred: {e}")
print("reading file frequency.txt failed")
try:
tx_frequency = int(frequencies[0])
rx_frequency = int(frequencies[1])
except Exception as e: except Exception as e:
print(f"An error 4 occurred: {e}") print(f"An error 4 occurred: {e}")
print("reading frequency.txt failed") print("reading frequency.txt failed")
return
if (len(frequencies) > 0): # if (len(frequencies) > 0):
tx_frequency = int(frequencies[0]) # tx_frequency = int(frequencies[0])
else: # else:
print("error 1 in reading frequency.txt") # print("error 1 in reading frequency.txt")
print(frequencies) # print(frequencies)
tx_frequency = 434900000 # tx_frequency = 434900000
if (len(frequencies) > 1): # if (len(frequencies) > 1):
rx_frequency = int(frequencies[1]) # Not used right now as FT857 emulation only updates transmit frequency # rx_frequency = int(frequencies[1]) # Not used right now as FT857 emulation only updates transmit frequency
else: # else:
print("error 2 in reading frequency.txt") # print("error 2 in reading frequency.txt")
print(frequencies) # print(frequencies)
rx_frequency = 435000000 # rx_frequency = 435000000
## print(f"New TX Frequency: {tx_frequency}, new RX Frequency: {rx_frequency}") ## print(f"New TX Frequency: {tx_frequency}, new RX Frequency: {rx_frequency}")
if rigctl: if rigctl:

Loading…
Cancel
Save

Powered by TurnKey Linux.