|
|
|
|
@ -228,8 +228,6 @@ output(txLed, txLedOn)
|
|
|
|
|
sleep(1)
|
|
|
|
|
output(txLed, txLedOff)
|
|
|
|
|
|
|
|
|
|
sleep(10) # to fix FSK no CW ID
|
|
|
|
|
|
|
|
|
|
battery_saver_check()
|
|
|
|
|
|
|
|
|
|
# print(txLedOn)
|
|
|
|
|
@ -253,7 +251,7 @@ if __name__ == "__main__":
|
|
|
|
|
elif (('s' == sys.argv[1]) or ('-s' in sys.argv[1])):
|
|
|
|
|
skip = True
|
|
|
|
|
print("Skipping delay and CW ID")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(transmit)
|
|
|
|
|
|
|
|
|
|
uptime_time = 45 # 45 second boot time if Pi Zero
|
|
|
|
|
@ -265,14 +263,28 @@ if __name__ == "__main__":
|
|
|
|
|
except:
|
|
|
|
|
print("Pi Zero 2 not detected")
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
if ( mode == "y"):
|
|
|
|
|
try:
|
|
|
|
|
file = open("/home/pi/CubeSatSim/.mode")
|
|
|
|
|
mode = file.read(1)
|
|
|
|
|
except:
|
|
|
|
|
mode = "f"
|
|
|
|
|
if (debug_mode == 1):
|
|
|
|
|
print("Can't open .mode file, defaulting to FSK")
|
|
|
|
|
print("Mode is: ")
|
|
|
|
|
print(mode)
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
system("cat /proc/uptime > /home/pi/CubeSatSim/uptime")
|
|
|
|
|
file = open("/home/pi/CubeSatSim/uptime")
|
|
|
|
|
up = file.read().split(" ")[0]
|
|
|
|
|
print(up)
|
|
|
|
|
uptime = float(up)
|
|
|
|
|
print(uptime)
|
|
|
|
|
if (uptime < uptime_time):
|
|
|
|
|
extra = 0
|
|
|
|
|
if (mode == 'f')
|
|
|
|
|
extra = 15
|
|
|
|
|
if (uptime < (uptime_time + extra)):
|
|
|
|
|
print("Uptime < threshold seconds")
|
|
|
|
|
else:
|
|
|
|
|
print("Uptime > threshold seconds")
|
|
|
|
|
@ -283,17 +295,8 @@ if __name__ == "__main__":
|
|
|
|
|
print("Can't open /proc/uptime")
|
|
|
|
|
print(skip)
|
|
|
|
|
|
|
|
|
|
if ( mode == "y"):
|
|
|
|
|
try:
|
|
|
|
|
file = open("/home/pi/CubeSatSim/.mode")
|
|
|
|
|
mode = file.read(1)
|
|
|
|
|
except:
|
|
|
|
|
mode = "f"
|
|
|
|
|
if (debug_mode == 1):
|
|
|
|
|
print("Can't open .mode file, defaulting to FSK")
|
|
|
|
|
print("Mode is: ")
|
|
|
|
|
print(mode)
|
|
|
|
|
|
|
|
|
|
if (mode == 'f')
|
|
|
|
|
sleep(10) # wait to avoid restart and truncated cw id
|
|
|
|
|
try:
|
|
|
|
|
file = open("/home/pi/CubeSatSim/beacon_off")
|
|
|
|
|
file.close()
|
|
|
|
|
|