How to install an IRLP Experimental Reflector with TheLinkBox

This article explains how to build an IRLP experimental reflector with TheLinkbox. It also induces enabling codec trans-coding, Allstar connectivity, and installing a basic dashboard.

There are a lot of brains behind this and I like to give credit where credit is due. I used the references below and I primarily worked with Fred W5MGM getting the trans-coding and Allstar working and I’m hoping I documented it all correctly if I (or someone else) ever needed to replicate this in the future.

Reference:
http://75.127.13.79/TheLinkBox
http://75.127.13.79/TheLinkBox/Notes_Fred_W5MGM

I setup a server on https://virmach.com/ that was Debian 10 64bit.

Install section:

These SSH Commands Will Install TheLinkBox
cd /home
wget https://github.com/wd5m/misc/raw/master/thelinkbox-compiled-debian9.tgz
tar xvzf thelinkbox-compiled-debian9.tgz
cd /home/thelinkbox
wget http://75.127.13.79/TheLinkBox/tlb.conf

Go into the file /home/thelinkbox/tlb.conf
sudo nano /home/thelinkbox/tlb.conf
Put in your personal echolink callsign and password
Then start up the linkbox with the following command
linkbox/tlb -d -f tlb.conf

After the software is installed and working to your satisfaction
you can run it in the background with this script
sudo nano /root/start

once you are in editing the start file paste this in:

#!/bin/bash

sleep 1
echo -n "Changing Present Working Directory PWD to home"
cd /home/thelinkbox
echo "Done!"


sleep 1
echo -n "Update the timezone to central time... "
sleep 1
TZ='America/Chicago'; export TZ
echo "Done!"
sleep 1
echo -n "here is the current time and date"

date

sleep 1
echo -n "Starting up the Link Box "
linkbox/tlb -d -f tlb.conf  >&/dev/null 2>&1 &
echo "Done!"

sleep 1

echo -n "this is the end of this script - - - " 

sleep 1 

echo " good bye." 

exit

Now start at an fresh ssh command window and type
/root/start
to start your LinkBox in the background on the server (if the server reboots you must do this again).

Transcoding section:

Create the following script
cd /home/thelinkbox/scripts; sudo nano tlbevent.sh

Paste in:

#!/bin/bash
# tlbEvent script
# Set path to this script in tlb.conf as: EventScript = /home/tlb/scripts/tlbEvents
# There are many other things you can do from this script baesd on tlb events.
# See TLB documentation.
# WD5M
TLBCMD="/usr/local/bin/tlbcmd"    # path to "tlbcmd" executable
# Logging - calls to this function have been commented out.
function log {
        local LOGFILE=/home/tlb/log/messages
        local MESSAGE="TLB: $@"
        echo "${0##*/}:$MESSAGE"
        if [ -n "$LOGFILE" ]; then
                echo "`date '+%b %d %Y %T %z'` $MESSAGE" >> $LOGFILE
        fi
}
function linkit {
	# The linkit function loops through connected users and links new connection
	# Be sure to set ConfEnable = 0 in tlb.conf
	#
	THISCALL="${1}"
	var1=$(${TLBCMD} -s ..users)
	IFS=$'\n'
	for line in ${var1}
	do
		unset IFS
		set ${line}
		if [[ "${1}" == *[0-9]. ]]; then  # --> user number
			if [[ "${3}" == *K* ]]||[[ "${3}" == *x* ]]; then   # Kicked
				#log "${THISCALL} allready kicked or inactive: ${line}"
				continue        # Already kicked or inactive"
			fi
			if [[ "${2}" == "${THISCALL}" ]]; then
				#log "${THISCALL} skip same node: ${line}"
				continue        # skip same node
			fi
			if [[ "${3}" == *R* ]]; then   # Monitor enabled
				if [[ ${MONITOR} -eq 1 ]]; then # unlink when both enable monitor
					#log "unlink ${THISCALL} ${line}"
					JUNK=$(${TLBCMD} -s "..unlink ${THISCALL} ${2}")
				else
					#log "${THISCALL} link -m node: ${line}"
					JUNK=$(${TLBCMD} -s "..link -m ${THISCALL} ${2}")
				fi
			else
				#log "linking ${THISCALL} to ${2}"
				JUNK=$(${TLBCMD} -s "..link ${THISCALL} ${2}")
			fi
		fi
	done
} # end of linkit function

# ${1} = <event> see SCRIPTING.txt in tlb source.
# ${2} = <type> one of "echolink" "speakfreely" "rtp" "outbound"
# ${3} = <user>
# ${4} = <user_count>
if [ "${1}" = "connected" ]; then
	linkit "${3}"     # link to other ports
