add command_tx to aprs

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

@ -176,28 +176,41 @@ if __name__ == "__main__":
print("Packet ready!")
system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1")
system("cat /home/pi/CubeSatSim/t.txt")
output(txLed, txLedOn)
# output(pd, 1)
output (ptt, 0)
sleep(.1)
if (txc):
system("aplay /home/pi/CubeSatSim/telem.wav")
else:
if (debug_mode == 1):
system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/telem.wav | 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:
system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/telem.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 > /dev/null 2>&1")
if (command_tx == True):
output(txLed, txLedOn)
# output(pd, 1)
output (ptt, 0)
sleep(.1)
if (txc):
system("aplay /home/pi/CubeSatSim/telem.wav")
else:
if (debug_mode == 1):
system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/telem.wav | 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:
system("gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/telem.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 > /dev/null 2>&1")
sleep(0.1)
output (ptt, 1)
# output(pd, 0)
output(txLed, txLedOff)
sleep(0.1)
output (ptt, 1)
# output(pd, 0)
output(txLed, txLedOff)
f.close()
system("sudo rm /home/pi/CubeSatSim/ready")
if (debug_mode == 1):
print("Ready for next packet!")
sleep(0.5)
if GPIO.input(squelch) == False:
print("carrier received!")
command_tx = not command_tx
print(command_tx)
if (command_tx == True):
print("Turning on transmit")
system("echo > command_tx True")
else:
if (command_tx == True):
print("Turning off transmit")
system("echo > command_tx False")
except:
sleep(0.5)
elif (mode == 'm'):

Loading…
Cancel
Save

Powered by TurnKey Linux.