Configuration now using libconfig++

pull/1/head
Tom Early 10 years ago
parent 545cb0d0aa
commit 738a7de435

@ -33,7 +33,7 @@ have all or most of these but it still doesn't hurt to be sure:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install make g++ unzip git
sudo apt-get install make g++ unzip git libconfig++-dev
and maybe a few more. Here is one of my favorites:
@ -64,9 +64,17 @@ password for sudo access. Upon completetion, make sure you are still in the
g2_ircddb directory and type "make" to build all the g2_ircddb executables. If you
need DTMFS then also execute "make g2link_test".
Next, edit all the *.cfg files, g2_ircddb.cfg, g2_link.cfg and either dvap_rptr.cfg
or dvrptr.cfg. These files contain detailed comments about all of the values you
need to set. Just read through the configuration files and edit accordingly.
Next, crate your g2.cfg configuration file. There are two example for you to look at:
. g2.everything.cfg contains all parameter with lengthly comments about what
each parameter does. The definitions that are commented out are defined with
their default value.
. g2.dvap.cfg is the simplest possible configuration for a 2m DVAP. If you have
a 70cm DVAP rename the module to "b" and change the frequency.
Remeber the everything file contain detailed comments about all of the values you
can set. Just read through it and edit accordingly. In the end you will need
a configuration file called "g2.cfg".
Additional information about the configuration as well as other important and
useful features are also in the CONFIGURING file.
@ -78,7 +86,10 @@ default 30001 prot. This will allow you to connect to these XREF reflectors with
creating any port-forwarding rules on your home router. You will also want to move
X-reflectors to port 20001 if you are going to tether you device via WiFi to a
smart-phone for internet access. Most phone companies will not let you configure
port-forwarding rules on you phone internet account.
port-forwarding rules on you phone internet account. If you operate behing a
router/firewall without port forwarding in place, you will not be able to
do most callsign routing techniques discussed in CONFIGURING.txt, but you should
still be able to connect to reflectors.
There are MANY OTHER gateways to which you can connect. Executing get_gwys_list.sh
will download a HUGE list of reflectors and gateways from www.va3uv.com with port
@ -92,8 +103,8 @@ Based on the above discussion, execute either "./get_reflectors.sh" or
"./get_gwy_list.sh". If you want to be able to update your hotspot dynamically,
you can modify either one of these scripts by adding a "reboot" or "service
g2_link restart" command at the end and moving it to /usr/local/etc/exec_?X.sh
where "?" is a number or letter. See the discussion of executables in the
CONFIGURING text file.
where "?" is a number or letter. You can then execute this script with ?X in YRCALL.
See the discussion of executables in the CONFIGURING text file.
If you plan on using DTMFS, you can also edit proc_g2_ircddb_dtmfs.sh to add new
dtmfs commands.
@ -104,9 +115,9 @@ Finally, if you want/need DTMFS, type "sudo make installdtmfs".
This will install the service scripts and symbolic links in /etc/init.d and
everything else in /usr/local. The executables will be in /usr/local/bin and the
*.cfg files and other data will be in /usr/local/etc. If you find that you need to
modify a configuration file, edit the ones in /usr/local/etc as root. If you edit
the files in the build directory, you will either have to copy these modified
g2.cfg file and other data will be in /usr/local/etc. If you find that you need to
modify the configuration file, edit the one in /usr/local/etc as root. If you edit
the file in the build directory, you will either have to copy these modified
configuration files you you will have to reinstall the application.
At this point, you can either reboot to start the three or four services, or start
@ -115,17 +126,17 @@ service g2_ircddb start". (See the man page for service.)
If you are having trouble connecting, look in the *.log files in /var/log. These
log files are recreated every time you restart a service. The beginning of each
log file will report the values of all the configuration parameters and after that
log file will report the values of all the configuration parameters (even the ones
you didn't specify in g2.cfg) and after that
you will see the verbose reports of what each service is doing. These logs are
invaluable for traking down problems with your *.cfg files. In a putty or ssh
invaluable for traking down problems with your g2.cfg file. In a putty or ssh
shell, you can see in real time what is being added to the logs during operation
by typing "tail -f /var/log/<service>.log", where <service> is one of the
service programs, 'g2_ircddb', 'g2_link', 'dvap_rptr', etc.
These services talk to each other through ports and the *.cfg file default values
are set up for a 2M gateway (module C). If you are using a 70cm setup, pay close
attention to the port configuration in the *.cfg files. You will need to change
several values.
These services talk to each other through ports and the default values
are set up for a 2M gateway (module C). If you are using a 70cm setup, just
change the module from "c" to "b".
You can clean up the build directory of intermediate *.o files with "make clean"
or, you can remove the intermediate *.o files and binary executables with "make

@ -1,14 +1,46 @@
You need to configure three software programs, g2_ircddb, g2_link, and either
dvap_rptr or dvrptr by setting values in their *.cfg text files. Use your
favorite text editor to do this. Scott's comments within those files are
mostly self explainatory.
I have substantially modified (and hopefully simplified) the configuration
of this software, now, modules g2_ircddb, g2_link, dvap_rptr and dvrptr
all use a single configuration file. Further, and this is the exciting
part, NEARLY ALL of the parameters these modules need have a useful
default value. If the default value is acceptible to you (and it
probably will be) then you only need to specify what you need to change.
This means that for most users, you will only need to specify a few
parameters. For example, if you want to set up a 2M dvap, your a working
configuration file might be:
-------------------------------------------------------------------
# my configuration, using rr.openquad.net with my DVAP Dongle
ircddb = {
login = "XX0XXX"
}
module = {
c = {
type = "dvap"
frequency = 146.55
serial_number = "AP123456"
}
}
-------------------------------------------------------------------
Of course, you can add other parameters, such as latitude and longitude,
or a URL that will show up on the "User Gateways" page of
www.openquad.net. This software is highly flexible, so you can have
different modules running on different computers and these hidden
configuration parameters to allow that are there, waiting to be defined.
However, most hams won't have to bother with them!
Some other features are discussed below.
Tom Early, ac2ie@arrl.net
Tom Early, ac2ie (at) arrl (dot) net
/*
* Copyright (C) 2010, 2011, 2012 by Scott Lawson KI4LKF
* addition Copyright (C) 2015 by Thomas A. Early AC2IE
*
* 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
@ -174,10 +206,7 @@ Required software to run the g2_ircddb gateway correctly:
--- 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.
dstar repeater software which uses the DV-RPTR modem(dg1ht).
ROUTING methods
===============
@ -319,21 +348,6 @@ x_voicemail.dat where x is one of A.B or C. Now copy that file into
id.dat.
Open the file g2_link.cfg:
Edit the values for LOGIN_CALL, OWNER and ADMIN. LOGIN_CALL is
always your PERSONAL callsign. It is used to connect to REF
reflectors. (REF reflectors check if the value of LOGIN_CALL is a
user callsign registered with UStrust.)
OWNER is your GATEWAY/club/Repeater callsign. If you do not have a
GATEWAY/club/Repeater callsign, you can set OWNER equal to your
PERSONAL callsign.
If you set OWNER to a PERSONAL callsign, then the Gateway config
file(g2_ircddb.cfg, g2_ccs.cfg) must also use the same PERSONAL
callsign. If you set OWNER to your GATEWAY/club/Repeater callsign,
then the Gateway config file(g2_ircddb.cfg, g2_ccs.cfg) must also
use the same GATEWAY/club/Repeater callsign.
You can add as many lines to gwys.txt, if you know of any other
reflectors that you want to be able to connect to. REF reflectors
use port 20001(for USER connections), DCS reflectors use port
@ -374,27 +388,24 @@ dvrptr
The serial number required in the .cfg file can most easily be obtained
by examining the /var/log/dvrptr.log file once the board has been
powered up by the BBB or RasPi. Once you know the board serial number,
edit /usr/local/etc/dvrptr.cfg. Please note that once installed, you
edit /usr/local/etc/g2.cfg. Please note that once installed, you
need to edit the configuration files in /usr/local/etc, not where you
build the software. You need to be root to edit files in /usr/local/etc.
After editing /usr/local/etc/dvrptr.cfg file you can restart the effected
program with "sudo service dvrptr restart.
Rig specific parameters are in "RF_AUDIO_Level", "RX_Inverse" and
"TX_Inverse". You need to play with these to work best with your rig.
With my Kenwood TM-V71, I use:
After editing /usr/local/etc/g2.cfg file you can restart the effected
program with "sudo service dvrptr restart". Or you can alway just
reboot with "sudo reboot".
RF_AUDIO_Level=80
TX_Inverse=1
RX_Inverse=1
Rig specific parameters are in "dvrptr.rf_rx_level", "dvrptr.inverse.rx" and
"dvrptr.inverse.tx". You need to play with these to work best with your rig.
With my Kenwood TM-V71, I use the default values.
You can first start with RX_Inverse, trying 0 or 1. Use the echo command
You can first start with inverse.rx, trying true or false. Use the echo command
on your radio and look in the logs to see if you are getting into the
dvprtr. Remember to restart the dvrptr service anytime you modify
/usr/local/etc/dvrptr.cfg. Once you are able to get into the dvrptr,
then you can work out the TX_Inverse paramter. Once you hear anything
with in the echo mode, move RF_AUDIO_Level up or down to get the best
/usr/local/etc/g2.cfg. Once you are able to get into the dvrptr,
then you can work out the inverse.tx paramter. Once you hear anything
with in the echo mode, move rf_rx_level up or down to get the best
audio.
Once you have a working system, it's a good idea to back up you *.cfg
Once you have a working system, it's a good idea to back up you g2.cfg
files.

@ -21,7 +21,7 @@ CFGDIR=/usr/local/etc
LOGDIR=/var/log
CPPFLAGS=-W -Wall -I/usr/include `wx-config --cppflags base`
LDFLAGS=-L/usr/lib `wx-config --libs base`
LDFLAGS=-L/usr/lib `wx-config --libs base` -lconfig++
PROGRAMS=g2_ircddb g2_link dvap_rptr dvrptr g2link_test g2link_test_audio
@ -33,13 +33,13 @@ g2_ircddb : g2_ircddb.cpp $(IRCDDBOBJS) versions.h
g++ $(CPPFLAGS) -o g2_ircddb g2_ircddb.cpp $(IRCDDBOBJS) $(LDFLAGS) -pthread
g2_link : g2_link.cpp versions.h
g++ -W -Wall -o g2_link g2_link.cpp -lrt -pthread
g++ -W -Wall -o g2_link g2_link.cpp -lrt -lconfig++ -pthread
dvap_rptr : dvap_rptr.cpp dstar_dv.o golay23.o versions.h
g++ -W -Wall -o dvap_rptr dvap_rptr.cpp golay23.o dstar_dv.o -I/usr/include -L/usr/lib -lrt -pthread
g++ -W -Wall -o dvap_rptr dvap_rptr.cpp golay23.o dstar_dv.o -I/usr/include -L/usr/lib -lrt -lconfig++ -pthread
dvrptr : dvrptr.cpp dstar_dv.o golay23.o
g++ -W -Wall -o dvrptr dvrptr.cpp golay23.o dstar_dv.o -I/usr/include -L/usr/lib -lrt
g++ -W -Wall -o dvrptr dvrptr.cpp golay23.o dstar_dv.o -I/usr/include -L/usr/lib -lconfig++ -lrt
IRCDDB.o : IRCDDB.cpp IRCDDB.h
g++ $(CPPFLAGS) -c $(CPPFLAGS) IRCDDB.cpp
@ -90,13 +90,12 @@ realclean :
installdvap : dvap_rptr g2_link g2_ircddb
######### g2_ircddb #########
/bin/cp -f g2_ircddb $(BINDIR)
/bin/cp -f g2_ircddb.cfg $(CFGDIR)
/bin/cp -f g2.cfg $(CFGDIR)
/bin/cp -f service.g2_ircddb /etc/init.d/g2_ircddb
/usr/sbin/update-rc.d g2_ircddb defaults
/usr/sbin/update-rc.d g2_ircddb enable
######### g2_link #########
/bin/cp -f g2_link $(BINDIR)
/bin/cp -f g2_link.cfg $(CFGDIR)
/bin/cp -f announce/*.dat $(CFGDIR)
/bin/cp -f gwys.txt $(CFGDIR)
/bin/cp -f exec_?.sh $(CFGDIR)
@ -106,7 +105,6 @@ installdvap : dvap_rptr g2_link g2_ircddb
######### dvap_rptr #########
/bin/cp -f dvap_rptr $(BINDIR)
/bin/cp -f dvap_rptr.sh $(BINDIR)
/bin/cp -f dvap_rptr.cfg $(CFGDIR)
/bin/cp -f service.dvap_rptr /etc/init.d/dvap_rptr
/usr/sbin/update-rc.d dvap_rptr defaults
/usr/sbin/update-rc.d dvap_rptr enable
@ -114,13 +112,12 @@ installdvap : dvap_rptr g2_link g2_ircddb
installdvrptr : dvrptr g2_link g2_ircddb
######### g2_ircddb #########
/bin/cp -f g2_ircddb $(BINDIR)
/bin/cp -f g2_ircddb.cfg $(CFGDIR)
/bin/cp -f g2.cfg $(CFGDIR)
/bin/cp -f service.g2_ircddb /etc/init.d/g2_ircddb
/usr/sbin/update-rc.d g2_ircddb defaults
/usr/sbin/update-rc.d g2_ircddb enable
######### g2_link #########
/bin/cp -f g2_link $(BINDIR)
/bin/cp -f g2_link.cfg $(CFGDIR)
/bin/cp -f announce/*.dat $(CFGDIR)
/bin/cp -f gwys.txt $(CFGDIR)
/bin/cp -f exec_?.sh $(CFGDIR)
@ -130,7 +127,6 @@ installdvrptr : dvrptr g2_link g2_ircddb
######### dvrptr ##########
/bin/cp -f dvrptr $(BINDIR)
/bin/cp -f dvrptr.sh $(BINDIR)
/bin/cp -f dvrptr.cfg $(CFGDIR)
/bin/cp -f service.dvrptr /etc/init.d/dvrptr
/usr/sbin/update-rc.d dvrptr defaults
/usr/sbin/update-rc.d dvrptr enable
@ -155,13 +151,12 @@ uninstalldvap :
/bin/rm -f /etc/init.d/g2_ircddb
/usr/sbin/update-rc.d g2_ircddb remove
/bin/rm -f $(BINDIR)/g2_ircddb
/bin/rm -f $(CFGDIR)/g2_ircddb.cfg
/bin/rm -f $(CFGDIR)/g2.cfg
######### g2_link #########
/usr/sbin/service g2_link stop
/bin/rm -f /etc/init.d/g2_link
/usr/sbin/update-rc.d g2_link remove
/bin/rm -f $(BINDIR)/g2_link
/bin/rm -f $(CFGDIR)/g2_link.cfg
/bin/rm -f $(CFGDIR)/already_linked.dat
/bin/rm -f $(CFGDIR)/already_unlinked.dat
/bin/rm -f $(CFGDIR)/failed_linked.dat
@ -178,7 +173,6 @@ uninstalldvap :
/usr/sbin/update-rc.d dvap_rptr remove
/bin/rm -f $(BINDIR)/dvap_rptr
/bin/rm -f $(BINDIR)/dvap_rptr.sh
/bin/rm -r $(CFGDIR)/dvap_rptr.cfg
uninstalldvrptr:
######### g2_ircddb #########
@ -186,13 +180,12 @@ uninstalldvrptr:
/bin/rm -f /etc/init.d/g2_ircddb
/usr/sbin/update-rc.d g2_ircddb remove
/bin/rm -f $(BINDIR)/g2_ircddb
/bin/rm -f $(CFGDIR)/g2_ircddb.cfg
/bin/rm -f $(CFGDIR)/g2.cfg
######### g2_link #########
/usr/sbin/service g2_link stop
/bin/rm -f /etc/init.d/g2_link
/usr/sbin/update-rc.d g2_link remove
/bin/rm -f $(BINDIR)/g2_link
/bin/rm -f $(CFGDIR)/g2_link.cfg
/bin/rm -f $(CFGDIR)/already_linked.dat
/bin/rm -f $(CFGDIR)/already_unlinked.dat
/bin/rm -f $(CFGDIR)/failed_linked.dat
@ -209,4 +202,3 @@ uninstalldvrptr:
/usr/sbin/update-rc.d dvrtpr remove
/bin/rm -f $(BINDIR)/dvrptr
/bin/rm -f $(BINDIR)/dvrptr.sh
/bin/rm -f $(CFGDIR)/dvrptr.cfg

@ -1,24 +1,28 @@
g2_ircddb
=========
NEW! Software configuration is SIGNIFICANTLY easier because most parameters now have default values. Most hams will only need to define a few things.
PRETTY NEW: g2_ircddb has come up to current practices when it comes to ":IRCDDB" irc commands. This means irc hosts like rr.openquad.net can list your repeater frequency, offset, location and URL automatically if you want.
This package is for making a ircddb gateway based on Scott Lawson KI4LKF g2_ircddb gateway software.
Two repeater devices are supported so far: the DVAP dongle (http://www.dvapdongle.com) and the dvrptr (http://www.dvrptr.net).
Two repeater devices are supported so far: the DVAP dongle (http://www.dvapdongle.com) and the dvrptr V1 (http://www.dvrptr.net).
Creating a portable ircddb hotspot based on a Raspberry Pi or a BeagleBone Black that can connect to DStar reflectors, XREF reflectors and DCS reflectors based on Scott Lawson KI4LKF software is easy.
Creating a portable ircddb hotspot based on a Raspberry Pi or a BeagleBone Black that can connect to DStar reflectors, XREF reflectors and DCS reflectors based on this software is easy.
As configured, this software requires a Debian or Debian-based Linux OS and is specifically designed for a Raspberry Pi (http://raspberrypi.org) on Raspbian Liunx or a BeagleBone Black (http://beagleboard.org) running Debian Linux. Depending on your knowledge with your choice of OS, you can probably get this to work on others as well. The closer you are to a Debian base, the easier it will be.
As configured, this software requires a Debian or Debian-based Linux OS and works very well on a Raspberry Pi (http://raspberrypi.org) on Raspbian Liunx or a BeagleBone Black (http://beagleboard.org) running Debian Linux. Depending on your knowledge with your choice of OS, you can probably get this to work on others as well. The closer you are to a Debian base, the easier it will be.
Start with a Raspberry Pi with the latest Raspbian image (see http://raspberrypi.org) or a BeagleBone Black with the latest Debian image (see http://www.armhf.com). Scott's software will EASILY fit on the 2gb on-board memory of the older Rev. B of the BBB, but you will still need a uSD card to install the armhf.com Debian image to the on-board memory. If you are using Raspbian on a RasPi, be sure to configure Raspbian with the `sudo raspi-config` command. If you are using Debian on a BBB, be sure to look over the notes on expanding the uSD memory on the www.armhf.com website.
Start with a Raspberry Pi with the latest Raspbian image (see http://raspberrypi.org) or a BeagleBone Black with the latest Debian image (see http://www.armhf.com). This software will EASILY fit on the 2gb on-board memory of the older Rev. B of the BBB, but you will still need a uSD card to install the armhf.com Debian image to the on-board memory. If you are using Raspbian on a RasPi, be sure to configure Raspbian with the `sudo raspi-config` command. If you are using Debian on a BBB, be sure to look over the notes on expanding the uSD memory on the www.armhf.com website.
You can also use the new Debian images on BeagleBone.org. New BBBs (with the 4gb on-board memory) are now shipping with Debian instead of Angstrom and g2_ircddb will compile and install just fine on this Debian image. However, right now (late June 2014) there are still some minor bugs in this package, e.g., `halt` in a ssh shell will hang the shell. Hopefully, `sudo apt-get upgrade` will eventually fix this.
You will need several packages to build Scott's gateway. The RasPi will probably have all or most of these but it still doesn't hurt to be sure:
You will need several packages to build software. The RasPi will probably have most of these but it still doesn't hurt to be sure:
```
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install make g++ unzip git
sudo apt-get install make g++ unzip git libconfig++-dev
```
and maybe a few more of your favorite packages. Here is one of my favorites: `sudo apt-get install avahi-daemon`. Then you can `ssh user@hostname.local` instead of `ssh user@ip_address`.
@ -27,7 +31,15 @@ After you install all the required packages, the g2_ircddb gateway installation
```
git clone git://github.com/ac2ie/g2_ircddb.git
```
Then cd into the new g2_ircddb directory and review the `BUILDING` and `CONFIGURING` file for further instructions.
Then cd into the new g2_ircddb directory and review the `BUILDING` and `CONFIGURING` file for further instructions, here is an outline:
```
Build the wxWidgets library.
Make the g2 modules.
Edit the configuration file, g2.cfg.
Download the latest gateway list, gwys.txt.
Install g2.
Reboot and enjoy!
```
73

@ -1,82 +0,0 @@
# This is the configuration file for the DVAP device(2m dongle with antenna)
# This is Dstar repeater callsign
# Use a correct repeater call.
# If you set RPTR different from the OWNER
# then only the RF user identified by RPTR callsign can talk on this repeater.
# This mode is called "restriction" mode and in some countries(UK,...)
# it is the only valid mode that you can use, while waiting for a repeater license.
# In a case like this, set RPTR to be your personal callsign
RPTR=
# This is the Gateway callsign
# This must be equal to the OWNER value in the gateway software(g2_ircddb.cfg)
OWNER=
# To protect the repeater owners from bad STN programs out there
# and to also protect the repeater owners from RF users that abuse the STN stuff
# Reject values in YRCALL that start with STN
# If you want to allow the local RF users to subscribe to remote STN groups,
# then set it to XXX or something that is invalid like 123
INVALID_YRCALL_KEY=STN
# This is the module of the Dstar repeater
# Please read the comments about RPTR_PORT below
RPTR_MOD=
# This identifies the IP for the repeater(controler)
# The DVAP device will run here
# For repeater module A: RPTR_PORT=19998
# For repeater module B: RPTR_PORT=19999
# For repeater module C: RPTR_PORT=20000
RPTR_VIRTUAL_IP=0.0.0.0
RPTR_PORT=20000
# This is the INTERNAL IP and PORT of your local G2 gateway
G2_INTERNAL_IP=127.0.0.1
G2_PORT=19000
# This is the serial number of your DVAP device
DVP_SERIAL=APXXXXXX
# This is your 2m frequency for the DVAP device, Between 144000000 and 148000000
# of course, 70cm frequencies are also acceptable for the 70cm DVAP.
DVP_FREQ=145500000;
# This is the power level for the DVAP device, Between -12 and 10
DVP_PWR=10;
# This is the squelch setting for the DVAP device, between -128 and -45
DVP_SQL=-100;
# This is the offset frequency for the DVAP device, between -2000 and 2000
DVP_OFF=0;
# How long before we say that the local gateway has stopped sending packets to our repeater.
# This value is in seconds.
# Lets say that you set REMOTE_TIMEOUT=2 seconds and WAIT_FOR_PACKETS=25 milliseconds
# The program does a small calculation: ( (REMOTE_TIMEOUT * 1000) / WAIT_FOR_PACKETS))
# So that is (2000 / 25) = 80 = number_of_times_to_loop
# This calculated value of 80 is the number of times we will loop waiting for
# packets from the remote system.
# A value of 2 is sufficient. Minimum is 1 seconds.
REMOTE_TIMEOUT=2
# This is used in a loop to wait for packets from your local gateway
# This is in milliseconds
WAIT_FOR_PACKETS=25
# This is in seconds,
# It allows the dvap to re-initialize before we send the repeater ack back to it
DELAY_BEFORE=2
# This is in milliseconds
# Dstar packets should reach the dvap at a rate of about 17-23 milliseconds
# We use that when we send a repeater ack back to the DVAP
DELAY_BETWEEN=19
# 19 seems to be a good value for both the RasPi and the BBB.
# Do you want a repeater ack sent to dvap, after the local RF radio user releases PTT ?
# Valid values are Y or N
RPTR_ACK=Y

@ -1,6 +1,8 @@
/*
* Copyright (C) 2010, 2011 by Scott Lawson KI4LKF
*
* Copyright (C) 2015 by Thomas A. Early AC2IE
*
* 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
@ -39,6 +41,11 @@
#include <pthread.h>
#include "versions.h"
#include <string>
#include <libconfig.h++>
using namespace std;
using namespace libconfig;
#define VERSION DVAP_VERSION
#define CALL_SIZE 8
#define RPTR_SIZE 8
@ -120,24 +127,24 @@ struct dvap_ack_arg_type {
dvap_ack_arg_type dvap_ack_arg;
/* Default configuration data */
static char RPTR[RPTR_SIZE + 1] = {"ABCDEF"};
static char OWNER[RPTR_SIZE + 1] = {"ABCDEF"};
static char RPTR_MOD = 'B';
static char RPTR_VIRTUAL_IP[IP_SIZE + 1] = {"172.16.0.1"};
static int RPTR_PORT = 20000;
static char G2_INTERNAL_IP[IP_SIZE + 1] = {"172.16.0.20"};
static int G2_PORT = 20000;
static char RPTR[RPTR_SIZE + 1];
static char OWNER[RPTR_SIZE + 1];
static char RPTR_MOD;
static char RPTR_VIRTUAL_IP[IP_SIZE + 1];
static int RPTR_PORT;
static char G2_INTERNAL_IP[IP_SIZE + 1];
static int G2_PORT;
static char DVP_SERIAL[64]; /* APxxxxxx */
static u_int32_t DVP_FREQ = 145500000; /* between 144000000 and 148000000 */
static int16_t DVP_PWR = 10; /* between -12 and 10 */
static char DVP_SQL = -100; /* between -128 and -45 */
static int16_t DVP_OFF = 0; /* between -2000 and 2000 */
static int WAIT_FOR_PACKETS=25; /* wait 25 ms in reading from local G2 */
static int REMOTE_TIMEOUT=1; /* 1 second */
static int DELAY_BETWEEN = 20;
static int DELAY_BEFORE = 1;
static bool RPTR_ACK = true;
static char INVALID_YRCALL_KEY[CALL_SIZE + 1] = { "" };
static u_int32_t DVP_FREQ; /* between 144000000 and 148000000 */
static int16_t DVP_PWR; /* between -12 and 10 */
static char DVP_SQL; /* between -128 and -45 */
static int16_t DVP_OFF; /* between -2000 and 2000 */
static int WAIT_FOR_PACKETS; /* wait 25 ms in reading from local G2 */
static int REMOTE_TIMEOUT; /* 1 second */
static int DELAY_BETWEEN;
static int DELAY_BEFORE;
static bool RPTR_ACK;
static char INVALID_YRCALL_KEY[CALL_SIZE + 1];
/* helper data */
static int32_t val32bits = 1;
@ -344,7 +351,7 @@ static void traceit(const char *fmt,...)
time(&ltime);
localtime_r(&ltime,&mytm);
snprintf(trace_buf,TRACE_BFSZ - 1,"%02d%02d%02d at %02d:%02d:%02d:",
snprintf(trace_buf,TRACE_BFSZ - 1,"%02d/%02d/%02d %02d:%02d:%02d:",
mytm.tm_mon+1,mytm.tm_mday,mytm.tm_year % 100,
mytm.tm_hour,mytm.tm_min,mytm.tm_sec);
@ -357,194 +364,177 @@ static void traceit(const char *fmt,...)
return;
}
bool get_value(const Config &cfg, const char *path, int &value, int min, int max, int default_value)
{
if (cfg.lookupValue(path, value)) {
if (value < min || value > max)
value = default_value;
} else
value = default_value;
traceit("%s = [%d]\n", path, value);
return true;
}
bool get_value(const Config &cfg, const char *path, double &value, double min, double max, double default_value)
{
if (cfg.lookupValue(path, value)) {
if (value < min || value > max)
value = default_value;
} else
value = default_value;
traceit("%s = [%lg]\n", path, value);
return true;
}
bool get_value(const Config &cfg, const char *path, bool &value, bool default_value)
{
if (! cfg.lookupValue(path, value))
value = default_value;
traceit("%s = [%s]\n", path, value ? "true" : "false");
return true;
}
bool get_value(const Config &cfg, const char *path, string &value, int min, int max, const char *default_value)
{
if (cfg.lookupValue(path, value)) {
int l = value.length();
if (l<min || l>max) {
traceit("%s is invalid\n", path, value.c_str());
return false;
}
} else
value = default_value;
traceit("%s = [%s]\n", path, value.c_str());
return true;
}
/* process configuration file */
static int read_config(const char *cfgFile)
{
short int valid_params = 18;
short int params = 0;
FILE *cnf = NULL;
char inbuf[1024];
char *p = NULL;
char *ptr;
unsigned short i;
cnf = fopen(cfgFile, "r");
if (!cnf) {
traceit("Failed to open file %s\n", cfgFile);
int i;
Config cfg;
traceit("Reading file %s\n", cfgFile);
// Read the file. If there is an error, report it and exit.
try {
cfg.readFile(cfgFile);
}
catch(const FileIOException &fioex) {
traceit("Can't read %s\n", cfgFile);
return 1;
}
catch(const ParseException &pex) {
traceit("Parse error at %s:%d - %s\n", pex.getFile(), pex.getLine(), pex.getError());
return 1;
}
traceit("Reading file %s\n", cfgFile);
while (fgets(inbuf, 1020, cnf) != NULL) {
if (strchr(inbuf, '#'))
continue;
string dvap_path, value;
for (i=0; i<3; i++) {
dvap_path = "module.";
dvap_path += ('a' + i);
if (cfg.lookupValue(dvap_path + ".type", value)) {
if (0 == strcasecmp(value.c_str(), "dvap"))
break;
}
}
if (i >= 3) {
traceit("dvap not defined in any module!\n");
return 1;
}
RPTR_MOD = 'A' + i;
p = strchr(inbuf, '\r');
if (p)
*p = '\0';
p = strchr(inbuf, '\n');
if (p)
*p = '\0';
if (cfg.lookupValue(string(dvap_path+".callsign").c_str(), value) || cfg.lookupValue("ircddb.login", value)) {
int l = value.length();
if (l<3 || l>CALL_SIZE-2) {
traceit("Call '%s' is invalid length!\n", value.c_str());
return 1;
} else {
for (i=0; i<l; i++) {
if (islower(value[i]))
value[i] = toupper(value[i]);
}
value.resize(CALL_SIZE, ' ');
}
strcpy(RPTR, value.c_str());
traceit("%s.login = [%s]\n", dvap_path.c_str(), RPTR);
} else {
traceit("%s.login is not defined!\n", dvap_path.c_str());
return 1;
}
p = strchr(inbuf, '=');
if (!p)
continue;
*p = '\0';
if (cfg.lookupValue("ircddb.login", value)) {
int l = value.length();
if (l<3 || l>CALL_SIZE-2) {
traceit("Call '%s' is invalid length!\n", value.c_str());
return 1;
} else {
for (i=0; i<l; i++) {
if (islower(value[i]))
value[i] = toupper(value[i]);
}
value.resize(CALL_SIZE, ' ');
}
strcpy(OWNER, value.c_str());
traceit("ircddb.login = [%s]\n", OWNER);
} else {
traceit("ircddb.login is not defined!\n");
return 1;
}
if (strcmp(inbuf,"RPTR") == 0) {
memset(RPTR,' ', sizeof(RPTR));
RPTR[RPTR_SIZE] = '\0';
if (get_value(cfg, string(dvap_path+".invalid_prefix").c_str(), value, 1, CALL_SIZE, "XXX")) {
if (islower(value[i]))
value[i] = toupper(value[i]);
value.resize(CALL_SIZE, ' ');
strcpy(INVALID_YRCALL_KEY, value.c_str());
} else
return 1;
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
if (get_value(cfg, string(dvap_path+".internal_ip").c_str(), value, 7, IP_SIZE, "0.0.0.0"))
strcpy(RPTR_VIRTUAL_IP, value.c_str());
else
return 1;
i = 19998 + (RPTR_MOD - 'A');
get_value(cfg, string(dvap_path+".port").c_str(), RPTR_PORT, 10000, 65535, i);
if ((strlen(p + 1) < 1) || (strlen(p + 1) > (RPTR_SIZE - 2)))
traceit("RPTR value [%s] invalid\n", p + 1);
if (get_value(cfg, "gateway.ip", value, 7, IP_SIZE, "127.0.0.1"))
strcpy(G2_INTERNAL_IP, value.c_str());
else {
memcpy(RPTR, p + 1, strlen(p + 1));
traceit("RPTR=[%s]\n",RPTR);
params ++;
traceit("gateway.ip '%s' is invalid!\\n", value.c_str());
return 1;
}
} else if (strcmp(inbuf,"OWNER") == 0) {
memset(OWNER,' ', sizeof(OWNER));
OWNER[RPTR_SIZE] = '\0';
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
get_value(cfg, "gateway.internal.port", G2_PORT, 10000, 65535, 19000);
if ((strlen(p + 1) < 1) || (strlen(p + 1) > (RPTR_SIZE - 2)))
traceit("OWNER value [%s] invalid\n", p + 1);
if (get_value(cfg, string(dvap_path+".serial_number").c_str(), value, 8, 10, "APXXXXXX"))
strcpy(DVP_SERIAL, value.c_str());
else {
memcpy(OWNER, p + 1, strlen(p + 1));
traceit("OWNER=[%s]\n",OWNER);
params ++;
traceit("%s.serial_number '%s' is invalid!\n", dvap_path.c_str(), value.c_str());
return 1;
}
} else if (strcmp(inbuf,"INVALID_YRCALL_KEY") == 0) {
memset(INVALID_YRCALL_KEY, 0, sizeof(INVALID_YRCALL_KEY));
if ( (strlen(p + 1) < 1) || (strlen(p + 1) > CALL_SIZE) )
traceit("INVALID_YRCALL_KEY value [%s] invalid\n", p + 1);
else {
memcpy(INVALID_YRCALL_KEY, p + 1, strlen(p + 1));
double f;
get_value(cfg, string(dvap_path+".frequency").c_str(), f, 100.0, 1400.0, 145.5);
DVP_FREQ = (u_int32_t)(1.0e6*f);
for (i = 0; i < strlen(INVALID_YRCALL_KEY); i++)
INVALID_YRCALL_KEY[i] = toupper(INVALID_YRCALL_KEY[i]);
get_value(cfg, string(dvap_path+".power").c_str(), i, -12, 10, 10);
DVP_PWR = (int16_t)i;
traceit("INVALID_YRCALL_KEY=[%s]\n",INVALID_YRCALL_KEY);
params ++;
}
} else if (strcmp(inbuf,"RPTR_MOD") == 0) {
RPTR_MOD = *(p + 1);
traceit("RPTR_MOD=[%c]\n", *(p + 1));
params ++;
} else if (strcmp(inbuf,"RPTR_VIRTUAL_IP") == 0) {
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
get_value(cfg, string(dvap_path+".squelch").c_str(), i, -128, -45, -100);
DVP_SQL = (char)i;
if (strlen(p + 1) < 1)
traceit("RPTR_VIRTUAL_IP value [%s] invalid\n", p + 1);
else {
strncpy(RPTR_VIRTUAL_IP, p + 1, IP_SIZE);
RPTR_VIRTUAL_IP[IP_SIZE] = '\0';
traceit("RPTR_VIRTUAL_IP=[%s]\n", RPTR_VIRTUAL_IP);
params ++;
}
} else if (strcmp(inbuf,"RPTR_PORT") == 0) {
RPTR_PORT = atoi(p + 1);
traceit("RPTR_PORT=[%d]\n",RPTR_PORT);
params ++;
} else if (strcmp(inbuf,"G2_INTERNAL_IP") == 0) {
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
if (strlen(p + 1) < 1)
traceit("G2_INTERNAL_IP value [%s] invalid\n", p + 1);
else {
strncpy(G2_INTERNAL_IP, p + 1, IP_SIZE);
G2_INTERNAL_IP[IP_SIZE] = '\0';
traceit("G2_INTERNAL_IP=[%s]\n", G2_INTERNAL_IP);
params ++;
}
} else if (strcmp(inbuf,"G2_PORT") == 0) {
G2_PORT = atoi(p + 1);
traceit("G2_PORT=[%d]\n",G2_PORT);
params ++;
} else if (strcmp(inbuf,"DVP_SERIAL") == 0) {
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
if ((strlen(p + 1) > 63) || (strlen(p + 1) < 1))
traceit("DVP_SERIAL value [%s] invalid\n", p + 1);
else {
strcpy(DVP_SERIAL, p + 1);
traceit("DVP_SERIAL=[%s]\n", DVP_SERIAL);
params ++;
}
} else if (strcmp(inbuf,"DVP_FREQ") == 0) {
DVP_FREQ = atoi(p + 1);
traceit("DVP_FREQ=[%u]\n", DVP_FREQ);
params ++;
} else if (strcmp(inbuf,"DVP_PWR") == 0) {
DVP_PWR = atoi(p + 1);
traceit("DVP_PWR=[%d]\n", DVP_PWR);
params ++;
} else if (strcmp(inbuf,"DVP_SQL") == 0) {
DVP_SQL = atoi(p + 1);
traceit("DVP_SQL=[%d]\n", DVP_SQL);
params ++;
} else if (strcmp(inbuf,"DVP_OFF") == 0) {
DVP_OFF = atoi(p + 1);
traceit("DVP_OFF=[%u]\n", DVP_OFF);
params ++;
} else if (strcmp(inbuf,"WAIT_FOR_PACKETS") == 0) {
WAIT_FOR_PACKETS = atoi(p + 1);
if (WAIT_FOR_PACKETS <= 5)
WAIT_FOR_PACKETS = 25;
traceit("WAIT_FOR_PACKETS=[%d]\n",WAIT_FOR_PACKETS);
params ++;
} else if (strcmp(inbuf,"REMOTE_TIMEOUT") == 0) {
REMOTE_TIMEOUT = atoi(p + 1);
if (REMOTE_TIMEOUT < 1)
REMOTE_TIMEOUT = 1;
traceit("REMOTE_TIMEOUT=[%d]\n",REMOTE_TIMEOUT);
params ++;
} else if (strcmp(inbuf,"DELAY_BETWEEN") == 0) {
DELAY_BETWEEN = atoi(p + 1);
if (DELAY_BETWEEN <= 0)
DELAY_BETWEEN = 20;
traceit("DELAY_BETWEEN=[%d]\n",DELAY_BETWEEN);
params ++;
} else if (strcmp(inbuf,"DELAY_BEFORE") == 0) {
DELAY_BEFORE = atoi(p + 1);
if (DELAY_BEFORE <= 0)
DELAY_BEFORE = 1;
traceit("DELAY_BEFORE=[%d]\n",DELAY_BEFORE);
params ++;
} else if (strcmp(inbuf,"RPTR_ACK") == 0) {
if (*(p + 1) == 'Y')
RPTR_ACK = true;
else
RPTR_ACK = false;
traceit("RPTR_ACK=[%c]\n", *(p + 1));
params ++;
}
}
fclose(cnf);
get_value(cfg, string(dvap_path+".offset").c_str(), i, -2000, 2000, 0.0);
DVP_OFF = (int16_t)i;
if (params != valid_params) {
traceit("Configuration file %s invalid\n",cfgFile);
return 1;
}
get_value(cfg, string(dvap_path+".packet_wait").c_str(), WAIT_FOR_PACKETS, 6, 100, 25);
get_value(cfg, "timing.timeout.remote_g2", REMOTE_TIMEOUT, 1, 10, 2);
get_value(cfg, "timing.play.delay", DELAY_BETWEEN, 9, 25, 19);
get_value(cfg, "timing.play.wait", DELAY_BEFORE, 1, 10, 2);
/********* HERE HERE check for valid values *************/
/* check valid values */
/********* HERE HERE check for valid values *************/
get_value(cfg, string(dvap_path+".acknowledge").c_str(), RPTR_ACK, false);
inactiveMax = (REMOTE_TIMEOUT * 1000) / WAIT_FOR_PACKETS;
traceit("Max loops = %d\n", inactiveMax);

@ -20,7 +20,7 @@
while [ 1 ];
do
/usr/local/bin/dvap_rptr /usr/local/etc/dvap_rptr.cfg > /var/log/dvap_rptr.log 2>&1
/usr/local/bin/dvap_rptr /usr/local/etc/g2.cfg > /var/log/dvap_rptr.log 2>&1
sleep 10
done

@ -1,106 +0,0 @@
# This is the repeater callsign
# This must be equal to the OWNER value in the gateway software(g2_ircddb.cfg)
DVCALL=
# If you operate in "restriction mode", set RPTR equal to your personal callsign
# otherwise set RPTR equal to the value of DVCALL
RPTR=
# If you want to enable/disable the repeater, set these options.
# Each of these options can NOT be more than 8 characters.
# Each of these options can NOT be another user's callsign.
# Each of these options can NOT be another repeater or reflector.
# Each of these options can NOT be a YRCALL command.
# If these options are set, then they can NOT be equal to each other.
# Lets take an example:
# ENABLE_RF=RFISON
# DISABLE_RF=RFISOFF
# Using the above options, if you use YRCALL=RFISOFF in your radio
# then the repeater will be OFF
# and no audio will be copied over local RF
# and no audio will be accepted from any remote system.
ENABLE_RF=RFISON
DISABLE_RF=RFISOFF
# This must be equal to: FROM_REMOTE_G2_TIMEOUT + 1
# Note: FROM_REMOTE_G2_TIMEOUT is in the gateway configuration
REMOTE_TIMEOUT=3
# This is the module of the Dstar repeater
DVRPTR_MOD=B
# To protect the repeater owners from bad STN programs out there
# and to also protect the repeater owners from RF users that abuse the STN stuff
# Reject values in YRCALL that start with STN
# If you want to allow the local RF users to subscribe to remote STN groups,
# then set it to XXX or something that is invalid like 123
INVALID_YRCALL_KEY=XXX
# Your serial number
DVRPTR_SERIAL=12.19.D3.42
# For repeater module A: DVRPTR_INTERNAL_PORT=19998
# For repeater module B: DVRPTR_INTERNAL_PORT=19999
# For repeater module C: DVRPTR_INTERNAL_PORT=20000
# Repeater IP and port, the repeater runs here
DVRPTR_INTERNAL_IP=0.0.0.0
# for module B, port is 19999
DVRPTR_INTERNAL_PORT=19999
# The Internal G2 IP and port
GATEWAY_IP=127.0.0.1
GATEWAY_PORT=19000
# Some settings for your DV-RPTR modem
RF_AUDIO_Level=60
# Do you want an ACK back ?
RPTR_ACK=Y
# ACK delay in milliseconds(ms)
# Minimum is 1, maximum is 999
# If you do not get a repeater ACK, then make it a higher number
# Some radios get the ACK in 250ms, other radios require 750ms
ACK_DELAY=300
# For each packet inside the ACK, delay so many milliseconds,
# so the ICOM Dstar radio can process the ACK
DELAY_BETWEEN=19
# This is the TX-delay in milliseconds and it is used to delay the PTT.
# Seme radios have "SLOW" switching time,
# If your radio switches slow from RX to TX, then give your radio more time to switch, maybe 250 ms
# If your radio switches fast from RX to TX, then you could set it to 100 ms or maybe less
# But the best value should be the one to match your radio, so read the manual for your radio.
# In tests that were done for SLOW and FAST radios, we set it to 100 for FAST radios and 250 for SLOW radios.
TX_DELAY=250
# Dead firmware ?
# Lets say that you set RQST_COUNT=10
# When there is NO local RF activity, (we do NOT receive anything from the DV-RPTR modem),
# then every 2 seconds we request the status from the DV-RPTR modem.
# If the DV-RPTR modem does NOT reply to our command, then after sending the command 10 times(RQST_COUNT)
# we have to assume the firmware in the DV-RPTR modem is DEAD.
# So, we send the command every 2 sedonds, and after sending the command 10 times,
# that is about (2 * 10) = 20 seconds,
# the repeater software will stop if the DV-RPTR modem does not respond after 20 seconds( 2 seconds * 10 times )
# and then the service script will restart the repeater software.
# This is used to protect the repeater owner from BAD firmware.
# Minimum value is 6.
# If you see in the log this: "Modem is not responding... shuttting down"
# Then that means that the firmware died and the DV-RPTR modem stopped responding.
# You can increase the value of RQST_COUNT if you have a slow computer,
# (or maybe your computer is running too many programs and can not service the USB/serial fast enough)
# but we were informed that this is a bug in the firmware and they are trying to fix it.
# So, increasing the value for RQST_COUNT to higher than 10, does not make much sense.
RQST_COUNT=10
# If you want duplex, set it to Y
DUPLEX=N
# These values depend on what type of tranceiver is connected to your DV-RPTR modem
# Use either 0 or 1
RX_Inverse=1
TX_Inverse=0

@ -22,6 +22,11 @@
#include <wchar.h>
#include <sys/file.h>
#include "versions.h"
#include <string>
#include <libconfig.h++>
using namespace std;
using namespace libconfig;
#define VERSION DVRPTR_VERSION
#define BAUD B115200
@ -1802,244 +1807,198 @@ static void calcPFCS(unsigned char packet[58])//Netzwerk CRC
return;
}
static int read_config(const char *cfgFile)
bool get_value(const Config &cfg, const char *path, int &value, int min, int max, int default_value)
{
short int valid_params = 21;
short int params = 0;
FILE *cnf = NULL;
char inbuf[1024];
char *p = NULL;
char *ptr;
unsigned short i;
cnf = fopen(cfgFile, "r");
if (!cnf) {
logdata("Failed to open file %s\n", cfgFile);
return 1;
if (cfg.lookupValue(path, value)) {
if (value < min || value > max)
value = default_value;
} else
value = default_value;
logdata("%s = [%d]\n", path, value);
return true;
}
logdata("Reading file %s\n", cfgFile);
while (fgets(inbuf, 1020, cnf) != NULL) {
if (strchr(inbuf, '#'))
continue;
bool get_value(const Config &cfg, const char *path, double &value, double min, double max, double default_value)
{
if (cfg.lookupValue(path, value)) {
if (value < min || value > max)
value = default_value;
} else
value = default_value;
logdata("%s = [%lg]\n", path, value);
return true;
}
p = strchr(inbuf, '\r');
if (p)
*p = '\0';
p = strchr(inbuf, '\n');
if (p)
*p = '\0';
bool get_value(const Config &cfg, const char *path, bool &value, bool default_value)
{
if (! cfg.lookupValue(path, value))
value = default_value;
logdata("%s = [%s]\n", path, value ? "true" : "false");
return true;
}
p = strchr(inbuf, '=');
if (!p)
continue;
*p = '\0';
bool get_value(const Config &cfg, const char *path, string &value, int min, int max, const char *default_value)
{
if (cfg.lookupValue(path, value)) {
int l = value.length();
if (l<min || l>max) {
logdata("%s is invalid\n", path, value.c_str());
return false;
}
} else
value = default_value;
logdata("%s = [%s]\n", path, value.c_str());
return true;
}
if (strcmp(inbuf,"DVCALL") == 0) {
memset(DVCALL,' ', sizeof(DVCALL));
DVCALL[RPTR_SIZE] = '\0';
/* process configuration file */
static int read_config(const char *cfgFile)
{
int i;
Config cfg;
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
logdata("Reading file %s\n", cfgFile);
// Read the file. If there is an error, report it and exit.
try {
cfg.readFile(cfgFile);
}
catch(const FileIOException &fioex) {
logdata("Can't read %s\n", cfgFile);
return 1;
}
catch(const ParseException &pex) {
logdata("Parse error at %s:%d - %s\n", pex.getFile(), pex.getLine(), pex.getError());
return 1;
}
if ((strlen(p + 1) < 1) || (strlen(p + 1) > (RPTR_SIZE - 2)))
logdata("DVCALL value [%s] invalid\n", p + 1);
else {
memcpy(DVCALL, p + 1, strlen(p + 1));
logdata("DVCALL=[%s]\n",DVCALL);
params ++;
string path, value;
for (i=0; i<3; i++) {
path = "module.";
path += ('a' + i);
if (cfg.lookupValue(path + ".type", value)) {
if (0 == strcasecmp(value.c_str(), "dvrptr"))
break;
}
}
if (i >= 3) {
logdata("dvrptr not defined in any module!\n");
return 1;
}
} else if (strcmp(inbuf,"RPTR") == 0) {
memset(RPTR,' ', sizeof(RPTR));
RPTR[RPTR_SIZE] = '\0';
DVRPTR_MOD = 'A' + i;
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
if (cfg.lookupValue(string(path+".callsign").c_str(), value) || cfg.lookupValue("ircddb.login", value)) {
int l = value.length();
if (l<3 || l>CALL_SIZE-2) {
logdata("Call '%s' is invalid length!\n", value.c_str());
return 1;
} else {
for (i=0; i<l; i++) {
if (islower(value[i]))
value[i] = toupper(value[i]);
}
value.resize(CALL_SIZE, ' ');
}
strcpy(RPTR, value.c_str());
logdata("%s.callsign = [%s]\n", path.c_str(), RPTR);
} else {
logdata("%s.callsign is not defined!\n", path.c_str());
return 1;
}
if ((strlen(p + 1) < 1) || (strlen(p + 1) > (RPTR_SIZE - 2)))
logdata("RPTR value [%s] invalid\n", p + 1);
else {
memcpy(RPTR, p + 1, strlen(p + 1));
logdata("RPTR=[%s]\n",RPTR);
params ++;
}
} else if (strcmp(inbuf,"DVRPTR_SERIAL") == 0) {
memset(DVRPTR_SERIAL, 0, sizeof(DVRPTR_SERIAL));
strncpy(DVRPTR_SERIAL, p + 1, 11);
DVRPTR_SERIAL[11] = '\0';
logdata("DVRPTR_SERIAL=[%s]\n",DVRPTR_SERIAL);
params ++;
} else if (strcmp(inbuf,"GATEWAY_IP") == 0) {
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
if (strlen(p + 1) < 1)
logdata("GATEWAY_IP value [%s] invalid\n", p + 1);
else {
strncpy(GATEWAY_IP, p + 1, IP_SIZE);
GATEWAY_IP[IP_SIZE] = '\0';
logdata("GATEWAY_IP=[%s]\n", GATEWAY_IP);
params ++;
}
} else if (strcmp(inbuf,"DVRPTR_INTERNAL_PORT") == 0) {
DVRPTR_INTERNAL_PORT = atoi(p + 1);
logdata("DVRPTR_INTERNAL_PORT=[%d]\n",DVRPTR_INTERNAL_PORT);
params ++;
} else if (strcmp(inbuf,"DVRPTR_INTERNAL_IP") == 0) {
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
if (strlen(p + 1) < 1)
logdata("DVRPTR_INTERNAL_IP value [%s] invalid\n", p + 1);
else {
strncpy(DVRPTR_INTERNAL_IP, p + 1, IP_SIZE);
DVRPTR_INTERNAL_IP[IP_SIZE] = '\0';
logdata("DVRPTR_INTERNAL_IP=[%s]\n", DVRPTR_INTERNAL_IP);
params ++;
}
} else if (strcmp(inbuf,"GATEWAY_PORT") == 0) {
GATEWAY_PORT = atoi(p + 1);
logdata("GATEWAY_PORT=[%d]\n",GATEWAY_PORT);
params ++;
} else if (strcmp(inbuf,"DVRPTR_MOD") == 0) {
DVRPTR_MOD = *(p + 1);
logdata("DVRPTR_MOD=[%c]\n", *(p + 1));
params ++;
} else if (strcmp(inbuf,"INVALID_YRCALL_KEY") == 0) {
memset(INVALID_YRCALL_KEY, 0, sizeof(INVALID_YRCALL_KEY));
if ( (strlen(p + 1) < 1) || (strlen(p + 1) > CALL_SIZE) )
logdata("INVALID_YRCALL_KEY value [%s] invalid\n", p + 1);
else {
memcpy(INVALID_YRCALL_KEY, p + 1, strlen(p + 1));
for (i = 0; i < strlen(INVALID_YRCALL_KEY); i++)
INVALID_YRCALL_KEY[i] = toupper(INVALID_YRCALL_KEY[i]);
logdata("INVALID_YRCALL_KEY=[%s]\n",INVALID_YRCALL_KEY);
params ++;
}
} else if (strcmp(inbuf,"RF_AUDIO_Level") == 0) {
RF_AUDIO_Level = atoi(p + 1);
if (RF_AUDIO_Level < 0)
RF_AUDIO_Level = 1;
Modem_Init2[7] = RF_AUDIO_Level;
logdata("RF_AUDIO_Level=[%d]\n",RF_AUDIO_Level);
params ++;
} else if (strcmp(inbuf,"DUPLEX") == 0) {
if (*(p + 1) == 'Y')
DUPLEX = true;
if (cfg.lookupValue("ircddb.login", value)) {
int l = value.length();
if (l<3 || l>CALL_SIZE-2) {
logdata("Call '%s' is invalid length!\n", value.c_str());
return 1;
} else {
for (i=0; i<l; i++) {
if (islower(value[i]))
value[i] = toupper(value[i]);
}
value.resize(CALL_SIZE, ' ');
}
strcpy(DVCALL, value.c_str());
logdata("ircddb.login = [%s]\n", DVCALL);
} else {
logdata("ircddb.login is not defined!\n");
return 1;
}
if (get_value(cfg, string(path+".rf_control.on").c_str(), value, 0, CALL_SIZE, " "))
strcpy(ENABLE_RF, value.c_str());
else
DUPLEX = false;
logdata("DUPLEX=[%c]\n", *(p + 1));
params ++;
} else if (strcmp(inbuf,"RPTR_ACK") == 0) {
if (*(p + 1) == 'Y')
RPTR_ACK = true;
logdata("%s.rf_control.on '%s' is invalid, rejected.\n", path.c_str(), value.c_str());
if (get_value(cfg, string(path+".rf_control.off").c_str(), value, 0, CALL_SIZE, " "))
strcpy(DISABLE_RF, value.c_str());
else
RPTR_ACK = false;
logdata("RPTR_ACK=[%c]\n", *(p + 1));
params ++;
} else if (strcmp(inbuf,"ACK_DELAY") == 0) {
ACK_DELAY = atol(p + 1);
if ((ACK_DELAY < 1) || (ACK_DELAY > 999))
ACK_DELAY = 250;
logdata("ACK_DELAY=[%ld]\n", ACK_DELAY);
ACK_DELAY = ACK_DELAY * 1000;
params ++;
} else if (strcmp(inbuf,"DELAY_BETWEEN") == 0) {
DELAY_BETWEEN = atoi(p + 1);
if (DELAY_BETWEEN < 10)
DELAY_BETWEEN = 16;
logdata("DELAY_BETWEEN=[%d]\n", DELAY_BETWEEN);
DELAY_BETWEEN = DELAY_BETWEEN * 1000;
params ++;
} else if (strcmp(inbuf,"RQST_COUNT") == 0) {
RQST_COUNT = atoi(p + 1);
if (RQST_COUNT < 6)
RQST_COUNT = 6;
logdata("RQST_COUNT=[%d]\n",RQST_COUNT);
params ++;
} else if (strcmp(inbuf,"ENABLE_RF") == 0) {
memset(ENABLE_RF,' ', sizeof(ENABLE_RF));
ENABLE_RF[RPTR_SIZE] = '\0';
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
if (strlen(p + 1) > RPTR_SIZE)
logdata("ENABLE_RF value [%s] invalid\n", p + 1);
else {
memcpy(ENABLE_RF, p + 1, strlen(p + 1));
logdata("ENABLE_RF=[%s]\n",ENABLE_RF);
params ++;
logdata("%s.rf_control.off '%s' is invalid, rejected.\n", path.c_str(), value.c_str());
if (cfg.lookupValue("timing.timeout.remote_g2", REMOTE_TIMEOUT)) {
REMOTE_TIMEOUT++;
if (REMOTE_TIMEOUT < 1)
REMOTE_TIMEOUT = 2;
} else
REMOTE_TIMEOUT = 3;
logdata("timing.timeout.remote_g2 = [%d]\n", REMOTE_TIMEOUT);
if (get_value(cfg, string(path+".invalid_prefix").c_str(), value, 1, CALL_SIZE, "XXX")) {
value.resize(CALL_SIZE, ' ');
for (i=0; i<CALL_SIZE; i++) {
if (islower(value[i]))
value[i] = toupper(value[i]);
}
strcpy(INVALID_YRCALL_KEY, value.c_str());
} else {
logdata("%s.invalid_prefix '%s' is invalid!\n", path.c_str(), value.c_str());
return 1;
}
} else if (strcmp(inbuf,"DISABLE_RF") == 0) {
memset(DISABLE_RF,' ', sizeof(DISABLE_RF));
DISABLE_RF[RPTR_SIZE] = '\0';
ptr = strchr(p + 1, ' ');
if (ptr)
*ptr = '\0';
if (get_value(cfg, string(path+".serial_number").c_str(), value, 11, 11, "00.00.00.00"))
strcpy(DVRPTR_SERIAL, value.c_str());
else {
logdata("%s.serial_number '%s' is invalid!\n", path.c_str(), value.c_str());
return 1;
}
if (strlen(p + 1) > RPTR_SIZE)
logdata("DISABLE_RF value [%s] invalid\n", p + 1);
if (get_value(cfg, string(path+".internal_ip").c_str(), value, 7, IP_SIZE, "0.0.0.0"))
strcpy(DVRPTR_INTERNAL_IP, value.c_str());
else {
memcpy(DISABLE_RF, p + 1, strlen(p + 1));
logdata("DISABLE_RF=[%s]\n",DISABLE_RF);
params ++;
logdata("%s.internal_ip '%s' is invalid!\n", path.c_str(), value.c_str());
return 1;
}
} else if (strcmp(inbuf,"REMOTE_TIMEOUT") == 0) {
REMOTE_TIMEOUT = atoi(p + 1);
if (REMOTE_TIMEOUT < 1)
REMOTE_TIMEOUT = 1;
logdata("REMOTE_TIMEOUT=[%d]\n",REMOTE_TIMEOUT);
params ++;
} else if (strcmp(inbuf,"RX_Inverse") == 0) {
if (*(p + 1) == '1')
RX_Inverse = 1;
else
RX_Inverse = 0;
logdata("RX_Inverse=[%c]\n", *(p + 1));
params ++;
} else if (strcmp(inbuf,"TX_Inverse") == 0) {
if (*(p + 1) == '1')
TX_Inverse = 1;
get_value(cfg, string(path+".port").c_str(), DVRPTR_INTERNAL_PORT, 10000, 65535, 19998 + (DVRPTR_MOD - 'A'));
else
TX_Inverse = 0;
logdata("TX_Inverse=[%c]\n", *(p + 1));
params ++;
} else if (strcmp(inbuf,"TX_DELAY") == 0) {
TX_DELAY = atoi(p + 1);
if (TX_DELAY < 0) {
TX_DELAY = 250;
logdata("TX-delay can not be below 0, setting it back to 250");
}
if (TX_DELAY > 6000) {
TX_DELAY = 250;
logdata("TX-delay exceeds maximum of 6000, setting it back to 250");
if (get_value(cfg, "gateway.ip", value, 7, IP_SIZE, "127.0.0.1"))
strcpy(GATEWAY_IP, value.c_str());
else {
logdata("gateway.ip '%s' is invalid!\n", value.c_str());
return 1;
}
get_value(cfg, "gateway.internal.port", GATEWAY_PORT, 10000, 65535, 19000);
get_value(cfg, string(path+".rf_tx_level").c_str(), RF_AUDIO_Level, 1, 100, 80);
get_value(cfg, string(path+".duplex").c_str(), DUPLEX, false);
get_value(cfg, string(path+".acknowledge").c_str(), RPTR_ACK, false);
get_value(cfg, string(path+".ack_delay").c_str(), i, 1, 999, 300);
ACK_DELAY = (long)i;
get_value(cfg, "timing.play.delay", DELAY_BETWEEN, 10, 25, 19);
DELAY_BETWEEN *= 1000;
get_value(cfg, string(path+".tx_delay").c_str(), TX_DELAY, 0, 6000, 250);
Modem_Init2[8] = TX_DELAY & 0xFF;
Modem_Init2[9] = TX_DELAY >> 8;
logdata("TX_DELAY=[%d]\n",TX_DELAY);
params ++;
}
}
fclose(cnf);
if (params != valid_params) {
logdata("Configuration file %s invalid\n",cfgFile);
return 1;
}
get_value(cfg, string(path+".rqst_count").c_str(), RQST_COUNT, 6, 20, 10);
get_value(cfg, string(path+".inverse.rx").c_str(), RX_Inverse, true);
get_value(cfg, string(path+".inverse.tx").c_str(), TX_Inverse, true);
inactiveMax = (REMOTE_TIMEOUT * 1000000) / 400;
logdata("... computed max number of loops %d, each loop is 400 microseconds\n", inactiveMax);
@ -2055,7 +2014,7 @@ static void logdata(const char *fmt,...)
time(&ltime);
localtime_r(&ltime,&mytm);
snprintf(trace_buf,TRACE_BFSZ - 1,"%02d%02d%02d at %02d:%02d:%02d:",
snprintf(trace_buf,TRACE_BFSZ - 1,"%02d/%02d/%02d %02d:%02d:%02d:",
mytm.tm_mon+1,mytm.tm_mday,mytm.tm_year % 100,
mytm.tm_hour,mytm.tm_min,mytm.tm_sec);
trace_buf[TRACE_BFSZ - 1] = '\0';

@ -2,7 +2,7 @@
while [ 1 ];
do
/usr/local/bin/dvrptr /usr/local/etc/dvrptr.cfg > /var/log/dvrptr.log 2>&1
/usr/local/bin/dvrptr /usr/local/etc/g2.cfg > /var/log/dvrptr.log 2>&1
sleep 3
done

@ -0,0 +1,24 @@
# g2_ircddb Configuration for me
ircddb = {
login = "MYCALL"
# If you are not using rr.openquad.net, you need to specify the host and possibly the password.
#
# host = "some.server.host" // others include group1-irc.ircddb.net
# password = "1111111111111" // not needed for rr.penquad.net
}
module = {
c = { // change the module to "b" if you have a 70cm DVAP
type = "dvap"
serial_number = "AP123456" // your serial number is visible through the case
frequency = 145.5 // this is the default value, chose a quiet frequency
# uncomment and set if you want the following to appear on you ircddb host website.
# range = 0.0 // in meters (1609.344 is one mile)
# agl = 0.0 // in meters
# latitude = 0.000000 // north is positive
# longitude = 0.000000 // east is positive
# desc1 = "Location1" // up to 20 chars
# desc2 = "location2" // up to 20 chars
}
}

@ -0,0 +1,282 @@
# g2_ircddb Configuration
ircddb = {
# login = ""; # login callsign for the ircDDB network
# host = "rr.openquad.net" # other include group1-irc.ircddb.net
# port = 9007 # not a good idea to change!
# password = "1111111111111" # not needed for Openquad
}
gateway = {
# regen_header = true # regenerate headers from incoming data
# send_qrgs_maps = true # send frequecy, offset, cooridinates and url to irc-server
# local_irc_ip = "0.0.0.0" # 0.0.0.0 means accept any incoming connections
# arps_send = true # send info to aprs
# ip = "127.0.0.1" # where the gateway is running
external = {
# ip = "0.0.0.0"
# port = 40000
}
internal = {
# ip = "0.0.0.0"
# port = 19000
}
}
module = {
a = {
# type = ""
# ip = "127.0.0.1"
# port = 19998 # default for mod a
}
b = {
# a DVRPTR connected to a 70cm radio is shown in this example
# type must be defined. This is how the dvrptr program finds the config params.
# type = "dvrptr"
# If you operate in "restriction mode", set callsign equal to your personal callsign
# Otherwise do not set callsign and we will use ircddb.username
# callsign = ""
# the frequency of your DVAP in MHz.
# frequency = 145.5
# the TX/RX offset in MHz, use 0.0 for simplex
# offset = 0
# the range of this repeater, in meters 1609.344 meters is 1.0 miles
# range = 0.0
# the height above ground level for you repeater's antenna
# agl = 0.0
# the latitude of your repeater
# latitude = 0.0
# the longitude of your repeater
# longitude = 0.0
# This is used in a loop to wait for packets from your local gateway
# This is in milliseconds
# packet_wait = 25
# description of repeater, part one and two 20 char max each
# desc1 = ""
# desc2 = ""
# the url of your repeater, 80 chars max, defaults to "github.com/ac2ie/g2_ircddb
# url = "" # 80 char max, defaults to "github.com/ac2ie/g2_ircddb
# If you want to enable/disable the repeater, set these options.
# Each of these options can NOT be more than 8 characters.
# Each of these options can NOT be another user's callsign.
# Each of these options can NOT be another repeater or reflector.
# Each of these options can NOT be a YRCALL command.
# If these options are set, then they can NOT be equal to each other.
# Using the above options, if you use YRCALL=RFISOFF in your radio
# then the repeater will be OFF and no audio will be copied over local RF
# and no audio will be accepted from any remote system.
# these command are disabled by default
# You can choose your own command strings, if you want to enable these
rf_control {
# on = "RFISON"
# off = "RFISOFF"
}
# To protect the repeater owners from bad STN programs out there
# and to also protect the repeater owners from RF users that abuse the STN stuff
# Reject values in YRCALL that start with STN
# If you want to allow the local RF users to subscribe to remote STN groups,
# then set it to XXX or something that is invalid like 123
# invalid_prefix = "XXX"
# Your DVRPTR V1 serial number
# If you don't know what it is, run the program and look in the log file!
# serial_number = "00.00.00.00"
# the dvrptr program runs here, leave the commented out unless you know what you are doing!
# internal_ip = "0.0.0.0"
# port = 19999 # default for mod b
# Some settings for your DVRPTR modem (see DVRPTR V1 manual for more info).
# rf_rx_level = 80
# If you need duplex, set it to true
# duplex = false
# Do you want an ACK back ?
# acknowledge = false
# ACK delay in milliseconds(ms)
# Minimum is 1, maximum is 999
# If you do not get a repeater ACK, then make it a higher number
# Some radios get the ACK in 250ms, other radios require 750ms
# ack_delay = 300
# This is the TX-delay in milliseconds and it is used to delay the PTT.
# Seme radios have "SLOW" switching time,
# If your radio switches slow from RX to TX, then give your radio more time to switch, maybe 250 ms
# If your radio switches fast from RX to TX, then you could set it to 100 ms or maybe less
# But the best value should be the one to match your radio, so read the manual for your radio.
# In tests that were done for SLOW and FAST radios, we set it to 100 for FAST radios and 250 for SLOW radios.
# tx_delay = 250
# Dead firmware ?
# Lets say that you set RQST_COUNT=10
# When there is NO local RF activity, (we do NOT receive anything from the DV-RPTR modem),
# then every 2 seconds we request the status from the DV-RPTR modem.
# If the DV-RPTR modem does NOT reply to our command, then after sending the command 10 times(RQST_COUNT)
# we have to assume the firmware in the DV-RPTR modem is DEAD.
# So, we send the command every 2 sedonds, and after sending the command 10 times,
# that is about (2 * 10) = 20 seconds,
# the repeater software will stop if the DV-RPTR modem does not respond after 20 seconds( 2 seconds * 10 times )
# and then the service script will restart the repeater software.
# This is used to protect the repeater owner from BAD firmware.
# Minimum value is 6.
# If you see in the log this: "Modem is not responding... shuttting down"
# Then that means that the firmware died and the DV-RPTR modem stopped responding.
# You can increase the value of RQST_COUNT if you have a slow computer,
# (or maybe your computer is running too many programs and can not service the USB/serial fast enough)
# but we were informed that this is a bug in the firmware and they are trying to fix it.
# So, increasing the value for RQST_COUNT to higher than 10, does not make much sense.
# rqst_count = 10
# These values depend on what type of tranceiver is connected to your DV-RPTR modem
# Use either true or false
inverse {
# rx = true
# tx = true
}
}
c = {
# a 2m DVAP is shown as an example
# type must be defined. This is how the dvap_rptr program finds the config params.
# type = "dvap"
# If you operate in "restriction mode", set RPTR equal to your personal callsign
# Otherwise do not set callsign and it will use ircddb.username
# callsign = ""
# TX DVAP power level -12 to 10, 10 is maximum poower
# power = 10
# Squelch, -128 to -45, -100 to -80 usually works best
# squelch = -100
# To protect the repeater owners from bad STN programs out there
# and to also protect the repeater owners from RF users that abuse the STN stuff
# Reject values in YRCALL that start with STN
# If you want to allow the local RF users to subscribe to remote STN groups,
# then set it to XXX or something that is invalid like 123
# ivalid_prefix = "XXX"
# The serial number of you DVAP is visible through the bottom of the case
# serial_number = "APXXXXXX"
# the DVAP will send a blip to acknowledge a transmission
# acknowledge = false
# the frequency of your DVAP in MHz.
# frequency = 145.5
# this is for tweaking the frequency of your DVAP, see the owner's manual
# dvap_offset = 0
# the range of this repeater, in meters 1609.344 meters is 1.0 miles
# range = 0.0
# the height above ground level for you repeater's antenna
# agl = 0.0
# the latitude of your repeater
# latitude = 0.0
# the longitude of your repeater
# longitude = 0.0
# This is used in a loop to wait for packets from your local gateway
# This is in milliseconds
# packet_wait = 25
# description of repeater, part one and two 20 char max each
# desc1 = ""
# desc2 = ""
# the url of your repeater, 80 chars max, defaults to "github.com/ac2ie/g2_ircddb
# url = "" # 80 char max, defaults to "github.com/ac2ie/g2_ircddb
# where other g2 programs find this repeater software
# ip = "127.0.0.1" # where is the device running? must be a "dotted number"
# the internal ip of this program, "0.0.0.0" is usually best
# internal_ip = "0.0.0.0"
# port number default: A:19990 B:19999 C:20000
# port = 20000 # default for mod C
}
}
log = {
# debuging and extra logging switches
# qso = true # QSO info goes into the log
# irc = false # IRC debug info
# dtmf = false # DTMF debug info
}
aprs = { # APRS.NET connect info
# host = "rotate.aprs.net"
# port = 14580
# interval = 40
# filter = ""
}
g2_link = {
# link_at_start = "NONE" # Link to a reflector at startup.
# to link repeater module B to REF001 C, use "BREF001C"
# ref_login = "" # for loging into REF reflectors, if undefined, ircddb.username will be used
# users = [ "CALL1", "CALL2", "CALL3" ] # if defined, only these users can use this gateway
# link_unlink = [ "CALL4", "CALL5", "CALL6" ] # if defined, only these users can link and unlink a repeater
# incoming_ip = "0.0.0.0" # incoming ip address, "0.0.0.0" means accepts all connections.
# ip = "127.0.0.1" # where g2_link is running
# port = 18997 # port for communications to g2_link
# ref_port = 20001 # port for REF linking, don't change
# xrf_port = 30001 # port for XRF linking, don't change
# dcs_port = 30051 # port for DCS linking, don't change
# announce = true # do link, unlink, etc. announcements
# acknowledge = true # sent text acknowledgement on key-up
# max_dongles = 5 # maximum number of linked hotspots
}
file = {
# status = "/usr/local/etc/rptr_status" # where repeater status info is passed between services
# DTMF = "/tmp" #
# echotest = "/tmp" # echo dat files will end up here
# gwys = "/usr/local/etc/gwys.txt" # where the list of gateways and reflectors (with ports) is.
# announce_dir = "/usr/local/etc" # where are the *.dat files for the verbal link, unlink, etc. announcements
}
timing = {
timeout = {
# echo = 1 # delay time in seconds for echo
# voicemail = 1 # delay time for voicemail
# remote_g2 = 2 # after this many seconds with no packets, we assume the tx is closed
# local_rptr = 1 # local timeout, in seconds
}
play = {
# wait = 2 # seconds before playback occurs, between 1 and 10
# delay = 19 # microseconds between frames playback, if echo sounds bad, adjust this up or down 1,2 microseconds
}
inactivity = {
# a = 0 # unlink repeater if no activity for this many minutes
# b = 0 # zero mean there will be no timer
# c = 0
}
}

@ -1,192 +0,0 @@
#
# 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.
#
# g2_ircddb.cfg configuration file for g2_ircddb gateway
# Your G2 Gateway callsign can be up to 6 characters
# This will also be used to connect to the remote ircDDB server
# and validate you on the DStar system
# YOU MUST SET THIS TO A VAILD CALLSIGN
OWNER =
# RPTR_X = Type | Frequency(MHz) | Offset(MHz) | Range(m) | above ground level(m) | latitude | longitude | description#1 | description#2 | URL
# If you do NOT want to define a parameter for a module, then leave the parameter BLANK, except...
# Type: 0 is DVAP, 1 is DVRPTR. YOU MUST SPECIFY THIS PARAMETER.
# only the first 20 characters of the descriptions and 64 characters of the URL will be used.
# Example for a 2m DVRPTR connected to an antenna 10 meters above ground level with a range of 10 miles
# RPTR_C = 1 | 146.5 | 0 | 16093.44 | 10 | 42.0000 | -73.0000 | Mytown, MyState | MyCountry or MyGridSquare | github.com/ac2ie/g2_ircddb
# YOU MUST DEFINE AT LEAST ONE REPEATER!
#RPTR_A = 1 | | | | | | | | | github.com/ac2ie/g2_ircddb
#RPTR_B = 1 | | | | | | | | | github.com/ac2ie/g2_ircddb
RPTR_C = 0 | | | | | | | | | github.com/ac2ie/g2_ircddb
###################################################################################################
# All other parameters are optional. Uncomment the assignments to set a different value.
# This is for APRS/GPS
#SEND_APRS = Y
# This is for the Live IRC site, or Quadnet
# if you don't want you frequency, location or url sent, set this to "N", or some of the RPTR_X fields empty.
#SEND_QRGS_MAPS = Y
# Which local address on your Linux box will be used
# to report to the remote IRC database server(group2, group1,...)
# For most installations it is 0.0.0.0 (which binds to all local IP addresses)
# If you have more than one ethernet card, then you may set it to a specific local IP
# that is assigned to that specific ethernet card
# If you have one ethernet card, you can use 0.0.0.0
#LOCAL_IRC_IP = 0.0.0.0
# 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 you have a server that is closer to your QTH
#APRS_HOST = rotate.aprs.net
#APRS_PORT = 14580
# How often to report the aprs beacon, in minutes, Do NOT make it less than 40
#APRS_INTERVAL = 40
#APRS_FILTER=
# The G2 external port of this Gateway server
# Remote gateways will route data here
#G2_EXTERNAL_IP = 0.0.0.0
#G2_EXTERNAL_PORT = 40000
# The G2 internal port of this Gateway server
# Our local repeater modules will send data here
#G2_INTERNAL_IP = 0.0.0.0
#G2_INTERNAL_PORT = 19000
# Where is the g2_link running?
#TO_G2_LINK_IP = 127.0.0.1
#TO_G2_LINK_PORT = 18997
# The repeater modules of this repeater
#TO_RPTR_IP_A = 127.0.0.1
#TO_RPTR_PORT_A = 19998
#TO_RPTR_IP_B = 127.0.0.1
#TO_RPTR_PORT_B = 19999
#TO_RPTR_IP_C = 127.0.0.1
#TO_RPTR_PORT_C = 20000
# Timeouts in seconds
# We need these timeouts because the END-OF-AUDIO packet can get lost.
# Of course it can get lost, because everything about Dstar is on UDP
# UDP is notorious for losing packets.
# Each packet arrives normally 20ms after previous packet,
# so giving it 1 second is more than enough.
# This 1-second timeout was used internally in the g2_ircddb software,
# but now the user has a chance to change it.
# We do not believe that it should be changed,
# As mentioned before, more than 1 second is more than
# enough to make sure that we should stop waiting for more packets.
# Echotest-recording timeout:
# If after 1 second, audio stops coming in for echotest-recording,
# we will stop recording for ECHOTEST
#ECHOTEST_REC_TIMEOUT = 1
# Voicemail-recording timeout:
# If after 1 second, audio stops coming in for voicemail-recording,
# we will stop recording for voicemail
#VOICEMAIL_REC_TIMEOUT = 1
# If after 2 seconds, we do not receive any more packets from remote system,
# we will assume that the remote QSO has stopped
#FROM_REMOTE_G2_TIMEOUT = 2
# If after 1 second, we do not receive any more packets from
# our local repeater, we will assume that the local RF user has stopped talking.
#FROM_LOCAL_RPTR_TIMEOUT = 1
# print QSO details
#QSO_DETAILS = Y
# These 2 options limit the lines in the log.
# For production systems, we recommend: IRC_DEBUG=N
#IRC_DEBUG = N
#DTMF_DEBUG = N
# Do you want to re-generate the HEADER if there is a timeout from
# messages arriving from remote systems(reflectors, gateways, ...)
#REGEN_HDR = Y
# LINK STATUS file
# This file is created by g2_link
# This gateway will ONLY read that status file
# to determine if any module is linked to anything
#STATUS_FILE = /usr/local/etc/RPT_STATUS.txt
#DTMF_DIR = /tmp
# Directory of recorded files created in ECHOTEST/playback mode
#ECHOTEST_DIR = /tmp
# How many SECONDS to wait before starting to playback the recorded file.
# 1 second is enough, some repeaters require 2 seconds to re-initialize
# before they accept new streams again.
# must be between 1 and 10
# PLAY_WAIT = 2
# How many MILLIseconds to delay when playing back each of the recorded packets
# Normal VoIP is 20 milliseconds or a little less
# must be between 10 and 50
#PLAY_DELAY = 19
# The remote ircDDB database
# For US, Canada and North America
# IRC_DDB_HOST=group2-irc.ircddb.net
# For the German and EU
# IRC_DDB_HOST=group1-irc.ircddb.net
# For registration free routing, use OpenQuad's round-robin, rr.openquad.net
#IRC_DDB_HOST = rr.openquad.net
# The remote ircDDB port
#IRC_DDB_PORT = 9007
# Your ircDDB password given to you by the German ircDDB team.
# Put your correct password here.
# you will only need this with a club call using group1-irc
#IRC_PASS = 1111111111111111

File diff suppressed because it is too large Load Diff

@ -1,95 +0,0 @@
# The ONLY values to change are: LOGIN_CALL, OWNER and ADMIN
#
# Callsign to use to login to remote REF reflector
# This is your personal user callsign
# Remove the # sign and set your callsign correctly
#
LOGIN_CALL=
# Because ONLY_ADMIN_LOGIN=Y
# only these 3 users can connect to your gateway
ADMIN=
ONLY_ADMIN_LOGIN=Y
# If you set ONLY_LINK_UNLINK=Y
# then ONLY user callsigns identified by the option LINK_UNLINK_USER
# can link or unlink your repeater.
# If you set ONLY_LINK_UNLINK=N
# then ANY user callsign can link or unlink your repeater.
#
ONLY_LINK_UNLINK=N
LINK_UNLINK_USER=XX0XXX
LINK_UNLINK_USER=YY0YYY
LINK_UNLINK_USER=ZZ0ZZZ
# Local gateway callsign
# This is your local G2 Gateway callsign
# You should register this with the remote irc database server
# Remove the # sign and set the gateway callsign correctly.
#
OWNER=
# remote friends
RMT_XRF_PORT=30001
RMT_REF_PORT=20001
RMT_DCS_PORT=30051
# Our server port so that the local g2 gateway can contact us
# our g2_link will create/open this UDP port as a server
MY_G2_LINK_IP=0.0.0.0
MY_G2_LINK_PORT=18997
# The external g2 port of the local G2
TO_G2_EXTERNAL_IP=127.0.0.1
TO_G2_EXTERNAL_PORT=40000
QSO_DETAILS=N
# The reflectors
GWYS=/usr/local/etc/gwys.txt
#LINK STATUS file
STATUS_FILE=/usr/local/etc/RPT_STATUS.txt
# SEND an AUDIO announcements on LINK/UNLINK/INFO ?
ANNOUNCE=Y
# The directory where the "*.dat" files are located
ANNOUNCE_DIR=/usr/local/etc
# Send a TEXT announcement on every key-up ?
RPTR_ACK=N
# While sending back the announcement,
# what is the delay in MILLISECONDS between each packet
DELAY_BETWEEN=19
# How many seconds to delay before sending the announcement
# Set it to 1
# If your local repeater requires more time to initialize after releasing PTT, then set it to 2
DELAY_BEFORE=1
# Try to link to this system after initialization
# Leave the option blank, if you do not want automatic linking at startup
#
# Link your local repeater mod B to the remote reflector XRF005 mod A
#
LINK_AT_STARTUP=CXRF901A
# Maximum number of incoming hotspotNode or dongle connections(r2g2_p, r2g2_x, HotSpotNode,...)
# If you do NOT want incoming HotSpotNode or dongle connections, set this to 0
MAX_DONGLES=5
# Each RF band has an inactivity timer, in minutes.
# If the timer is 0, then there is NO timer at all.
# If the timer is greater than 0 and that RF band is linked
# to a remote system, and no local RF activity has taken place
# in the last minutes as set in the timer, then
# automatically the RF band will unlink from the remote system.
# This is done to protect the owner from local RF users that
# link the RF band to a remote system,
# and then go away.
RF_INACTIVITY_TIMER_A=0
RF_INACTIVITY_TIMER_B=0
RF_INACTIVITY_TIMER_C=0

File diff suppressed because it is too large Load Diff

@ -13,7 +13,7 @@
. /lib/lsb/init-functions
IRCDDB_EXE=/usr/local/bin/g2_ircddb
IRCDDB_CFG=/usr/local/etc/g2_ircddb.cfg
IRCDDB_CFG=/usr/local/etc/g2.cfg
IRCDDB_LOG=/var/log/g2_ircddb.log
start() {

@ -14,7 +14,7 @@
. /lib/lsb/init-functions
G2_LINK_EXE=/usr/local/bin/g2_link
G2_LINK_CFG=/usr/local/etc/g2_link.cfg
G2_LINK_CFG=/usr/local/etc/g2.cfg
G2_LINK_LOG=/var/log/g2_link.log
start() {

@ -1,4 +1,5 @@
// version strings must be 55 characters or less!
#define IRCDDB_VERSION "linux-g2_ircddb-4.1.0"
#define LINK_VERSION "4.00"
#define DVAP_VERSION "linux-dvap_rptr-3.0.0"
#define DVRPTR_VERSION "linux-dvrptr-2.0.0"

Loading…
Cancel
Save

Powered by TurnKey Linux.