1
0
mirror of https://github.com/AG7GN/nexus-utilities.git synced 2025-05-28 04:10:19 -07:00

Updated help text and bug fixes to direwolf GUI scripts

This commit is contained in:
Steve Magnuson 2020-05-28 15:11:04 -07:00
parent 68e0034e9d
commit 0ebe4afd90
4 changed files with 146 additions and 41 deletions

View File

@ -5,6 +5,9 @@
<body>
<h1>APRS Configuration Help</h1>
<p>
See Direwolf author WB2OSZ's <a href="https://github.com/wb2osz/direwolf/blob/master/doc/Successful-APRS-IGate-Operation.pdf">Successful APRS IGate Operation</a> for some good tips on using APRS.
</p>
<a href="#call">Call sign and SSID</a><br />
<a href="#tactical">Tactical Call Sign</a><br />
@ -32,6 +35,27 @@
<h2 id="call">Call and SSID</h2>
<p>Station call sign. Default SSID is 0. See <a href="http://www.aprs.org/aprs11/SSIDs.txt">APRS SSID Recommendations</a> for more information.
</p>
<p>
SSID RECOMMENDATIONS: It is very convenient to other mobile operators or others looking at callsigns flashing by, to be able to recognize some common applications at a glance. Here are the recommendations for the 16 possible SSID's (the limit of 16 comes from the 4 bits available in the AX.25 protocol. Note, The SSID of zero is dropped by most display applications. So a callsign with no SSID has an SSID of 0.
</p>
<pre>
-0 Your primary station usually fixed and message capable
-1 generic additional station, digi, mobile, wx, etc
-2 generic additional station, digi, mobile, wx, etc
-3 generic additional station, digi, mobile, wx, etc
-4 generic additional station, digi, mobile, wx, etc
-5 Other networks (Dstar, Iphones, Androids, Blackberry's etc)
-6 Special activity, Satellite ops, camping or 6 meters, etc
-7 walkie talkies, HT's or other human portable
-8 boats, sailboats, RV's or second main mobile
-9 Primary Mobile (usually message capable)
-10 internet, Igates, echolink, winlink, AVRS, APRN, etc
-11 balloons, aircraft, spacecraft, etc
-12 APRStt, DTMF, RFID, devices, one-way trackers*, etc
-13 Weather stations
-14 Truckers or generally full time drivers
-15 generic additional station, digi, mobile, wx, etc
</pre>
<a href="#top">Top</a>
<h2 id="tactical">Tactical Call</h2>
@ -132,7 +156,7 @@ Print Direwolf's audio statistics every x seconds. Set to 0 to disable printing
<p>
Default is disabled. If disabled, Direwolf APRS will not autostart when the Pi boots up. Otherwise, select which levers in the piano switch you want to be in the ON (down) position. A corresponding piano script will be created and, if the switches are in the selected postion, will autostart APRS at bootup. If 'none' is selected, meaning all switches are in the OFF (UP) position, script piano.sh will be created and will autostart APRS provided all levers are in the UP position.
<br /><br />
<b>IMPORTANT</b>: Scripts with the same name will be overwritten without warning!
<b>IMPORTANT</b>: If a piano script with the same name already exists, the old one will be renamed with a <pre>.YYYYMMDD</pre> extension appended to the file name.
<br /><br />
See <a href="https://github.com/AG7GN/hampi-utilities/blob/master/README.md#check-piano-script">Check Piano Script</a> for details.
</p>
@ -358,8 +382,7 @@ W3GHI>APRS,DIGI1,DIGI2*:whatever
<ul>
<li>If we had the filter “i/30/0” we would transmit only messages for the first station because it was heard directly.</li>
<li>If we had the filter “i/30/1” we would also transmit messages for the second station.</li>
<li>We would need “i/30/2” or larger to forward messages the third which is 2 digipeater hops
away.</li>
<li>We would need “i/30/2” or larger to forward messages the third which is 2 digipeater hops away.</li>
</ul>
<p>This is not entirely reliable because some digipeaters dont maintain the via path to indicate the actual path taken. I have little rant about this, called “APRS Digipeater Compared to other implementations,” in the User Guide. Currently section 9.5.5 but subject to change as new material is added.
</p>
@ -370,6 +393,27 @@ W3GHI>APRS,DIGI1,DIGI2*:whatever
</p>
<a href="#top">Top</a>
<h2>Typical Configurations for Messaging</h2>
<p>
Source: <a href="https://github.com/wb2osz/direwolf/blob/master/doc/Successful-APRS-IGate-Operation.pdf">Successful APRS IGate Operation</a>.
Comments in this section are from Direwolf's author, WB2OSZ.
</p>
<p>
The servers have a tendency of sending us too much unexpected stuff. In earlier versions, lack of an explicit client side filter often resulted in too much undesired radio traffic. Starting with version 1.4, there is now a reasonable default filter when going from the IS to RF. It is equivalent to:
<pre>FILTER IG 0 i/30</pre>
Client-Side filters are explored in more depth in a later second.
Suppose you wanted to forward messages to stations within 50 km, regardless of digipeater hops required:
<pre>FILTER IG 0 i/30/8/42.6/-71.3/50</pre>
Personally, I think the physical distance restriction for messages is a bad idea. Others may disagree. We might not know the location of the nearby stations that send packet types other than Position Report. We could relax the restriction a bit by allowing anyone heard directly, in the past hour, even if we dont know the location:
<pre>FILTER IG 0 i/30/8/42.6/-71.3/50 | i/60/0</pre>
Suppose we are in the USA, not too far from the Canadian border. We might want to avoid sending messages across the border due to third party traffic legal concerns. In this case, we could add another filter requiring the addressee to begin with W, K, A, or N.
<pre>FILTER IG 0 ( i/30/8/42.6/-71.3/50 | i/60/0 ) & g/W*/K*/A*/N*</pre>
If you want to allow additional types of packets, just append the or operator and something creative. Here we will also transmit any telemetry data from WB2OSZ.
<pre>FILTER IG 0 i/30 | ( t/t & b/WB2OSZ )</pre>
Of course you would also need to ask for additional types of packets, from the server, with a server side filter.
</p>
<h2 id="server">iGate Server</h2>
<p>
<a href="http://www.aprs2.net">Internet servers</a> that collect and redistribute APRS traffic over the internet.

View File

@ -16,7 +16,7 @@
#%
#================================================================
#- IMPLEMENTATION
#- version ${SCRIPT_NAME} 0.1.9
#- version ${SCRIPT_NAME} 0.1.10
#- author Steve Magnuson, AG7GN
#- license CC-BY-SA Creative Commons License
#- script_id 0
@ -45,17 +45,19 @@ Optnum=$#
function TrapCleanup() {
[[ -d "${TMPDIR}" ]] && rm -rf "${TMPDIR}/"
pkill "^direwolf"
#pkill "^direwolf"
kill $timeStamp_PID >/dev/null 2>&1
kill $direwolf_PID >/dev/null 2>&1
for P in ${YAD_PIDs[@]}
do
kill $P >/dev/null 2>&1
done
rm -f $PIPE
rm -f $PIPE
}
function SafeExit() {
trap - INT TERM EXIT SIGINT
TrapCleanup
trap - INT TERM EXIT
exit 0
}
@ -291,10 +293,18 @@ EOF
}
function timeStamp () {
while sleep 60
do
echo -e "\nTIMESTAMP: $(date)"
done >$PIPEDATA
}
function killDirewolf () {
if pgrep "^direwolf" >/dev/null
# $1 is the direwolf PID
if pgrep ^direwolf | grep -q $1 2>/dev/null
then
pkill "^direwolf"
kill $1 >/dev/null 2>&1
echo -e "\n\nDirewolf stopped. Click \"Restart...\" button below to restart." >$PIPEDATA
else
echo -e "\n\nDirewolf was already stopped. Click \"Restart...\" button below to restart." >$PIPEDATA
@ -412,7 +422,7 @@ done
shift $((${OPTIND} - 1)) ## shift options
# Ensure only one instance of this script is running.
pidof -o %PPID -x $(basename "$0") >/dev/null && exit 1
pidof -o %PPID -x $(basename "$0") >/dev/null && Die "$(basename $0) already running."
# Check for required apps.
for A in yad direwolf
@ -446,7 +456,7 @@ export PIPEDATA=$PIPE
#============================
# Trap bad exits with cleanup function
trap SafeExit EXIT INT TERM
trap SafeExit EXIT INT TERM SIGINT
# Exit on error. Append '||true' when you run the script if you expect an error.
set -o errexit
@ -456,25 +466,33 @@ $SYNTAX && set -n
# Run in debug mode, if set
$DEBUG && set -x
timeStamp &
timeStamp_PID=$!
direwolf_PID=""
YAD_PIDs=()
while true
do
YAD_PIDs=()
# Kill any running processes and load latest settings
pgrep "^direwolf" >/dev/null && pkill "^direwolf"
killDirewolf $direwolf_PID
for P in ${YAD_PIDs[@]}
do
ps x | egrep -q "^$P" && kill $P
done
rm -f $TMPDIR/CONFIGURE_APRS.txt
loadSettings $CONFIG_FILE
# Start the tail window tab
YAD_PIDs=()
# Start the monitor tab
[[ $FIRST_RUN == true ]] && MODE_MESSAGE="" || MODE_MESSAGE="${F[_APRSMODE_]}"
TEXT="<big><b>Direwolf $MODE_MESSAGE APRS Monitor</b></big>"
yad --plug="$ID" --tabnum=1 \
yad --plug="$ID" --tabnum=1 --text="$TEXT" --editable --show-uri --show-cursor \
--back=black --fore=yellow \
--text-info --text-align=center \
--editable --tail --center <&6 &
YAD_PIDs+=( $! )
if [[ $FIRST_RUN == true ]]
then
echo -e "\n\nDirewolf was not started because APRS is not configured.\nConfigure it in the \"Configure APRS\" tab, then click the \"Restart...\" button below." >&6
@ -485,9 +503,10 @@ do
echo >&6
[[ ${F[_AUDIOSTATS_]} == 0 ]] || DIREWOLF+=" -a ${F[_AUDIOSTATS_]}"
$DIREWOLF -c $DW_CONFIG >&6 2>&6 &
echo -e "\n\nDirewolf APRS is running." >&6
direwolf_PID=$!
echo -e "\n\nDirewolf APRS has started. PID=$direwolf_PID" >&6
fi
# Set up tab for configuring Direwolf.
# Start the Configure APRS.
CMD=(
yad --plug="$ID" --tabnum=2 --show-uri
--item-separator="~"
@ -533,16 +552,16 @@ do
--field="<b>Configuration Help</b>":FBTN
--
"${F[_CALL_]}"
"${F[_SSID_]}!1..15!1!"
"${F[_SSID_]}~0..15~1~"
"${F[_TACTICAL_CALL_]}"
"${F[_COMMENT_]}"
"${F[_LOC_]}"
"${F[_GRID_]}"
"${F[_LAT_]}"
"${F[_LONG_]}"
"${F[_POWER_]}!1..100!1!"
"${F[_HEIGHT_]}!0..200!1!"
"${F[_GAIN_]}!0..20!1!"
"${F[_POWER_]}~1..100~1~"
"${F[_HEIGHT_]}~0..200~1~"
"${F[_GAIN_]}~0..20~1~"
"$ADEVICE_CAPTUREs"
"$ADEVICE_PLAYBACKs"
"$ARATEs"
@ -578,8 +597,8 @@ do
--buttons-layout=center \
--tab="Monitor APRS" \
--tab="Configure APRS" \
--button="<b>Exit</b>":1 \
--button="<b>Stop Direwolf APRS</b>":'bash -c "killDirewolf"' \
--button="<b>Stop Direwolf APRS &#x26; Exit</b>":1 \
--button="<b>Stop Direwolf APRS</b>":"bash -c 'killDirewolf $direwolf_PID'" \
--button="<b>Restart Direwolf APRS</b>":0
RETURN_CODE=$?
@ -628,19 +647,21 @@ do
else
FIRST_RUN=false
fi
# Make or update an autostart piano switch script if necessary
# Make autostart piano switch script if necessary
if [[ ${F[_BOOTSTART_]} == "disabled" ]]
then # Disable autostart
[[ $PREVIOUS_AUTOSTART =~ none ]] && SWITCHES="" || SWITCHES="$PREVIOUS_AUTOSTART"
rm -f $HOME/piano${SWITCHES}.sh
# Save previous piano script if it exists
[[ -s $HOME/piano${SWITCHES}.sh ]] && mv -f $HOME/piano${SWITCHES}.sh $HOME/piano${SWITCHES}.sh.$(date '+%Y%m%d')
else # Enable autostart
if [[ ${F[_BOOTSTART_]} != $PREVIOUS_AUTOSTART ]]
then # Previous autostart was not the same as the requested autostart
[[ $PREVIOUS_AUTOSTART =~ none ]] && SWITCHES="" || SWITCHES="$PREVIOUS_AUTOSTART"
rm -f $HOME/piano${SWITCHES}.sh
# Save previous piano script if it exists
[[ -s $HOME/piano${SWITCHES}.sh ]] && mv -f $HOME/piano${SWITCHES}.sh $HOME/piano${SWITCHES}.sh.$(date '+%Y%m%d')
[[ ${F[_BOOTSTART_]} =~ none ]] && SWITCHES="" || SWITCHES="${F[_BOOTSTART_]}"
echo -e "#!/bin/bash\nsleep 5\n$(command -v $(basename $0)) >/dev/null 2>&1" > $HOME/piano${SWITCHES}.sh
chmod +x $HOME/piano$SWITCHES.sh
chmod +x $HOME/piano${SWITCHES}.sh
fi
fi
;;

View File

@ -15,7 +15,7 @@
#%
#================================================================
#- IMPLEMENTATION
#- version ${SCRIPT_NAME} 1.3.9
#- version ${SCRIPT_NAME} 1.4.0
#- author Steve Magnuson, AG7GN
#- license CC-BY-SA Creative Commons License
#- script_id 0
@ -44,20 +44,22 @@ Optnum=$#
function TrapCleanup() {
[[ -d "${TMPDIR}" ]] && rm -rf "${TMPDIR}/"
pkill "^(pat|direwolf)"
kill $timeStamp_PID >/dev/null 2>&1
kill $direwolf_PID >/dev/null 2>&1
kill $pat_PID >/dev/null 2>&1
kill $RIG_PID >/dev/null 2>&1
for P in ${YAD_PIDs[@]}
do
kill $P >/dev/null 2>&1
done
kill $RIG_PID >/dev/null 2>&1
sudo pkill kissattach >/dev/null 2>&1
rm -f /tmp/kisstnc
rm -f $PIPE
}
function SafeExit() {
trap - INT TERM EXIT SIGINT
TrapCleanup
trap - INT TERM EXIT
exit 0
}
@ -174,6 +176,24 @@ EOF
PAT_LOCATOR="$(jq -r ".locator" $PAT_CONFIG)"
}
function timeStamp () {
while sleep 60
do
echo -e "\nTIMESTAMP: $(date)"
done >$PIPEDATA
}
function killDirewolf () {
# $1 is the direwolf PID
if pgrep ^direwolf | grep -q $1 2>/dev/null
then
kill $1 >/dev/null 2>&1
echo -e "\n\nDirewolf stopped. Click \"Restart...\" button below to restart." >$PIPEDATA
else
echo -e "\n\nDirewolf was already stopped. Click \"Restart...\" button below to restart." >$PIPEDATA
fi
}
#============================
# FILES AND VARIABLES
#============================
@ -315,6 +335,8 @@ then
echo -n "" | pat configure >/dev/null 2>&1
fi
export PIPEDATA=$PIPE
#============================
# MAIN SCRIPT
#============================
@ -348,11 +370,18 @@ then # No rigs configured. Make a dummy rig
'.ax25.rig = $R' | sponge $PAT_CONFIG
fi
while [[ $RETURN_CODE == 0 ]]
timeStamp &
timeStamp_PID=$!
direwolf_PID=""
pat_PID=""
YAD_PIDs=()
while true
do
YAD_PIDs=()
# Kill any running processes and load latest settings
pgrep "^(pat|direwolf)" >/dev/null && pkill "^(pat|direwolf)"
killDirewolf $direwolf_PID
[[ $pat_PID == "" ]] || kill $pat_PID >/dev/null 2>&1
for P in ${YAD_PIDs[@]}
do
ps x | egrep -q "^$P" && kill $P
@ -361,6 +390,7 @@ do
rm -f $TMPDIR/CONFIGURE_TNC.txt $TMPDIR/CONFIGURE_PAT.txt
rm -f /tmp/kisstnc
loadSettings
YAD_PIDs=()
# Start the tail window tab
TEXT="AGW Port: <span color='blue'><b>$AGWPORT</b></span> KISS Port: <span color='blue'><b>$KISSPORT</b></span>"
@ -372,8 +402,10 @@ do
YAD_PIDs+=( $! )
# Start rigctld. Assume should use the dummy rig.
if ! pgrep rigctld >/dev/null
if pgrep rigctld >/dev/null
then
echo "rigctld already running." >&3
else
echo "Starting rigctld using dummy rig..." >&3
$(command -v rigctld) -m 1 >&3 2>&3 &
RIG_PID=$!
@ -387,6 +419,8 @@ do
# Start Direwolf
[[ ${F[_AUDIOSTATS_]} == 0 ]] || DIREWOLF+=" -a ${F[_AUDIOSTATS_]}"
$DIREWOLF -c $DW_CONFIG >&3 2>&3 &
direwolf_PID=$!
echo -e "\n\nDirewolf TNC has started. PID=$direwolf_PID" >&3
# Wait for Direwolf to allocate a PTY
COUNTER=0
@ -413,7 +447,13 @@ do
[ $? -eq 0 ] || Die "kissparms settings failed. Aborting."
# Start pat
[[ $PAT_START_HTTP == TRUE ]] && $PAT >&3 2>&3 &
if [[ $PAT_START_HTTP == TRUE ]]
then
$PAT >&3 2>&3 &
pat_PID=$!
else
pat_PID=""
fi
fi
# Set up tab for configuring Direwolf.
@ -483,14 +523,11 @@ Click the <b>Restart...</b> button below after you make your changes.\n\n" \
--tab="Configure TNC" \
--tab="Configure pat" \
--width="800" --height="600" \
--button="<b>Stop Direwolf$AND_PAT and Exit</b>":1 \
--button="<b>Stop Direwolf$AND_PAT &#x26; Exit</b>":1 \
--button="<b>Restart Direwolf$AND_PAT</b>":0
RETURN_CODE=$?
case $RETURN_CODE in
1|252) # User click Exit button or closed window.
break
;;
0) # Read and handle the Configure TNC tab yad output
[[ -s $TMPDIR/CONFIGURE_TNC.txt ]] || Die "Unexpected input from dialog"
IFS='|' read -r -a TF < "$TMPDIR/CONFIGURE_TNC.txt"
@ -540,6 +577,9 @@ Click the <b>Restart...</b> button below after you make your changes.\n\n" \
FIRST_RUN=false
fi
;;
*) # User click Exit button or closed window.
break
;;
esac
done
SafeExit

View File

@ -1 +1 @@
VERSION="2.2.2"
VERSION="2.2.3"