3_transmit 873 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # Utile pour couper le TX quand on ctrl+c et que le script n'abouti pas
  3. trap ctrl_c INT
  4. function ctrl_c() {
  5. echo "Ctrl + C happened"
  6. raspi-gpio set 4 dh
  7. rm -rf /ramfs/*
  8. }
  9. # Setup the GPIO4 as output for Tx
  10. raspi-gpio set 4 op && raspi-gpio set 4 dh
  11. IMG=$(cd /ramfs; find ./ -type f -name *.jpg -exec readlink -f {} \;)
  12. #############
  13. # Mode SSTV
  14. echo " => Converting image to WAV..."
  15. cd ~/PySSTV/
  16. source bin/activate
  17. python -m pysstv --mode PD120 $IMG /ramfs/out.wav
  18. deactivate
  19. raspi-gpio set 4 dl
  20. sleep 1
  21. echo " => Playing WAV file"
  22. # TXT_TO_WFALL
  23. cd ~/trxamadrmv3_7/linux
  24. ./txwfal 0
  25. sleep 1
  26. espeak "Radio station S S T V"
  27. sleep 1
  28. aplay /ramfs/out.wav
  29. raspi-gpio set 4 dh
  30. espeak "End of transmission"
  31. #############
  32. # Mode DRM
  33. #cd ~/trxamadrmv3_7/linux/
  34. #(./drm $IMG; raspi-gpio set 4 dh)
  35. echo " => All done, cleaning ramfs"
  36. rm -rf /ramfs/*