|
|
|
@ -326,22 +326,23 @@ if __name__ == "__main__":
|
|
|
|
txr = '144.9000'
|
|
|
|
txr = '144.9000'
|
|
|
|
sim_mode = False
|
|
|
|
sim_mode = False
|
|
|
|
sim_config = False
|
|
|
|
sim_config = False
|
|
|
|
|
|
|
|
hab_mode = False
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
file = open("/home/pi/CubeSatSim/sim.cfg")
|
|
|
|
file = open("/home/pi/CubeSatSim/sim.cfg")
|
|
|
|
# callsign = file.readline().split(" ")[0]
|
|
|
|
# callsign = file.readline().split(" ")[0]
|
|
|
|
config = file.readline().split()
|
|
|
|
config = file.readline().split()
|
|
|
|
callsign = config[0]
|
|
|
|
callsign = config[0]
|
|
|
|
if len(config) > 5:
|
|
|
|
|
|
|
|
sq = config[5]
|
|
|
|
|
|
|
|
if (mode == 'p') or (mode == 'P'):
|
|
|
|
|
|
|
|
sq = 0 # turn off squelch for Pacsat
|
|
|
|
|
|
|
|
print(sq)
|
|
|
|
|
|
|
|
if len(config) > 4:
|
|
|
|
if len(config) > 4:
|
|
|
|
if config[4] == 'y' or config[4] == 'yes':
|
|
|
|
if config[4] == 'y' or config[4] == 'yes':
|
|
|
|
sim_mode = True
|
|
|
|
sim_mode = True
|
|
|
|
sim_config = True
|
|
|
|
sim_config = True
|
|
|
|
print("Simulated telemetry mode is configured.")
|
|
|
|
print("Simulated telemetry mode is configured.")
|
|
|
|
|
|
|
|
if len(config) > 5:
|
|
|
|
|
|
|
|
sq = config[5]
|
|
|
|
|
|
|
|
if (mode == 'p') or (mode == 'P'):
|
|
|
|
|
|
|
|
sq = 0 # turn off squelch for Pacsat
|
|
|
|
|
|
|
|
print(sq)
|
|
|
|
if len(config) > 6:
|
|
|
|
if len(config) > 6:
|
|
|
|
txf = float(config[6])
|
|
|
|
txf = float(config[6])
|
|
|
|
if (mode == 'e'):
|
|
|
|
if (mode == 'e'):
|
|
|
|
@ -356,6 +357,10 @@ if __name__ == "__main__":
|
|
|
|
# print( "{:.4f}".format(rxf))
|
|
|
|
# print( "{:.4f}".format(rxf))
|
|
|
|
rx = "{:.4f}".format(rxf)
|
|
|
|
rx = "{:.4f}".format(rxf)
|
|
|
|
print(rx)
|
|
|
|
print(rx)
|
|
|
|
|
|
|
|
if len(config) > 8:
|
|
|
|
|
|
|
|
if config[8] == 'y' or config[8] == 'yes':
|
|
|
|
|
|
|
|
hab_mode = True
|
|
|
|
|
|
|
|
print("Balloon (HAB) mode is configured.")
|
|
|
|
if len(config) > 9:
|
|
|
|
if len(config) > 9:
|
|
|
|
rxpl = float(config[9])
|
|
|
|
rxpl = float(config[9])
|
|
|
|
# print(rxpl)
|
|
|
|
# print(rxpl)
|
|
|
|
@ -455,6 +460,7 @@ if __name__ == "__main__":
|
|
|
|
system("sudo systemctl restart gpsd.socket")
|
|
|
|
system("sudo systemctl restart gpsd.socket")
|
|
|
|
|
|
|
|
|
|
|
|
sim_failure_check()
|
|
|
|
sim_failure_check()
|
|
|
|
|
|
|
|
if (hab_mode == True) and (mode == 'a'):
|
|
|
|
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
|
|
|
|
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
|
|
|
|
GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4
|
|
|
|
GPIO.setup(txLed, GPIO.OUT)
|
|
|
|
GPIO.setup(txLed, GPIO.OUT)
|
|
|
|
@ -474,9 +480,10 @@ if __name__ == "__main__":
|
|
|
|
sleep(1)
|
|
|
|
sleep(1)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
print("Don't transmit CW ID since command_tx is False or APRS mode or change of mode")
|
|
|
|
print("Don't transmit CW ID since command_tx is False or APRS mode or change of mode")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
print("Don't transmit CW ID since APRS HAB mode is active")
|
|
|
|
|
|
|
|
|
|
|
|
if (transmit):
|
|
|
|
if (transmit):
|
|
|
|
|
|
|
|
|
|
|
|
# print 'Length: ', len(sys.argv)
|
|
|
|
# print 'Length: ', len(sys.argv)
|
|
|
|
|
|
|
|
|
|
|
|
# if (len(sys.argv)) > 1:
|
|
|
|
# if (len(sys.argv)) > 1:
|
|
|
|
|