3_transmit 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. ############################
  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. /home/pi/BallonSonde/tx_process/qpsk31
  34. aplay /ramfs/psk.wav
  35. ###########################
  36. # Partie CW super crade
  37. ARGS=$(/home/pi/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="F4KOA-AM F4KOA-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. # On coupe le TX
  49. raspi-gpio set 4 dh
  50. ##########################
  51. # un peu de repos pour le transceiver :)
  52. # et ça aide au GPS pour retrouver ses petits.
  53. sleep 30
  54. if [[ -f /ramfs/out.wav ]]; then
  55. echo " => All done, cleaning ramfs"
  56. rm -rf /ramfs/out.wav
  57. fi