Setting Up HBLink for a Private DMR Network with HBlink
Published:
This guide walks you through setting up HBLink for a private DMR network, including configuring a Parrot (echo test) repeater and talkgroup. Ensure that you have administrative access to your server and basic knowledge of Python.
Step 1: Install Dependencies
- Create and Activate a Virtual Environment:
python3 -m venv venv source ./venv/bin/activate
- Install Required Python Libraries:
./venv/bin/pip install dmr_utils3 dmr_utils twisted
- Clone the HBLink Repository:
git clone https://github.com/HBLink-org/hblink3 /opt/hblink/hblink3
- Navigate to the Cloned Directory:
cd /opt/hblink/hblink3
Step 2: Configure HBLink
Main Configuration (hblink.cfg
)
The hblink.cfg
file defines your DMR systems and how they interact. For each system:
- Name: Must match across configurations.
- Port: Assign unique ports for each system.
- Talkgroup and Timeslot Settings:
- TG9 for local traffic on Timeslot 1.
- TG9999 for Parrot on Timeslot 2.
[GLOBAL]
PATH: ./
PING_TIME: 5
MAX_MISSED: 3
USE_ACL: True
REG_ACL: PERMIT:ALL
SUB_ACL: DENY:1
TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL
[REPORTS]
REPORT: True
REPORT_INTERVAL: 60
REPORT_PORT: 4321
REPORT_CLIENTS: 127.0.0.1
[LOGGER]
LOG_FILE: /var/log/hblink/hblink.log
LOG_HANDLERS: console-timed
LOG_LEVEL: DEBUG
LOG_NAME: HBlink
[ALIASES]
TRY_DOWNLOAD: True
PATH: ./
PEER_FILE: peer_ids.json
SUBSCRIBER_FILE: subscriber_ids.json
TGID_FILE: talkgroup_ids.json
PEER_URL: https://www.radioid.net/static/rptrs.json
SUBSCRIBER_URL: https://www.radioid.net/static/users.json
STALE_DAYS: 7
[MASTER-1]
MODE: MASTER
ENABLED: True
REPEAT: True
MAX_PEERS: 10
EXPORT_AMBE: False
IP:
PORT: 62030
PASSPHRASE: xxx
GROUP_HANGTIME: 5
USE_ACL: True
REG_ACL: DENY:1
SUB_ACL: DENY:1
TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL
[PARROT]
MODE: PEER
ENABLED: True
LOOSE: False
EXPORT_AMBE: False
IP:
PORT: 62031
MASTER_IP: 127.0.0.1
MASTER_PORT: 54100
PASSPHRASE: xxx
CALLSIGN: ECHO
RADIO_ID: 9999
RX_FREQ: 000000000
TX_FREQ: 000000000
TX_POWER: 1
COLORCODE: 1
SLOTS: 2
LATITUDE: 0
LONGITUDE: 0
HEIGHT: 0
LOCATION: Server Echo: TG 9999
DESCRIPTION: Echo server
URL:
SOFTWARE_ID: DMRGateway-20190702
PACKAGE_ID: MMDVM_HBlink
GROUP_HANGTIME: 5
OPTIONS:
USE_ACL: False
SUB_ACL: DENY:1
TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL
Rules Configuration (rules.py
)
The rules.py
file specifies conference bridges and how systems interact. Example:
BRIDGES = {
'PRIVATE_TG': [
{'SYSTEM': 'MASTER-1', 'TS': 1, 'TGID': 9, 'ACTIVE': True, 'TIMEOUT': 2, 'TO_TYPE': 'NONE', 'ON': [9], 'OFF': []}
],
'PARROT': [
{'SYSTEM': 'MASTER-1', 'TS': 2, 'TGID': 9999, 'ACTIVE': True, 'TIMEOUT': 2, 'TO_TYPE': 'NONE', 'ON': [9999], 'OFF': []},
{'SYSTEM': 'PARROT', 'TS': 2, 'TGID': 9999, 'ACTIVE': True, 'TIMEOUT': 2, 'TO_TYPE': 'NONE', 'ON': [9999], 'OFF': []}
]
}
Replace MASTER-1
and PARROT
with the names of your systems as defined in hblink.cfg
.
Playback Configuration (playback.cfg
)
Configure the Parrot repeater as described in the GitHub HBLink3 Parrot Config.
- Talkgroup: 9999
- Timeslot: 2
- Color Code: 1
[GLOBAL]
PATH: ./
PING_TIME: 10
MAX_MISSED: 5
USE_ACL: True
REG_ACL: PERMIT:ALL
SUB_ACL: DENY:1
TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL
[REPORTS]
REPORT: False
REPORT_INTERVAL: 60
REPORT_PORT: 4322
REPORT_CLIENTS: 127.0.0.1
[LOGGER]
LOG_FILE: /var/log/hblink/parrot.log
LOG_HANDLERS: file-timed
LOG_LEVEL: INFO
LOG_NAME: Parrot
[ALIASES]
TRY_DOWNLOAD: False
PATH: ./
PEER_FILE: peer_ids.json
SUBSCRIBER_FILE: subscriber_ids.json
TGID_FILE: talkgroup_ids.json
PEER_URL: https://database.radioid.net/static/rptrs.json
SUBSCRIBER_URL: https://database.radioid.net/api/dmr/user/?country=United+States
STALE_DAYS: 7
[PARROT]
MODE: MASTER
ENABLED: True
REPEAT: True
MAX_PEERS: 10
EXPORT_AMBE: False
IP:
PORT: 54100
PASSPHRASE: xxx
GROUP_HANGTIME: 5
USE_ACL: True
REG_ACL: DENY:1
SUB_ACL: DENY:1
TGID_TS1_ACL: PERMIT:9999
TGID_TS2_ACL: PERMIT:9999
Testing Configuration
To test the configuration, run the rules.py
file:
python3 rules.py
Step 3: Start Services
- Enable and Start HBLink:
systemctl start hblink
- Enable and Start Parrot:
systemctl start parrot.service
Step 4: Set Up Your Radio
- Talkgroups:
- TG9 for local communication.
- TG9999 for Parrot playback.
- Timeslots:
- TG9 on Timeslot 1.
- TG9999 on Timeslot 2.
- Color Code: 1.
- Monitor Mode: Enable monitor mode or add the talkgroups to a receive group to hear responses.
Talkgroup Forawrding with a pi-star
If you are using a pi-star or wpsd device for DMR, you can configure an additional DMR master network with talkgroup forwarding, which will enable you to program unique talkgroup numbers into your radio for use with the pi-star, and the pi-star will forward those talkgroup numbers to the ones we configured on the HBlink server. Add a DMR network with the following settings, or add the following stanza to the DMR configuration file (using the passphrase you chose in the configuration files):
[DMR Network 4]
Enabled=1
Name=HBlink
Address=<IP address of your HBlink server>
Port=62030
TGRewrite0=1,60009,1,9,1
TGRewrite1=2,69999,2,9999,1
Password="xxx"
Location=0
Debug=0
Substitue “DMR Network #” for the appropriate network number - generally one higher than the other stanzas. This rewrites talkgroups 60009 to HBlink talkgroup 9, and 69999 to HBlink talkgroup 9999. You can adjust 60009 and 69999 to whatever you’d like to use on your radio, and adjust 9 and 9999 to the ones you configured when you set up the HBlink server configuration files above.
Notes
I set the password in this guide to xxx
, but you can replace this with a password of your choosing. Be sure to replace it in all config files! In addition, the primary port for the HBlink server in this configuration is 62030, while the parrot repeater uses ports 62031 and 54001 behind the scenes. These can be adjusted in the configuration files as well.