3_transmit 1.7 KB

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