/*
* Copyright (C) 2010, 2011, 2012 by Scott Lawson KI4LKF
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
We can be reached at: ham44865 (at) yahoo (dot) com
G2_ircDDB adapted from the OpenG2
CHANGES from previous release
================================
Changes are listed at the end of this document
DESCRIPTION
=================
g2_ircddb is a G2 gateway for the Dstar network with access to ircDDB and NO postgres required.
It is a pure ircDDB based Gateway.
It runs on either Linux(as a Linux service) or Windows(standard EXE program)
ircddb originated from the OpenG2 with only one change for the ircDDB dstar network.
Instead of using the local Postgres database server, we use the remote IRC database server.
So, the difference between OpenG2 and ircddb is 0.01%
This new software g2_ircddb has been approved for use on the ircDDB network.
g2_ircDDB supports the following commands in YRCALL
Note: In the commands that folow, _ is a SPACE.
1)
For Echotest/playback. This command is handled by g2_ircDDB
YRCALL=_______E
2)
For Voice Mail: This command is handled by g2_ircDDB
YRCALL=_ _ _ _ _ _ S0
The above command will Store/create voice mail in the dvtool file x_voicemail.dat
YRCALL=_ _ _ _ _ _ R0
The above command will Recall/playback voice mail from the dvtool file x_voicemail.dat
YRCALL=_ _ _ _ _ _ C0
The above command will Clear/delete voice mail. File x_voicemail.dat will be deleted.
In all cases, the letter x in the file name x_voicemail is the module A,B or C
3)
For inquiring the status of the link. This command is handled by the g2_link software.
YRCALL=_______I
4)
For unlinking: This command is handled by the g2_link software.
YRCALL=_______U
5)
For linking. This command is handled by the g2_link software.
YRCALL=XXNYYYML
Where XXNYYY is a friendly gateway, M is the gateways's module and L is the LINK command
YRCALL=XRFNNNML
Where XRFNNN is a friendly reflector, M is the reflector's module and L is the LINK command
Note about linking:
After linking succeeds, set YRCALL=CQCQCQ
because your audio will go to the remote reflector
ONLY if YRCALL=CQCQCQ
6)
For executing scripts(Linux .sh or Windows .BAT): This command is handled by the g2_link software.
YRCALL=______nX
where n can be from 0-9 or A-Z
Example: YRCALL=______1X
Then the script exec_1.sh(Linux) or exec_1.BAT(Windows) will be executed.
7)
Enabling and disabling INCOMING HotSpotNode connections: This command is handled by the g2_link software.
To Enable:
YRCALL=______D1
To Disable:
YRCALL=______D0
--- g2_ircddb: The G2 audio gateway with routing and member of ircDDB dstar
--- g2_link: This communicates with g2_ircddb to link the local G2 gateway to reflectors
Note: g2_link is NOT required if you only make routing calls or
talk locally on the repeater.
--- rptr: This is our dstar repeater software that uses a GMSK adapter/modem.
Instead of rptr, you can use our dvap_rptr dstar repeater software which uses a DVAP device.
Intead of rptr, you can use our dvrptr dstar repeater software which uses the DV-RPTR modem(dg1ht).
Intead of rptr, you can use our snd_rptr dstar repeater software which uses a SOUND CARD.
You can also use the ICOM's RP2C repeater hardware box.
INSTRUCTIONS
=================
Required compiler for Linux: C++
To install the C++ compiler,
On CentOS, execute: yum install gcc-c++
On Debian/Ubuntu, execute: apt-get install g++
On OpenSUSE, execute: zypper install gcc-c++
Required compiler for Windows: NONE.
Instructions have to do with editing these 3 configuration files:
--- g2_ircddb.cfg (for our G2 gateway)
--- g2_link.cfg (for linking the G2 gateway to reflectors)
--- rptr.cfg (for our dstar repeater rptr software which uses a GMSK adapter/modem)
or dvap_rptr.cfg (for our dstar repeater dvap_rptr software which uses the DVAP device)
or dvrptr.cfg (for our dvrptr repeater software which uses the DV-RPTR modem by dg1ht)
or snd_rptr (for our snd_rptr repeater software which uses a SOUND CARD)
In all the above configuration files,
the value for OWNER is your Gateway callsign.
Configuring the g2_ircddb G2 gateway:
-------------------------------------
STEP 1.
For Linux:
Create a new forlder: /root/g2_ircddb
If your repeater is ICOM's RP2C:
Unzip the package g2_ircddb_rp2c_{VersionNumber}_Linux.zip
into the folder /root/g2_ircddb
Unzip the package ircDDB_{VersionNumber}_Linux.zip
into the folder /root/g2_ircddb
Note: The ircDDB_{VersionNumber}_Linux.zip package
is required for any G2 on the ircDDB dstar network.
Unzip the package libber.zip
If your repeater is home-brew:
Unzip the package g2_ircddb_{VersionNumber}_Linux.zip
into the folder /root/g2_ircddb
Unzip the package ircDDB_{VersionNumber}_Linux.zip
into the folder /root/g2_ircddb
Note: The ircDDB_{VersionNumber}_Linux.zip package
is required for any G2 on the ircDDB dstar network.
Unzip the package libber.zip
For Windows:
Create a new folder: C:\g2_ircddb
If your repeater is ICOM's RP2C:
Unzip the package g2_ircddb_rp2c_{VersionNumber}_Windows.zip
into the folder C:\g2_ircddb
If your repeater is home-brew:
Unzip the package g2_ircddb_{VersionNumber}_Windows.zip
into the folder C:\g2_ircddb
STEP 2.
For Linux:
If your repeater is ICOM's RP2C:
Go to that new folder /root/g2_ircddb
Edit the file g2_ircddb_rp2c.cfg and correct the value of the OWNER
OWNER is the call of your G2 gateway. Use UPPERCASE letters.
Adjust the G2_INTERNAL_IP value to reflect your ICOM G2 INTERNAL IP.
Adjust the TO_RPTR_IP value to reflect the ICOM RP2C repeater IP.
Set your IRC_PASS password correctly.
Rename the file to g2_ircddb.cfg
If your repeater is home-brew:
Go to that new folder /root/g2_ircddb
Edit the file g2_ircddb.cfg and correct the value of the OWNER
OWNER is the call of your G2 gateway. Use UPPERCASE letters.
Set your IRC_PASS password correctly.
For Windows:
If your repeater is ICOM's RP2C:
Go to that new folder C:\g2_ircddb
Edit the file g2_ircddb_rp2c.cfg and correct the value of the OWNER
OWNER is the call of your G2 gateway. Use UPPERCASE letters.
Adjust the G2_INTERNAL_IP value to reflect your ICOM G2 INTERNAL IP.
Adjust the TO_RPTR_IP value to reflect the ICOM RP2C repeater IP.
Set your IRC_PASS password correctly.
If your repeater is home-brew:
Go to that new folder C:\g2_ircddb
Edit the file g2_ircddb.cfg and correct the value of the OWNER
OWNER is the call of your G2 gateway. Use UPPERCASE letters.
Set your IRC_PASS password correctly.
STEP 3.
For Linux:
Download the wxBase package from:
http://sourceforge.net/projects/wxwindows/files/2.8.12/wxBase-2.8.12.tar.gz/download
Do this to build the wxBase package:
Go to the folder where you downloaded the wxBase package and do these steps:
tar xvf wxBase-2.8.12.tar.gz
cd wxBase-2.8.12
./configure --disable-gui --without-expat
make
Now go to the build subdirectory(.../wxBase-2.8.12/build) and
download the file bakefiles.zip from
http://sourceforge.net/projects/ircddb/files/ircDDB_gateway/Linux/
and unzip with the command: unzip bakefiles.zip
Now go back to the main directory(.../wxBase-2.8.12) and
execute the last step: make install
Now edit the file /etc/ld.so.conf and add
this line: /usr/local/lib
Save the file /etc/ld.so.conf, exit out of the editor and
execute this command: ldconfig -v
Build the ircDDB toolkit library:
From inside the /root/g2_ircddb/ folder, type the commands:
rm -f libircddb.a
make
That will build the library file: libircddb.a (This is from Michael DL1BFF)
Build the libber.a library:
From inside the /root/g2_ircddb/ folder, type the commands:
chmod +x build_ber.doit
./build_ber.doit
Build the g2_ircDDB G2 gateway for the ircDDB dstar network.
For ICOM RP2C repeater hardware:
chmod +x g2_ircddb_rp2c.doit
./g2_ircddb_rp2c.doit
For home-brew repeater:
chmod +x g2_ircddb.doit
./g2_ircddb.doit
For Windows:
Nothing to do in this step.
STEP 4.
For Linux:
For CentOS:
Install the Linux service script: g2_ircddb.SVC
like this:
chmod +x g2_ircddb.SVC
mv g2_ircddb.SVC /etc/init.d/g2_ircddb
chkconfig --add g2_ircddb
For Debian/Ubuntu: The service script g2_ircddb.SVC.Debian is included,
Follow your Operating System instructions to install g2_ircddb.SVC.Debian
For OpenSUSE: The service script g2_ircddb.SVC.SUSE is included,
Follow your Operating System instructions to install g2_ircddb.SVC.SUSE
For Windows: Nothing to do in this step.
STEP 5.
For Linux:
start the g2_ircddb service: service g2_ircddb start
Log file is in /var/log/g2_ircddb.log
For Windows:
If your repeater is ICOM's RP2C:
Run the g2_ircddb_rp2c on the command line:
g2_ircddb_rp2c_gui.exe g2_ircddb_rp2c.cfg
The activity is seen on the screen.
If you also want to have a log file, then execute it like this instead:
g2_ircddb_rp2c_gui.exe g2_ircddb_rp2c.cfg g2_ircddb_rp2c.log
If your repeater is home-brew:
Run the g2_ircddb on the command line:
g2_ircddb_gui.exe g2_ircddb.cfg
The activity is seen on the screen.
If you also want to have a log file, then execute it like this instead:
g2_ircddb_gui.exe g2_ircddb.cfg g2_ircddb.log
STEP 6.
For either Linux or Windows, open these ports in your router box:
UDP port 40000 (for dstar G2 to G2 routing)
UDP port 30001 (For linking to XRF reflectors)
UDP port 20001 (For accepting connections from HotSpotNodes,...)
DTMF decoding and processing
=============================
Prepare the software to decode and process DTMF tones
-----------------------------------------------------
For Linux:
Install the Linux service script: proc_g2_ircddb_dtmfs.SVC (for CentOS)
by executing these commands:
chmod +x proc_g2_ircddb_dtmfs.SVC
mv proc_g2_ircddb_dtmfs.SVC /etc/init.d/proc_g2_ircddb_dtmfs
chkconfig --add proc_g2_ircddb_dtmfs
chkconfig proc_g2_ircddb_dtmfs on
Copy proc_g2_ircddb_dtmfs.sh into /root/g2_ircddb/ directory
and make it executable, by executing this command: chmod +x proc_g2_ircddb_dtmfs.sh
Edit the Shell script proc_g2_ircddb_dtmfs.sh
Correct the value for G2 to be the local G2 gateway callsign(same value in g2_ircddb.cfg ----> OWNER)
Edit G2_INT_IP as follows:
If your g2_ircddb.cfg, says:
G2_INTERNAL_IP=0.0.0.0, then set G2_INT_IP=127.0.0.1
If your g2_ircddb, says:
G2_INTERNAL_IP=...real local IP address...., then set G2_INT_IP equal to the exact value of G2_INTERNAL_IP
Edit G2_INT_PORT to be equal to G2_INTERNAL_PORT in g2_ircddb.cfg
Make sure you have the program: g2link_test under the directory: /root/g2_link/
Start the Linux dtmf service script, by executing this command: service proc_g2_ircddb_dtmfs start
(the shell script: proc_g2_ircddb_dtmfs.sh will start running)
Note: When local RF user has entered dtmf tones on the Dstar HT and then PTT is released,
g2_ircddb will print the whole sequence in the g2_ircddb.log
just before it creates the dtmf file under /tmp/
For Windows:
The BAT file procdtmf.bat is supplied that can be executed to do the DTMF processing.
Edit the file procdtmf.bat and set the following values:
# This is your Gateway
set myG2=YY0YYY
# This is the location of the program g2link_test
# If you do not have that, download it from our SourceForge Web site.
set myG2LinkTest=C:\g2_link\g2link_test.exe
# This is the same value that you have in your g2_ircddb.cfg, for the variable DTMF_DIR
set DTMF_DIR=C:\temp
# This is the G2 Internal IP of your gateway
If your g2_ircddb.cfg, says:
G2_INTERNAL_IP=0.0.0.0, then set G2_INT_IP=127.0.0.1
If your g2_ircddb, says:
G2_INTERNAL_IP=...real local IP address....,then set G2_INT_IP equal to the exact value of G2_INTERNAL_IP
set G2_INT_IP=127.0.0.1
# This is the G2 Internal port of your gateway
set G2_INT_PORT=19000
Now, run the BAT file procdtmf.bat and it will start processing the decoded DTMF tones coming from your gateway.
Actually, it will process the DTMF temporary files created by the Gateway.
The procdtmf.bat file will be running in a loop, looking for files created by the gateway,
processing them and removing them.
How to enter DTMF tones correctly on your Dstar HT
--------------------------------------------------
If you want to have perfect DTMF decoding/processing in g2_ircddb, follow these suggestions:
1) Hold down each dtmf key for at least 150 milliseconds.
2) Leave at least 250 milliseconds of "silence", when you go from one dtmf key to the next dtmf key.
If you use a DTMF autodialer on your Dstar radio, you can program the above numbers easily into the ICOM's radio "auto-dialer".
Note: MAXIMUM dtmf sequence is up to 32 dtmf tones.
What dtmf tones are being decoded and processed
-----------------------------------------------
To link to an XRF reflector: Example: #02102
That says: link to XRF021 module B
So, we use the # dtmf key to mean that we're interested in linking to an XRF reflector
The last two digits are the remote module 01 thru 05 (which is translated to A thru E).
To link to a DCS reflector: Example: D00126
That says: link to DCS001 module Z
So, we use the D dtmf key to mean that we're interested in linking to a DCS reflector
The last two digits are the remote module 01 thru 26 (which is translated to A thru Z).
To link to REF: Example: *01601
That says: link to REF016 module A
So, we use the * dtmf key to mean that we're interested in linking to a REF reflector
The last two digits are the remote module 01 thru 05 (which is translated to A thru E).
To unlink (from any reflector xrf or ref): 73
To get the "link status": 99
Note:
You can extend the shell ascript to do more things. like force your repeater to ID itself.
Any YRCALL command that can be executed by g2link_test, can be added to the shell script.
Basically, the shell script proc_g2_ircddb_dtmfs.sh converts the decoded dtmf tones
into YRCALL commands using g2link_test
GPS ---> APRS data processing
-----------------------------
The following steps are for reporting DSTAR GPS positions
from your local RF users to APRS server(s).
Both GPS and GPS-A modes are supported.
You do NOT have to follow these steps at all.
They are NOT required for running the G2_ircDDB gateway.
There are certain options in the config file g2_ircddb.cfg (or g2_ircddb_rp2c.cfg)
These options have to do with GPS and APRS.
Here they are:
# Do you want to send an APRS beacon for your repeater modules(A,B,C) to the remote APRS host ?
# Do you want to convert GPS report as they come in from your local RF radio users while they talk on your repeater ?
SEND_APRS=Y
# The repeater module specifications for GPS/APRS use
# LATITUDE,LONGITUDE,RANGE,DESCRIPTION
#
# If a line for a repeater module is a blank line,
# then that means that the APRS beacon for that repeater module will NOT be sent
# because maybe you do not have a module for that band
# Examples
RPTR_ID_A=
RPTR_ID_B=24.1947,-77.0891,20,DSTAR module B
RPTR_ID_C=
# The remote APRS host
# You should NOT change the value for APRS_HOST
# Leave it set to: rotate.aprs.net
# The only time to change it is when you have your own APRS_HOST server
# or when an APRS server is close to your gateway in your own state or community
APRS_HOST=rotate.aprs.net
#
#
# The specific TCP port on that remote APRS server that accepts APRS client connections
# IN this case, the APRS client is your g2 gateway g2_ircddb (or g2_ircddb_rp2c)
# Not all APRS servers have the same port
# Also soem ports are FILTER ports only, which means that you have to set a value for APRS_FILTER
APRS_PORT=14580
#
# How often to report the aprs beacon, in minutes, leave that at 40 minutes.
APRS_INTERVAL=40
#
#
# port 14580 on the aprs host rotate.aprs.net, is already a filtered type of port
# But if you want to overide the default filter that is suppied by rotate.aprs.net
# and instead define your own filter, you can do this here.
# BUT BE CAREFUL, if the value in APRS_FILTER is not valid, the aprs host will NOT let you login...
APRS_FILTER=
Configuring the g2_link software for linking to reflectors:
-----------------------------------------------------------
Before we begin, there are some dat files included in the g2_link ZIP package.
These dat files are:
already_linked.dat
already_unlinked.dat
failed_linked.dat
linked.dat
unlinked.dat
id.dat
All of the above dat files are dvtool format files and they are used
when certain events take place.
For example, when the link between your gateway and a reflector is established,
then the file "linked.dat" will be played over RF, so anyone listening on
your repeater, will hear the announcement that the link has been established.
You do not have to change these files, unless you want to have your own
personal voice played over RF.
These dat files were created using a computer and they are NOT anyone's voice.
The only dat file that you should really change is id.dat
The file id.dat contains the audio "UNLINKED" and nothing else.
When the gateway is not linked and the RF user sets YRCALL=_______I
to request the status of the link, the file id.dat will be played back
over RF. But you should create your own id.dat file that should
identify your own repeater with extra information if you like.
For example, you could create your own dvtool audio file
that contains the audio: "This is repeater ..."
A simple way to create your own recorded "repeater identification file" id.dat
is to use your Dstar HT and set YRCALL command: YRCALL=_ _ _ _ _ _ S0
and key up your repeater.
Start talking, and the gateway will record your audio into the file: x_voicemail.dat
where x is one of A.B or C
Now copy that file into id.dat
STEP 1.
For Linux:
Create a new folder: /root/g2_link
Unzip the g2_link_{VersionNumber}_Linux.zip into the new folder /root/g2_link
For Windows:
Create a new folder: C:\g2_link
Unzip the g2_link_{VersionNumber}_Windows.zip into the new folder C:\g2_link
STEP 2.
For Linux or Windows:
Open the file gwys.txt and add your reflectors and their IP addresses with the correct port
Open the file g2_link.cfg:
Edit the values for LOGIN_CALL, OWNER and ADMIN
STEP 3.
For Linux:
Compile it by executing these commands:
chmod +x g2_link.doit
./g2_link.doit
Additional steps to install it as a Linux service:
For Linux CentOS:
chmod +x g2_link.SVC
mv g2_link.SVC /etc/init.d/g2_link
chkconfig --add g2_link
For Debian/Ubuntu:
The service script file g2_link.SVC.Debian is included.
Follow your Operating System instructions to install g2_link.SVC.Debian
For OpenSUSE:
The service script file g2_link.SVC.SUSE is included.
Follow your Operating System instructions to install g2_link.SVC.SUSE
For Windows:
Nothing to do in this step.
STEP 3.
Download the package get_list.zip
Read the help file README_get_list.txt
so that you will know how to update
the file gwys.txt whenever you want.
The file /root/g2_link/gwys.txt (or C:\g2_link\gwys.txt)
is used by g2_link software.
Most, if not all, gateways link to reflectors, so if you know
the host name of the reflector(instead of the IP address),
then you can add the host names in gwys.txt and never have to change,
the file gwys.txt again, because the software g2_link will also work
with host names instead of IP addresses, so in this case,
you do not need the get_list.zip package.
For Linux:
Start the Linux service like this: service g2_link start
Log file is in /var/log/g2_link.log
For Windows:
Start it like this: g2_link_gui.exe g2_link.cfg
Activity will be seen on the screen.
If you also want to have a log file on disk, then start it like this instead:
g2_link_gui.exe g2_link.cfg g2_link.log
You may be thinking why did we put all this source code
inside g2_link instead of putting it all inside the G2 Gateway software g2_ircddb.
Because it is NOT a good design to burden the G2 gateway with
code that is not DSTAR protocol and reflectors are NOT part of Dstar and
they are not Dstar protocol.
The only code that should be in a gateway, is G2 protocol code.
This way we keep the g2_ircddb G2 gateway clean of any unneccesary source code logic
and containing only pure G2/dstar logic.
Configuration of our rptr Dstar repeater software to use a GMSK adapter/modem
-----------------------------------------------------------------------------
For the GMSK adapter/modem plugged into the usb port on Linux,
controlled by our rptr/GMSK Dstar repeater software,
you will install the libusb development package, as follows:
For CentOS, execute: yum install libusb-devel
For Debian, execute: apt-get install libusb-dev
For OpenSUSE, execute: zypper install libusb-compat-devel
For the GMSK modem/adapter on Windows controlled by our rptr/GMSK Dstar repeater software,
we include the LIBUSB dll file: libusb0.dll in our rptr_vxxx_Windows.zip
The file libusb0.dll was copied from the package libusb-win32-bin-1.2.5.0.zip that
we downloaded from: http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.5.0/
Inside that package, you will find the file libusb0_x86.dll, which we rename it libusb0.dll
and include it in our rptr_vxxx_Windows.zip
The file libusb0.dll that is included in our rptr_vxxx_Windows.zip must be placed
in the same directory where our Dstar repeater rptr v3.18 will run from.
The web site http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases
is also recommended by Satoshi's web site: http://www.d-star.asia/libusb.html.en
It is also the site http://sourceforge.net/apps/trac/libusb-win32/wiki
that libusb drivers are submitted for Microsoft WHQL testing.
Do NOT install any other libusb packages or libusb drivers.
However, if you're using some gmsk adapter/modem that is not Satoshi,
then the libusb0.dll that is included in our rptr_vxxx_Windows.zip
might not recognize/detect your modem/adapter, so in that case
use only rptr_win_gui.exe from our rptr_vxxx_Windows.zip
and for LIBUSB driver(dll), use libusb0.dll that comes with your modem/adapter.
On linux, "detection" issues do not occur, because all gmsk adapters when installed on Linux
follow the LIBUSB standard driver which you install with "yum install ..." or "apt-get install ...",
but if you get the error: "Can not detect ...", then use the libusb0.dll that was created for your adapter
and do NOT use the libusb0.dll that is included inside our rptr_vxxx_Windows.zip
STEP 1.
For Linux:
Create a new folder: /root/rptr
Unzip the rptr_{VersionNumber}_Linux.zip into the new folder /root/rptr
For Windows:
Create a new folder: C:\rptr
Unzip the rptr_{VersionNumber}_Windows.zip into the new folder C:\rptr
STEP 2.
For Linux or Windows:
Open the file rptr.cfg
Edit the values for OWNER, RPTR and RPTR_MOD
Edit the PRODUCTID
For one repeater module only, leave it at 768
Edit the value for G2_INTERNAL_IP and G2_PORT
to match the values in g2_ircddb.cfg
Example 1:
Lets say that you have a repeater module C
Set these values in g2_ircddb.cfg
OWMER=put your gateway callsign here in UPPERCASE
G2_INTERNAL_IP=0.0.0.0
G2_INTERNAL_PORT=19000
TO_RPTR_IP_C=127.0.0.1
TO_RPTR_PORT_C=20000
Set these values in rptr.cfg
OWNER=put your gateway callsign here in UPPERCASE
RPTR=put your repeater callsign here in UPPERCASE
Note: OWNER and RPTR are the same unless you use "restriction" mode.
RPTR_MOD=C
PRODUCTID=768
RPTR_VIRTUAL_IP=0.0.0.0
RPTR_PORT=20000
G2_INTERNAL_IP=127.0.0.1
G2_PORT=19000
Note: Use program pid_set from Satoshi
or another program to set the value for the
"product id" directly into the GMSK firmware.
The program pid_set uses HEX numbers,
so HEX number 300 is equal to decimal 768
STEP 3.
For Linux:
chmod +x rptr.doit
./rptr.doit
For Windows:
Nothing to do in this step.
STEP 4.
For Linux, run: ./rptr.sh
or you can install the rptr.SVC service script(CentOS),
or rptr.SVC.Debian(Debian/Ubuntu)
or rptr.SVC.SUSE(OpenSUSE)
Note: If you execute it as a service, then the log file is: /var/log/rptr.log
For Windows, run: rptr.bat
Note: Inside rptr.bat, you will see these contents:
:TOP
start /WAIT C:\rptr\rptr_win_gui.exe C:\rptr\rptr.cfg C:\rptr\rptr.log
ping localhost -n 5 >nul
GOTO TOP
Explanations on the rptr.bat file on Windows:
--- As you can see, we use a loop mechanism(:TOP and GOTO TOP) to start the repeater application.
--- We use a loop, because if something happens to your repeater hardware, you always want the repeater software
to restart automatically(especially if you're far away from your repeater installation).
--- We use: start /WAIT
because we want the Windows Operating System to wait for the application to stop, before it restarts it again.
--- You can also see that we use the command: ping localhost -n 5 >nul
because we want to delay 5 seconds, before the application restarts.
--- The program can take an additional parameter: C:\rptr\rptr.log
so that you can have a hard copy of the activity when the repeater software operates.
Configuration of our Dstar repeater software dvap_rptr that uses a DVAP device
==============================================================================
DVAP devices, although they are plugged into a USB port, they use a serial(RS232) interface.
With serial ports, the interface(RS232) is stable and standard.
Because of that, there is nothing else to be installed.
Note: On windows, stop the BlueTooth(BT) service, because we found out that BT manager
locks the serial ports and it will NOT allow dvap_rptr to scan the serial ports
to find your DVAP device.
STEP 1.
For Linux:
Create a new folder: /root/dvap_rptr
Unzip the dvap_rptr_{VersionNumber}_Linux.zip into the new folder /root/dvap_rptr
For Windows:
Create a new folder: C:\dvap_rptr
Unzip the dvap_rptr_{VersionNumber}_Windows.zip into the new folder C:\dvap_rptr
STEP 2.
For Linux or Windows:
Open the file dvap_rptr.cfg
Edit the values for OWNER, RPTR and RPTR_MOD
EDit the value for DVP_SERIAL which is the serial number for your DVAP
Note: If you do not know the serial number, not to worry,
read the instruction in STEP 4, later in this document,
after you finish with the rest of the configuration.
Edit the value for G2_INTERNAL_IP and G2_PORT
to match the values in g2_ircddb.cfg
Example 1:
Lets say that you have a repeater module C
Set these values in g2_ircddb.cfg
OWMER=put your gateway callsign here in UPPERCASE
G2_INTERNAL_IP=0.0.0.0
G2_INTERNAL_PORT=19000
TO_RPTR_IP_C=127.0.0.1
TO_RPTR_PORT_C=20000
Set these values in rptr.cfg
OWNER=put your gateway callsign here in UPPERCASE
RPTR=put your repeater callsign here in UPPERCASE
Note: OWNER and RPTR are the same unless you use "restriction" mode.
RPTR_MOD=C
RPTR_VIRTUAL_IP=0.0.0.0
RPTR_PORT=20000
G2_INTERNAL_IP=127.0.0.1
G2_PORT=19000
STEP 3.
For Linux:
chmod +x dvap_rptr.doit
./dvap_rptr.doit
For Windows:
Nothing to do in this step.
STEP 4.
If you do not know the serial number of your DVAP, then set DVP_SERIAL=APxxxxxx
then open a terminal window, go to the directory where you installed dvap_rptr
and type this command line on the keyboard:
For Linux, type this: ./dvap_rptr dvap_rptr.cfg
For Windows, type this: dvap_rptr.exe dvap_rptr.cfg
The software will print some errors and in one of the printed lines, it will show you
your DVAP serial number.
Now, edit the file dvap_rptr.cfg and set DVP_SERIAL equal to your DVAP serial number.
STEP 5.
For Linux, run: ./dvap_rptr.sh
or you can install the dvap_rptr.SVC service script(CentOS),
or dvap_rptr.SVC.Debian(Debian/Ubuntu)
or dvap_rptr.SVC.SUSE(OpenSUSE)
Note: If you execute it as a service, then the log file is: /var/log/dvap_rptr.log
For Windows, run: dvap_rptr.bat
Note: Inside dvap_rptr.bat, you will see these contents:
:TOP
start /WAIT C:\dvap_rptr\dvap_rptr.exe C:\dvap_rptr\dvap_rptr.cfg C:\dvap_rptr\dvap_rptr.log
ping localhost -n 5 >nul
GOTO TOP
Explanations on the dvap_rptr.bat file on Windows:
--- As you can see, we use a loop mechanism(:TOP and GOTO TOP) to start the repeater application.
--- We use a loop, because if something happens to your repeater hardware, you always want the repeater software
to restart automatically(especially if you're far away from your repeater installation).
--- We use: start /WAIT
because we want the Windows Operating System to wait for the application to stop, before it restarts it again.
--- You can also see that we use the command: ping localhost -n 5 >nul
because we want to delay 5 seconds, before the application restarts.
--- All the repeater actvity will be written into the file: C:\dvap_rptr\dvap_rptr.log
so that you can have a hard copy of the activity when the repeater software operates.
STEP 6.
There is nothing to do in this step, except to say, our dvap_rptr repeater software,
will detect the serial port that you plugged in the DVAP and it will associate
the correct repeater band for it.
So, if you set in dvap_rptr.cfg, these values:
RPTR_MOD=B
DVP_SERIAL=AP999999
Then our dvap_rptr DStar repeater will associate the above serial number with your repeater band B
We do this so that you can have multiple DVAP devices plugged into your computer
and you can run multiple instances of our dvap_rptr running, controlling multiple bands.
When you stop/restart our dvap_rptr repeater software, the Operating System that you use(Linux or Windows)
may associate a different device every time it reboots.
So, sometimes, Linux will associate /dev/ttyUSB0 and sometimes /dev/ttyUSB1, ... and so on.
But it does not matter, because our Dstar repeater dvap_rptr, will find the correct device
and there is no need to bother with these OS associations.
Same thing will occur with Windows, as we all know, COM1, COM2, COM3, COM4, ...
Either on Linux or Windows, our dvap_rptr Dstar repeater software, will search
every available device to find the correct port to use for your repeater band.
So, during the initialization, you will see errors from Linux or Windows
while these ports/devices are being checked for the correct device to use for your band.
This is normal.
Also, since Linux or Windows make take some time to release these devices,
we use a loop mechanism in our dvap_rptr.sh(Linux) and dvap_rptr.bat(Windows)
to keep trying until Linux or Windows give us control of that device/port.
Again, this is normal. During that initialization time, errors will be printed
in the log file(screen). Again, this is normal.
Configuration of our Dstar repeater software dvrptr that uses a DV-RPTR modem(dg1ht)
===================================================================================
DV-RPTR modems use a serial(RS232) interface.
With serial ports, the interface(RS232) is stable and standard.
Because of that, there is nothing else to be installed.
Note: Do NOT enable the "PC Watchdog" on the modem.
In other words, when the dvrptr starts, one of the lines ypu should see in the log this:
(Date and Time): Bit2 : PC Watchdog enabled = 0
Note: value of 0 means that the "PC Watchdog" is NOT enabled, and that is what you must see, a value of 0
STEP 1.
For Linux:
Create a new folder: /root/dvrptr
Unzip the dvrptr_{VersionNumber}_Linux.zip into the new folder /root/dvrptr
For Windows:
Create a new folder: C:\dvrptr
Unzip the dvrptr_{VersionNumber}_Windows.zip into the new folder C:\dvrptr
STEP 2.
For Linux or Windows:
Open the file dvrptr.cfg
Edit the value for DVCALL, this is the gateway callsign.
Edit the value for RPTR, in 99.99% of the cases, the value for RPTR,
should be the same as the value for DVCALL, unless you are "restricted".
Edit the value for DVRPTR_MOD (A or B or C). This is your module.
Edit the value for DVRPTR_SERIAL
(if you do not know your serial number for your DV-RPTR modem, see step 3)
Edit the value for DVRPTR_INTERNAL_IP. It is usually 0.0.0.0
Edit the value for DVRPTR_INTERNAL_PORT
For repeater module A: DVRPTR_INTERNAL_PORT=19998
For repeater module B: DVRPTR_INTERNAL_PORT=19999
For repeater module C: DVRPTR_INTERNAL_PORT=20000
Edit the value for GATEWAY_IP, This is the G2 INTERNAL IP of the local gateway.
So, leave it set at: 127.0.0.1
Edit the value for GATEWAY_PORT, set it at 19000
Edit the rest: RF_AUDIO_Level, RPTR_ACK, DUPLEX(Y or N).
Edit the value for TX_DELAY
Some radios are SLOW-switching, so set it to around 250.
For FAST-switching radios, you can set it to around 100.
Edit the values for RX_Inverse and TX_Inverse.
These values depend on what type of base radio you have.
For our base radios, we used these values:
Base radio: YAESU 7800
RX_Inverse=1
TX_Inverse=0
Base radio: YAESU 897D
RX_Inverse=1
TX_Inverse=1
Note: your base radio may need different values, you will have to set correct values,
otherwise no audio will pass thru(incoming or outgoing or both).
STEP 3.
To see the serial number that is inside your DV-RPTR modem,
plug in the DV-RPTR modem into the USB port,
set DVRPTR_SERIAL=11.22.D0.33 (inside dvrptr.cfg)
and execute this:
For Linux: ./dvrptr dvrptr.cfg
For Windows: dvrptr_gui.exe dvrptr.cfg dvrptr.log
In both cases, the program will run and print the serial number and then the program will exit
(because serial may not match)
Now take that serial number that you see and put it in the dvrptr.cfg, replacing 11.22.D0.33
STEP 4.
For Linux, run: ./dvrptr.sh
or you can install the dvrptr.SVC service script(CentOS),
or dvrptr.SVC.Debian(Debian/Ubuntu)
or dvrptr.SVC.SUSE(OpenSUSE)
Note: If you execute it as a service, then the log file is: /var/log/dvap_rptr.log
For Windows, If you have not installed the driver DVRPTR_CDC.inf, install it now,we have included it in dvrptr zip file for Windows.
Then you can run: dvrptr_win.bat
Note: Inside dvrptr_win.bat, you will see these contents:
:TOP
start /WAIT C:\dvrptr\dvrptr_gui.exe C:\dvrptr\dvrptr.cfg C:\dvrptr\dvrptr.log
ping localhost -n 5 >nul
GOTO TOP
Explanations on the dvrptr_win.bat file on Windows:
--- As you can see, we use a loop mechanism(:TOP and GOTO TOP) to start the repeater application.
--- We use a loop, because if something happens to your repeater hardware, you always want the repeater software
to restart automatically(especially if you're far away from your repeater installation).
--- We use: start /WAIT
because we want the Windows Operating System to wait for the application to stop, before it restarts it again.
--- You can also see that we use the command: ping localhost -n 5 >nul
because we want to delay 5 seconds, before the application restarts.
--- All the repeater actvity will be written into the file: C:\dvrptr\dvrptr.log
so that you can have a hard copy of the activity when the repeater software operates.
Use of Linux logrotate service to manage the log files
=====================================================
This information is provided by Patrick Caron, and with permission is re-printed here.
Patrick did research on how to manage the various log files created on Linux,
by the Dstar gateway service g2_ircddb and the Dstar repeaters.
The examples are for Debian, but they can be used with very little changes to apply on other Linux boxes(CentOS, OpenSUSE, ...)
For the Dstar g2_ircddb gateway running on Debian:
--- Change g2_ircddb.SVC.Debian
start-stop-daemon --exec /root/g2_ircddb/g2_ircddb -S $G2_IRCDDB_CFG >> $G2_IRCDDB_LOG 2>&1 &
--- Change the g2_link.SVC.Debian
start-stop-daemon --exec /root/g2_link/g2_link -S $G2_LINK_CFG >> $G2_LINK_LOG 2>&1 &
--- Change the Dstar repeater shell script rptr.sh
/root/rptr/rptr /root/rptr/rptr.cfg >> /var/log/rptr.log 2>&1
Note: Same changes in other Dstar repeaters: dvap_rptr.sh, dvrptr.sh
In in /etc/logrotate.d/ directory, add these:
g2_ircddb
----------------------------------------------------------------------------------
/var/log/g2_ircddb.log {
rotate 14
daily
compress
delaycompress
copytruncate
missingok
notifempty
}
/var/log/proc_g2_ircddb_dtmfs.log {
rotate 14
daily
compress
delaycompress
copytruncate
missingok
notifempty
}
g2_link
----------------------------------------------------------------------------------
/var/log/g2_link.log {
rotate 14
daily
copytruncate
compress
missingok
notifempty
}
rptr
----------------------------------------------------------------------------------
/var/log/rptr.log {
rotate 14
daily
copytruncate
compress
missingok
notifempty
}
Changes in g2_ircddb v3.03
==========================
DTMF tones will be silenced(MUTED) if talking on reflectors or when routing.
73
ki4lkf
Source: README_ircDDB.txt, updated 2012-04-28