-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdecode-ft8.sh
executable file
·57 lines (38 loc) · 1.04 KB
/
decode-ft8.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#! /bin/sh
# Station parameters
UDPPORT=2238
# End of station parameters
JOBS=4
NICE=10
BROADCASTIP=`ip a s dev eth0 | awk '/inet / {print $4}'`
DIR=`readlink -f $0`
DIR=`dirname $DIR`
RECORDER=$DIR/write-c2-files
CONFIG=write-c2-files.cfg
DECODER=/media/mmcblk0p1/apps/ft8d/ft8d
SLEEP=$DIR/sleep-to-59
test $DIR/$CONFIG -ot $CONFIG || cp $DIR/$CONFIG $CONFIG
#echo `date --utc +"%Y-%m-%d "` "Sleeping ..."
echo "Slp"
$SLEEP
sleep 1
TIMESTAMP=`date --utc +'%y%m%d_%H%M'`
#echo `date --utc +"%H:%M:%SZ"` "Rec using $CONFIG ..."
echo "Rec"
killall -q $RECORDER
$RECORDER $CONFIG
#echo `date --utc +"%H:%M:%SZ"` "Decoding ..."
echo "Dec"
for file in ft8_*_$TIMESTAMP.c2
do
while [ `pgrep $DECODER | wc -l` -ge $JOBS ]
do
sleep 1
done
nice -n $NICE $DECODER $file &
done > decodes_$TIMESTAMP.txt
wait
#echo `date --utc +"%Y-%m-%d %H:%M:%SZ"` "Uploading to RBN..."
$DIR/upload-to-rbn $BROADCASTIP $UDPPORT decodes_$TIMESTAMP.txt
echo "Upl:" `wc -l < decodes_$TIMESTAMP.txt`" @" `date --utc +"%h %d %H:%M:%SZ"`
rm -f ft8_*_$TIMESTAMP.c2