3_transmit 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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/2025_stpourcain/1_prez.wav
  26. ionice -c 2 -n 0 aplay /ramfs/out.wav
  27. sleep 1
  28. aplay ~/BallonSonde/sound/2025_stpourcain/2_qpsq31.wav
  29. # Generate the wav file to Tx
  30. /home/pi/BallonSonde/tx_process/qpsk31
  31. # Tx the wav file !
  32. aplay /ramfs/psk.wav
  33. aplay ~/BallonSonde/sound/2025_stpourcain/3_cw.wav
  34. echo "F4KOA-AM F4KOA-AM from France" | /usr/local/bin/cwwav -f 700 -w 20 -o /ramfs/cw.wav
  35. aplay /ramfs/cw.wav; rm /ramfs/cw.wav
  36. # On se passe
  37. #/home/pi/BallonSonde/read_nmea.py | awk '{print $10$3$4$5$6}' | sed -e "s/,/ /g" | sed -e "s/ NS=//g" | sed -e "s/ EW=//g" | sed -e "s/=/ /g" | /usr/local/bin/cwwav -f 700 -w 20 -o /ramfs/cw.wav
  38. # alt 311.7 lat 46.0154466667N lon 1.0988666667E for example...
  39. #aplay /ramfs/cw.wav; rm /ramfs/cw.wav
  40. aplay ~/BallonSonde/sound/2025_stpourcain/4_stop.wav
  41. raspi-gpio set 4 dh
  42. # un peu de repos pour le transceiver :)
  43. # et ça aide au GPS pour retrouver ses petits.
  44. sleep 30
  45. if [[ -f /ramfs/out.wav ]]; then
  46. echo " => All done, cleaning ramfs"
  47. rm -rf /ramfs/out.wav
  48. fi