3_transmit 799 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. if [ ! -f /ramfs/.canbetx ]; then
  3. echo "Nothing to transmit, wait 5 seconds"
  4. sleep 5
  5. exit 1
  6. fi
  7. rm /ramfs/.canbetx
  8. echo "=> moving totx.wav to out.wav"
  9. mv /ramfs/totx.wav /ramfs/out.wav
  10. # Utile pour couper le TX quand on ctrl+c et que le script n'abouti pas
  11. trap ctrl_c INT
  12. function ctrl_c() {
  13. echo "Ctrl + C happened"
  14. raspi-gpio set 4 dh
  15. rm -rf /ramfs/*
  16. }
  17. # Setup the GPIO4 as output for Tx
  18. raspi-gpio set 4 op && raspi-gpio set 4 dh
  19. raspi-gpio set 4 dl
  20. sleep 1
  21. echo " => Playing WAV file"
  22. cd ~/trxamadrmv3_7/linux
  23. ./txwfal 0
  24. sleep 1
  25. aplay ~/BallonSonde/sound/annonce_start.wav
  26. sleep 1
  27. aplay /ramfs/out.wav
  28. aplay ~/BallonSonde/sound/annonce_stop.wav
  29. raspi-gpio set 4 dh
  30. if [[ -f /ramfs/out.wav ]]; then
  31. echo " => All done, cleaning ramfs"
  32. rm -rf /ramfs/out.wav
  33. fi