|
|
|
@ -47,20 +47,22 @@ if __name__ == "__main__":
|
|
|
|
change_mode = True
|
|
|
|
change_mode = True
|
|
|
|
if ((line.find("MODE=o")) > 0) or ((line.find("DTMF>APDW15:t10#")) > 0):
|
|
|
|
if ((line.find("MODE=o")) > 0) or ((line.find("DTMF>APDW15:t10#")) > 0):
|
|
|
|
system("echo '\nBeacon Mode toggle!!\n'")
|
|
|
|
system("echo '\nBeacon Mode toggle!!\n'")
|
|
|
|
try:
|
|
|
|
mode = 'o'
|
|
|
|
fm = open("/home/pi/CubeSatSim/beacon_off")
|
|
|
|
change_mode = True
|
|
|
|
fm.close()
|
|
|
|
# try:
|
|
|
|
system("echo 'Beacon is off, turning it ON'")
|
|
|
|
# fm = open("/home/pi/CubeSatSim/beacon_off")
|
|
|
|
system("sudo rm /home/pi/CubeSatSim/beacon_off > /dev/null 2>&1")
|
|
|
|
# fm.close()
|
|
|
|
except:
|
|
|
|
# system("echo 'Beacon is off, turning it ON'")
|
|
|
|
system("echo 'Beacon is on, turning it OFF'")
|
|
|
|
# system("sudo rm /home/pi/CubeSatSim/beacon_off > /dev/null 2>&1")
|
|
|
|
system("touch /home/pi/CubeSatSim/beacon_off")
|
|
|
|
# except:
|
|
|
|
|
|
|
|
# system("echo 'Beacon is on, turning it OFF'")
|
|
|
|
system("echo 'Restarting rpitx'")
|
|
|
|
# system("touch /home/pi/CubeSatSim/beacon_off")
|
|
|
|
system("sudo systemctl restart rpitx")
|
|
|
|
#
|
|
|
|
# system("echo 'Resuming rpitx'")
|
|
|
|
# system("echo 'Restarting rpitx'")
|
|
|
|
# system("sudo python3 -u /home/pi/CubeSatSim/rpitx.py s & > /dev/null 2>&1")
|
|
|
|
# system("sudo systemctl restart rpitx")
|
|
|
|
change_mode = False
|
|
|
|
## system("echo 'Resuming rpitx'")
|
|
|
|
|
|
|
|
## system("sudo python3 -u /home/pi/CubeSatSim/rpitx.py s & > /dev/null 2>&1")
|
|
|
|
|
|
|
|
# change_mode = False
|
|
|
|
if (debug_mode == False) and (change_mode == True):
|
|
|
|
if (debug_mode == False) and (change_mode == True):
|
|
|
|
GPIO.setmode(GPIO.BCM)
|
|
|
|
GPIO.setmode(GPIO.BCM)
|
|
|
|
GPIO.setwarnings(False)
|
|
|
|
GPIO.setwarnings(False)
|
|
|
|
|