-
Notifications
You must be signed in to change notification settings - Fork 2
/
aprs-threaded-transmit.sh
executable file
·59 lines (45 loc) · 1.39 KB
/
aprs-threaded-transmit.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
58
59
#!/bin/bash
#
# APRS Position, Telemetry and Status Packet Compiler/Transmitter
#
# Requires Python libafsk (pip install afsk)
#
GPIO=/sys/class/gpio/gpio22/value
PAN=2:0:1
# Long term counter
COUNT=`cat /home/pi/balloon/.count`
# On the second iteration, send the telemetry parameters
if [ $COUNT -eq 1 ] ; then
echo -n "Compiling/sending telemetry units, parameters, etc... "
aprs -c KE5GDB -o aprs.wav ":KE5GDB-4 :PARM.ExtTemp,IntTemp,Humidity,Current,Voltage"
echo 0 > $GPIO
mplayer /home/pi/balloon/aprs.wav -af pan=$PAN > /dev/null 2>&1
echo 1 > $GPIO
aprs -c KE5GDB -o aprs.wav ":KE5GDB-4 :UNIT.degC,degC,%,mA,Volts"
echo 0 > $GPIO
mplayer /home/pi/balloon/aprs.wav -af pan=$PAN > /dev/null 2>&1
echo 1 > $GPIO
aprs -c KE5GDB -o aprs.wav ":KE5GDB-4 :EQNS.0,.1,-60,0,.1,-60,0,.1,0,0,2,0,0,.01,5"
echo 0 > $GPIO
mplayer /home/pi/balloon/aprs.wav -af pan=$PAN > /dev/null 2>&1
echo 1 > $GPIO
echo "done!"
fi
sleep 2
echo -n "Transmitting position packet... "
echo 0 > $GPIO
mplayer /home/pi/balloon/position.wav -af pan=$PAN > /dev/null 2>&1
echo 1 > $GPIO
echo "done!"
sleep 2
echo -n "Transmitting telemetry packet... "
echo 0 > $GPIO
mplayer /home/pi/balloon/telem.wav -af pan=$PAN > /dev/null 2>&1
echo 1 > $GPIO
echo "done!"
sleep 2
echo -n "Transmitting status packet... "
echo 0 > $GPIO
mplayer /home/pi/balloon/status.wav -af pan=$PAN > /dev/null 2>&1
echo 1 > $GPIO
echo "done!"