Setup your own DMR Network with HBLink3

hblink.cfg

The hblink.cfg file is the main configuration for HBlink3. It is broken down into several sections, and I will explain each section and what it is used for. Let’s get started by opening hblink.cfg with the nano editor

nano hblink.cfg

If you have never used nano, it is a simple text editor. Using the arrow keys on your keyboard scroll down to the first section [Global].

Global

[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

For the most part we will leave this section how it is with a few minor changes.

Path is the main path for HBLink, we will leave it as it is.

PING_TIME: Is the amount of time between pings to a connected device. we will change this value to 20. That will give us 20 seconds between each ping. You could leave it at 3 but I have found that a minor network issue will cause the connected devices to dropped by HBLink.

MAX_MISSED: Is the amount of pings a device is allowed to miss before HBLink drops the device. The default is 3, but I also set this number to 20, for the same reason as the PING_TIME adjustment.

ACL section: we will leave this section how it is. ACL is Access Control List and can be used for to allow or deny users based on the users DMR ID. If you need more information on ACL and how to use them head over to google. For most Servers the default settings is the best.

Reports

[REPORTS]
REPORT: True
REPORT_INTERVAL: 60
REPORT_PORT: 4321
REPORT_CLIENTS: 127.0.0.1

This section is used if you are going to configure an HBMonitor to view the status and operation of your HBLink Server. I will not go into this section now as it is covered in another How To on setting up HBMonitor.

Logger

[LOGGER]
LOG_FILE: /tmp/hblink.log
LOG_HANDLERS: console-timed
LOG_LEVEL: DEBUG
LOG_NAME: HBlink

This section is how HBLink will produce the log files for your Server. You can leave it as the default and it will work just fine. I however have a few recommend tweaks. I would not leave the files in the /tmp/hblink.log, I would move that do your logging directory of /var/log/. I would then make a directory named hblink. So the LOG_FILE would look like /var/log/hblink/hblink.log.

The next item to adjust would be the LOG_HANDLERS as you can see by reading the comments, there are several options you could use. By default it is only set to console-timed. I normally add file-timed. To do that change the LOG_HANDLERS to look like this.

LOG_HANDLERS: console-timed,file-timed

The LOG_LEVEL is used to define the level of the logs you will get. By default it is set to DEBUG, which is good when you are first getting started and trying to find out why something is not working. Once you have the system setup, I would change that do INFO. In the comments there is a list of values you can set it to, depending on what you are needing.

Leave the LOG_NAME set to the default value.

Aliases

[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

For the most part you do not need to make any adjustments for the Aliases section. It will automatically download the json files. These files are only used for the logging system. The only thing you will need to adjust will be the STALE_DAYS. That defines how often HBLink should check for fresh copies of the downloaded files. Because I don’t watch my log files very often I usually adjust this to 999 days.

OpenBridge

[OBP-1]
MODE: OPENBRIDGE
ENABLED: True
IP:
PORT: 62035
NETWORK_ID: 3129100
PASSPHRASE: password
TARGET_IP: 1.2.3.4
TARGET_PORT: 62035
USE_ACL: True
SUB_ACL: DENY:1
TGID_ACL: PERMIT:ALL

Now we are starting to get into the nuts and bolts of the HBLink configuration file. This section will allow you to define any and all OpenBridge connections to your Server. If you are not familiar with the OpenBridge protocol developed by Brand Meister, you can get more information on their wiki page at https://wiki.brandmeister.network/index.php/Open_Bridge.

If you plain on accessing any talkgroups on the Brand Meister Network, you will need to setup an OpenBridge connection to them. To do this just log in to your Brand Meister Account and submit a support ticket. You will need to provide them with the IP Address of your server, your DMR ID and which talkgroups you want access to. Once the ticket is completed the will send you the information you need to use to setup the OpenBridge on your side. I will give you one word of warning. It is possible to setup a PEER connection to Brand Meister (see below), but don’t do it. Brand Meister’s policy regarding their network prohibits PEER connections from HBLink. If they find out you have setup a PEER connection you will run the risk of being removed from the Brand Meister Network. So don’t do it, use an OpenBridge connection instead.

OpenBridges can also be used to connect 2 HBLink Server together so I will go through the settings for you.

[OBP-1]This is the system name. It will be used in the rules.py file. If you have multiple OpenBridge Stanza’s you must name each one with a unique name. For clarity, I would name each one by it’s purpose. Keep the name in upper case and no spaces.
MODE: OPENBRIDGEMode this connection will use, in this case OPENBRIDGE
ENABLED: TrueEnables and Disables this connection True for enabled, False for Disabled.
IP:For the most part, leave blank. Would be used if you had multiple interfaces, you then specify the IP Address you want the inbound connection to use.
PORT: 62035This is the port used for the other side of this OpenBridge. You can use the same port number for inbound and outbound. If you decide to use 2 different port numbers, be sure to flip them on the other side.
NETWORK_ID: 3129100This will normally be your DMR ID, you can add 2 digits to the end of your id to make it unique.
PASSPHRASE: passwordThis will be the passphrase, it will be the same for both sides of this OpenBridge.
TARGET_IP: 1.2.3.4This will be the IP Address of the remote HBLink Server or the IP Address of the Brand Meister Server you are connecting to.
USE_ACL: TrueThis turn on and off the use of ACL’s. True is on and False is off.
SUB_ACL: DENY:1This will allow you to Deny or accept subscribers based on their ID. If set to DENY: any ID entered will be blocked. If set to PERMIT: any ID entered will only be permitted. You can also set it to PERMIT:ALL or DENY:ALL to accept or block all. If you enter ID’s, this is a comma separated list.
TGID_ACL: PERMIT:ALLThis acts the same as SUB_ACL, but only with TG ID’s. Normally would leave the default setting of PERMIT:ALL, but if you need to block a TG ID that is being passed by the OpenBridge, then you could use DENY: and the list of TG ID’s to be blocked. As with the SUB_ACL, this is a comma separated list.

Masters

[MASTER-1]
MODE: MASTER
ENABLED: True
REPEAT: True
MAX_PEERS: 10
EXPORT_AMBE: False
IP:
PORT: 54000
PASSPHRASE: s3cr37w0rd
GROUP_HANGTIME: 5
USE_ACL: True
REG_ACL: DENY:1
SUB_ACL: DENY:1
TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL

The next section we will talk about it the Masters section. You need to think of Master connections as inbound connections. This could be a Hotspot device or even a connection from an XLX Server or Reflector. It is basically devices connecting to your HBLink. In the rules section we will talk more about how a Master Connection is used. For now we will go through each of the settings as we did with the OpenBridge.

[MASTER-1]This is the system name. It will be used in the rules.py file. If you have multiple Master Stanza’s you must name each one with a unique name. For clarity, I would name each one by it’s purpose. Keep the name in upper case and no spaces
MODE: MASTERThis is the mode for this connection, will be set to MASTER.
ENABLED: TrueEnable or Disable this MASTER connection. True to Enable, False to Disable.
REPEAT: TrueYou will normally leave this to True. This setting will determine if the traffic coming across this connection will be repeated to the group in the Conference Bridge this system is used in. If set to False, than any traffic will not be repeated to the group.
MAX_PEERS: 10This is the Maximum number of PEER Connections this Master will handle. Something to keep in mind when setting up Master Connections, is that each PEER will behave the same. So if you have 10 PEERS connected to this 1 master all the PEERS will be connected to the same Talkgroup in the Conference Bridge. It is best if each PEER connection has a their own MASTER connection. More on this when we get to the rules.
EXPORT_AMBE: FalseThis is used to Export the AMBE Audio, normally left at False.
IP:Just like the OpenBridge Stanza, you will normally leave this blank. Unless you have multiple IP Address on your server and need to specify which IP Address is to be used.
PORT: 54000This is the port to be used by the PEERs. Each MASTER should use it’s own port number. If you are creating a public connection to your HBLink Server, you would use the standard port of 62031.
PASSPHRASE: s3cr37w0rdThis is the passphrase each PEER will use to get authenticated by the MASTER.
GROUP_HANGTIME: 5This is how long HBLink will hold a Talkgroup before it will accept any new Talkgroups. For example, if you are talking on TG 1 and want to move to TG 2, you will have to wait 5 seconds before moving to the new Talkgroup. This value is in seconds, I normally set this to 1.
USE_ACL: TrueJust like the OpenBridge, this will turn on and off ACLs. True is on and False if off.
REG_ACL: DENY:1REG_ACL is used for Radio ID’s, just like in the SUB_ACL, you and PERMIT or DENY by Radio ID for this MASTER Connection.
SUB_ACL: DENY:1See OpenBridge SUB_ACL for explanation.
TGID_TS1_ACL: PERMIT:ALLThis works the same as the OpenBridge TGID_ACL, the only difference is this will only PERMIT or DENY Talkgroups on Time Slot 1.
TGID_TS2_ACL: PERMIT:ALLThis is just like TGID_TS1_ACL, except it will work on Time Slot 2.

Peers

[REPEATER-1]
MODE: PEER
ENABLED: True
LOOSE: False
EXPORT_AMBE: False
IP:
PORT: 54001
MASTER_IP: 172.16.1.1
MASTER_PORT: 54000
PASSPHRASE: homebrew
CALLSIGN: W1ABC
RADIO_ID: 312000
RX_FREQ: 449000000
TX_FREQ: 444000000
TX_POWER: 25
COLORCODE: 1
SLOTS: 1
LATITUDE: 38.0000
LONGITUDE: -095.0000
HEIGHT: 75
LOCATION: Anywhere, USA
DESCRIPTION: This is a cool repeater
URL: www.w1abc.org
SOFTWARE_ID: 20170620
PACKAGE_ID: MMDVM_HBlink
GROUP_HANGTIME: 5
OPTIONS:
USE_ACL: True
SUB_ACL: DENY:1
TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL

The last section we will talk about in the hblink.cfg file is the PEER connections. This connection is used as an outbound connection. You use a PEER connection to connect to another HBLink Server, another network that allows PEER Connections, or to an XLX Server. I will once again warn you about setting up a PEER Connection to Brand Meister, simply don’t do it. Don’t be intimated by the size of this section, like before I will break everything down for you, so you understand what each line in the Stanza means. Take a deep breath and let’s get started.

[REPEATER-1]Just like before, this is the system name for this PEER Connection. Each PEER connection must have it’s own name.
MODE: PEER/XLXPEERFor a PEER Connection there are 2 types of MODES. The first as shown here PEER. This is used to connect to other HBLink Servers or Networks. The second type is XLXPEER, this is used to connect to an XLX Server.
ENABLED: TrueThis Enables and Disables this PEER connection True is on and False is off.
LOOSE: FalseLoose has 2 options, False for off and True for on. When set to True, this will relax the validation on packets recevied from the master. You will end up turn this on for XLX Servers or Networks like DMR+
EXPORT_AMBE: FalseThis is used to Export the AMBE Audio, normally left at False.
IP:Just like the OpenBridge and Master Stanza, you will normally leave this blank. Unless you have multiple IP Address on your server and need to specify which IP Address is to be used.
PORT: 54001This is an internal port HBLink will use. Each PEER Connection will need it’s own port number.
MASTER_IP: 172.16.1.1This is the IP Address of the MASTER you are connecting to. This could be another HBLink server, XLX server or other DMR Network.
MASTER_PORT: 54000This is the port number to use when connecting to a remote Master.
PASSPHRASE: homebrewThis is the passphrase that will be used to authentic with the remote Master.
CALLSIGN: W1ABCThis will be your Ham Radio Callsign. If you are setting this HBLink Server up as a Club Server and your Club has a Club Call, then you can use it here. Just make sure your Club as a DMR ID associated with the Club Call.
RADIO_ID: 312000This will be your DMR ID. If you are make multiple connection to the same Remote Master you can add 2 digits to the end of your DMR ID, just make sure it is unique.
RX_FREQ: 449000000A PEER connection will look like a repeater to the Master so you can set the RX Freq of your station. It is required to be here, but it does not really matter what it is set to.
TX_FREQ: 444000000This is the same as the RX_FREQ, does not matter what it is set to, as long as it is there.
TX_POWER: 25Like the TX and RX Freq you can set this to any value you like, or just leave it as it is.
COLORCODE: 1As you should know, DMR uses a colorcode, you should not change this value regardless of what colorcode you use in your radios.
SLOTS: 1This defines how many Time Slots you are going to use. DMR can use 2 Time Slots, and because this connection looks like a Repeater you can access to both Time Slots. Use 1 for 1 TS 1, 2 for TS2 or the best option is 3 for both Time Slots.
LATITUDE: 38.0000This is just like the RX and TX Freq, you can put the Latitude for your station or leave it to the default value, it is required so don’t remove it.
LONGITUDE: -095.0000See LATITUDE
HEIGHT: 75Again, this looks like a Repeater to the Master so this would be your antenna height, does not really matter what you use, just as long as it is there.
LOCATION: Anywhere, USAYep, you guessed it by now. Does not matter what you use as long as it is there. One difference with this setting is that if you have a monitor on the Master this value will show up on your dashboard so you can use this field to show where the server is or your station location.
DESCRIPTION: This is a cool repeaterJust a description field, you can leave it to default or but some short notes about this PEER connection.
URL: www.w1abc.orgJust enter a valid URL for your Website or point it to your QRZ page.
SOFTWARE_ID: 20170620This is the Software ID for HBLink, just leave it alone.
PACKAGE_ID: MMDVM_HBlinkThis is the Package ID for HBLink, no need to change it.
GROUP_HANGTIME: 5This is just like the other Group Hangtime setting we have already talked about. You can leave it at the default setting, I normally change it to 1.
OPTIONS:For the most part if you are connecting to another HBLink, you will leave this blank. If you are connecting to an XLX Reflector via a PEER Connection you can put which Module you want to connect to by default. If this stanza is set to XLXPEER instead of PEER, then you need to change this field to XLXOPTIONS: then you can define which module to connect to using the number of 4001-4027. 4001 would be A, 4002 would be B and so on.
USE_ACL: TrueThis behaves just like it did in the MASTER Stanza, so I will not repeat it here. So see the MASTER for details.
SUB_ACL: DENY:1See the MASTER Stanza
TGID_TS1_ACL: PERMIT:ALLSee the MASTER Stanza
TGID_TS2_ACL: PERMIT:ALLSee the MASTER Stanza

That will cover the hblink.cfg file. We have covered the basics of how this config is set and how to make changes to fit the system you are building. We are not done yet. In the next section we will talk about the rules.py file and how it works. If you are still in the nano editor you can press CTRL-O to save your changes and then CTRL-X to exit out of the nano editor.

Leave a Reply

Your email address will not be published. Required fields are marked *