-
Notifications
You must be signed in to change notification settings - Fork 2
/
aprs-send-weather.sh
57 lines (46 loc) · 2.37 KB
/
aprs-send-weather.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/bash -x
#
# aprs-send-weather.sh
#
# send an aprs weather packet to aprsis and RF
#
# Install requirements (weewx, weewx-aprs weewx extension, direwolf):
# apt-get install weewx
# wget https://github.com/cavedon/weewx-aprs/archive/refs/heads/master.zip
# wee_extension --install=master.zip
# apt-get install direwolf
#
# (C)2022 Craig Lamparter
# GPL v2
#
# User serviceable parts:
USER="KM6XXX-3"
PASS="11111" # https://apps.magicbug.co.uk/passcode/
DIREWOLFHOSTNAME=direwolf.hostname
# packet generated by weewx with weewx-aprs extension installed
STRING=`cat /dev/shm/aprs.pkt`
# telnet to aprsis server, login, send concatenated string, quit
echo Sending: $STRING
{
sleep 2
echo "user $USER pass $PASS vers aprs-send-weather 0.99"
sleep 2
printf "$USER>APRS,TCPIP*:$STRING\n"
sleep 5
echo "^]"
echo "quit"
} | telnet noam.aprs2.net 14580
ERR="${PIPESTATUS[0]}"
if [ $ERR -eq 0 ]; then
echo "Message sent."
else
echo "ERROR: telnet returned $ERR."
fi
# Now send the packet to a KISS TNC to transmit over RF
echo "Sending packet to Radio TNC."
PACKET="$USER>APRS,WIDE1-1:$STRING"
{
sleep 5 # allow kissutil time to make connection
echo $PACKET
} | kissutil -h $DIREWOLFHOSTNAME
exit $ERR