|
|
|
@ -613,6 +613,39 @@ morse_table = [ # 0-9, A-Z only by (ASCII - 48)
|
|
|
|
[ 3, 3, 1, 1, 0, 0 ] # Z
|
|
|
|
[ 3, 3, 1, 1, 0, 0 ] # Z
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cw_transmit_id_fm():
|
|
|
|
|
|
|
|
global txLed
|
|
|
|
|
|
|
|
global no_command
|
|
|
|
|
|
|
|
global debug_mode
|
|
|
|
|
|
|
|
global sim_mode
|
|
|
|
|
|
|
|
global callsign
|
|
|
|
|
|
|
|
global tx
|
|
|
|
|
|
|
|
global txr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
output(txLed, 1)
|
|
|
|
|
|
|
|
print("Transmit CW ID")
|
|
|
|
|
|
|
|
status = ""
|
|
|
|
|
|
|
|
if not no_command:
|
|
|
|
|
|
|
|
status = status + " C"
|
|
|
|
|
|
|
|
if sim_mode:
|
|
|
|
|
|
|
|
status = status + " S"
|
|
|
|
|
|
|
|
if (mode != 'e'):
|
|
|
|
|
|
|
|
if (debug_mode == 1):
|
|
|
|
|
|
|
|
system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
if (debug_mode == 1):
|
|
|
|
|
|
|
|
system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + txr + "e3")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + txr + "e3 > /dev/null 2>&1")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output(txLed, 0)
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
|
|
|
|
print(f"An error occurred: {e}")
|
|
|
|
|
|
|
|
print("cw_transmit_id_fm failed")
|
|
|
|
|
|
|
|
|
|
|
|
def cw_transmit_string(string):
|
|
|
|
def cw_transmit_string(string):
|
|
|
|
global morse_timing
|
|
|
|
global morse_timing
|
|
|
|
for character in string:
|
|
|
|
for character in string:
|
|
|
|
@ -979,25 +1012,26 @@ if __name__ == "__main__":
|
|
|
|
print("Don't transmit CW ID since APRS HAB mode is active")
|
|
|
|
print("Don't transmit CW ID since APRS HAB mode is active")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if (((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'j') or (mode == 'p') or (mode == 'P')) and (command_tx == True) and (skip == False)) or ((mode == 'e') and (command_tx == True)): # battery_saver_mode
|
|
|
|
if (((mode == 'a') or (mode == 'b') or (mode == 'f') or (mode == 's') or (mode == 'j') or (mode == 'p') or (mode == 'P')) and (command_tx == True) and (skip == False)) or ((mode == 'e') and (command_tx == True)): # battery_saver_mode
|
|
|
|
output(txLed, 1)
|
|
|
|
cw_transmit_id_fm()
|
|
|
|
print("Transmit CW ID")
|
|
|
|
# output(txLed, 1)
|
|
|
|
status = ""
|
|
|
|
# print("Transmit CW ID")
|
|
|
|
if not no_command:
|
|
|
|
# status = ""
|
|
|
|
status = status + " C"
|
|
|
|
# if not no_command:
|
|
|
|
if sim_mode:
|
|
|
|
# status = status + " C"
|
|
|
|
status = status + " S"
|
|
|
|
# if sim_mode:
|
|
|
|
if (mode != 'e'):
|
|
|
|
# status = status + " S"
|
|
|
|
if (debug_mode == 1):
|
|
|
|
# if (mode != 'e'):
|
|
|
|
system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3")
|
|
|
|
# if (debug_mode == 1):
|
|
|
|
else:
|
|
|
|
# system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3")
|
|
|
|
system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1")
|
|
|
|
# else:
|
|
|
|
else:
|
|
|
|
# system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1")
|
|
|
|
if (debug_mode == 1):
|
|
|
|
# else:
|
|
|
|
system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + txr + "e3")
|
|
|
|
# if (debug_mode == 1):
|
|
|
|
else:
|
|
|
|
# system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + txr + "e3")
|
|
|
|
system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + txr + "e3 > /dev/null 2>&1")
|
|
|
|
# else:
|
|
|
|
|
|
|
|
# system("echo 'hi hi de " + callsign + status + "' > id.txt && gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f " + txr + "e3 > /dev/null 2>&1")
|
|
|
|
output(txLed, 0)
|
|
|
|
#
|
|
|
|
|
|
|
|
# output(txLed, 0)
|
|
|
|
|
|
|
|
|
|
|
|
sleep(1)
|
|
|
|
sleep(1)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
@ -1456,6 +1490,7 @@ if __name__ == "__main__":
|
|
|
|
print("Ready to detect carrier")
|
|
|
|
print("Ready to detect carrier")
|
|
|
|
if (doppler_mode):
|
|
|
|
if (doppler_mode):
|
|
|
|
update_doppler()
|
|
|
|
update_doppler()
|
|
|
|
|
|
|
|
cw_transmit_id_fm()
|
|
|
|
start_time = time.perf_counter()
|
|
|
|
start_time = time.perf_counter()
|
|
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
while True:
|
|
|
|
|