3_transmit 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #!/bin/bash
  2. source ~/BallonSonde/variables.sh
  3. source ~/BallonSonde/functions.sh
  4. if [ ! -f /ramfs/.canbetx ]; then
  5. echo "Nothing to transmit, wait 5 seconds"
  6. sleep 5
  7. exit 1
  8. fi
  9. rm /ramfs/.canbetx
  10. echo "=> moving totx.wav to out.wav"
  11. mv /ramfs/totx.wav /ramfs/out.wav
  12. # Utile pour couper le TX quand on ctrl+c et que le script n'abouti pas
  13. trap ctrl_c INT
  14. function ctrl_c() {
  15. echo "Ctrl + C happened"
  16. ptt_off
  17. rm -rf /ramfs/*
  18. }
  19. ptt_on
  20. sleep 1
  21. echo " => Playing WAV file"
  22. cd ~/trxamadrmv3_7/linux
  23. ./txwfal 0
  24. sleep 1
  25. ############################
  26. # Partie prez + SSTV
  27. aplay ~/BallonSonde/sound/2025_stpourcain/1_prez.wav
  28. ionice -c 2 -n 0 aplay /ramfs/out.wav
  29. sleep 1
  30. ###########################
  31. # Partie QPSK31
  32. aplay ~/BallonSonde/sound/2025_stpourcain/2_qpsq31.wav
  33. ~/BallonSonde/tx_process/qpsk31
  34. aplay /ramfs/psk.wav
  35. ###########################
  36. # Partie CW super crade
  37. ARGS=$(~/BallonSonde/read_nmea.py | awk '{print $3 $5}' | awk -F'[=,]' '{print "--lat " $2 " --lon " $4}')
  38. QTH=$(~/BallonSonde/qth_locator.py location_to_square $ARGS)
  39. MESSAGE="$INDICATIF-AM $INDICATIF-AM from France
  40. QTH : $QTH
  41. PEACE FOR ALL
  42. "
  43. aplay ~/BallonSonde/sound/2025_stpourcain/3_cw.wav
  44. echo $MESSAGE | /usr/local/bin/cwwav -f 700 -w 22 -o /ramfs/cw.wav; aplay /ramfs/cw.wav; rm /ramfs/cw.wav
  45. ##########################
  46. # Stop Message
  47. aplay ~/BallonSonde/sound/2025_stpourcain/4_stop.wav
  48. ptt_off
  49. ##########################
  50. # un peu de repos pour le transceiver :)
  51. # et ça aide au GPS pour retrouver ses petits.
  52. sleep 30
  53. if [[ -f /ramfs/out.wav ]]; then
  54. echo " => All done, cleaning ramfs"
  55. rm -rf /ramfs/out.wav
  56. fi