Use command_tx to transmit and reboot

fm-rx
Alan Johnston 2 years ago committed by GitHub
parent b5294aa2a2
commit a5886110aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -132,7 +132,7 @@ if __name__ == "__main__":
system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1") system("echo 'hi hi de " + callsign + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1")
# if (mode != 'a'): # if (mode != 'a'):
if True: if (command_tx == True):
output(pd, 1) output(pd, 1)
output (ptt, 0) output (ptt, 0)
output(txLed, txLedOn) output(txLed, txLedOn)
@ -152,7 +152,7 @@ if __name__ == "__main__":
output(pd, 0) output(pd, 0)
sleep(1) sleep(1)
else: else:
print("Don't transmit CW ID for APRS") print("Don't transmit CW ID since command_tx is False")
if (transmit): if (transmit):
@ -403,8 +403,9 @@ if __name__ == "__main__":
print("FSK") print("FSK")
print("turn on FM rx") print("turn on FM rx")
output(pd, 1) output(pd, 1)
output(ptt, 1) output(ptt, 1)
system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 &") if (command_tx == True):
system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 &")
print("Turning LED on/off and listening for carrier") print("Turning LED on/off and listening for carrier")
while 1: while 1:
output(txLed, txLedOff) output(txLed, txLedOff)
@ -412,8 +413,18 @@ if __name__ == "__main__":
if GPIO.input(squelch) == False: if GPIO.input(squelch) == False:
print("carrier received!") print("carrier received!")
command_tx = not command_tx command_tx = not command_tx
print(command_tx) print(command_tx)
output(txLed, txLedOn) if (command_tx == True):
print("Turning on transmit")
system("echo > command_tx True")
system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 &")
else:
print("Turning of transmit and rebooting")
system("echo > command_tx False")
system("sudo reboot now")
sleep(60)
if (command_tx == True):
output(txLed, txLedOn)
sleep(4.0) sleep(4.0)
else: else:
print("No Low Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") print("No Low Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.")

Loading…
Cancel
Save

Powered by TurnKey Linux.