#!/bin/bash if [ ! -f /ramfs/.canbetx ]; then echo "Nothing to transmit, wait 5 seconds" sleep 5 exit 1 fi rm /ramfs/.canbetx echo "=> moving totx.wav to out.wav" mv /ramfs/totx.wav /ramfs/out.wav # Utile pour couper le TX quand on ctrl+c et que le script n'abouti pas trap ctrl_c INT function ctrl_c() { echo "Ctrl + C happened" raspi-gpio set 4 dh rm -rf /ramfs/* } # Setup the GPIO4 as output for Tx raspi-gpio set 4 op && raspi-gpio set 4 dh raspi-gpio set 4 dl sleep 1 echo " => Playing WAV file" cd ~/trxamadrmv3_7/linux ./txwfal 0 sleep 1 ############################ # Partie prez + SSTV aplay ~/BallonSonde/sound/2025_stpourcain/1_prez.wav ionice -c 2 -n 0 aplay /ramfs/out.wav sleep 1 ########################### # Partie QPSK31 aplay ~/BallonSonde/sound/2025_stpourcain/2_qpsq31.wav /home/pi/BallonSonde/tx_process/qpsk31 aplay /ramfs/psk.wav ########################### # Partie CW super crade ARGS=$(/home/pi/BallonSonde/read_nmea.py | awk '{print $3 $5}' | awk -F'[=,]' '{print "--lat " $2 " --lon " $4}') QTH=$(~/BallonSonde/qth_locator.py location_to_square $ARGS) MESSAGE="F4KOA-AM F4KOA-AM from France QTH : $QTH PEACE FOR ALL " aplay ~/BallonSonde/sound/2025_stpourcain/3_cw.wav echo $MESSAGE | /usr/local/bin/cwwav -f 700 -w 22 -o /ramfs/cw.wav; aplay /ramfs/cw.wav; rm /ramfs/cw.wav ########################## # Stop Message aplay ~/BallonSonde/sound/2025_stpourcain/4_stop.wav # On coupe le TX raspi-gpio set 4 dh ########################## # un peu de repos pour le transceiver :) # et ça aide au GPS pour retrouver ses petits. sleep 30 if [[ -f /ramfs/out.wav ]]; then echo " => All done, cleaning ramfs" rm -rf /ramfs/out.wav fi