3_transmit 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. if [[ $HAVE_GPS = 1 ]]
  38. then
  39. ARGS=$(~/BallonSonde/read_nmea.py | awk '{print $3 $5}' | awk -F'[=,]' '{print "--lat " $2 " --lon " $4}')
  40. QTH=$(~/BallonSonde/qth_locator.py location_to_square $ARGS)
  41. fi
  42. MESSAGE="$INDICATIF-AM $INDICATIF-AM from France
  43. QTH : $QTH
  44. PEACE FOR ALL
  45. "
  46. aplay ~/BallonSonde/sound/2025_stpourcain/3_cw.wav
  47. echo $MESSAGE | /usr/local/bin/cwwav -f 700 -w 22 -o /ramfs/cw.wav; aplay /ramfs/cw.wav; rm /ramfs/cw.wav
  48. ##########################
  49. # Stop Message
  50. aplay ~/BallonSonde/sound/2025_stpourcain/4_stop.wav
  51. ptt_off
  52. ##########################
  53. # un peu de repos pour le transceiver :)
  54. # et ça aide au GPS pour retrouver ses petits.
  55. sleep 30
  56. if [[ -f /ramfs/out.wav ]]; then
  57. echo " => All done, cleaning ramfs"
  58. rm -rf /ramfs/out.wav
  59. fi