3_transmit 885 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. aplay ~/BallonSonde/annonce_start.wav
  27. sleep 1
  28. aplay /ramfs/out.wav
  29. aplay ~/BallonSonde/annonce_stop.wav
  30. raspi-gpio set 4 dh
  31. #############
  32. # Mode DRM
  33. #cd ~/trxamadrmv3_7/linux/
  34. #./drm $IMG
  35. #raspi-gpio set 4 dh
  36. echo " => All done, cleaning ramfs"
  37. rm -rf /ramfs/*