3_transmit 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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/2024_aubusson/1_presentation.wav
  26. sleep 1
  27. aplay ~/BallonSonde/sound/2024_aubusson/2_tx_sstv.wav
  28. ionice -c 2 -n 0 aplay /ramfs/out.wav
  29. sleep 1
  30. aplay ~/BallonSonde/sound/2024_aubusson/2_tx_qpsk.wav
  31. # Generate the wav file to Tx
  32. /home/pi/BallonSonde/tx_process/qpsk31
  33. # Tx the wav file !
  34. aplay /ramfs/psk.wav
  35. aplay ~/BallonSonde/sound/2024_aubusson/3_tx_cw.wav
  36. echo "F4KOA-AM F4KOA-AM from France" | /usr/local/bin/cwwav -f 700 -w 20 -o /ramfs/cw.wav
  37. aplay /ramfs/cw.wav; rm /ramfs/cw.wav
  38. /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
  39. # alt 311.7 lat 46.0154466667N lon 1.0988666667E for example...
  40. aplay /ramfs/cw.wav; rm /ramfs/cw.wav
  41. aplay ~/BallonSonde/sound/2024_aubusson/9_stop_en.wav
  42. aplay ~/BallonSonde/sound/2024_aubusson/9_stop_fr.wav
  43. raspi-gpio set 4 dh
  44. if [[ -f /ramfs/out.wav ]]; then
  45. echo " => All done, cleaning ramfs"
  46. rm -rf /ramfs/out.wav
  47. fi