|
|
|
|
@ -251,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
|
|
|
|
|
@ -263,17 +263,6 @@ if __name__ == "__main__":
|
|
|
|
|
except:
|
|
|
|
|
print("Pi Zero 2 not detected")
|
|
|
|
|
|
|
|
|
|
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")
|
|
|
|
|
@ -281,10 +270,7 @@ if __name__ == "__main__":
|
|
|
|
|
print(up)
|
|
|
|
|
uptime = float(up)
|
|
|
|
|
print(uptime)
|
|
|
|
|
extra = 0
|
|
|
|
|
if (mode == 'f'):
|
|
|
|
|
extra = 15
|
|
|
|
|
if (uptime < (uptime_time + extra)):
|
|
|
|
|
if (uptime < uptime_time):
|
|
|
|
|
print("Uptime < threshold seconds")
|
|
|
|
|
else:
|
|
|
|
|
print("Uptime > threshold seconds")
|
|
|
|
|
@ -295,8 +281,17 @@ if __name__ == "__main__":
|
|
|
|
|
print("Can't open /proc/uptime")
|
|
|
|
|
print(skip)
|
|
|
|
|
|
|
|
|
|
if (mode == 'f'):
|
|
|
|
|
sleep(10) # wait to avoid restart and truncated cw id
|
|
|
|
|
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:
|
|
|
|
|
file = open("/home/pi/CubeSatSim/beacon_off")
|
|
|
|
|
file.close()
|
|
|
|
|
|