Update rpitx.py fix system call

sr-frs-rx-mode
Alan Johnston 2 years ago committed by GitHub
parent 9fad1ac330
commit 439493a3af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,14 +26,15 @@ def increment_mode():
# count_string = str(command_count) # count_string = str(command_count)
file.write(mode) file.write(mode)
file.close() file.close()
print(".mode file written")
GPIO.setwarnings(False) GPIO.setwarnings(False)
GPIO.output(txLed, 0) GPIO.output(txLed, 0)
print("sudo reboot -h now") print("sudo reboot -h now")
GPIO.setwarnings(False) GPIO.setwarnings(False)
GPIO.setup(16, GPIO.OUT) GPIO.setup(16, GPIO.OUT)
GPIO.output(16, 0); GPIO.output(16, 0);
subprocess.call(['reboot', '-h', 'now'], shell=False) system("reboot -h now")
# release = True; # release = True;
time.sleep(10); time.sleep(10);
except: except:
@ -47,7 +48,7 @@ from RPi.GPIO import output
from time import sleep from time import sleep
#import os #import os
import sys import sys
from os import system from os import
from PIL import Image, ImageDraw, ImageFont, ImageColor from PIL import Image, ImageDraw, ImageFont, ImageColor
print("CubeSatSim v1.3b rpitx.py starting...") print("CubeSatSim v1.3b rpitx.py starting...")
@ -187,7 +188,7 @@ if __name__ == "__main__":
sleep(1) sleep(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") ("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 (command_tx == True): if (command_tx == True):
@ -197,10 +198,10 @@ if __name__ == "__main__":
sleep(0.1) sleep(0.1)
if (txc): if (txc):
system("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav") ("aplay -D hw:CARD=Headphones,DEV=0 /home/pi/CubeSatSim/morse.wav")
else: else:
if (debug_mode == 1): if (debug_mode == 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 && 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 434.9e3") ("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 && 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 434.9e3")
else: else:
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 && 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 434.9e3 > /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 && 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 434.9e3 > /dev/null 2>&1")

Loading…
Cancel
Save

Powered by TurnKey Linux.