-[[.:start]]
====== Explorations ======
** Digging Deeper into Allstar **
I've seen a few examples of small networks and am interested in building up a mixed protocol system too.
Some examples that interested me:
* Milnet [[http://milnet.io/]] with Allstar connected nodes and a DMR bridge
* Allstar node status [[http://stats.allstarlink.org/nodeinfo.cgi?node=424611]]
* W2YMM [[https://w2ymm.home.blog/allstar-howto/]] with a group of connected gateways, repeaters and a bridge to DMR etc.
* This one was discovered by accident on Allstar's Portal I mistyped my own original base node ID (pre-NNX) **48148** as [[http://stats.allstarlink.org/nodeinfo.cgi?node=48418 | 48418]] and found his system with lots of information on his blog
===== Adding more nodes =====
{{ :public:radio:2025:networkmap_2_.jpg?direct&600 |}}
It's possible to have up to 10 individual Node IDs with a single Allstar node number, by using NNX to add a 6th digit to the base node number...
My Base Number is ''48148'' and I activated the ''NNX'' feature and created 3 nodes
* ''481480''
* ''481481''
* ''481482''
Since they are all behind a NAT firewall, sharing one public IP address the nodes must use different UDP ports. To make this possible I created 2 new ''Server'' instances on the Allstar Portal, one per node, and chose the UDP ports :
[[https://www.allstarlink.org/portal/servers.php]]
* ''node481480'' => ''UDP 4569''
* ''node481481'' => ''UDP 4570''
* ''node481482'' => ''UDP 4571''
The choice of which server is used per node is chosen on the Node configuration page for each node, on the Allstar Portal
[[https://www.allstarlink.org/portal/nodes.php]]
Then I flashed new SD cards for the new nodes using the ASL 2.0.0 Beta 6 image I've used for the initial VHF Gateway node.
[[https://github.com/AllStarLink/ASL-Live-Build/releases/download/2.0.0-beta.6/asl-2.0.0-beta.6-kc1kcc-20210324-raspberrypi-armhf.img.zip]]
The config. for the original node had to be changed, to reflect the new node number ''481480'' versus ''48148'' which means editing (at least)
* ''/etc/asterisk/rpt.conf''
* ''/etc/asterisk/iax.conf''
* ''/etc/asterisk.extensions.conf''
To ensure each internal LAN node can find each other (can't rely on Allstar's DNS) it's necessary to add each one to the ''[nodes]'' stanza in each node's config file ''/etc/asterisk/rpt.conf'' using the appropriate IP and UDP port depending on which node is being configured.
; from the VHF Gateway node 481480
[nodes]
481480 = radio@127.0.0.1:4569/481480,NONE
481481 = radio@192.168.21.241:4570/481481,NONE
481482 = radio@192.168.21.242:4571/481482,NONE
I added the DVSwitch bridging to the hub node ''481481'' which is configured as //radioless//, I made a local/private node on that machine ''1399'' for this purpose.
All 3 nodes have ''supermon'' and this needed some configuration to make sure the Asterisk Manager ports were available on their external interfaces ''bindaddr = 0.0.0.0'' and not just on the loopback ''bindaddr = 127.0.0.1''
''/etc/asterisk/manager.conf'' =>
;
; Asterisk Call Management support
;
; By default asterisk will listen on localhost only.
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
[admin]
secret = YOUR_MANAGER_PASSWORD
read = all,system,call,log,verbose,command,agent,user,config
write = all,system,call,log,verbose,command,agent,user,config
===== Port Forwarding =====
My ADSL router has the following port forwards to allow external incoming connections to be set up
* ''UDP 4569'' => ''192.168.21.240'' for the VHF Gateway / Echolink node
* ''UDP 4570'' => ''192.168.21.241'' for the DMR Bridge node
* ''UDP 4571'' => ''192.168.21.242'' for the Test Node
* ''UDP 5198-5199'' => ''192.168.21.240'' for Echolink client connections
* ''TCP 42110'' => ''192.168.21.240'' for the VHF Gateway/Echolink node's Dashboard
* [[http://gm4slv.plus.com:42110]]
* ''TCP 42111'' => ''192.168.21.241'' for the DMR Bridge node's Dashboard
* [[http://gm4slv.plus.com:42111]]
* ''TCP 42112'' => ''192.168.21.242'' for the Test node's Dashboard
* [[http://gm4slv.plus.com:42112]]
To allow the node numbers to be resolved to useful names tp display on the dashboards the script ''astdb.php'' should run nightly to maintain a lookup table.
The image came with several copies of ''astdb.php'' in different places, all updating a central data file ''/var/log/asterisk/astdb.txt''. Which was confusing, as they all looked in different places for the file detailing private nodes.
===== Private Node Names =====
To allow private node numbers to appear as useful information, rather than ''not in database'' you first put the information in a file ''privatenodes.txt''
1399|GM4SLV|Bridge to DMR|TGIF TG2354429
1398|GM4SLV|Bridge to DMR|TGIF TG2354435
and then the ''astdb.php'' script pulls it in, with all the other nodes downloaded from the web, but ''astdb.php'' must know where to find the ''privatenodes.txt'' file.
The easiest way is to run the ''astdb.php'' from the directory containing ''privatenodes.txt''
and therefore it's the copy in ''/var/www/html/supermon/'' that is used, since ''privatenodes.txt'' resides here too.
To automate the process the update is done nightly via ''/etc/cron.daily/allstar_helpers'' which was modified to point to the correct version of ''astdb.php''
#!/bin/bash
# Get new allmon data daily
/var/www/html/supermon/astdb.php
=== Semi-automated Private Node descriptions ===
* I've written a small bash script on the gateway node481480.local to make it easier to re-name the internal //"private nodes"// as they appear listed in Supermon
* for this to work it's necessary to arrange public-key authentication on the nodes, with passwordless logins. But that's normal, anyway, no?
#!/bin/bash
NODE1=node481480.local
NODE2=node481481.local
NODE3=node481482.local
WEB=/var/www/html/supermon/
PRIVATE_NODES=/home/gm4slv/privatenodes.txt
sudo cp $PRIVATE_NODES $WEB
sudo $WEB/astdb.php
scp $PRIVATE_NODES gm4slv@$NODE2:
ssh $NODE2 'sudo cp /home/gm4slv/privatenodes.txt /var/www/html/supermon/ && /var/www/html/supermon/astdb.php'
scp $PRIVATE_NODES gm4slv@$NODE3:
ssh $NODE3 'sudo cp /home/gm4slv/privatenodes.txt /var/www/html/supermon/ && /var/www/html/supermon/astdb.php'
* Just make changes to the ''privatenodes.txt'' file in my local directory on the gateway ''node481480'' and then run
gm4slv@node481480:~$ ./update_private.sh
Success: astdb.txt 1422647 bytes
privatenodes.txt 100% 79 39.0KB/s 00:00
Success: astdb.txt 1422647 bytes
privatenodes.txt 100% 79 24.9KB/s 00:00
Success: astdb.txt 1422647 bytes
===== Favourites =====
* to keep the ''favorites.ini'' file consistent on all nodes I've written a script that distributes a copy to all nodes
* I edit the copy in my home directory on ''node481480'' and run
./update_favorites.sh
#!/bin/bash
# update_favorites.sh
# a script to keep the supermon favorites.ini file synchronized on all nodes
NODE1=node481480.local
NODE2=node481481.local
NODE3=node481482.local
WEB=/var/www/html/supermon/
FAVORITES=/home/gm4slv/favorites.ini
sudo cp $FAVORITES $WEB
scp $FAVORITES gm4slv@$NODE2:
ssh $NODE2 'sudo cp /home/gm4slv/favorites.ini /var/www/html/supermon/'
scp $FAVORITES gm4slv@$NODE3:
ssh $NODE3 'sudo cp /home/gm4slv/favorites.ini /var/www/html/supermon/'
===== Supermon : allmon.ini =====
The nodes monitored, and the menu to select them, and external websites, on each node's Supermon Dashboard is configured by ''allmon.ini''
Here's the current version:
++++ Generic /var/www/html/supermon/allmon.ini |
[All Nodes]
nodes = 481480,481481,481482,1399,1398
menu = yes
system = Nodes
[481480]
host = 192.168.21.240:5038
user = admin
passwd = "XXXX"
menu = yes
hideNodeURL = no
system = Nodes
[481481]
host = 192.168.21.241:5038
user = admin
passwd = "XXXX"
menu = yes
hideNodeURL = no
system = Nodes
[481482]
host = 192.168.21.242:5038
user = admin
passwd = "XXXX"
menu = yes
hideNodeURL = no
system = Nodes
[1399]
host = 192.168.21.241:5038
user = admin
passwd = "XXXX"
menu = yes
hideNodeURL = yes
system = Nodes
[1398]
host = 192.168.21.242:5038
user = admin
passwd = "XXXX"
menu = yes
hideNodeURL = yes
system = Nodes
[lsNodes 481480]
url = "http://gm4slv.plus.com:42110/cgi-bin/lsnodes_web?node=481480"
menu = yes
system = LsNodes
[lsNodes 481481]
url = "http://gm4slv.plus.com:42111/cgi-bin/lsnodes_web?node=481481"
menu = yes
system = LsNodes
[lsNodes 481482]
url = "http://gm4slv.plus.com:42112/cgi-bin/lsnodes_web?node=481482"
menu = yes
system = LsNodes
[Node 481840]
url = "http://gm4slv.plus.com:42110/"
menu = yes
system = Dashboards
[Node 481841]
url = "http://gm4slv.plus.com:42111/"
menu = yes
system = Dashboards
[Node 481842]
url = "http://gm4slv.plus.com:42112/"
menu = yes
system = Dashboards
[GM4SLV Wiki]
url = "https://gm4slv.org.uk/dokuwiki/doku.php?id=start"
menu = yes
system = External Sites
[Echolink Link Status]
url = "https://echolink.org/links.jsp?d=1&gs=IP90gg&sel=gridsq"
menu = yes
system = External Sites
[TGIF]
url = "https://tgif.network/"
menu = yes
system = External Sites
[AllStarLink]
url = "http://www.allstarlink.org"
menu = yes
system = External Sites
++++
* I've also made it easy to distribute the same ''allmon.ini'' file to all nodes
#!/bin/bash
# update_allmon.sh
# a script to distribute a common supermon config to all nodes
NODE1=node481480.local
NODE2=node481481.local
NODE3=node481482.local
WEB=/var/www/html/supermon/
ALLMON=/home/gm4slv/allmon.ini
sudo cp $ALLMON $WEB
scp $ALLMON gm4slv@$NODE2:
ssh $NODE2 'sudo cp /home/gm4slv/allmon.ini /var/www/html/supermon/'
scp $ALLMON gm4slv@$NODE3:
ssh $NODE3 'sudo cp /home/gm4slv/allmon.ini /var/www/html/supermon/'
===== Node Callsigns instead of Numbers =====
To have the telemetry say the //callsign// of a connected node, instead of its //node number//, install the script ''write_node_callsigns_ulaw.sh''
I put it in ''/usr/local/bin/'' and run it via root's crontab each day - but via a wrapper script ''/usr/local/bin/update_names.sh'' that then deletes the ulaw sound file for my own nodes, as I don't want all of them to be announced as ''GM4SLV'' - I'd rather hear the actual node numbers:
#!/bin/bash
/usr/local/bin/write_node_callsigns_ulaw.sh
rm /var/lib/asterisk/sounds/rpt/nodenames/481480.ulaw
rm /var/lib/asterisk/sounds/rpt/nodenames/481481.ulaw
rm /var/lib/asterisk/sounds/rpt/nodenames/1399.ulaw
rm /var/lib/asterisk/sounds/rpt/nodenames/1398.ulaw
rm /var/lib/asterisk/sounds/rpt/nodenames/48148.ulaw
rm /var/lib/asterisk/sounds/rpt/nodenames/481482.ulaw
I forget where I found it, so here's the ''write_node'' script itself
++++ write_node_callsigns_ulaw.sh |
#!/bin/bash
#
# Created by Marshall Dias
# Modified by Doug, WA3DSP 8/18/2015
#
# using ULAW format
#
# Script to write Calls to /var/lib/asterisk/sounds/rpt/nodenames
# which will then be used in place of node numbers. This script
# will NOT overwrite exisitng files unless you use the -o option.
# If you want to start clean and delete all nodename files do
# rm -rf /var/lib/asterisk/sounds/rpt/nodenames/*
# or delete just the files you want to replace.
#
# A single node number can be specified on the command line with
# the -n node -ex. -n 40000
#
# A -v option gives a little more info
# See all comments below
# Set the source directory to the Allstar database on your system.
# 'locate astdb.php' This file will exist if you are running any of the
# images from hamvoip.org or you have installed allmon or lsnodes on
# your system. For the BBB and RPi2 it will generally be /var/log/asterisk
SRCDIR=/var/log/asterisk
#SRCDIR=/var/www/html/allmon
# Set the destination directory.
# Use a tmp directory for testing
# The final destination for Allstar would be
# /var/lib/asterisk/sounds/rpt/nodenames
# Use the -d path option to overide
DESTDIR=/var/lib/asterisk/sounds/rpt/nodenames
# Test destination directory - must exist
#DESTDIR=/tmp/nodes
# Definitions of sound file directories
NODENAMES=/var/lib/asterisk/sounds/rpt/nodenames
LETTERS=/var/lib/asterisk/sounds/letters
NUMBERS=/var/lib/asterisk/sounds/digits
STRING=""
usage()
{
cat << EOF
Usage: $0 options
Writes voice files of call signs from node numbers
OPTIONS:
-h Show this message
-o Overwrite existings file(s)
-n node Specify node number - single write
-d path Specify path to output files
Default: /var/lib/asterisk/sounds/rpt/nodenames
-v Verbose
Write callsign for node 40000, no overwrite -
$0 -n 40000
Write callsign for node 40000, overwrite -
$0 -on 40000
Write all callsigns, no overwrite -
$0
Write all callsigns, overwrite
$0 -o
Write single node to specific directory -
$0 -n 40000 -d /etc/asterisk/local
EOF
}
OVERWRITE=""
VERBOSE=""
while getopts "hovn:d:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
d)
DESTDIR=$OPTARG
;;
o)
OVERWRITE=1
;;
n)
node=$OPTARG
;;
v)
VERBOSE=1
;;
?)
usage
exit
;;
esac
done
# Form filenames from callsign
make_call ()
{
STRING=""
foo=${f2,,}
for (( i=0; i<${#foo}; i++ )); do
char=${foo:$i:1}
case ${foo:$i:1} in
[0-9]*) FILENAME=$NUMBERS/$char.ulaw ;;
"/") FILENAME=$LETTERS/slash.ulaw ;;
"-") FILENAME=$LETTERS/dash.ulaw ;;
[a-z]*|[A-Z]*) FILENAME=$LETTERS/$char.ulaw ;;
esac
STRING="$STRING $FILENAME"
done
}
# Concatenate filenames into final audio file
write_call ()
{
if [ ! $OVERWRITE ]
then
if [ -f "$DESTDIR/$f1.ulaw" ]
then
echo "$DESTDIR/$f1.ulaw exists - not overwriting"
return
fi
fi
echo "Writing $DESTDIR/$f1.ulaw"
cat $STRING > "$DESTDIR/$f1.ulaw"
}
# If no node given process all nodes
if [ -z "$node" ]
then
while IFS='|' read f1 f2 f3 f4
do
if [ $VERBOSE ]; then echo "Processing Node Number: $f1 - Callsign: $f2" ; fi
make_call
write_call
done < $SRCDIR/astdb.txt
else
# process just given node
CALL=`grep -m 1 $node $SRCDIR/astdb.txt`
if [ -z "$CALL" ]
then
echo "No Call found for node - $1"
exit
else
f2=`echo $CALL | awk -F"|" '{print $2}'`
fi
f1=$node
if [ $VERBOSE ]; then echo "Processing Node Number: $node - Callsign: $f2" ; fi
make_call
write_call
fi
++++
There's a version that uses GSM coded files which didn't work on my system, as all the numbers and letters are in ''ulaw'' format, but for completeness here's the ''gsm'' version
++++ write_node_callsigns.sh |
# !/bin/bash
#
# write_node_callsigns.sh v0.8
#
# Doug, WA3DSP 8/18/2015
# Portions by Marshall Dias
#
# Script to write Calls to /var/lib/asterisk/sounds/rpt/nodenames
# which will then be used in place of node numbers. This script
# will NOT overwrite exisitng files unless you use the -o option.
# If you want to start clean and delete all nodename files do
# rm -rf /var/lib/asterisk/sounds/rpt/nodenames/*
# or delete just the files you want to replace.
#
# A single node number can be specified on the command line with
# the -n node -ex. -n 40000
#
# A -v option gives a little more info
#
# v 0.7 - removed level changing as this is accomplished in
# global telemetry level parameters. Files should
# stay at nominal levels.
# V 0.8 - added code to ignore semicolon comments. 6/5/2020, WA3DSP
# See all comments below
# Set the source directory to the Allstar database on your system.
# 'locate astdb.php' This file will exist if you are running any of the
# images from hamvoip.org or you have installed allmon or lsnodes on
# your system. For the BBB and RPi2 it will generally be /var/log/asterisk
SRCDIR=/var/log/asterisk
# Set the destination directory.
# Use a tmp directory for testing
# The final destination for Allstar would be
# /var/lib/asterisk/sounds/rpt/nodenames
# Use the -d path option to overide
DESTDIR=/var/lib/asterisk/sounds/rpt/nodenames
# Test destination directory - must exist
#DESTDIR=/tmp/nodes
# Definitions of sound file directories
RPTSOUNDS=/var/lib/asterisk/sounds/rpt
NODENAMES=/var/lib/asterisk/sounds/rpt/nodenames
LETTERS=/var/lib/asterisk/sounds/letters
NUMBERS=/var/lib/asterisk/sounds/digits
STRING=""
usage()
{
cat << EOF
write_node_callsigns.sh v0.8
Usage: write_node_callsigns.sh options
Writes Asterisk Allstar voice files of call signs from node numbers
OPTIONS:
-h Show this message
-a Process all nodes
-i Include node number with call
-o Overwrite existing file(s)
-n node Process single node (overrides -a)
-d path Specify path to output files
Default: /var/lib/asterisk/sounds/rpt/nodenames
-v Verbose
Write callsign for node 40000, no overwrite, all nodes -
$0 -n 40000
Write callsign for node 40000, overwrite, all nodes -
$0 -on 40000
Write all callsigns, no overwrite -
$0 -a
Write all callsigns, overwrite
$0 -ao
Write single node to specific directory -
$0 -n 40000 -d /etc/asterisk/local
Write single node including both call and node number, overwrite
$0 -ion 40000
EOF
}
OVERWRITE=""
VERBOSE=""
INCNODE=""
VOLUME=""
if [ $# -eq 0 ];
then
usage
exit 0
fi
if [ ! -e $SRCDIR/astdb.txt ]
then
echo "$SRCDIR/astdb.txt not found - Be sure to point SRCDIR in script to file location."
exit
fi
while getopts "hail:ovn:d:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
a) ;;
d)
DESTDIR=$OPTARG
;;
i)
INCNODE=1
;;
o)
OVERWRITE=1
;;
n)
node=$OPTARG
;;
v)
VERBOSE=1
;;
?)
usage
exit
;;
esac
done
# Form filenames from callsign
make_call ()
{
foo=${1,,}
for (( i=0; i<${#foo}; i++ )); do
char=${foo:$i:1}
case ${foo:$i:1} in
[0-9]*) FILENAME=$NUMBERS/$char.gsm ;;
"/") FILENAME=$LETTERS/slash.gsm ;;
"-") FILENAME=$LETTERS/dash.gsm ;;
[a-z]*|[A-Z]*) FILENAME=$LETTERS/$char.gsm ;;
esac
STRING="$STRING $FILENAME"
done
}
# Concatenate filenames into final audio file
write_call ()
{
if [ ! $OVERWRITE ]
then
if [ -f "$DESTDIR/$f1.gsm" ]
then
echo "$DESTDIR/$f1.gsm exists - not overwriting"
return
fi
fi
echo "Writing $DESTDIR/$f1.gsm"
cat $STRING > $DESTDIR/$f1.gsm
}
# If no node given process all nodes
if [ -z "$node" ]
then
Total=0
while IFS='|' read f1 f2 f3 f4
do
if [[ $f1 =~ ^\; ]]; then continue ; fi
if [ -z $f1 ]; then continue ; fi
if [ $VERBOSE ]; then echo "Processing Node Number: $f1 - Callsign: $f2" ; fi
((Total=Total+1))
STRING=""
make_call $f2
# Test for including node number
if [ $INCNODE ]
then
STRING=$STRING" $RPTSOUNDS/node.gsm "
make_call $f1
fi
write_call
done < $SRCDIR/astdb.txt
echo -e "\nProcessed $Total Nodes\n"
else
# process just given node (-n node)
CALL=`grep -m 1 $node $SRCDIR/astdb.txt`
if [ -z "$CALL" ]
then
echo "No Call found for node - $1"
exit
else
f2=`echo $CALL | awk -F"|" '{print $2}'`
fi
f1=$node
if [ $VERBOSE ]; then echo "Processing Node Number: $node - Callsign: $f2" ; fi
STRING=""
make_call $f2
# Test for including node number
if [ $INCNODE ]
then
STRING=$STRING" $RPTSOUNDS/node.gsm "
make_call $f1
fi
write_call
fi
++++
I only have this on the node that's my VHF Gateway ''481480''
===== Nodes Created =====
See : [[Allstar Nodes built]]
===== Accessing remotely via IAX =====
See [[iax_access|]]
===== Morse / Speech IDs =====
See [[Allstar_Id]]
===== Bridges =====
* DMR : [[allstar_dmr]]
* NXDN : [[allstar_nxdn|]]
===== Configs =====
* {{ :private:node481480.zip |}}
* {{ :private:node481481.zip |}}
* {{ :private:node481482.zip |}}
--- //John Pumford-Green 05/06/25 22:30 BST//
===== Further Information =====
{{tag>radio allstar dvswitch dmr echolink}}