Author Topic: DMRGateway-3 Instruction Update 2021-04-29  (Read 205 times)

0 Members and 0 Guests are viewing this topic.

Offline VE3RD

  • Newbie
  • *
  • Posts: 37
  • Referrals: 0
DMRGateway-3 Instruction Update 2021-04-29
« on: April 29, 2021, 11:21:21 am »
DMRGateway-3 by VE3RD
( This file will be edited/modified periodically as issues are identified... Comments are welcome addressed to ve3rd@rac.va)

2021-05-01 :: CAUTION: Major Update in Progress to use Only one Config File. If you care to wait a couple of days, please do so.
DMRGateway-4 is currently undergoing initial in house testing.

The Pi-Star DMRGateway Rules are explained at https://github.com/g4klx/DMRGateway/wiki/Rewrite-Rules

Note 1: READ EVERYTHING BEFORE DOING ANYTHING

Note 2: Unless you have a duplex hotspot running in duplex mode, DO NOT use TS1 in any rules.
MMDVMHOST will change TS1 to TS2 and you WILL have conflicting rules.

Note 3: Start with the Bare Basics. Get any 2 Networks working and expand it in small Steps

Note 4: This DMRGateway-3 will run in two modes that I refer to as Basic Mode, and Translation Mode

BASIC: This mode does not translate the TG Numbers. Ie: 31665 in the radio is sent to the server as 31665 and the return to the radio is also on 31665. The network  is selected by keying up on TG 9001 to 9006 where 9001 selects Network 1 and 9004 selects Network 4. Therefore, to use Network 4, TG31665.  Key up on 9004 then switch to 31665 and key up. This works much the same as the profiles in the Openspot
!!  This mode uses the standard /etc/dmrgateway file

TRANSLATION: This mode uses 7 digit TG numbers in the radio and the ReWrite rules translate the the 7 digit TG to a regular or basic TG . Ie: 4031665 in the radio will be translated to 31665 on Network 4 and sent to the server associated with Network 4. The server will respond on 31665 Network 4 and the ReWrite rules will translate it over to 4031665 to the Radio
!! This mode uses a modified /etc/dmrgateway  which is /etc/dmrgateway.7. This file is a copy of /etc/dmrgateway except for the rewrite rules that are expanded for the 7 digit translation such as for Network 4.   You NEED Both Files.  This mode is selected by setting the NetMode parameter to 1, IE NetMode=1 in /etc/dmrgateway [General] section
TGRewrite0=2,1,2,1,999999      ## in Basic Mode becomes
TGRewrite0=2,4000001,2,1,99999     ## in Translation Mode
Again these two files should be identical except for the ReWrite Rule set

Note 5: When running the DMRGateway DO NOT make changes in the Pi-Star Configuration Page. It will very likely wipe out /etc/dmrgateway and replace it with a generic version. ALWAYS maintain a copy of /etc/dmrgateway

Note 6: The main reason for creating this version of the DMRGateway was to create the isolation between networks. This version will NOT allow any data to go to the radio that is not on the selected Network. Only one network can be active at anytime unlike the stock pi-star gateway that will allow multiple networks to send RF data at any given time and the radio can switch networks in the middle of a conversation.

Note 7: Please avoid the use of Network 3 of the DMRGateway-3  unless you are using one of the DMR2xxx crossovers.

Note 8: The Pi-Star Configuration Script that runs when you hit Apply Changes currently has over 4718 lines of code. This script is looking for BM on Net 1, DMR+ on Net2, HBLink or DMR2xx Crossovers on Net3. Any other use of these first 3 networks is just begging for trouble.


--------------------------------------------------------------------------------------------------
INSTALLATION of DMRGateway-3 (NEW)
1) Log into Pi-Star with an SSH Session, preferably putty.
2) Issue the following commands
   rpi-rw   
   sudo su
   git clone https://github.com/ve3rd/DMRGateway-3
   cd DMRGateway-3
   make clean
   make
3) make will compile all the components of the gateway and create a single binary file   DMRGateway
4) Install the new Binary by running the following script. The ./ are important
   ./binupdate.sh
5) the binupdate.sh script will
      a) stop the DMRGateway and replace the binary file in /usr/local/bin
      b) if /etc/dmrgateway.7 does not exist, it will overwrite /etc/dmrgateway and create /etc/dmrgateway.7
6) if new config files are created they MUST be edited with your information.
--------------------------------------------------------------------------------------------------
UPDATE: Check for and Update Your DMRGateway-3 Version
1) Log into Pi-Star with an SSH Session, preferably putty.
2) Issue the following commands
   rpi-rw   
   sudo su
   cd DMRGateway-3
   git pull
3) This last command will either tell you that you are up to date or will download the newer version
4) If a newer version is downloaded you MUST issue the following commands to install it, this will not re-install or modify your config files
   make clean
   make
   ./binupdate.sh
--------------------------------------------------------------------------------------------------

BARE BASICS

Note if this is a new install, most of this will have been done for you, All you need to do is modify the two files with your parameters, ie: radio frequencies, digital Id's, passwords and personal information

