Update rpitx.py

pull/120/head
alanbjohnston 5 years ago committed by GitHub
parent d47c82b0ca
commit 0cd59038cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,9 +3,10 @@
import RPi.GPIO as GPIO
import subprocess
import time
import os
#import os
import sys
# from picamera import PiCamera
from os import system
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
@ -38,7 +39,7 @@ print(callsign)
#GPIO.output(27, 1);
GPIO.output(txLed, txLedOn);
os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat 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")
system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat 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")
#GPIO.output(27, 0);
GPIO.output(txLed, txLedOff);
@ -60,14 +61,15 @@ if __name__ == "__main__":
print("SSTV")
GPIO.output(txLed, txLedOn);
# os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3")
# os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &")
system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &")
while True:
GPIO.output(txLed, txLedOn);
os.system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1")
system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1")
print("Picture taken")
os.system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1")
system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1")
print ("Sending picture")
os.system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1")
system("sudo killall -9 rpitx > /dev/null 2>&1")
system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1")
# try:
# camera = PiCamera()

Loading…
Cancel
Save

Powered by TurnKey Linux.