Understanding the DMR Gateway


The MMDVM page on this site ends with a stack: radio, modem, MMDVMHost, gateways, internet. For most modes, the gateway layer is simple — a YSF gateway connects to one YSF reflector, an NXDN gateway to one NXDN reflector, and that's that. DMR is different, because DMR's world is different: not one network but many — and you shouldn't have to choose. DMRGateway is the program that lets you stop choosing.

The problem it solves

MMDVMHost, on its own, can hold exactly one DMR network connection. Point it at one server and that's your whole DMR universe until you log into the dashboard and change it. But the DMR landscape is a dozen networks, each with its own talkgroups, friends, and nets. Without help, every hop between networks is a configuration change.

DMRGateway was created by Jonathan Naylor, G4KLX — the developer behind MMDVM and much of the amateur digital-voice stack. See the hams who built digital voice.

The trick: one hotspot pretending to be many

DMRGateway slides into the stack between MMDVMHost and the internet. To MMDVMHost, it looks like a single, ordinary DMR network — nothing changes on that side. But on the internet side, DMRGateway opens several network connections at once, each a full, legitimate login to a different DMR network, each with its own identity (your DMR ID plus a distinct two-digit ESSID suffix, so the networks can tell your connections apart). One physical hotspot, several simultaneous network presences.

MMDVMHost sees one network DMRGateway routes by talkgroup Network 1 Network 2 Network 3 Network 4 All connections live at the same time — the talkgroup you key decides which one carries your voice
One hotspot, several simultaneous network logins, traffic sorted by talkgroup.

How it knows where to send your voice

The routing is rule-based, and the rules key off the talkgroup number you transmit. Each network slot in DMRGateway owns a set of talkgroup ranges — these TGs belong to network one, those to network two. Key up TG 91 and DMRGateway hands your transmission to the network whose rules claim 91; key up a talkgroup claimed by another slot and you've changed networks without touching a dashboard. Where two networks both use the same number, the common solution is a prefix: dial the talkgroup with an agreed leading digit or two, and DMRGateway strips the prefix and forwards the bare talkgroup to the right network. Your radio's channel list becomes the network selector.

Traffic coming the other way is simpler still: whatever arrives from any connected network flows back through MMDVMHost to your radio, with the gateway keeping the streams straight so two networks don't talk over each other.

Rewrite rules — how the routing is actually configured

The prefix is the idea. The rewrite rule is the machinery, and it lives in a single file: DMRGateway.ini.

Each network you connect to gets its own section in that file, and each section needs at least one TGRewrite rule telling the gateway which talkgroups belong to it. This is not optional decoration.

No rule, no route

DMRGateway will only pass traffic to a network if that traffic is named in a rewrite rule. A network can be enabled, connected, logged in and perfectly healthy — and still carry none of your audio, because nothing told the gateway to send it there.

What a TGRewrite says

TGRewrite=2,5000001,2,1,999999

Read left to right: traffic arriving from the radio on slot 2, with a talkgroup starting at 5000001, goes out to this network on slot 2, renumbered to start at 1, for a range of 999999 talkgroups.

In other words — strip the 5, keep the rest. Your radio dials 5031665; TGIF receives 31665. The rule works in both directions, so replies come back with the prefix restored and your radio sees the number it dialled.

One rule per network — that is the whole design

Five networks means five sections, and five rewrite rules. Each claims a numeric territory, and no two may overlap. That is how a single talkgroup number typed on a radio resolves to exactly one destination out of half a dozen possibilities.

Prefix Network (WPSD defaults)
none Whichever network is set as primary — BrandMeister by default
2 BrandMeister, when it is not the primary
4 SystemX
5 TGIF
6 XLX — TG 6 to talk, prefix 6 to change module
7 DMR2YSF / DMR2NXDN cross-over
8 DMR+ / FreeDMR / HBLink / custom hosts
9 Custom DMR network (with Automatic Rewrite Rules)

Why BrandMeister needs no prefix — and why that is misleading

Almost everyone learns this as “a bare number means BrandMeister.” True in practice, but it is not a fact about BrandMeister. It is a fact about being primary.

The primary network is the one whose prefix is waived, and BrandMeister is merely the default choice. Make DMR+ primary instead and the world inverts: DMR+ talkgroups are typed bare, and BrandMeister’s TG 91 becomes 2000091.

