#!/bin/bash' # auto-wspr by IZ7SLZ sept 2017 for LF . includes wspr-15 # impostazioni del ricevitore JRC: dial 136.0 kHz, USB, BW 3 kHz, AGC OFF, GAIN 6 function update_log { cat WSPROLD.TXT > tmp1 echo $(date -R -u) > data.txt cat wspr_spots.txt tmp1 > WSPROLD.TXT cat data.txt header2 WSPROLD.TXT > WSPRDECODED_LF.TXT rm tmp1 } function process_wspr2 { echo echo $TIMESLOT $FILENAME processing.... echo '==============================================================' vtread -v -T $TIMESLOT,+145 /media/iz7slz/Storage/LF | #read raw audio from storage hd 30s early vtfilter -v -h bp,f=1500,w=3000 | #apply filter before NB vtblank -v -a18 -d0 -t300 | # Noise Blanker ###vtresample -v -r 12000 | # requirement for wspr vtcat -v -T $TIMESLOT -S30 | #buffer starts 30s after vtraw -ow > $FILENAME #create wav file echo '' sleep 10 #wait 10 seconds for wav file to be closed wsprd $FILENAME -f 0.136 -w -d -v #wspr decode using wav file rm $FILENAME #delete the wave file update_log ## ./uploadwspr # call to upload on wsprnet.org DONE=0 } function process_wspr15 { echo echo $TIMESLOT $FILENAME processing.... echo '==============================================================' vtread -v -T $TIMESLOT,+925 /media/iz7slz/Storage/LF | #read raw audio from storage hd 30s early vtfilter -v -h bp,f=1500,w=3000 | #apply filter before NB vtblank -v -a19 -d0 -t300 | # excellent Noise Blanker ###vtresample -v -r 12000 | # wspr vtcat -v -T $TIMESLOT -S30 | #buffer starts 30s after vtraw -ow > $FILENAME'0' #create wav file echo '' sleep 10 #wait 5 seconds for wav file to be closed wsprd $FILENAME'0' -f 0.136 -d -w -v -m #wspr 15 decode using wav file rm $FILENAME'0' #delete the wave file update_log #./uploadwspr DONE=0 } #### main DONE=0 clear while DONE=0; do MINUTO=$(date +%M):$(date +%S) if [ $MINUTO = "59:55" -a $DONE = 0 ]; then #wspr15 DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):44:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)45.wav process_wspr15 elif [ $MINUTO = "01:55" -a $DONE = 0 ]; then DONE=1 #$date --date='1 hour ago' TIMESLOT=$(date -u --date='1 hour ago' +%F)_$(date -u --date='1 hour ago' +%H):59:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)00.wav process_wspr2 elif [ $MINUTO = "03:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):01:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)02.wav process_wspr2 elif [ $MINUTO = "05:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):03:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)04.wav process_wspr2 elif [ $MINUTO = "07:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):05:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)06.wav process_wspr2 elif [ $MINUTO = "09:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):07:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)08.wav process_wspr2 elif [ $MINUTO = "11:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):09:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)10.wav process_wspr2 elif [ $MINUTO = "13:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):11:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)12.wav process_wspr2 elif [ $MINUTO = "14:55" -a $DONE = 0 ]; then #wspr15 DONE=1 TIMESLOT=$(date -u --date='1 hour ago' +%F)_$(date -u --date='1 hour ago' +%H):59:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)00.wav process_wspr15 elif [ $MINUTO = "15:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):13:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)14.wav process_wspr2 elif [ $MINUTO = "17:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):15:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)16.wav process_wspr2 elif [ $MINUTO = "19:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):17:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)18.wav process_wspr2 elif [ $MINUTO = "21:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):19:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)20.wav process_wspr2 elif [ $MINUTO = "23:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):21:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)22.wav process_wspr2 elif [ $MINUTO = "25:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):23:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)24.wav process_wspr2 elif [ $MINUTO = "27:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):25:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)26.wav process_wspr2 elif [ $MINUTO = "29:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):27:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)28.wav process_wspr2 elif [ $MINUTO = "30:30" -a $DONE = 0 ]; then #wspr15 DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):14:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)15.wav process_wspr15 elif [ $MINUTO = "31:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):29:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)30.wav process_wspr2 elif [ $MINUTO = "33:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):31:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)32.wav process_wspr2 elif [ $MINUTO = "35:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):33:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)34.wav process_wspr2 elif [ $MINUTO = "37:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):35:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)36.wav process_wspr2 elif [ $MINUTO = "39:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):37:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)38.wav process_wspr2 elif [ $MINUTO = "41:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):39:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)40.wav process_wspr2 elif [ $MINUTO = "43:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):41:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)42.wav process_wspr2 elif [ $MINUTO = "44:55" -a $DONE = 0 ]; then #wspr15 DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):29:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)45.wav process_wspr15 elif [ $MINUTO = "45:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):43:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)44.wav process_wspr2 elif [ $MINUTO = "47:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):45:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)46.wav process_wspr2 elif [ $MINUTO = "49:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):47:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)48.wav process_wspr2 elif [ $MINUTO = "51:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):49:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)50.wav process_wspr2 elif [ $MINUTO = "53:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):51:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)52.wav process_wspr2 elif [ $MINUTO = "55:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):53:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)54.wav process_wspr2 elif [ $MINUTO = "57:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):55:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)56.wav process_wspr2 elif [ $MINUTO = "59:55" -a $DONE = 0 ]; then DONE=1 TIMESLOT=$(date -u +%F)_$(date -u +%H):57:30 FILENAME=$(date -u +%y)$(date -u +%m)$(date -u +%d)_$(date -u +%H)58.wav process_wspr2 fi sleep 0.5 done