Update transmit.py add log messages

master-bf
Alan Johnston 2 days ago committed by GitHub
parent 7515fe6b09
commit c3b9f59206
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -223,7 +223,7 @@ def program_fm(rx, tx, rxpl_value, sq, txpl_value):
global gpsd_status global gpsd_status
global pd global pd
global ptt global ptt
global force_rpitx global two_meter_rpitx
global txc global txc
global restore_txc global restore_txc
@ -236,20 +236,23 @@ def program_fm(rx, tx, rxpl_value, sq, txpl_value):
if (txf > 144.0) and (txf < 148.0): if (txf > 144.0) and (txf < 148.0):
two_meter_rpitx = True two_meter_rpitx = True
print("Transmitting in 2m band using rptix")
if (txc): if (txc):
restore_txc = True restore_txc = True
print("Restore FM with 70cm band")
txc = False txc = False
tx = "434.9000" tx = "434.9000"
elif (two_meter_rpitx): elif (two_meter_rpitx):
two_meter_rpitx = False two_meter_rpitx = False
print("Stop transmitting in 2m bacnd using rptix")
if (restore_txc): if (restore_txc):
txc = True txc = True
restore_txc = False restore_txc = False
print("Restore FM with 70cm band")
if (txf > 450.0) or (txf < 420.0) and not two_meter_rpitx: if (txf > 450.0) or (txf < 420.0) and not two_meter_rpitx:
tx = "434.9000" tx = "434.9000"
print("Transmit frequency out of FM bounds") print("Transmit frequency out of 70cm band")
if (rxf > 450.0) or (rxf < 420.0): if (rxf > 450.0) or (rxf < 420.0):
rx = "435.0000" rx = "435.0000"
@ -268,13 +271,15 @@ def program_fm(rx, tx, rxpl_value, sq, txpl_value):
sleep(0.1) sleep(0.1)
ser.close() ser.close()
ser = serial.Serial("/dev/ttyAMA0", 115200) # reset back to 115200 for cubesatsim code for payload sensor data ser = serial.Serial("/dev/ttyAMA0", 115200) # reset back to 115200 for cubesatsim code for payload sensor data
except: except Exception as e:
print(f"An error occurred: {e}")
print("Error in serial write") print("Error in serial write")
# output(pd, 0) # Don't turn off receiver # output(pd, 0) # Don't turn off receiver
if (gpsd_status == "active"): if (gpsd_status == "active"):
print("Restarting gpsd.socket") print("Restarting gpsd.socket")
system("sudo systemctl restart gpsd.socket") system("sudo systemctl restart gpsd.socket")
except: except Exception as e:
print(f"An error occurred: {e}")
print("program_fm failed") print("program_fm failed")
def start_repeater(tx_doppler_freq_hz): def start_repeater(tx_doppler_freq_hz):

Loading…
Cancel
Save

Powered by TurnKey Linux.