Worth knowing

Set your primary to whatever your local repeaters use. Then one codeplug entry works whether you go through the hotspot or through the machine on the hill — no duplicate contacts, no second zone.

The seven-digit rule

A prefixed talkgroup is padded with zeros to seven digits total. Prefix, then zeros, then the talkgroup.

You want You build it You dial
DMR+ TG 321 8 + 000 + 321 8000321
SystemX TG 2350 4 + 00 + 2350 4002350
TGIF TG 31665 5 + 0 + 31665 5031665
BrandMeister TG 91 primary — nothing to build 91

Two traps

A talkgroup that is already seven digits has nowhere to put a prefix. TGIF runs some of these. Prefixing one produces an eight-digit number, and a radio’s talkgroup field tops out around 16.7 million — so the number simply will not go in. That is a real limitation, not a configuration mistake.

The Configuration page overwrites hand-edited rules. WPSD generates the rewrite rules for you. If you hand-tune DMRGateway.ini and then touch anything on the main Configuration page, your edits are gone. Use the Full Editors under Advanced — and know that the dashboard can undo you.

Duplex hotspots: the slot is the first number in every rule

Look again at a rewrite rule and notice what it opens with.

TGRewrite=2,5000001,2,1,999999

That first digit is the RF timeslot — the slot your radio transmits on. The third is the slot used on the network side. In the stock configuration, both are always 2.

Why the defaults are all slot 2

Because a simplex hotspot has no timeslots at all. It runs DMO — Direct Mode — on a single frequency, with no TDMA framing to divide. Everything lands on TS2 no matter what your radio is set to. Set your handheld to TS1 into a simplex hotspot and the log will still show slot 2.

So DMRGateway ships configured for the common case, and the common case is a simplex hotspot. Every default rule says 2 because there is nowhere else for traffic to go.

Nothing does this for you

A duplex hotspot changes the picture, and DMRGateway does not know it yet. The Pi‑Star team put it plainly: the stock config is built for simplex, TS2 only — and repeater keepers and duplex hotspot owners must edit the rewrite rules themselves.

What a duplex hotspot gives you

A duplex hotspot transmits and receives on two frequencies, mimicking a repeater. That means real TDMA, and two genuinely independent timeslots. Two conversations can occupy the box at once — and, more usefully here, two different networks can live on two different slots.

To use TS1, you write rules that say so:

# TS1 — wide-area, via the primary network
TGRewrite=1,91,1,91,1

# TS2 — TGIF, prefix 5
TGRewrite=2,5000001,2,1,999999

Now the timeslot on your radio is doing real work: slot 1 is one network, slot 2 is another. The prefix still sorts talkgroups within a network; the slot sorts at a level above that.

Passing everything, on both slots

If you want a network to carry any talkgroup without naming each one, that is PassAllTG — and on a duplex box you need it twice, once per slot:

PassAllTG=1
PassAllTG=2

One catch-all only

PassAllTG can only be used on one network. It is a catch-all, and two catch-alls would be ambiguous. Give it to your primary network, and route everything else with explicit rules.

A design worth stealing

The neat arrangement on a duplex hotspot is to give each slot a job:

Two networks monitored simultaneously, on one box, with no dashboard visits. That is the thing a simplex hotspot simply cannot do, and it is the reason to own a duplex one.

One caution: a simplex hotspot cannot be talked into this. Rules that try to move traffic from TS1 to TS2 on a single-frequency hotspot do not work — the audio comes out on slot 2 regardless. The two slots are real only when the hardware is.

What it makes possible

The everyday win is convenience — your morning net on one network and your friends' talkgroup on another, both one key-press away, no reconfiguration. But the same machinery scales to the extreme: a single hotspot can hold half a dozen or more simultaneous network logins, making one small box on a shelf a citizen of essentially the whole DMR world at once. And because DMRGateway also accepts connections from things like XLX reflectors in their DMR guise, it's quietly the glue in a lot of cross-mode setups too.

The big idea

The talkgroup number was always how DMR users chose who to talk to. DMRGateway extends it to choose where — turning one radio, one hotspot, and one antenna into a doorway with every network behind it.


A noncommercial hobby reference compiled by N6JET, gathered from public sources and shared freely for anyone interested in amateur digital voice.