ASL to DMR Bridge
ASL to DMR Bridge
ASL to DMR Bridge
We are going to take you through installing one of the most requested DVSwitch bridge types,
an Analog to DMR bridge. Throughout this document, we will use real node numbers, real DMR
IDs and real TG numbers. Where possible those values will be green. Please substitute your
numbers. We will start with a already running ASL node and add the required parts to bridge it
to BrandMeister DMR.
Throughout this document we will be testing along the way. If you do not get the expected
results as shown, stop, check your work and if it all looks right, ask for help. It is a LOT easier to
troubleshoot at the points along the way rather than at the end.
Everything we will do from this point on needs root privileges, so once logged in as user
repeater:
Gain root privileges
sudo -s
Jun 04 08:55:52 repeater systemd[1]: Started Asterisk PBX and telephony daemon.
It is much easier to make your changes and then run the program in the foreground to
troubleshoot before continuing.
Jun 04 08:55:52 repeater systemd[1]: Started Asterisk PBX and telephony daemon.
Jun 04 08:58:38 repeater systemd[1]: Stopping Asterisk PBX and telephony daemon...
Jun 04 08:58:39 repeater systemd[1]: Stopped Asterisk PBX and telephony daemon.
root@repeater:/etc/asterisk#
ASL will support multiple nodes on one server. For the bridge, this allows us to easily connect
and disconnect ASL from DMR. Not all nodes on ASL need be in the public node list. These
type of nodes are called private nodes. We are going to add a private node to ASL. This
minimizes the changes required to ASL. The settings for node 1999 are selected to keep
unwanted sounds from being sent to DMR from ASL.
Edit /etc/asterisk/rpt.conf
Copy the [1999] stanza from https://dvswitch.groups.io/g/allstarlink/wiki/home
Paste the stanza for the private node at the top of rpt.conf file.
; Your Repeater
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[1999]
rxchannel = USRP/127.0.0.1:34001:32001 ; Use the USRP channel driver. Must be enabled in modules.conf
; 127.0.0.1 = IP of the target application
; 34001 = UDP port the target application is listening on
; 32001 = UDP port ASL is listening on
duplex = 0 ; 0 = Half duplex with no telemetry tones or hang time. Ah, but Allison STILL talks!
holdofftelem = 1 ; Hold off all telemetry when signal is present on receiver or from connected nodes
; except when an ID needs to be done and there is a signal coming from a connected node.
telemdefault = 0 ; 0 = telemetry output off. Don't send Allison to DMR !!!!!!!!!!!!!!!!! Trust me.
telemdynamic = 0 ; 0 = disallow users to change the local telemetry setting with a COP command,
totime = 180000 ; transmit time-out time (in ms) (optional, default 3 minutes 180000 ms)
root@repeater:/etc/asterisk# asterisk -c
*CLI>
You can see both the private node (1999) and the public node (2100) have started properly.
Normal Repeater Init 1999
Normal Repeater Init 2100
Exit asterisk with a Control-C
[globals]
HOMENPA = 999 ; change this to your Area Code
NODE = 2100 ; change this to your node number
NODE1 = 1999 ; This is the private node
[default]
exten => i,1,Hangup
[radio-secure]
exten => ${NODE},1,rpt,${NODE}
exten => ${NODE1},1,rpt,${NODE1}
This completes the changes needed to be made to ASL Time to check our work.
Let’s look at the statistics for node 2100. At the CLI> prompt type
rpt stats 2100
root@repeater:/etc/asterisk# asterisk -c
*CLI>
*CLI>
Node 1999 is connected to node 2100. This tells us that our ASL configuration is correct.
Press Control-C to exit asterisk
It is best practice to build from the outside in. From shore to shore, so to speak. We can now
move on to connecting to BrandMeister.
Run:
apt-get update
If you see no errors let’s add the DVSwitch programs:
The ASL and DVSwitch Repository are both hosted on dvswitch.org so the DVSwitch programs
are available.
Run:
apt-get install dvswitch -y
This installs Analog_Bridge, MMDVM_Bridge, and md380-emu. The scripts and datafiles
needed to support these programs are also installed. Each of the programs is set to start at
boot. You don’t have to do anything.
Before we start, Let’s take a look at how this all goes together. Usually in the message board
you will see a simple ASCII diagram like this:
The <-> denotes two way communications between the programs. This is done via UDP ports.
Since the DVSwitch programs can be configured to build a large number of different bridges, the
number of options can be staggering to a first time user. Focus on the project at hand. In reality
there are not too many changes that need to be made. We have tried to be consistent in the
naming between programs and to set the default value as someone would use in a simple
bridge. Here is a port diagram of what you will be building:
From left to right, we start with The [1999] node stanza. Each node has a rxchannel. This
defines how the node communicates. In this case, we will use USRP to communicate with
Analog_Bridge. 127.0.0.1 is the address that ASL will send data to Analog_Bridge. 34001 is the
UDP port that ASL will send data on. 32001 is the port that ASL will listen for data on.
In Analog_Bridge.ini the [USRP] stanza defines how Analog_Bridge will communicate with
another USRP Partner. In this case ASL. 127.0.0.1 is the address that Analog_Bridge will send
data to. Port 32001 is the port that Analog_Bridge will send data to ASL on. Port 34001 is the
port that Analog_Bridge will listen for data from ASL on.
In Analog_Bridge.ini the [AMBE_AUDIO] stanza defines how Analog_Bridge will communicate
with a digital Partner. In this case MMDVM_Bridge. 127.0.0.1 is the address that Analog_Bridge
will send data to. Port 31103 is the port that Analog_Bridge will send data to MMDVM_Bridge
on. Port 31100 is the port that Analog_Bridge will listen for data from MMDVM_Bridge on.
MMDVM_Bridge is the program that connects to BrandMeister. Let’s check it’s status:
systemctl status mmdvm_bridge
Good, MMDVM_Bridge is not running though it is enabled, meaning it will start at boot.
You will see the program and it’s two configuration files.
In the [General] stanza, the callsign is your callsign. For the Id, It is STRONGLY recommended
to user your DMRID and append a 2 digit number between 01 and 99. These 2 digits are
referred to as SSID For this example that’s 3112138 plus 05. So the Id in the [General] stanza is
311213805. This is how MMDVM_Bridge logs into a BrandMeister Master. This will make it
MUCH easier for you to control any static Talk Groups you want for your bridge.
[DMR Network]
Enable=1
Address=3108.repeater.net
Port=62031
Jitter=360
Local=62032
Password=passw0rd
Slot1=0
Slot2=1
Debug=0
Time to test
This verifies the Callsign and the Id used to login to BrandMeister. The BrandMeister Master
Address and Port you are connected to and that you have successfully logged in to the Master.
While we are here, we can setup a Static Talk Group to pass through the bridge. We will add
the Talk Group number here:
Enter your Talk Group number in the box on the left and click on the right arrow. It will look like
this, for the example I used Talkgroup 311222:
At this point, you have both sides of bridge installed and working. Now it is time to connect them
together. Since one network is analog and the other network is digital we need to convert the
audio between the modes. That is the job of Analog_Bridge.
Press Control-C to stop MMDVM_Bridge.
root@repeater:/opt/Analog_Bridge# ls
Analog_Bridge Analog_Bridge.ini
root@repeater:/opt/Analog_Bridge#
You should see the program Analog_Bridge and it’s configuration file Analog_Bridge.ini
Edit /opt/Analog_Bridge/Analog_Bridge.ini
in the [GENERAL] stanza
change:
decoderFallBack = true
; Metadata management
exportMetadata = true ; Export metadata to USRP partner (transcode setups require this)
subscriberFile = /var/lib/dvswitch/subscriber_ids.csv ; DMR ID to callsign lookup data
Remember the values in green are for the example. You should use your values here.
; The metadata below is used when ASL is the source since it does not have any concept of digital modes
gatewayDmrId = 3112138 ; ID to use when transmitting from Analog_Bridge
repeaterID = 311213805 ; ID of source repeater
txTg = 311222 ; TG to use for all frames sent from Analog_Bridge -> xx_Bridge
txTs = 2 ; Slot to use for frames sent from Analog_Bridge -> xx_Bridge
colorCode = 1 ; Color Code to assign DMR frames
The [USRP] stanza is what is used to connect to ASL. This is also where you can tailor the
audio in and out of ASL to DMR. For now the defaults will work as is. We are done editing
Analog_Bridge. Let’s check our work.
Run Analog_Bridge in the foreground.
./Analog_Bridge Analog_Bridge.ini
If you got this far, you are doing well. It’s now time to test everything and see if we missed
anything. For this portion you will run all of the bridge programs in the foreground. Each will be
in a separate window so you can watch in real time. Again we will work from the outside in.
Let’s start asterisk. We will also tell asterisk to use more verbose logging so that we can see the
traffic coming from Analog_Bridge.
At the # prompt:
cd /etc/asterisk
*CLI>
Open a another window on the bridge
Gain root privileges
sudo -s
At the # prompt:
cd /opt/MMDVM_Bridge
At the # prompt:
cd /opt/Analog_Bridge
I will use my DMR radio and HotSpot to transmit on Time Slot 2 Talk Group 311222 to generate
traffic
Go over to the MMDVM_Bridge window
M: 2018-06-04 15:51:24.087 MMDVM_Bridge-20180423 is running
I: 2018-06-04 15:51:24.087 Started the DMR Id lookup reload thread
D: 2018-06-04 15:51:34.153 DMR, Sending authorisation
D: 2018-06-04 15:51:34.210 DMR, Sending configuration
M: 2018-06-04 15:51:34.246 DMR, Logged into the master successfully
M: 2018-06-04 15:52:04.825 DMR Slot 2, received network voice header from N4IRS to TG 311222
M: 2018-06-04 15:52:05.380 DMR Slot 2, received network end of voice transmission, 0.5 seconds, 0% packet loss, BER: 0.0%
In the above output from MMDVM_Bridge, Traffic from N4IRS on Slot 2, Talk Group 311222 has
been received. Notice the time stamp: 2018-06-04 15:52:04.825
Go over to the Analog_Bridge window
I: 2018-06-04 15:51:37.781 Starting USRP --> HB_Bridge thread
I: 2018-06-04 15:52:04.825 Begin TX: src=3112138 rpt=0 dst=311222 slot=2 cc=0
In the above output from Analog_Bridge, traffic is received from MMDVM_Bridge Notice the time
stamp: 2018-06-04 15:52:04.825. BINGO! We have passed traffic from BrandMeister to
Analog_Bridge through MMDVM_Bridge.
Traffic is flowing from DMR to ASL! ! Did you get the above results? If you did not, stop. Check
your work before continuing. If you did, let’s test in the other direction from ASL to DMR. You
could use a radio on the ASL node for this but there is a simply way for your first test to do this
without an analog radio.
Look at the Analog_Bridge windows, you should see something like this:
M: 2018-06-05 14:03:09.787 PTT on
Look at the MMDVM_Bridge windows, you should see something like this:
M: 2018-06-05 14:05:13.971 DMR, TX state = ON
I: 2018-06-05 14:05:13.971 DMR, Begin TX: src=3112138 rpt=311213805 dst=311222 slot=2 cc=1 metadata=3112138
If you still have your DMR radio and HotSpot connected, you should hear the tone coming out of
your radio. You do? We have liftoff !
Yes, the cop 4 command is a toggle, once on and once off. Please remember to turn it off.
Congratulations, You have built your very own ASL <-> DMR bridge. We hope that was not too
bad and you learned a few things along the way. Just a few little cleanup tasks to do and you
are ready to run.
The debug level in asterisk will quickly fill your log file with mostly unneeded information. Let’s
set it back to a sane value.
You probably want your public node to connect to the the DMR node when asterisk starts. We
will use the startup macro in rpt.conf to do this for you.
Edit rpt.conf
Set the startup macro to connect your public node to your private node by setting
startup_macro = *31999 in the [2100] node stanza.
Edit /etc/asterisk/rpt.conf
In the [2100] node stanza
Change:
startup_macro =
To:
startup_macro = *31999
Now it’s time to make sure everything will start at boot and do what you expect.
At the # prompt:
systemctl status asterisk
Jun 06 14:24:18 repeater systemd[1]: Started Asterisk PBX and telephony daemon.
root@repeater:/lib/systemd/system#
At the # prompt:
systemctl status analog_bridge
At the # prompt:
systemctl status md380-emu
At the # prompt:
systemctl status mmdvm_bridge
OK, you have been a very diligent person, time for a little fun
Connect to the running instance of asterisk
Asterisk -r
Did you hear yourself (parrot)? That’s right, ASL has a parrot function and it just proved your
bridge is working in both directions. Your DMR audio was actually parroted by ASL. A full round
trip. A pretty quick and easy way to verify everything is working as expected.
Before you start getting strange phone calls, we better turn off the parrot.
Get up, walk around, pat yourself on the back. It works! We will cover some basic info and then
you can go play. School is not quite out yet.
Below is some basic information you will need to maintain your bridge:
File locations
Programs
In /opt/program_name
/opt/MMDVM_Bridge/MMDVM_Bridge
Configuration files
With the program
/opt/MMDVM_Bridge/MMDVM_Bridge.ini
Datafiles
In /var/lib/mmdvm or /var/lib/dvswitch
/var/lib/mmdvm/DMRIds.dat
Logs
In /var/log/mmdvm, /var/log/dvswitch, /var/log/asterisk
/var/log/mmdvm/MMDVM_Bridge-2018-05-22.log
For the log files you can watch what one of the programs in real time by
“tailing” the log files. For example:
tail -f /var/log/dvswitch/Analog_Bridge.log will show you what is going on
with Analog_Bridge. Key your DMR radio and ID. See the traffic?
Scripts
In /usr/local/sbin
/usr/local/sbin/DMRIDUpdate.sh
Daily cron tasks to update data files
/etc/cron.daily/DMRIDUpdate (this is a symbolic link to the script
In /usr/local/sbin Note: If you want to add a link, the link name
should not have a extension (.sh)
Analog_Bridge
systemctl status analog_bridge
systemctl stop analog_bridge
systemctl start analog_bridge
systemctl restart analog_bridge
MMDVM_Bridge
systemctl status mmdvm_bridge
systemctl stop mmdvm_bridge
systemctl start mmdvm_bridge
systemctl restart mmdvm_bridge
MD380-Emulator
systemctl status md380-emu
systemctl stop md380-emu
systemctl start md380-emu
systemctl restart md380-emu
There are some final adjustments you will probably want to make to your bridge. You can
control the audio level from ASL to DMR. You can also control the audio level from DMR to ASL.
Both these values are in Analog_Bridge.ini. Let’s take a look.
[USRP]
address = 127.0.0.1
txPort = 32001
rxPort = 34001
aslAudio = AUDIO_UNITY
agcGain = -20 ; Gain (in db) of the AGC filter
dmrAudio = AUDIO_UNITY
dmrGain = 0.35 ; Gain factor of audio from ASL (0.0-1.0)
These values a labels will be changing to something more specific to the usage. ( Due to me
trying to document usage ) Grin Funny how you find things this way.