If you are modifying a stock Pi-Star DMRGateway, then most of the following will need to be performed

1) Cut and paste the following into your etc/dmrgateway file 
item 1) above is optional Optional - It may Not be required for DMRGateway-3 as the Installation script (binupdate.sh) will create the file with most of the default settings. You should only need to edit the two files for your RF Frequency, Digital ID, Passwords and Personal Information.

2) Replace the ****** code with your own parameters.

3) Remove the comment lines that are marked ####

4)  a) Text common 2 both Modes is standard Black
    b) Text to be used ONLY In Basic Mode is Blue
    c) Text used ONLY in Translation Mode is Green


[General]
RptAddress=127.0.0.1
RptPort=62032
LocalAddress=127.0.0.1
LocalPort=62031
RuleTrace=1
#### The following StartNet rule is NEW and sets the Network you want to be on when the DMRGateway starts
StartNet=4
#### The following NetMode rule is NEW and sets the Mode you wish to Start in
[ 0= Basic Mode where 31665 in your Radio is 31665 at the Server]   
[1 = Translation Mode using 7 Digits. Where 4031665 in the radio will put you on Network 4 TG 31665
NetMode=1
Daemon=1
Debug=1
RFTimeout=5
NetTimeout=5

[Log]
DisplayLevel=0
FileLevel=2
FilePath=/var/log/pi-star
FileRoot=DMRGateway

[Voice]
Enabled=0
Language=en_US
Directory=/usr/local/etc/DMR_Audio

[Info]
Latitude=****
Longitude=******
Location=******
Description="CA"
URL=https://www.qrz.com/db/****
RXFrequency=******
TXFrequency=*******
Enabled=1
Power=1
Height=0

[XLX Network]
Enabled=0
Id=*****
Startup=000
File=/usr/local/etc/XLXHosts.txt
Port=62030
Password=passw0rd
ReloadTime=60
Slot=2
TG=6
Base=64000
Relink=60
Debug=0
UserControl=1

[DMR Network 1]
Enabled=1
Name=****** Your Selected BM Server
Id=*******01
Address=******  Your selected BM Server IP Address
Password=******
TGRewrite1=2,1,2,1,999999
PCRewrite0=2,9990,2,9990,1
SrcRewrite0=2,9990,2,****,1     ## Where **** is the call sign in your radio

#Translation Mode used in /etc/dmrgateway.7
TGRewrite0=2,1000001,2,1,999999
PCRewrite0=2,1009990,2,9990,1
SrcRewrite0=2,9990,2,YourCall,1

Port=62031
Local=62035
Location=0
Debug=0


[DMR Network 2]
Enabled=0
Name=DMR+_IPSC2-CAN-TRBO
Id=**********
Address=209.226.17.178
Password="PASSWORD"
Port=55555
TGRewrite0=2,1,2,1,9999999
TGRewrite0=2,2000001,2,1,999999



[DMR Network 3]
Enabled=0
Name=HBLink


[DMR Network 4]
Enabled=1
Name=TGIF_Network
Address=tgif.network
Port=62031
Local=62038
Id=*******04
# Basic Mode
TGRewrite0=2,1,2,1,999999
PCRewrite0=2,9990,2,9990,1
SrcRewrite0=2,9990,2,YourCall,1

Password=**********
Location=0
Debug=1
# Translation Mode used in /etc/dmrgateway.7
TGRewrite0=2,4000001,2,1,999999
PCRewrite0=2,4009990,2,9990,1
SrcRewrite0=2,9990,2,YourCall,1


######  Leave This disabled until you get Network 1 and 4 Running
[DMR Network 5]
Enabled=0
Name=MNet_Network
Address=mnet.hopto.org
Port=62031
Local=62039
TGRewrite1=2,1,2,1,9999999
#Translation Mode used in /etc/dmrgateway.7
TGRewrite0=2,6000001,2,1,999999
PCRewrite0=2,6009990,2,9990,1
SrcRewrite0=2,9990,2,YourCall,1

Password=*************
Id=*******05
Location=0
Debug=1

#### The following Network 6 is ONLY available in the DMRGateway-3 by VE3RD
[DMR Network 6]
Enabled=0
Name=TGIF_Network
Address=tgif.network
Port=62031
Local=62037
Id=302395444
#Basic Mode
TGRewrite0=2,1,2,1,999999
PCRewrite0=2,9990,2,9990,1
SrcRewrite0=2,9990,2,YourCall,1

Password=passw0rd
Location=0
Debug=1
#Translation Mode used in /etc/dmrgateway.7
TGRewrite0=2,6000001,2,1,999999
PCRewrite0=2,6009990,2,9990,1
SrcRewrite0=2,9990,2,YourCall,1


[GPSD]
Enable=0
Address=127.0.0.1
Port=2947

[APRS]
Enable=1
Address=127.0.0.1
Port=8673
Description=APRS for DMRGateway
Suffix=DMR

[Dynamic TG Control]
Enabled=1
Port=3769

------------------------------------------------------------------------------
Special Instructions to handle 7 Digit Talk Groups in Translation Mode

New Discovery.... 7 Digit talk groups can be used in the 7 digit Translation Mode by adjusting the TGRewrite rules as follows
TGRewrite0=2,5000001,2,3023954,1           // 5000001 in the radio uses the 7 digit tg 3023954
TGRewrite1=2,5000002,2,3023955,1
TGRewrite2=2,5000003,2,3023956,1
TGRewrite3=2,5000004,2,3023957,1
5000001 to 5000009 can be used for special translations if the following rule is used to start the regular translations at 5000010
TGRewrite4=2,5000010,10,999999
Replace the 3023954 to 3023957 with your special 7 digit talk groups

___________________________________________________________
Special Instructions to handle 7 digit talk groups from a radio that will NOT Handle 7 Digits
Some radio's will not allow you to use 7 digit talk groups. ie: TYT MD420
In basic Mode use something like this to access 3023954
TGRewrite0=2,4354,3023954,2,1
This rule will translate TG4354 in the radio to 3023954 at the server and the response on 3023954 will come back to TG4354 in the radio.
This use of TG 4354 is strictly between your radio and hotspot, it will not affect any real work tg on 4354. Just make sure that you do not use a number that corresponds to a real TG that you may plan to use in the future. Check the server list and find a number that is not used

------------------------------------------------------------------------------------
PARROT   ( May Not be Implemented Yet on the New TGIF Server )

The call to the parrot on TGIF is a Private Call(PC) to 9990. Make sure you have both 9990 and 4009990 set as a private call in your Contact List
The DMRGateway (Translation Mode) will convert the Radio Private Call on 4009990 to a Private Call on 9990 and send it to the server
The SrcRewrite Rule will trap the Private Call coming from the Server on 9990 send it to the radio via the call sign or digital ID assigned in the Radio
This works in both modes

On MNET, the Parrot uses a Group Call to 9999

-----------------------------------------------------------------------------------------
INSTRUCTION to Restart the Gateway After Configuration changes

If for any resason you need to modify either of the wo configuration files for the DMRGateway you must issue the following command
sudo dmrgateway.service restart ; mmdvmhost.service restart
You can watch the log file as it starts up with the following command. You can exit the log file with a ctrl-call
   tail -f -n 100 /var/log/pi-star/DMRGateway-2021-04-27.log    This is a date named file name that changes at midnight UTC. Replace the date with the current date file
------------------------------------------------------------------------------------------
Contact Information

Phil VE3RD
ve3rd@rac.ca

--------------------------------------------------------------------------------------------
If you have just read this file for the FIRST Time,   READ IT AGAIN
« Last Edit: May 01, 2021, 04:09:53 pm by VE3RD »

Share on Facebook Share on Twitter


Offline N5UNB

  • Newbie
  • *
  • Posts: 3
  • Referrals: 0
  • Call Sign: N5UNB
Re: DMRGateway-3 Instruction Update 2021-04-29
« Reply #1 on: May 25, 2021, 02:21:30 pm »
Hi Phil,


I cannot get your Gateway-3 configuration to switch to Brandmeister.


I have the 3.5" TGIF hotspot from Robert.\ and a D878UVII radio.


Followed the instructions carefully to install Gateway-3.  Used the SSH page in the expert mode of Pi-Star.   Then edited the dmrgateway config settings in the expert page to include my personal settings for user, passwords, etc so it othewise matches up with the config settings on your TGIF Forum post for Gateway-3.  Using Basic mode.


I have a saved hotspot password on BM which I used in the script.


I have channels with talk groups for 9001 (BMswitch)  9004 (TGIF switch) and one channel for each (31665 for TGIF and 3100 for BM).


But the hotspot does not seem to switch to BM network.  Every keyup of 9001 and the 3100 channel ends up being reported on TGIF last heard website, and I can place no calls onto the BM network (calls not reported on the BM last heard page).


I have NetMode=0 which I understand is Basic mode.


What am I missing?


Brian Hausknecht
N5UNB

Offline VE3RD

  • Newbie
  • *
  • Posts: 37
  • Referrals: 0
Re: DMRGateway-3 Instruction Update 2021-04-29
« Reply #2 on: May 25, 2021, 04:22:39 pm »
Send me your /etc/dmrgateway file
Almost all problems are in this file

Send it to VE3RD@rac.ca

Offline N5UNB

  • Newbie
  • *
  • Posts: 3
  • Referrals: 0
  • Call Sign: N5UNB
Re: DMRGateway-3 Instruction Update 2021-04-29
« Reply #3 on: May 25, 2021, 04:32:55 pm »
Email sent with current Pi-Star backup file containing the config settings.  Thanks for your help with this!

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
503 Views
Last post February 07, 2019, 09:43:39 am
by John K3NXU
14 Replies
641 Views
Last post February 07, 2019, 03:35:12 pm
by VE3RD
3 Replies
430 Views
Last post April 10, 2020, 05:53:52 pm
by VA3CKI
9 Replies
796 Views
Last post June 08, 2021, 08:43:54 am
by VE3RD
0 Replies
99 Views
Last post June 07, 2021, 10:19:50 am
by VE3RD