From 23b76d3e95604233e73e5733f423b30babf20831 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Thu, 23 May 2024 06:39:13 -0700 Subject: [PATCH] readme --- README.md | 39 ++++++++++++++++++++------------------- reflector/TCSocket.cpp | 6 ++++-- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 91c2661..2f6b7e4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The URF Multi-protocol Gateway Reflector Server, ***urfd***, is part of the soft ## Introduction -This will build a new kind of digital voice reflector. A *urfd* supports DStar protocols (DPlus, DCS, DExtra and G3) DMR protocols (MMDVMHost, DMR+ and NXDN), M17, YSF, P25 (using IMBE) and USRP (Allstar). A key part of this is the hybrid transcoder, [tcd](https://github.com/n7tae/tcd), which is in a separate repository. You can't interlink urfd with xlxd. This reflector can be built without a transcoder, but clients will only hear other clients using the same codec. Please note that currently, urfd only supports the tcd transcoder when run locally. As a local device, urfd and tcd uses UNIX DGRAM sockets for inter-process communications. These kernel-base sockets are significantly faster than conventional UDP/IP sockets. It should be noted that tcd supports DVSI-3003 nad DVSI-3000 devices, which it uses for AMBE vocoding. +This will build a new kind of digital voice reflector. A *urfd* supports DStar protocols (DPlus, DCS, DExtra and G3) DMR protocols (MMDVMHost, DMR+ and NXDN), M17, YSF, P25 (using IMBE) and USRP (Allstar). A key part of this is the hybrid transcoder, [tcd](https://github.com/n7tae/tcd), which is in a separate repository. You can't interlink urfd with xlxd. This reflector can be built without a transcoder, but clients will only hear other clients using the same codec. This version of urfd/tcd now supports ***remote transcoding***. Communication between urfd and tcd is now handled *via* TCP, with *urfd* acting as the server and *tcd* is the client. In this way, it shouldn't be necessary to open any ports on the tcd system. A two-way TCP channel will be opened for each transcoded module. It should be noted that tcd supports DVSI-3003 nad DVSI-3000 devices, which it uses for AMBE vocoding. This build support *dual-stack* operation, so the server on which it's running, must have both an IPv4 and IPv6 routable address if you are going to configure a dual-stack reflector. @@ -33,7 +33,7 @@ The packages which are described in this document are designed to install server Below are instructions to build a URF reflector. If you are planning on an URF reflector without a transcoder, you can help your users by naming modules with names that suggest which protocol is welcome. You name modules in the config.inc.php file mentioned below. -The transcoder is in a separate repository, but you can install and monitor the transcoder and reflector from a script, *radmin* in this repository. You *should* look over the README.md file in the tcd repository to understand the transcoder. +For local transcoding reflectors only: The transcoder is in a separate repository, but you can install and monitor the transcoder and reflector from a script, *radmin* in this repository. You *should* look over the README.md file in the tcd repository to understand the transcoder. ### After a clean installation of Debian make sure to run update and upgrade @@ -48,6 +48,14 @@ sudo apt upgrade sudo apt install git apache2 php build-essential nlohmann-json3-dev libcurl4-gnutls-dev ``` +On the latest systems. *e.g.*, Ubuntu 24, Debian 12, you can install the OpenDHT support without having to build it. + +```bash +sudo apt install libopendht-dev +``` + +If the above command reports that this package is using something earlier that C++17, don't install it. You'll need to build it instead (described in the next section). + ### Ham-DHT support (optional, but highly recommended) **Ham-DHT**, a DHT network for hams, is implemented using a distributed hash table provided by OpenDHT. @@ -69,8 +77,6 @@ make sudo make install ``` -Please note that there is no easy way to uninstall OpenDHT once it's been installed. - ### Download and build the repository and ```bash @@ -112,7 +118,7 @@ After possibly editing `urfd.mk`, you can build your reflector: `make` . Besides Use your favorite text editor to set your run-time configuration in your copy of `urfd.ini`. -There are only a few things that need to be specified. Most important are, the reflector callsign and the IP addresses for the IPv4 and IPv6 listen ports and a transcoder port, if there is a transcoder. Dual-stack operation is enabled by specifying both an IPv4 and IPv6 address. IPv4-only single stack can be specified by leaving the IPv6 address undefined. +There are only a few things that need to be specified. Most important are, the reflector callsign and the IP addresses for the IPv4 and IPv6 listen ports and a transcoder port, if there is a transcoder. If you don't have a transcoder, be sure to set the transcoding port to zero. If you have a local transcoder, set the binding address to `127.0.0.1` or `::1`. If your transcoder is remote, you will usually set the binding address to `0.0.0.0` or `::`. Dual-stack operation is enabled by specifying both an IPv4 and IPv6 address. IPv4-only single stack can be specified by leaving the IPv6 address undefined. You can configure any modules, from **A** to **Z**. They don't have to be contiguous. If your reflector is configured with a transcoder, you can specify which configured modules will be transcoded. Up to three modules can be transcoded if you have the necessary hardware. @@ -150,7 +156,7 @@ The *dbutil* app can be used for several tasks relating to the three databases t - INIFILE is the path to the infile that defines the location of the http and file sources for these three databases. One at a time, *dbutil* can work with any of the three DATABASEs. It can read either the http or the file SOURCE. It can either show you the data entries that are syntactically correct or incorrect (ACTION). -### Installing your system +### Installing your system with a local transcoder After you have written your configuration files, you can install your system: @@ -160,14 +166,13 @@ After you have written your configuration files, you can install your system: You can use this interactive shell script to install and uninstall your system. This can also perform other tasks like restarting the reflector or transcoder process, or be used to view the reflector or transcoder log in real time. -### Stopping and starting the services manually +### Installing your system with a remote transcoder -```bash -sudo systemctl stop urfd # (or xrfd) -sudo systemctl stop tcd -``` - -You can start each component by replacing `stop` with `start`, or you can restart each by using `restart`. +In the `reflector` subdirectory, use: +- `make` to compile *urfd*. +- `sudo install` to install and start *urfd*. +- `systemctl` and `journalctl` can be used to manage *urfd* and view the log. +- `sudo make uninstall` will uninstall *urfd*. ### Copy dashboard to /var/www @@ -192,6 +197,7 @@ TCP port 80 (http) optional TCP port 443 (https) UDP port 8880 (DMR+ DMO mode) UDP port 10002 (BM connection) UDP port 10017 (URF interlinking) +TCP port 10100 (Transcoder listening port) UDP port 12345 - 12346 (G3 Icom Terminal presence and request port) UDP port 17000 (M17 protocol) UPD port 20001 (DPlus protocol) @@ -210,13 +216,8 @@ UDP port 62030 (MMDVM protocol) Pay attention, the URF Server acts as an YSF Master, which provides 26 wires-x rooms. It has nothing to do with the regular YSFReflector network, hence you don’t need to register your URF at ysfreflector.de! -## To-dos - -I will eventually support a remote transcoder option, so that you can, for example, run *urfd* in a data center, and then run the transcoder somewhere you have physical access so you can plug in your AMBE vocoders. I don't recommend this as it will add unnecessary and variable latency to your reflector. - -A new dashboard is on the to-do list! - ## Copyright - Copyright © 2016 Jean-Luc Deltombe LX3JL and Luc Engelmann LX1IQ - Copyright © 2022 Doug McLain AD8DP and Thomas A. Early N7TAE +- Copyright © 2024 Thomas A. Early N7TAE diff --git a/reflector/TCSocket.cpp b/reflector/TCSocket.cpp index 5b8a357..524430b 100644 --- a/reflector/TCSocket.cpp +++ b/reflector/TCSocket.cpp @@ -388,7 +388,8 @@ bool CTCClient::Connect(char module) int yes = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int))) { - perror("TC client setsockopt"); + std::cerr << "Moudule " << module << " error:"; + perror("setsockopt"); close(fd); return true; } @@ -403,7 +404,7 @@ bool CTCClient::Connect(char module) } else { - std::cerr << "For module '" << module << "' : "; + std::cerr << "Module " << module << " error: "; perror("connect"); close(fd); return true; @@ -439,6 +440,7 @@ bool CTCClient::ReConnect() { if (-1 == GetFD(m)) { + std::cout << "Reconnecting module " << m << "..." << std::endl; if (Connect(m)) { rv = true;