The default DMRGateway in Pi-Star or WPSD has all DMR networks active with adjustable timeouts/holds, but VE3RD created a DMRGateway-6 that has only one network active at a time, and the user can use multiple ways to switch networks. I have opted for using the TG codes to select network, e.g. TG 9004 selects network 4 for instance. For this to work I made sure this was in the beginning of my dmrgateway.3rd file for VE3RD’s version of the file. StartNet is what network is active on load.
StartNet=4
GWMode=1
RawNet=0
And this lets you use normal TG numbers on each network verses TG translation with the standard DMRGateway. There are also some other modes with translation and switching you can read about in Phil’s post, but I leave talk group translations for the standard DMRGateway. The nice part of the latest version is you also have the XLX network selected by TG 9007.
There are times I want to use Phil’s DMRGateway and times I like the original DMRGateway. So if you save your main DMRGateway config file and one for Phil’s DMRGateway, along with the versions of DMRGateway executable, you can use a simple bash script to switch between them. The original DMRGateway is good for monitoring multiple networks and talk groups if not too busy as well as having access to XLX reflectors. Phil’s gateway can be advantageous for using actual talk group numbers with no translation along with isolating networks, and using 7 digit personal talk group numbers on each network where the standard DMRGateway with translation limits you to one network. Or if you are monitoring busy talk groups on multiple networks and switching between them without awkward network switching on inactivity (you can also adjust timeouts but that’s not a perfect solution).
I copy /etc/dmrgateway to /etc/dmrgateway.old and setup /etc/dmrgateway.3rd for Phil’s DMRGateway. These are the DMRGateway config files, which then can be copied to the /etc/dmrgateway file when switching.
Also copy /usr/local/bin/DMRGateway to /usr/local/bin/DMRGateway.old and compile and copy Phil’s DMRGateway file to /usr/local/bin/DMRGateway.3rd, which can be copied to /usr/local/bin/DMRGateway when switching between versions.
Bash script to change to Phil’s version, file gw3 (chmod +x), and if on original Pi-Star uncomment the mount lines for switching between read only and read write (not needed with WPSD or if you disabled this functionality in Pi-Star):
#!/bin/bash
systemctl stop mmdvmhost dmrgateway
sleep 1
#mount -o remount,rw /
cp /etc/dmrgateway.3rd /etc/dmrgateway
cp /usr/local/bin/DMRGateway.3rd /usr/local/bin/DMRGateway
systemctl restart mmdvmhost dmrgateway
#mount -o remount,ro /
echo Installed VE3RD DMRGateway 6 configuration
Bash script to switch back to default DMRGateway, file gw (chmod +x)
#!/bin/bash
systemctl stop mmdvmhost dmrgateway
sleep 1
#mount -o remount,rw /
cp /etc/dmrgateway.old /etc/dmrgateway
cp /usr/local/bin/DMRGateway.old /usr/local/bin/DMRGateway
systemctl restart mmdvmhost dmrgateway
#mount -o remount,ro /
echo Restored original DMRGateway configuration
I just have the files in the /home/Pi-Star directory. Then to execute from the home directory, sudo ./gw3 or sudo ./gw. Also,
This also makes restoring the DMRGateway config files easy if Pi-Star damages them with its script and using the config editor. If you use Pi-Star or WPSD to edit the file, be sure to copy it to the .old or .3rd files as appropriate to preserve the change. Or just edit the .old or .3rd files directly and run the script to install. The bash scripts could be improved but just what I came up with on the fly to switch between the gateways quickly. And having access to the different DMRGateways is pretty handy depending on what kind of operating mode you’re trying to enjoy.