mirror of
https://github.com/AG7GN/nexus-utilities.git
synced 2025-05-28 04:10:19 -07:00
Updates to pat and APRS GUIs
This commit is contained in:
parent
7c1d5a4f7d
commit
96c8b55ff4
121
aprs_help.html
121
aprs_help.html
@ -1,19 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>APRS Parameters Help</title>
|
||||
<title>APRS Configuration Help</title>
|
||||
<body>
|
||||
|
||||
<h1>APRS Configuration Help</h1>
|
||||
|
||||
This script allows you to run Direwolf as an APRS digipeater (full or fill-in) and/or an iGate (TX/RX or RX only). This web page describes each of these modes and provides help configuring some APRS attribues should you want to create your own custom Direwolf APRS configuration file.
|
||||
|
||||
<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="#monitor">Open monitor window when [re]starting this script</a><br />
|
||||
<a href="#call">Call sign and SSID</a><br />
|
||||
<a href="#tactical">Tactical Call Sign</a><br />
|
||||
<a href="#status">Comment/Status</a><br />
|
||||
<a href="#location">Location</a><br />
|
||||
<a href="#grid">Grid Square</a><br />
|
||||
<a href="#lat">LAT</a><br />
|
||||
<a href="#log">LONG</a><br />
|
||||
<a href="#power">Power</a><br />
|
||||
@ -22,9 +24,12 @@ See Direwolf author WB2OSZ's <a href="https://github.com/wb2osz/direwolf/blob/ma
|
||||
<a href="#adevice">Direwolf Capture/Playback ADEVICEs</a><br />
|
||||
<a href="#arate">Direwolf ARATE</a><br />
|
||||
<a href="#ptt">Direwolf PTT</a><br />
|
||||
<a href="#stats">Direwolf Audio Stats</a><br />
|
||||
<a href="#agw">AGW Port</a><br />
|
||||
<a href="#kiss">KISS Port</a><br />
|
||||
<a href="#colors">Direwolf text colors</a><br />
|
||||
<a href="#auto">Autostart APRS</a><br />
|
||||
<a href="#mode">APRS Mode</a><br />
|
||||
<p>Some common APRS parameters guidance is at these links (might be helpful for creating your custom configuration file):</p>
|
||||
<a href="#igtxlimit">iGate TX Limit IGTXLIMIT</a><br />
|
||||
<a href="#server">iGate Server</a><br />
|
||||
<a href="#filter">Client Side FILTER</a><br />
|
||||
@ -32,6 +37,10 @@ See Direwolf author WB2OSZ's <a href="https://github.com/wb2osz/direwolf/blob/ma
|
||||
<a href="#hops">Hops IGTXVIA</a><br />
|
||||
<a href="#beacon">iGate and Digipeater delay and interval settings</a><br />
|
||||
|
||||
<h2 id="status">Open monitor window when [re]starting this script</h2>
|
||||
<p>Check this box to launch a Terminal window that will display decoded APRS messages received and sent by Direwolf. In earlier versions of this script, those messages appeared in the Status tab (used to be called Monitor APRS). Default is checked (enabled).</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<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>
|
||||
@ -66,20 +75,12 @@ SSID RECOMMENDATIONS: It is very convenient to other mobile operators or others
|
||||
<p>Short comment or status message that is sent in beacon</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<h2 id="location">Location</h2>
|
||||
<p>City/town/state/province, etc.</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<h2 id="grid">Grid Square</h2>
|
||||
<p>Six character maidenhead grid square. See <a href="https://www.levinecentral.com/ham/grid_square.php">Amateur Radio Ham Radio Maidenhead Grid Square Locator Map</a></p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<h2 id="lat">LAT</h2>
|
||||
<p>Latitude in decimal degrees to no more than 6 decimal places.</p>
|
||||
<p>Latitude in decimal degrees to no more than 6 decimal places. Use the decimal point and not the ^ symbol to separate the decimal part.</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<h2 id="long">LONG</h2>
|
||||
<p>Longitude in decimal degrees to no more than 6 decimal places.</p>
|
||||
<p>Longitude in decimal degrees to no more than 6 decimal places. Use the decimal point and not the ^ symbol to separate the decimal part.</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<h2 id="power">Power</h2>
|
||||
@ -145,9 +146,21 @@ The GPIO (BCM numbering) pin to use for Push To Talk. Nexus DR-X is wired to us
|
||||
</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<h2 id="stats">Direwolf Audio Stats</h2>
|
||||
<h2 id="agw">AGW Port</h2>
|
||||
<p>
|
||||
Print Direwolf's audio statistics every x seconds. Set to 0 to disable printing of statistics.
|
||||
Other applications (like Xastir) can access Direwolf's APRS data via an TCP/IP network connection to Direwolf's <a href="https://www.on7lds.net/42/sites/default/files/AGWPEAPI.HTM">AGW</a> port. Default is 8001
|
||||
</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<h2 id="kiss">KISS Port</h2>
|
||||
<p>
|
||||
Other applications can access Direwolf's APRS data via an TCP/IP network connection to Direwolf's <a href="http://www.ax25.net/kiss.aspx">KISS</a> port. Default is 8011.
|
||||
</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<h2 id="colors">Direwolf text colors</h2>
|
||||
<p>
|
||||
Direwolf prints out the APRS message text in a terminal window. This option enables colorizing the output. Direwolf comes with 5 color schemes, numbered 0 to 4 with 0 being no color. Run <pre>direwolf -t 9</pre> in a Terminal to see the different color schemes. Default is 1.
|
||||
</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
@ -161,12 +174,80 @@ See <a href="https://github.com/AG7GN/nexus-utilities/blob/master/README.md#chec
|
||||
</p>
|
||||
<a href="#top">Top</a>
|
||||
|
||||
<h2 id="mode">APRS Mode</h2>
|
||||
<p>
|
||||
Choices are: iGate (RX Only), iGate (TX+RX), Digipeater (for installations without internet access) or Digitpeater + iGate. All iGate selections require the Pi to be connected to the Internet.
|
||||
</p>
|
||||
<h2 id="mode">APRS Modes</h2>
|
||||
<p>This script provides the user with the ability to select APRS certain modes with minimal manual configuration, as well as the ability to load and run your own custom Direwolf APRS configuration.</p>
|
||||
|
||||
<table rules="all" style="border-color:DarkGray;border-width:1px;border-style:solid;">
|
||||
<tr align="center">
|
||||
<th>Mode</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><b>Custom</b></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>You can create a custom Direwolf APRS configuration in a text editor and load it into the script. The script will then use that configuration and ignore all the other settings in the Configure APRS tab. Note the the script does no error checking, so watch the monitor window to verify that Direwolf didn't find any problems in your configuration</p><p>You must select <b>Custom</b> for the APRS mode <i>and</i> click the <b>Select Direwolf config file (for APRS Mode Custom)</b> button to select your custom configuration file. Once selected, click <b>Save & [Re]start Direwolf APRS</b> to load your file and start Direwolf.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><b>Fill-in Digipeater</b></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Uses the settings in the left column to direct Direwolf to run the digipeater using:<pre>DIGIPEAT 0 0 ^WIDE1-1$ ^WIDE1-1$</pre> and will use 3 beacons:<pre>PBEACON delay=1 every=30 symbol="digi" overlay=S lat=LAT long=LONG POWER=POWER HEIGHT=HEIGHT GAIN=GAIN COMMENT="Comment/Status" via=WIDE2-2
|
||||
PBEACON delay=11 every=30 symbol="digi" overlay=S lat=LAT long=LONG POWER=POWER HEIGHT=HEIGHT GAIN=GAIN COMMENT="Comment/Status" via=WIDE1-1,WIDE2-2
|
||||
PBEACON delay=21 every=30 symbol="digi" overlay=S lat=LAT long=LONG POWER=POWER HEIGHT=HEIGHT GAIN=GAIN COMMENT="Comment/Status"</pre></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><b>Fill-in Digipeater + iGate</b></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Uses the settings in the left column to direct Direwolf to run the digipeater the same settings as the <b>Fill-in Digipeater</b>, plus will connect to the <b>noam.aprs2.net</b>server and handle APRS traffic to/from that server.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><b>Full Digipeater</b></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Uses the settings in the left column to direct Direwolf to run the digipeater using:<pre>DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$ ^WIDE[12]-[12]$</pre> and will use 3 beacons:<pre>PBEACON delay=1 every=30 symbol="digi" overlay=S lat=LAT long=LONG POWER=POWER HEIGHT=HEIGHT GAIN=GAIN COMMENT="Comment/Status" via=WIDE2-2
|
||||
PBEACON delay=11 every=30 symbol="digi" overlay=S lat=LAT long=LONG POWER=POWER HEIGHT=HEIGHT GAIN=GAIN COMMENT="Comment/Status" via=WIDE1-1,WIDE2-2
|
||||
PBEACON delay=21 every=30 symbol="digi" overlay=S lat=LAT long=LONG POWER=POWER HEIGHT=HEIGHT GAIN=GAIN COMMENT="Comment/Status"</pre></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><b>Full Digipeater + iGate</b></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Uses the settings in the left column to direct Direwolf to run the digipeater the same settings as the <b>Full Digipeater</b>, plus will connect to the <b>noam.aprs2.net</b>server and handle APRS traffic to/from that server.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><b>iGate</b></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Uses the settings in the left column to direct Direwolf to run as an iGate and connect to the <b>noam.aprs2.net</b> server and handle APRS traffic to/from that server. </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><b>iGate (RX only)</b></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><b>THIS MODE IS NOT RECOMMENDED</b> (see <a href="https://www.f4fxl.org/why-are-aprs-rx-only-igates-bad/">Why are APRS RX only iGates bad?</a>).</p><p>Uses the settings in the left column to direct Direwolf to run as an iGate and connect to the <b>noam.aprs2.net</b> server and pass APRS traffic heard via the radio to that server.</p><p>Direwolf never transmits over the radio in this mode.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br />
|
||||
<a href="#top">Top</a>
|
||||
|
||||
|
||||
<h1>Other common APRS parameters</h1>
|
||||
|
||||
<h2 id="igtxlimit">iGate TX Limit /min and iGate TX Limit /5min (IGTXLIMIT)</h2>
|
||||
|
||||
<p>We don’t want to flood the radio channel. If something goes wrong, this rate limiting will limit the damage. The transmit IGate will limit the number of packets transmitted during 1 minute and 5 minute intervals. If a limit would be exceeded, the packet is dropped and warning is displayed red. The default is 6 packets in a 1 minute interval and 10 packets during a 5 minute interval.</p>
|
||||
|
567
dw_aprs_gui.sh
567
dw_aprs_gui.sh
@ -16,7 +16,7 @@
|
||||
#%
|
||||
#================================================================
|
||||
#- IMPLEMENTATION
|
||||
#- version ${SCRIPT_NAME} 1.0.9
|
||||
#- version ${SCRIPT_NAME} 2.1.0
|
||||
#- author Steve Magnuson, AG7GN
|
||||
#- license CC-BY-SA Creative Commons License
|
||||
#- script_id 0
|
||||
@ -25,6 +25,10 @@
|
||||
# HISTORY
|
||||
# 20200428 : Steve Magnuson : Script creation.
|
||||
# 20200507 : Steve Magnuson : Bug fixes
|
||||
# 20210316 : Steve Magnuson : Enabled using custom configs and
|
||||
# reduced complexity by using most
|
||||
# common filters, etc. Also added
|
||||
# fill-in digipeat mode
|
||||
#
|
||||
#================================================================
|
||||
# DEBUG OPTION
|
||||
@ -45,10 +49,7 @@ Optnum=$#
|
||||
|
||||
function TrapCleanup() {
|
||||
[[ -d "${TMPDIR}" ]] && rm -rf "${TMPDIR}/"
|
||||
#pkill "^direwolf"
|
||||
kill $clearTextInfo_PID >/dev/null 2>&1
|
||||
kill $direwolf_PID >/dev/null 2>&1
|
||||
for P in ${YAD_PIDs[@]}
|
||||
for P in $direwolf_PID $socat_PID ${YAD_PIDs[@]}
|
||||
do
|
||||
kill $P >/dev/null 2>&1
|
||||
done
|
||||
@ -101,7 +102,7 @@ function aprsPasscode () {
|
||||
}
|
||||
|
||||
function loadAPRSDefaults () {
|
||||
for I in $(seq 19 28)
|
||||
for I in $(seq 20 27)
|
||||
do # I+1 is the field number. D[$I] is the default value
|
||||
echo "$((I + 1)):${D[$I]}"
|
||||
done
|
||||
@ -113,30 +114,49 @@ function setDefaults () {
|
||||
D[2]="0" # SSID
|
||||
D[3]="" # Tactical Callsign (if set, will be used instead of MYCALL)
|
||||
D[4]="Comment/Status" # Comment/Status
|
||||
D[5]="Bellingham, WA" # Location
|
||||
D[6]="CN88SS" # Grid Square
|
||||
D[7]="48.753318" # Latitude in decimal seconds
|
||||
D[8]="-122.472632" # Longitude in decimal seconds
|
||||
D[9]="10" # Rig power in watts
|
||||
D[10]="40" # Antenna height in feet above average terrain
|
||||
D[11]="5" # Antenna gain in dB
|
||||
D[12]="null" # Audio capture interface (ADEVICE)
|
||||
D[13]="null" # Audio playback interface (ADEVICE)
|
||||
D[14]="96000" # Audio playback rate (ARATE)
|
||||
D[15]="GPIO 23" # GPIO PTT (BCM pin)
|
||||
D[16]="60" # Audio stats interval
|
||||
D[17]="iGate (RX Only)"
|
||||
D[18]="disabled" # Autostart APRS on boot
|
||||
D[19]="6" # iGate tansmit limit per minute
|
||||
D[20]="10" # iGate transmit limit per 5 minutes
|
||||
D[21]="( i/30/8/\$LAT/\$LONG/16 | i/60/0 ) & g/W*/K*/A*/N*" # iGate server > TX filter
|
||||
D[22]="noam.aprs2.net" # iGate server
|
||||
D[23]="m/16" # TX messages from iGate server to stations within 16KM (10 miles)
|
||||
D[24]="WIDE1-1,WIDE2-1" # Hops
|
||||
D[25]="00:30" # Wait time in mm:ss to send position beacon after startup (sent to iGate server)
|
||||
D[26]="15:00" # Position beacon send interval in mm:ss (sent to iGate server)
|
||||
D[27]="00:30" # Wait time in mm:ss to TX position beacon after startup
|
||||
D[28]="10:00" # Position beacon TX interval in mm:ss
|
||||
D[5]="48.753318" # Latitude in decimal seconds
|
||||
D[6]="-122.472632" # Longitude in decimal seconds
|
||||
D[7]="10" # Rig power in watts
|
||||
D[8]="40" # Antenna height in feet above average terrain
|
||||
D[9]="5" # Antenna gain in dB
|
||||
D[10]="null" # Audio capture interface (ADEVICE)
|
||||
D[11]="null" # Audio playback interface (ADEVICE)
|
||||
D[12]="96000" # Audio playback rate (ARATE)
|
||||
D[13]="GPIO 23" # GPIO PTT (BCM pin)
|
||||
D[14]="8001" #AGW Port
|
||||
D[15]="8011" # KISS Port
|
||||
D[16]="0" # Direwolf text colors
|
||||
D[17]="disabled" # Autostart APRS on boot
|
||||
D[18]="Fill-in Digipeater" # digipeat/igate operating mode
|
||||
D[19]="" # Custom configuration file
|
||||
D[20]="TRUE" # Open monitor window at startup
|
||||
}
|
||||
|
||||
function browseCustomFile () {
|
||||
echo "22:$(yad --center --file --title="Select your Direwolf config file")"
|
||||
}
|
||||
|
||||
function upgradeSettings () {
|
||||
# Upgrades older configurations that didn't have the full and fill-in digipeat options
|
||||
# Old modes were: APRSMODEs="Digipeater~iGate (RX Only)~iGate (TX+RX)~Digipeater + iGate"
|
||||
# New modes are: APRSMODEs="Custom~Full Digipeater~Fill-in Digipeater~iGate (RX Only)~iGate~Full Digipeater + iGate~Fill-in Digipeater + iGate"
|
||||
sed -i -e "s/F[_APRSMODE_]='Digipeater'/F[_APRSMODE_]='Fill-in Digipeater'/" \
|
||||
-e "s/F[_APRSMODE_]='Digipeater + iGate'/F[_APRSMODE_]='Fill-in Digipeater + iGate'/" \
|
||||
-e "s/F[_APRSMODE_]='iGate (TX+RX)'/F[_APRSMODE_]='iGate'/" \
|
||||
-e "/F[_LOC_]/d" \
|
||||
-e "/F[_GRID_]/d" \
|
||||
-e "/F[_DIGIPEATDELAY_]/d" \
|
||||
-e "/F[_DIGIPEATEVERY_]/d" \
|
||||
-e "/F[_IGTXLIMIT1_]/d" \
|
||||
-e "/F[_IGTXLIMIT5_]/d" \
|
||||
-e "/F[_FILTER_]/d" \
|
||||
-e "/F[_SERVER_]/d" \
|
||||
-e "/F[_IGFILTER_]/d"\
|
||||
-e "/F[_HOPS_]/d" \
|
||||
-e "/F[_IGDELAY_]/d" \
|
||||
-e "/F[_AUDIOSTATS_]/d" \
|
||||
-e "/F[_IGEVERY_]/d" "$1"
|
||||
|
||||
}
|
||||
|
||||
function loadSettings () {
|
||||
@ -152,30 +172,22 @@ function loadSettings () {
|
||||
echo "F[_SSID_]='${D[2]}'" >> $1 # SSID
|
||||
echo "F[_TACTICAL_CALL_]='${D[3]}'" >> $1 # Tactical Callsign
|
||||
echo "F[_COMMENT_]='${D[4]}'" >> $1 # Comment or tactical call
|
||||
echo "F[_LOC_]='${D[5]}'" >> $1 # Location
|
||||
echo "F[_GRID_]='${D[6]}'" >> $1 # Grid Square
|
||||
echo "F[_LAT_]='${D[7]}'" >> $1 # Latitude in decimal seconds
|
||||
echo "F[_LONG_]='${D[8]}'" >> $1 # Longitude in decimal seconds
|
||||
echo "F[_POWER_]='${D[9]}'" >> $1 # Rig power in watts
|
||||
echo "F[_HEIGHT_]='${D[10]}'" >> $1 # Antenna height in feet above average terrain
|
||||
echo "F[_GAIN_]='${D[11]}'" >> $1 # Antenna gain in dB
|
||||
echo "F[_ADEVICE_CAPTURE_]='${D[12]}'" >> $1 # Audio capture interface (ADEVICE)
|
||||
echo "F[_ADEVICE_PLAY_]='${D[13]}'" >> $1 # Audio playback interface (ADEVICE)
|
||||
echo "F[_ARATE_]='${D[14]}'" >> $1 # Audio playback rate (ARATE)
|
||||
echo "F[_PTT_]='${D[15]}'" >> $1 # GPIO PTT (BCM pin)
|
||||
echo "F[_AUDIOSTATS_]='${D[16]}'" >> $1 # Audio stats interval
|
||||
echo "F[_APRSMODE_]='${D[17]}'" >> $1 #
|
||||
echo "F[_BOOTSTART_]='${D[18]}'" >> $1 # Autostart APRS on boot
|
||||
echo "F[_IGTXLIMIT1_]='${D[19]}'" >> $1 # iGate tansmit limit per minute
|
||||
echo "F[_IGTXLIMIT5_]='${D[20]}'" >> $1 # iGate transmit limit per 5 minutes
|
||||
echo "F[_FILTER_]='${D[21]}'" >> $1 # iGate server > TX filter
|
||||
echo "F[_SERVER_]='${D[22]}'" >> $1 # iGate server
|
||||
echo "F[_IGFILTER_]='${D[23]}'" >> $1 # TX messages from iGate server to stations within 16KM (10 miles)
|
||||
echo "F[_HOPS_]='${D[24]}'" >> $1 # Hops
|
||||
echo "F[_IGDELAY_]='${D[25]}'" >> $1 # Wait time in mm:ss to send position beacon after startup (sent to iGate server)
|
||||
echo "F[_IGEVERY_]='${D[26]}'" >> $1 # Position beacon send interval in mm:ss (sent to iGate server)
|
||||
echo "F[_DIGIPEATDELAY_]='${D[27]}'" >> $1 # Wait time in mm:ss to TX position beacon after startup
|
||||
echo "F[_DIGIPEATEVERY_]='${D[28]}'" >> $1 # Position beacon TX interval in mm:ss
|
||||
echo "F[_LAT_]='${D[5]}'" >> $1 # Latitude in decimal seconds
|
||||
echo "F[_LONG_]='${D[6]}'" >> $1 # Longitude in decimal seconds
|
||||
echo "F[_POWER_]='${D[7]}'" >> $1 # Rig power in watts
|
||||
echo "F[_HEIGHT_]='${D[8]}'" >> $1 # Antenna height in feet above average terrain
|
||||
echo "F[_GAIN_]='${D[9]}'" >> $1 # Antenna gain in dB
|
||||
echo "F[_ADEVICE_CAPTURE_]='${D[10]}'" >> $1 # Audio capture interface (ADEVICE)
|
||||
echo "F[_ADEVICE_PLAY_]='${D[11]}'" >> $1 # Audio playback interface (ADEVICE)
|
||||
echo "F[_ARATE_]='${D[12]}'" >> $1 # Audio playback rate (ARATE)
|
||||
echo "F[_PTT_]='${D[13]}'" >> $1 # GPIO PTT (BCM pin)
|
||||
echo "F[_AGWPORT_]='${D[14]}'" >> $1 # AGW Port
|
||||
echo "F[_KISSPORT_]='${D[15]}'" >> $1 # KISS Port
|
||||
echo "F[_COLORS_]='${D[16]}'" >> $1 # Direwolf text colors
|
||||
echo "F[_BOOTSTART_]='${D[17]}'" >> $1 # Piano switch autostart setting
|
||||
echo "F[_APRSMODE_]='${D[18]}'" >> $1 # digipeat/igate operating mode
|
||||
echo "F[_CUSTOM_]='${D[19]}'" >> $1 # Custom Direwolf config file
|
||||
echo "F[_MONITOR_]='${D[20]}'" >> $1 # Custom Direwolf config file
|
||||
source "$1"
|
||||
fi
|
||||
|
||||
@ -191,9 +203,18 @@ function loadSettings () {
|
||||
ADEVICE_CAPTUREs="$(arecord -L | grep "^null\|^plughw" | tr '\n' '~' | sed 's/~$//')"
|
||||
ADEVICE_PLAYBACKs="$(aplay -L | grep "^null\|^plughw" | tr '\n' '~' | sed 's/~$//')"
|
||||
fi
|
||||
[[ $ADEVICE_CAPTUREs =~ ${F[_ADEVICE_CAPTURE_]} ]] && ADEVICE_CAPTUREs="$(echo "$ADEVICE_CAPTUREs" | sed "s/${F[_ADEVICE_CAPTURE_]}/\^${F[_ADEVICE_CAPTURE_]}/")" || F[_ADEVICE_CAPTURE_] = "null"
|
||||
[[ $ADEVICE_PLAYBACKs =~ ${F[_ADEVICE_PLAY_]} ]] && ADEVICE_PLAYBACKs="$(echo "$ADEVICE_PLAYBACKs" | sed "s/${F[_ADEVICE_PLAY_]}/\^${F[_ADEVICE_PLAY_]}/")" || F[_ADEVICE_PLAY_] = "null"
|
||||
|
||||
if [[ $ADEVICE_CAPTUREs =~ ${F[_ADEVICE_CAPTURE_]} ]]
|
||||
then
|
||||
ADEVICE_CAPTUREs="$(echo "$ADEVICE_CAPTUREs" | sed "s/${F[_ADEVICE_CAPTURE_]}/\^${F[_ADEVICE_CAPTURE_]}/")"
|
||||
else
|
||||
F[_ADEVICE_CAPTURE_] = "null"
|
||||
fi
|
||||
if [[ $ADEVICE_PLAYBACKs =~ ${F[_ADEVICE_PLAY_]} ]]
|
||||
then
|
||||
ADEVICE_PLAYBACKs="$(echo "$ADEVICE_PLAYBACKs" | sed "s/${F[_ADEVICE_PLAY_]}/\^${F[_ADEVICE_PLAY_]}/")"
|
||||
else
|
||||
F[_ADEVICE_PLAY_] = "null"
|
||||
fi
|
||||
# Generate sound card rates and selection
|
||||
ARATEs="48000~96000"
|
||||
[[ $ARATEs =~ ${F[_ARATE_]} ]] && ARATEs="$(echo "$ARATEs" | sed "s/${F[_ARATE_]}/\^${F[_ARATE_]}/")"
|
||||
@ -202,22 +223,32 @@ function loadSettings () {
|
||||
PTTs="GPIO 12~GPIO 23"
|
||||
[[ $PTTs =~ ${F[_PTT_]} ]] && PTTs="$(echo "$PTTs" | sed "s/${F[_PTT_]}/\^${F[_PTT_]}/")" || PTTs+="!^${F[_PTT_]}"
|
||||
|
||||
AUDIOSTATs="0~15~30~45~60~90~120"
|
||||
[[ $AUDIOSTATs =~ ${F[_AUDIOSTATS_]} ]] && AUDIOSTATs="$(echo "$AUDIOSTATs" | sed "s/${F[_AUDIOSTATS_]}/\^${F[_AUDIOSTATS_]}/")"
|
||||
#AUDIOSTATs="0~15~30~45~60~90~120"
|
||||
#[[ $AUDIOSTATs =~ ${F[_AUDIOSTATS_]} ]] && AUDIOSTATs="$(echo "$AUDIOSTATs" | sed "s/${F[_AUDIOSTATS_]}/\^${F[_AUDIOSTATS_]}/")"
|
||||
|
||||
APRSMODEs="Digipeater~iGate (RX Only)~iGate (TX+RX)~Digipeater + iGate"
|
||||
#APRSMODEs="Digipeater~iGate (RX Only)~iGate (TX+RX)~Digipeater + iGate"
|
||||
APRSMODEs="Custom~Fill-in Digipeater~Fill-in Digipeater + iGate~Full Digipeater~Full Digipeater + iGate~iGate~iGate (RX Only)"
|
||||
case ${F[_APRSMODE_]} in
|
||||
"Digipeater + iGate")
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed "s/Digipeater + iGate/\^Digipeater + iGate/")"
|
||||
"Full Digipeater + iGate")
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed -e "s/Full Digipeater + iGate/\^Full Digipeater + iGate/1")"
|
||||
;;
|
||||
Digipeater)
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed "s/Digipeater/\^Digipeater/1")"
|
||||
"Fill-in Digipeater + iGate")
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed -e "s/Fill-in Digipeater + iGate/\^Fill-in Digipeater + iGate/1")"
|
||||
;;
|
||||
"Full Digipeater")
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed -e "s/Full Digipeater/\^Full Digipeater/1")"
|
||||
;;
|
||||
"Fill-in Digipeater")
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed -e "s/Fill-in Digipeater/\^Fill-in Digipeater/1")"
|
||||
;;
|
||||
"iGate (RX Only)")
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed "s/iGate (RX/\^iGate (RX/1")"
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed -e "s/iGate (RX/\^iGate (RX/1")"
|
||||
;;
|
||||
"iGate (TX+RX)")
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed "s/iGate (TX/\^iGate (TX/1")"
|
||||
"iGate")
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed -e "s/~iGate/~\^iGate/1")"
|
||||
;;
|
||||
"Custom")
|
||||
APRSMODEs="$(echo "$APRSMODEs" | sed -e "s/Custom/\^Custom/1")"
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -231,47 +262,59 @@ function loadSettings () {
|
||||
else
|
||||
MYCALL="${F[_TACTICAL_CALL_]}"
|
||||
# Prepend CALL if not already present in COMMENT.
|
||||
[[ ${F[_COMMENT_]} =~ ${F[_CALL_]} ]] || F[_COMMENT_]="${F[_CALL_]} ${F[_COMMENT_]}"
|
||||
#[[ ${F[_COMMENT_]} =~ ${F[_CALL_]} ]] || F[_COMMENT_]="${F[_CALL_]} ${F[_COMMENT_]}"
|
||||
[[ ${F[_COMMENT_]} =~ ${F[_CALL_]} ]] || F[_COMMENT_]="${F[_CALL_]}-${F[_SSID_]} ${F[_COMMENT_]}"
|
||||
fi
|
||||
|
||||
DIGIPEAT=""
|
||||
FILTER="$(echo "$FILTER_DEFAULT" | sed -e "s/_LAT_/${F[_LAT_]}/" -e "s/_LONG_/${F[_LONG_]}/")"
|
||||
IGFILTER="$IGFILTER_DEFAULT"
|
||||
IGLOGIN="IGLOGIN ${F[_CALL_]}-${F[_SSID_]} $(aprsPasscode ${F[_CALL_]})"
|
||||
IGSERVER="$IGSERVER_DEFAULT"
|
||||
IGTXLIMIT="$IGTXLIMIT_DEFAULT"
|
||||
IGTXVIA="$IGTXVIA_DEFAULT"
|
||||
PBEACON0=""
|
||||
PBEACON1=""
|
||||
PBEACON2=""
|
||||
PBEACON_IGATE=""
|
||||
COMMENT="${F[_COMMENT_]}"
|
||||
case ${F[_APRSMODE_]} in
|
||||
Digi*) # Digipeater or Digipeater + iGate
|
||||
if [[ ${F[_APRSMODE_]} == "Digipeater" ]]
|
||||
*Digi*) # Digipeater or Digipeater + iGate
|
||||
case ${F[_APRSMODE_]} in
|
||||
Full*) # Full Digipeater
|
||||
DIGIPEAT="DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$ ^WIDE[12]-[12]$"
|
||||
;;
|
||||
Fill*) # Fill-in Digipeater
|
||||
DIGIPEAT="DIGIPEAT 0 0 ^WIDE1-1$ ^WIDE1-1$"
|
||||
;;
|
||||
*)
|
||||
Die "Invalid APRS Mode"
|
||||
;;
|
||||
esac
|
||||
PBEACON0="PBEACON delay=1 every=30 symbol=\"digi\" overlay=S lat=${F[_LAT_]} long=${F[_LONG_]} POWER=${F[_POWER_]} HEIGHT=${F[_HEIGHT_]} GAIN=${F[_GAIN_]} COMMENT=\"$COMMENT\" via=WIDE2-2"
|
||||
PBEACON1="PBEACON delay=11 every=30 symbol=\"digi\" overlay=S lat=${F[_LAT_]} long=${F[_LONG_]} POWER=${F[_POWER_]} HEIGHT=${F[_HEIGHT_]} GAIN=${F[_GAIN_]} COMMENT=\"$COMMENT\" via=WIDE1-1,WIDE2-2"
|
||||
PBEACON2="PBEACON delay=21 every=30 symbol=\"digi\" overlay=S lat=${F[_LAT_]} long=${F[_LONG_]} POWER=${F[_POWER_]} HEIGHT=${F[_HEIGHT_]} GAIN=${F[_GAIN_]} COMMENT=\"$COMMENT\""
|
||||
if [[ ${F[_APRSMODE_]} =~ Digipeater$ ]]
|
||||
then # Digipeater only
|
||||
FILTER=""
|
||||
IGFILTER=""
|
||||
IGLOGIN=""
|
||||
IGSERVER=""
|
||||
IGTXLIMIT=""
|
||||
IGTXVIA=""
|
||||
COMMENT="${F[_COMMENT_]} Digipeater | ${F[_LOC_]}"
|
||||
PBEACON="PBEACON delay=${F[_DIGIPEATDELAY_]} every=${F[_DIGIPEATEVERY_]} symbol=\"digi\" overlay=S lat=${F[_LAT_]} long=${F[_LONG_]} POWER=${F[_POWER_]} HEIGHT=${F[_HEIGHT_]} GAIN=${F[_GAIN_]} COMMENT=\"$COMMENT\" via=${F[_HOPS_]}"
|
||||
else # Digipeater + iGate
|
||||
IGTXVIA="IGTXVIA 0 ${F[_HOPS_]}"
|
||||
COMMENT="${F[_COMMENT_]} Digipeater+iGate | ${F[_LOC_]}"
|
||||
PBEACON="PBEACON sendto=IG delay=${F[_IGDELAY_]} every=${F[_IGEVERY_]} symbol=\"igate\" overlay=T lat=${F[_LAT_]} long=${F[_LONG_]} COMMENT=\"$COMMENT\""
|
||||
IGLOGIN="IGLOGIN ${F[_CALL_]}-${F[_SSID_]} $(aprsPasscode ${F[_CALL_]})"
|
||||
FILTER="FILTER IG 0 $(echo "${F[_FILTER_]}" | sed -e "s/\$LAT/${F[_LAT_]}/" -e "s/\$LONG/${F[_LONG_]}/")"
|
||||
IGFILTER="IGFILTER ${F[_IGFILTER_]}"
|
||||
IGSERVER="IGSERVER ${F[_SERVER_]}"
|
||||
else # Digipeater + iGate
|
||||
PBEACON_IGATE="PBEACON sendto=IG delay=00:30 every=15:00 symbol=\"igate\" overlay=T lat=${F[_LAT_]} long=${F[_LONG_]} COMMENT=\"$COMMENT\""
|
||||
fi
|
||||
DIGIPEAT="DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$ TRACE"
|
||||
;;
|
||||
"iGate (RX Only)") # iGate RX Only
|
||||
DIGIPEAT=""
|
||||
IGTXLIMIT=""
|
||||
IGTXVIA=""
|
||||
COMMENT="${F[_COMMENT_]} iGate | ${F[_LOC_]}"
|
||||
PBEACON="PBEACON sendto=IG delay=${F[_IGDELAY_]} every=${F[_IGEVERY_]} symbol=\"igate\" overlay=R lat=${F[_LAT_]} long=${F[_LONG_]} COMMENT=\"$COMMENT\""
|
||||
IGLOGIN="IGLOGIN ${F[_CALL_]}-${F[_SSID_]} $(aprsPasscode ${F[_CALL_]})"
|
||||
IGSERVER="IGSERVER ${F[_SERVER_]}"
|
||||
FILTER="FILTER IG 0 $(echo "${F[_FILTER_]}" | sed -e "s/\$LAT/${F[_LAT_]}/" -e "s/\$LONG/${F[_LONG_]}/")"
|
||||
IGFILTER="IGFILTER ${F[_IGFILTER_]}"
|
||||
PBEACON_IGATE="PBEACON sendto=IG delay=00:30 every=15:00 symbol=\"igate\" overlay=R lat=${F[_LAT_]} long=${F[_LONG_]} COMMENT=\"$COMMENT\""
|
||||
;;
|
||||
"iGate (TX+RX)") # iGate TX+RX
|
||||
DIGIPEAT=""
|
||||
IGTXVIA="IGTXVIA 0 ${F[_HOPS_]}"
|
||||
COMMENT="${F[_COMMENT_]} iGate | ${F[_LOC_]}"
|
||||
PBEACON="PBEACON sendto=IG delay=${F[_IGDELAY_]} every=${F[_IGEVERY_]} symbol=\"igate\" overlay=T lat=${F[_LAT_]} long=${F[_LONG_]} COMMENT=\"$COMMENT\""
|
||||
IGLOGIN="IGLOGIN ${F[_CALL_]}-${F[_SSID_]} $(aprsPasscode ${F[_CALL_]})"
|
||||
IGSERVER="IGSERVER ${F[_SERVER_]}"
|
||||
FILTER="FILTER IG 0 $(echo "${F[_FILTER_]}" | sed -e "s/\$LAT/${F[_LAT_]}/" -e "s/\$LONG/${F[_LONG_]}/")"
|
||||
IGFILTER="IGFILTER ${F[_IGFILTER_]}"
|
||||
iGate) # iGate TX+RX
|
||||
PBEACON_IGATE="PBEACON sendto=IG delay=00:30 every=15:00 symbol=\"igate\" overlay=T lat=${F[_LAT_]} long=${F[_LONG_]} COMMENT=\"$COMMENT\""
|
||||
;;
|
||||
Custom)
|
||||
return
|
||||
;;
|
||||
*)
|
||||
Die "Invalid mode choice"
|
||||
@ -287,9 +330,12 @@ ARATE ${F[_ARATE_]}
|
||||
PTT ${F[_PTT_]}
|
||||
MYCALL $MYCALL
|
||||
MODEM 1200
|
||||
AGWPORT 0
|
||||
KISSPORT 0
|
||||
$PBEACON
|
||||
AGWPORT ${F[_AGWPORT_]}
|
||||
KISSPORT ${F[_KISSPORT_]}
|
||||
$PBEACON0
|
||||
$PBEACON1
|
||||
$PBEACON2
|
||||
$PBEACON_IGATE
|
||||
$IGLOGIN
|
||||
$FILTER
|
||||
$IGSERVER
|
||||
@ -318,9 +364,9 @@ function killDirewolf () {
|
||||
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
|
||||
echo -e "\n\nDirewolf stopped. Click \"Save & [Re]start...\" button below to restart." >$PIPEDATA
|
||||
else
|
||||
echo -e "\n\nDirewolf was already stopped. Click \"Restart...\" button below to restart." >$PIPEDATA
|
||||
echo -e "\n\nDirewolf was already stopped. Click \"Save & [Re]start...\" button below to restart." >$PIPEDATA
|
||||
fi
|
||||
}
|
||||
|
||||
@ -346,17 +392,40 @@ SCRIPT_ID="$(ScriptInfo | grep script_id | tr -s ' ' | cut -d' ' -f3)"
|
||||
SCRIPT_HEADSIZE=$(grep -sn "^# END_OF_HEADER" ${0} | head -1 | cut -f1 -d:)
|
||||
VERSION="$(ScriptInfo version | grep version | tr -s ' ' | cut -d' ' -f 4)"
|
||||
|
||||
TITLE="Direwolf APRS Monitor and Configuration $VERSION"
|
||||
TITLE="Direwolf APRS Manager $VERSION"
|
||||
CONFIG_FILE="$HOME/direwolf_aprs.conf"
|
||||
|
||||
CONFIG_TAB_TEXT="<b><big><big>Direwolf APRS Configuration</big></big></b>\n \
|
||||
<span color='red'><b>DO NOT USE</b></span> the '<b>~</b>' character in any field below. \
|
||||
Click the <b>Restart...</b> button to save your changes and restart APRS.\n"
|
||||
<span color='red'><b>DO NOT USE</b></span> the '<b>~</b>' or '<b>^</b>' characters in any field below! \
|
||||
Click the <b>Save...</b> button to save your changes and restart APRS.\n \
|
||||
<span color='blue'>Note that if you select <b>Custom</b> for the APRS Mode, you must \
|
||||
also select your own Direwolf configuration file using the button below. </span>\n \
|
||||
<span color='red'>** No error checking is done on your custom configuration file. **\n</span>"
|
||||
|
||||
ID="${RANDOM}"
|
||||
|
||||
RETURN_CODE=0
|
||||
#### APRS Default settings.
|
||||
FILTER_DEFAULT="FILTER IG 0 ( i/30/8/_LAT_/_LONG_/16 | i/60/0 ) & g/W*/K*/A*/N*"
|
||||
IGFILTER_DEFAULT="IGFILTER m/16"
|
||||
IGSERVER_DEFAULT="IGSERVER noam.aprs2.net"
|
||||
IGTXLIMIT_DEFAULT="IGTXLIMIT 6 10"
|
||||
IGTXVIA_DEFAULT="IGTXVIA 0 WIDE1-1,WIDE2-1"
|
||||
|
||||
# YAD Dialog Window settings
|
||||
POSX=10
|
||||
POSY=45
|
||||
WIDTH=1000
|
||||
|
||||
# Other settings
|
||||
SOCAT_PORT=3333
|
||||
AUDIO_STATS_INTERVAL=120
|
||||
TIME_FORMAT="%Y%m%dT%H:%M:%S"
|
||||
# Have direwolf allocate a pty
|
||||
#DIREWOLF="$(command -v direwolf) -p -t 0 -d u"
|
||||
# No pty
|
||||
# Direwolf does not allow embedded spaces in timestamp format string -T
|
||||
DIREWOLF="$(command -v direwolf) -a $AUDIO_STATS_INTERVAL -d u -T "$TIME_FORMAT""
|
||||
RETURN_CODE=0
|
||||
PIPE=$TMPDIR/pipe
|
||||
mkfifo $PIPE
|
||||
exec 6<> $PIPE
|
||||
@ -439,6 +508,7 @@ do
|
||||
command -v $A >/dev/null 2>&1 || Die "$A is required but not installed."
|
||||
done
|
||||
|
||||
upgradeSettings $CONFIG_FILE
|
||||
loadSettings $CONFIG_FILE
|
||||
|
||||
# If this is the first time running this script, don't attempt to start Direwolf
|
||||
@ -455,8 +525,10 @@ else # No configuration files exist
|
||||
FIRST_RUN=true
|
||||
fi
|
||||
|
||||
export -f setDefaults loadAPRSDefaults killDirewolf
|
||||
export load_aprs_defaults_cmd='@bash -c "setDefaults; loadAPRSDefaults"'
|
||||
#export -f setDefaults loadAPRSDefaults killDirewolf browseCustomFile
|
||||
export -f setDefaults killDirewolf browseCustomFile
|
||||
export click_browse_custom_file='@bash -c "browseCustomFile"'
|
||||
#export load_aprs_defaults_cmd='@bash -c "setDefaults; loadAPRSDefaults"'
|
||||
export click_aprs_help_cmd='bash -c "xdg-open /usr/local/share/nexus/aprs_help.html"'
|
||||
export PIPEDATA=$PIPE
|
||||
|
||||
@ -482,16 +554,10 @@ YAD_PIDs=()
|
||||
while true
|
||||
do
|
||||
|
||||
# Have direwolf allocate a pty
|
||||
#DIREWOLF="$(command -v direwolf) -p -t 0 -d u"
|
||||
# No pty
|
||||
# Direwolf does not allow embedded spaces in timestamp format string -T
|
||||
DIREWOLF="$(command -v direwolf) -t 0 -d u -T "%Y%m%dT%H:%M:%S""
|
||||
|
||||
# Kill any running processes and load latest settings
|
||||
killDirewolf $direwolf_PID
|
||||
# for P in ${YAD_PIDs[@]} $clearTextInfo_PID
|
||||
for P in $clearTextInfo_PID ${YAD_PIDs[@]}
|
||||
for P in $clearTextInfo_PID $socat_PID ${YAD_PIDs[@]}
|
||||
do
|
||||
kill $P >/dev/null 2>&1
|
||||
done
|
||||
@ -501,14 +567,14 @@ do
|
||||
loadSettings $CONFIG_FILE
|
||||
if [[ ${F[_ADEVICE_CAPTURE_]} == "null" || ${F[_ADEVICE_PLAY_]} == "null" ]]
|
||||
then
|
||||
yad --center --title="$TITLE" --borders=10 --text "<big><b>Audio device(s) are not set!</b></big>\nClick <b>Continue</b> below, then select the <b>Configure TNC</b> tab to select audio devices and PTT settings." --text-align=center --button="Continue":0 --buttons-layout=center
|
||||
yad --center --title="$TITLE" --borders=10 --text "<big><b>Audio device(s) are not set!</b></big>\nClick <b>Continue</b> below, then select the <b>Configure APRS</b> tab to select audio devices and PTT settings." --text-align=center --button="Continue":0 --buttons-layout=center
|
||||
fi
|
||||
|
||||
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>"
|
||||
TEXT="<big><b>APRS $MODE_MESSAGE Status</b></big>"
|
||||
yad --plug="$ID" --tabnum=1 --text="$TEXT" --back=black --fore=yellow \
|
||||
--text-info --text-align=center \
|
||||
--tail --listen --center <&6 &
|
||||
@ -517,98 +583,132 @@ do
|
||||
YAD_PIDs+=( $! )
|
||||
#tail -F --pid=$MONITOR_YAD_PID -q -n 30 $LOGFILE 2>/dev/null | cat -v >&6 &
|
||||
|
||||
clearTextInfo 15m &
|
||||
clearTextInfo_PID=$!
|
||||
#clearTextInfo 15m &
|
||||
#clearTextInfo_PID=$!
|
||||
|
||||
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
|
||||
echo -e "\n\nAPRS is not configured.\nConfigure it in the \"Configure APRS\" tab, then click the \"Save...\" button below." >&6
|
||||
else # Not a first run. Direwolf appears to be configured so start it
|
||||
echo >&6
|
||||
echo "Using Direwolf configuration in $DW_CONFIG:" >&6
|
||||
cat $DW_CONFIG | grep -v "^$" >&6
|
||||
echo >&6
|
||||
[[ ${F[_AUDIOSTATS_]} == 0 ]] || DIREWOLF+=" -a ${F[_AUDIOSTATS_]}"
|
||||
$DIREWOLF -c $DW_CONFIG >&6 2>&1 &
|
||||
direwolf_PID=$!
|
||||
echo -e "\n\nDirewolf APRS has started. PID=$direwolf_PID" >&6
|
||||
if [[ ${F[_APRSMODE_]} =~ ^Custom ]]
|
||||
then
|
||||
if [[ ${F[_CUSTOM_]} == "" || ! -s ${F[_CUSTOM_]} ]]
|
||||
then
|
||||
echo -e "\n\nCustom mode requested, but no custom direwolf configuration file found.\nSelect your custom configuration file in the \"Configure APRS\" tab, then click the \"Save...\" button below." >&6
|
||||
RUN_OK=false
|
||||
else
|
||||
cp "${F[_CUSTOM_]}" $DW_CONFIG
|
||||
echo "Using Custom Direwolf configuration in ${F[_CUSTOM_]}:" >&6
|
||||
RUN_OK=true
|
||||
fi
|
||||
else # Non-custom APRS mode requested.
|
||||
echo "Using Direwolf configuration in $DW_CONFIG:" >&6
|
||||
RUN_OK=true
|
||||
fi
|
||||
|
||||
if [[ $RUN_OK == true ]]
|
||||
then
|
||||
cat $DW_CONFIG | grep -v "^$" >&6
|
||||
echo >&6
|
||||
#[[ ${F[_AUDIOSTATS_]} == 0 ]] || DIREWOLF+=" -a ${F[_AUDIOSTATS_]}"
|
||||
# Open a terminal to receive the output from direwolf
|
||||
if [[ ${F[_MONITOR_]} == "TRUE" ]]
|
||||
then
|
||||
MONITOR_TITLE="APRS $MODE_MESSAGE Monitor"
|
||||
lxterminal --geometry=80x30 -t "$MONITOR_TITLE" -e "socat udp-recv:$SOCAT_PORT -" &
|
||||
echo -e "" | socat - udp-datagram:localhost:$SOCAT_PORT
|
||||
# Set background color of lxterminal if necessary
|
||||
#if [[ ${F[_COLORS_]} == 0 ]]
|
||||
#then
|
||||
# echo -e "" | socat - udp-datagram:localhost:$SOCAT_PORT
|
||||
#else
|
||||
# echo -e "\e[48;2;255;255;255m\e[0J\e[38;2;0;0;0m" | socat - udp-datagram:localhost:$SOCAT_PORT
|
||||
#fi
|
||||
fi
|
||||
# Send direwolf output to the terminal we opened earlier
|
||||
($DIREWOLF -t ${F[_COLORS_]} -c $DW_CONFIG 2>&6 | socat - udp-datagram:localhost:$SOCAT_PORT) &
|
||||
direwolf_PID=$(pgrep -f "^$DIREWOLF -t ${F[_COLORS_]} -c $DW_CONFIG")
|
||||
socat_PID=$(pgrep -f "socat udp-recv:$SOCAT_PORT -")
|
||||
if [[ $direwolf_PID == "" ]]
|
||||
then
|
||||
echo -e "\nDirewolf was *NOT* started" >&6
|
||||
else
|
||||
echo -e "\nDirewolf configured as APRS $MODE_MESSAGE mode has started. PID=$direwolf_PID" >&6
|
||||
if [[ ! ${F[_APRSMODE_]} =~ ^Custom ]]
|
||||
then
|
||||
echo -e "Direwolf listening on port ${F[_KISSPORT_]} for KISS connections." >&6
|
||||
echo -e "Direwolf listening on port ${F[_AGWPORT_]} for AGW connections." >&6
|
||||
fi
|
||||
fi
|
||||
if [[ $socat_PID != "" ]]
|
||||
then
|
||||
echo -e "\nExternal '$MONITOR_TITLE' running. PID=$socat_PID" >&6
|
||||
# Position the monitor window so it's not under the configuration window
|
||||
#bash -c "sleep 2;wmctrl -r "$MONITOR_TITLE" -e "0,$(($POSX + $WIDTH + 5)),$POSY,-1,-1"" &
|
||||
wmctrl -r "$MONITOR_TITLE" -e "0,$(($POSX + $WIDTH + 5)),$POSY,-1,-1"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# Start the Configure APRS.
|
||||
CMD=(
|
||||
yad --plug="$ID" --tabnum=2 --show-uri
|
||||
--item-separator="~"
|
||||
--separator="~"
|
||||
--align=right
|
||||
--text-align=center
|
||||
--align=right
|
||||
--borders=10
|
||||
--form
|
||||
--scroll
|
||||
--columns=3
|
||||
--text="$CONFIG_TAB_TEXT"
|
||||
--field="Call"
|
||||
--field="SSID":NUM
|
||||
--field="Tactical Call"
|
||||
--field="Comment/Status"
|
||||
--field="Location"
|
||||
--field="Grid Square"
|
||||
--field="LAT"
|
||||
--field="LONG"
|
||||
--field="Power (watts)":NUM
|
||||
--field="Antenna HAAT (ft)":NUM
|
||||
--field="Antenna Gain (dB)":NUM
|
||||
--field="Direwolf Capture ADEVICE":CB
|
||||
--field="Direwolf Playback ADEVICE":CB
|
||||
--field="Direwolf ARATE":CB
|
||||
--field="Direwolf PTT":CBE
|
||||
--field="Direwolf Audio Stats (show\nevery x sec. 0 disables)":CB
|
||||
--field="Autostart APRS when these\npiano switch levers are <b>ON</b>:":CB
|
||||
--field="<b> APRS Settings </b>\t\t\t\t\t\t":LBL
|
||||
--field="APRS Mode":CB
|
||||
--field="iGate TX Limit /min"
|
||||
--field="iGate TX Limit /5 min"
|
||||
--field="Client: FILTER IG 0"
|
||||
--field="iGate Server"
|
||||
--field="Server: IGFILTER"
|
||||
--field="Hops: IGTXVIA 0"
|
||||
--field="iGate Beacon\nDelay (mm:ss)"
|
||||
--field="iGate Beacon\nInterval (mm:ss)"
|
||||
--field="Digipeat Beacon\nDelay (mm:ss)"
|
||||
--field="Digipeat Beacon\nInterval (mm:ss)"
|
||||
--field="<b>Load Default APRS Settings</b>":FBTN
|
||||
--field="<b>Configuration Help</b>":FBTN
|
||||
--
|
||||
"${F[_CALL_]}"
|
||||
"${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~"
|
||||
"$ADEVICE_CAPTUREs"
|
||||
"$ADEVICE_PLAYBACKs"
|
||||
"$ARATEs"
|
||||
"$PTTs"
|
||||
"$AUDIOSTATs"
|
||||
$BOOTSTARTs
|
||||
"@disabled@"
|
||||
"$APRSMODEs"
|
||||
"${F[_IGTXLIMIT1_]}"
|
||||
"${F[_IGTXLIMIT5_]}"
|
||||
"${F[_FILTER_]}"
|
||||
"${F[_SERVER_]}"
|
||||
"${F[_IGFILTER_]}"
|
||||
"${F[_HOPS_]}"
|
||||
"${F[_IGDELAY_]}"
|
||||
"${F[_IGEVERY_]}"
|
||||
"${F[_DIGIPEATDELAY_]}"
|
||||
"${F[_DIGIPEATEVERY_]}"
|
||||
"$load_aprs_defaults_cmd"
|
||||
"$click_aprs_help_cmd"
|
||||
|
||||
# Start the Configure APRS tab
|
||||
CMD=(
|
||||
yad --plug="$ID" --tabnum=2 --show-uri
|
||||
--item-separator="~"
|
||||
--separator="~"
|
||||
--align=right
|
||||
--text-align=center
|
||||
--align=right
|
||||
--borders=10
|
||||
--form
|
||||
--scroll
|
||||
--columns=2
|
||||
--text="$CONFIG_TAB_TEXT"
|
||||
--field="<b>Configuration Help</b>":FBTN
|
||||
--field="Open monitor window when [re]starting this script":CHK
|
||||
--field="Call"
|
||||
--field="SSID":NUM
|
||||
--field="Tactical Call"
|
||||
--field="Comment/Status"
|
||||
--field="LAT"
|
||||
--field="LONG"
|
||||
--field="Power (watts)":NUM
|
||||
--field="Antenna HAAT (ft)":NUM
|
||||
--field="Antenna Gain (dB)":NUM
|
||||
--field="Direwolf Capture ADEVICE":CB
|
||||
--field="Direwolf Playback ADEVICE":CB
|
||||
--field="Direwolf ARATE":CB
|
||||
--field="Direwolf PTT":CBE
|
||||
--field="AGW Port":NUM
|
||||
--field="KISS Port":NUM
|
||||
--field="Direwolf text colors (0=off)":NUM
|
||||
--field="Autostart APRS when these\npiano switch levers are <b>ON</b>:":CB
|
||||
--field="<b>APRS Mode</b>":CB
|
||||
--field="<b>Select Direwolf config file (for APRS Mode Custom)</b>":FBTN
|
||||
--field="Custom mode config file:":RO
|
||||
--
|
||||
"$click_aprs_help_cmd"
|
||||
"${F[_MONITOR_]}"
|
||||
"${F[_CALL_]}"
|
||||
"${F[_SSID_]}~0..15~1~"
|
||||
"${F[_TACTICAL_CALL_]}"
|
||||
"${F[_COMMENT_]}"
|
||||
"${F[_LAT_]}"
|
||||
"${F[_LONG_]}"
|
||||
"${F[_POWER_]}~1..100~1~"
|
||||
"${F[_HEIGHT_]}~0..200~1~"
|
||||
"${F[_GAIN_]}~0..20~1~"
|
||||
"$ADEVICE_CAPTUREs"
|
||||
"$ADEVICE_PLAYBACKs"
|
||||
"$ARATEs"
|
||||
"$PTTs"
|
||||
"${F[_AGWPORT_]}~8001..8010~1~"
|
||||
"${F[_KISSPORT_]}~8011..8020~1~"
|
||||
"${F[_COLORS_]}~0..4~1~"
|
||||
$BOOTSTARTs
|
||||
"$APRSMODEs"
|
||||
"$click_browse_custom_file"
|
||||
"${F[_CUSTOM_]}"
|
||||
)
|
||||
"${CMD[@]}" > $TMPDIR/CONFIGURE_APRS.txt &
|
||||
YAD_PIDs+=( $! )
|
||||
@ -620,49 +720,40 @@ do
|
||||
#yad --title="$TITLE" --text="<b><big>Direwolf APRS Monitor and Configuration</big></b>" \
|
||||
yad --title="$TITLE" \
|
||||
--text-align="center" --notebook --key="$ID" --window-icon=logviewer \
|
||||
--posx=10 --posy=45 --width=1100 --height=700 \
|
||||
--posx=$POSX --posy=$POSY --width=$WIDTH --no-focus \
|
||||
--buttons-layout=center \
|
||||
--tab="Monitor APRS" \
|
||||
--tab="Direwolf Status" \
|
||||
--tab="Configure APRS" \
|
||||
--button="<b>Stop Direwolf APRS & Exit</b>":1 \
|
||||
--button="<b>Stop Direwolf APRS</b>":"bash -c 'killDirewolf $direwolf_PID'" \
|
||||
--button="<b>Restart Direwolf APRS</b>":0
|
||||
--button="<b>Save & [Re]start Direwolf APRS</b>":0
|
||||
|
||||
RETURN_CODE=$?
|
||||
|
||||
case $RETURN_CODE in
|
||||
0) # Read and handle the Configure APRS tab yad output
|
||||
[[ -s $TMPDIR/CONFIGURE_APRS.txt ]] || Die "Unexpected input from dialog"
|
||||
IFS='~' read -r -a TF < "$TMPDIR/CONFIGURE_APRS.txt"
|
||||
F[_CALL_]="${TF[0]^^}"
|
||||
F[_SSID_]="${TF[1]}"
|
||||
F[_TACTICAL_CALL_]="${TF[2]}"
|
||||
F[_COMMENT_]="${TF[3]}"
|
||||
F[_LOC_]="${TF[4]}"
|
||||
F[_GRID_]="${TF[5]}"
|
||||
F[_LAT_]="${TF[6]}"
|
||||
F[_LONG_]="${TF[7]}"
|
||||
F[_POWER_]="${TF[8]}"
|
||||
F[_HEIGHT_]="${TF[9]}"
|
||||
F[_GAIN_]="${TF[10]}"
|
||||
F[_ADEVICE_CAPTURE_]="${TF[11]}"
|
||||
F[_ADEVICE_PLAY_]="${TF[12]}"
|
||||
F[_ARATE_]="${TF[13]}"
|
||||
F[_PTT_]="${TF[14]}"
|
||||
F[_AUDIOSTATS_]="${TF[15]}"
|
||||
F[_BOOTSTART_]="${TF[16]}"
|
||||
F[_APRSMODE_]="${TF[18]}"
|
||||
F[_IGTXLIMIT1_]="${TF[19]}"
|
||||
F[_IGTXLIMIT5_]="${TF[20]}"
|
||||
F[_FILTER_]="${TF[21]}"
|
||||
F[_SERVER_]="${TF[22]}"
|
||||
F[_IGFILTER_]="${TF[23]}"
|
||||
F[_HOPS_]="${TF[24]}"
|
||||
F[_IGDELAY_]="${TF[25]}"
|
||||
F[_IGEVERY_]="${TF[26]}"
|
||||
F[_DIGIPEATDELAY_]="${TF[27]}"
|
||||
F[_DIGIPEATEVERY_]="${TF[28]}"
|
||||
|
||||
[[ -s $TMPDIR/CONFIGURE_APRS.txt ]] || Die "Unexpected input from dialog"
|
||||
IFS='~' read -r -a TF < "$TMPDIR/CONFIGURE_APRS.txt"
|
||||
F[_MONITOR_]="${TF[1]}"
|
||||
F[_CALL_]="${TF[2]^^}"
|
||||
F[_SSID_]="${TF[3]}"
|
||||
F[_TACTICAL_CALL_]="${TF[4]}"
|
||||
F[_COMMENT_]="${TF[5]}"
|
||||
F[_LAT_]="${TF[6]}"
|
||||
F[_LONG_]="${TF[7]}"
|
||||
F[_POWER_]="${TF[8]}"
|
||||
F[_HEIGHT_]="${TF[9]}"
|
||||
F[_GAIN_]="${TF[10]}"
|
||||
F[_ADEVICE_CAPTURE_]="${TF[11]}"
|
||||
F[_ADEVICE_PLAY_]="${TF[12]}"
|
||||
F[_ARATE_]="${TF[13]}"
|
||||
F[_PTT_]="${TF[14]}"
|
||||
F[_AGWPORT_]="${TF[15]}"
|
||||
F[_KISSPORT_]="${TF[16]}"
|
||||
F[_COLORS_]="${TF[17]}"
|
||||
F[_BOOTSTART_]="${TF[18]}"
|
||||
F[_APRSMODE_]="${TF[19]}"
|
||||
[[ ${F[_APRSMODE_]} =~ ^Custom ]] && F[_CUSTOM_]="${TF[21]}" || F[_CUSTOM_]=""
|
||||
## Update the yad configuration file.
|
||||
echo "declare -gA F" > "$CONFIG_FILE"
|
||||
for J in "${!F[@]}"
|
||||
|
@ -15,7 +15,7 @@
|
||||
#%
|
||||
#================================================================
|
||||
#- IMPLEMENTATION
|
||||
#- version ${SCRIPT_NAME} 1.8.1
|
||||
#- version ${SCRIPT_NAME} 1.8.2
|
||||
#- author Steve Magnuson, AG7GN
|
||||
#- license CC-BY-SA Creative Commons License
|
||||
#- script_id 0
|
||||
@ -113,7 +113,7 @@ function setTNCpatDefaults () {
|
||||
D[10]="20" # Slot Time
|
||||
D[11]="60" # Audio Stats
|
||||
D[12]="8001" # AGW Port
|
||||
D[13]="8010" # KISS Port
|
||||
D[13]="8011" # KISS Port
|
||||
D[14]="FALSE" # Enable pat HTTP server
|
||||
D[15]="disabled" # Disable piano switch autostart
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user