fi

exit 0

Save the file and make it executable with this command:
cd /home/thelinkbox/scripts
chmod +x tlbevent.sh

Go into /home/thelinkbox/tlbcmd.
I copied the tlbcmd file in this directory to /usr/local/bin

To test it out I typed in
/home/thelinkbox/scripts/tlbevent.sh

In /home/thelinbox/tlb.conf
On line 29 I added ConfEnable=0
On line 30 I added EventScript = /home/thelinkbox/scripts/tlbevent.sh

I changed the CompressionType on line 37 from 3 which =GSM to 5 which = ADPCM.

Rebooted the tlb machine, when it came back up started tlb connected through remote admin on my nano node using adpcm.
It transmits packets through echolink. Echolink transmits packets back through the nano node.

Verify everything is working as expected before continuing.

ASL Section:

Thsi assumes you have ASL running on another server somewhere already

Setting up Allstar (ASL not Hamvoip):
Open ports on ASL machine:
44966 as UDP
2074 as UDP

Configure your LinkBox tlb.conf like so:

###### Your personal settings ######################################
; Callsign MUST be UPPERCASE and either a link "-L" or repeater "-R" 

ConferenceCall = redacted
ConferencePass = redacted
ConferenceQth = redacted
EmailAdr = redacted

###### Echolink - no need to change these settings #################
; EchoLinkEnable = 0
ConferenceID = The Linkbox TLB
Banner = Welcome to this Echolink/IRLP conference
Banner = TLB
; Banner = This is line 3 of the Banner
MaxConferenceClients = 99
WorkingDir = /home
EnableRemoteDTMF = 0
ShowStatusInInfo = 2
DirServerHost1 = server2.echolink.org
DirServerHost2 = server3.echolink.org
DirServerHost3 = server4.echolink.org
LoginInterval = 360
StationListInterval = 600
InactiveDirTimeout = 51000
LogFileRolloverType = 1
CmdPort = 5198
ChatPort = 5199
ConfEnable = 0
EventScript = /home/thelinkbox/scripts/tlbevent.sh
BlabOffTimer = 0
###### speakfreely/IRLP - no need to change these settings #########
SF_Enable = 1
RTP_Pass = -
RTP_Port = 44966
SF_Port = 2074
SF_ReplyPort = 2074
FullDuplex = 1
CompressionType = 0     ; 5=ADPCM   3=GSM   0=Uncompressed/uLaw

In /etc/asterisk/modules make sure you make the tlb channel load. It’s set to noload as default.
Then you’ll configure the /etc/asterisk/tlb.conf to connect to the machine you have the linkbox on via ip address.

Note the astnode can be your public node or private. I setup a private in case I needed to disconnect it.

[tlb0]
call=callsign-something ; Call of the app_rpt station
port=44966              ; Start of UDP port range (this port, port + 1)
astnode=1995            ; app_rpt node associated with this instance (for incoming connections)
context=radio-secure    ; Asterisk context for incoming connections
codec=ULAW              ; Default CODEC to be used


[nodes]
1001 = W6ABC,12.34.56.78,44966      ; This one is for W6ABC at ip 12.34.56.78:44966 default CODEC
1002 = W1XYZ,11.22.33.44,1234,G726  ; This one is for W1XYZ at ip 11.22.33.44:1234 with G726 CODEC

1001 example:
1001 = KV4S-R,555.555.555.555,44966 ; direct IP address not host name.

Next use your Allmon and connect node 1001 to your astnode you defined above.

make Linkbox show IRLP stations instead of IP addresses.
/home/thelinkbox/src/conference.c change line 3025 to
bFoundCallsign = TRUE;

/home/thelinkbox/linkbox
take an attached tlb and replace the tlb file that’s in there with this one.
Make it executable.
chmod +x tlb
Reboot the linbox and then restart it.
/root/start
Irlp nodes will then show up as node numbers.

Install a very basic dashboard:
Instructions found here:
https://github.com/Russell-KV4S/TheLinkBox-Dashboard

Here is a text version in case commands or scripts are problematic copying from wordpress:

Lastly, we found the tlb.log fills up pretty fast at some point it will crash the linkbox. At this time I’m not sure what the threshold is but if you add this to a crontab schedule of your choosing it will truncate the file:

> /home/tlb.log

That should have everything working (LinkBox, Transcoding, Duplex, Allstar, and a dashboard).

Have fun!

Author: KV4S

http://KV4S.com Amateur Radio Operator, Software Developer, Star Trek Online gamer. Game Handle: @Russell-KV4S

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.