├── templates ├── apache.tbd.conf ├── ysfreflector.service ├── config.php └── ysf2dmr-start.sh ├── README.md └── Multi-Reflector-Installer.sh /templates/apache.tbd.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName apache.tbd 3 | DocumentRoot /var/www/ysf-xlxd 4 | 5 | -------------------------------------------------------------------------------- /templates/ysfreflector.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=YSFReflector 3 | 4 | [Service] 5 | Type=forking 6 | ExecStart=/ysfreflector/YSFReflector /ysfreflector/YSFReflector.ini 7 | 8 | [Install] 9 | WantedBy=multi-user.target 10 | Alias=ysfreflector.service 11 | -------------------------------------------------------------------------------- /templates/config.php: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /templates/ysf2dmr-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This is a modified version of the startup script for DIREWOLF. 3 | # Original credit goes to 'wb2osz'. 4 | # https://github.com/wb2osz/direwolf/blob/master/dw-start.sh 5 | # Be sure to add this to crontab via 'crontab -e' 6 | # * * * * * /ysf2dmr/ysf2dmr-start.sh >/dev/null 2>&1 7 | # Since YSF2DMR doesnt have an init or unit file yet, we need 8 | # to start it via screen and this will do it for you and keep it alive. 9 | 10 | RUNMODE=wb2osz 11 | YSF2DMR="/ysf2dmr/YSF2DMR" 12 | YSFCMD="$YSF2DMR YSF2DMR.ini" 13 | LOGFILE=/var/tmp/ysf2dmr-start.log 14 | 15 | #Status variables 16 | SUCCESS=0 17 | 18 | function wb2osz { 19 | SCREEN=`which screen` 20 | if [ $? -ne 0 ]; then 21 | echo -e "Error: screen is not installed but is required. Aborting" 22 | exit 1 23 | fi 24 | 25 | echo "YSF2DMR Start" 26 | echo "YSF2DMR Start" >> $LOGFILE 27 | 28 | 29 | cd /ysf2dmr; $SCREEN -d -m -S ysf2dmr $YSFCMD >> $LOGFILE 30 | SUCCESS=1 31 | 32 | $SCREEN -list ysf2dmr 33 | $SCREEN -list ysf2dmr >> $LOGFILE 34 | 35 | echo "-----------------------" 36 | echo "-----------------------" >> $LOGFILE 37 | } 38 | 39 | a=`ps ax | grep YSF2DMR | grep -vi -e bash -e screen -e grep | awk '{print $1}'` 40 | if [ -n "$a" ] 41 | then 42 | exit 43 | fi 44 | 45 | # Main execution of the script 46 | 47 | if [ $RUNMODE == "wb2osz" ];then 48 | wb2osz 49 | else 50 | #echo -e "ERROR: illegal run mode given. Giving up" 51 | exit 1 52 | fi 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This repo is outdated as of January 2020. 2 | #### At the start of 2020 a new version of XLX was released that allows for native C4FM connections. This means it's even simpler to run a multi-mode reflector. XLX now natively supports DMR, D-Star, and C4FM. C4FM and DMR do not require any transcoding hardware (AMBE) to work together. If you plan on using D-Star with any of the other modes, you will need hardware AMBE chips. 3 | 4 | ##### If your goal is to build a system that supports D-Star, YSF, and DMR, then please see: https://github.com/n5amd/xlxd-debian-installer 5 | 6 | NOTE FOR BELOW: If you plan on using the scripts below anyway it will still work. Please take note that by using the latest version of XLX and YSFReflector, you will need to alter the default network ports as both applications use UDP 42000. 7 | 8 | ### Multi-Reflector-Installer (Proof of Concept) 9 | The script is very much currently a proof of concept and gets you about 90% of the way to have everything fully installed and configured. The concept is, This will build you a 3 mode ham radio digital voice reflector server that will transcode Yaesu Fusion, DMR, and D-Star with the help of AMBED and AMBE vocoder chips. I did not build each application. This script simply goes through the install steps for each application for you and configures apache for the dashboards. Features and abilities coming... If you are looking to only build an XLX reflector, possibly with transcoding, then look at my other project: https://github.com/n5amd/xlxd-debian-installer, this multi-reflector might be overkill for your needs. 10 | 11 | #### This script will install the following: 12 | - `XLXD` *(D-Star/DMR Reflector that also communicates with AMBED)* 13 | - `YSFReflector` *(HomeBrew Fusion Reflector)* 14 | - `YSF2DMR` *(The bridge software between YSF and XLX)* 15 | - `YSF and XLX Dashboards` *(Web pages that shows real-time activity)* 16 | - Apache2 and configure the virtualhosts for both dashboards 17 | 18 | **But not** 19 | - `AMBED` (along with the required AMBE chips) 20 | - *AMBED can be installed locally or on a remote server, but is required for the transcoding part.* 21 | 22 | #### You will need the following information to get started: 23 | - Ready to go **and updated** fresh install of Debian 9.x 24 | - FQDN for ysf and xlx web dashboards 25 | - XLX number that isnt taken (or pick a random one for testing) 26 | 27 | 28 | #### The script does not yet edit all the config files in order to complete the installation: 29 | | App | Config file(s) | 30 | | ------ | ------ | 31 | | XLXD | /etc/init.d/xlxd, /var/www/xlxd/pgs/config.inc.php | 32 | | YSF | /ysfreflector/YSFReflector.ini | 33 | | YSF2DMR | /ysf2dmr/YSF2DMR.ini | 34 | 35 | ### Using the Multi-Reflector-Installer script: 36 | ```sh 37 | git clone https://github.com/n5amd/Multi-Reflector-Installer.git 38 | cd Multi-Reflector-Installer 39 | ./Multi-Reflector-Installer.sh 40 | ``` 41 | 42 | ### To manage each service after installation: 43 | **XLXD** 44 | ```sh 45 | systemctl start|stop|status|restart xlxd 46 | ``` 47 | - Installs to /xlxd 48 | - Logs are in /var/log/messages 49 | - Be sure to restart xlxd after each config change 50 | 51 | 52 | **YSFReflector** 53 | ```sh 54 | systemctl start|stop|status|restart ysfreflector 55 | ``` 56 | - Installs to /ysfreflector 57 | - Logs are in /var/log/YSFReflector 58 | 59 | **YSF2DMR** 60 | 61 | I havent been able to make a working Systemd unit file for this yet. So this app will simply have to run in screen. 62 | ```sh 63 | screen -S ysf2dmr 64 | cd /ysf2dmr 65 | ./YSF2DMR YSF2DMR.ini 66 | ``` 67 | 68 | To exit the screen session and leave ysf2dmr running: 69 | ```sh 70 | ctrl-a, then press d 71 | ``` 72 | To return to the screen session: 73 | ```sh 74 | screen -r ysf2dmr 75 | ``` 76 | 77 | ### Linking to AMBED for transcoding: 78 | 1. Install AMBED: https://github.com/n5amd/ambed-debian-installer 79 | 2. Edit the /etc/init.d file for xlxd. 80 | ```sh 81 | nano or vi /etc/init.d/xlxd 82 | ``` 83 | Edit the ARGUMENTS line: 84 | ```sh 85 | ARGUMENTS="XLX### " #Use 127.0.0.1 if ambed is on the same computer as XLXD 86 | EX: ARGUMENTS="XLX111 192.168.0.2 127.0.0.1" 87 | ``` 88 | Then update systemd to read the updated init file and restart xlxd: 89 | ```sh 90 | systemctl daemon-reload 91 | systemctl restart xlxd 92 | ``` 93 | -------------------- 94 | 95 | ### For more information, please visit: 96 | https://n5amd.com/digital-radio-how-tos/build-digital-voice-transcoding-server/ 97 | -------------------------------------------------------------------------------- /Multi-Reflector-Installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script will install, XLXD, YSFREFlector, and YSF2DMR 3 | # for the purpose of having a tri mode transcoding server. 4 | # This will also install the service's respective dashboards 5 | # and configure apache. 6 | # Because of the simplicity around installing AMBED, it will 7 | # not be installed via this script. I dont know where 8 | # you will install it and building logic around that will take 9 | # time. When Version 1 gets released, it will have that feature, 10 | # along with many more. 11 | # This script is just a proof of concept and will be itterated over time. 12 | # Stay tuned... 13 | 14 | #Lets begin------------------------------------------------------------------------------------------------- 15 | WHO=$(whoami) 16 | if [ "$WHO" != "root" ] 17 | then 18 | echo "" 19 | echo "You Must be root to run this script!!" 20 | exit 0 21 | fi 22 | if [ ! -e "/etc/debian_version" ] 23 | then 24 | echo "" 25 | echo "This script is only tested in Debian 9 and x64 cpu Arch. " 26 | exit 0 27 | fi 28 | DIRDIR=$(pwd) 29 | XLXDREPO=https://github.com/LX3JL/xlxd.git 30 | YSF2DMRREPO=https://github.com/juribeparada/MMDVM_CM.git 31 | YSFREPO=https://github.com/g4klx/YSFClients.git 32 | YSFDASHREPO=https://github.com/dg9vh/YSFReflector-Dashboard.git 33 | XLXDMRIDURL=http://xlxapi.rlx.lu/api/exportdmr.php 34 | LOCAL_IP=$(ip a | grep inet | grep "eth0\|en" | awk '{print $2}' | tr '/' ' ' | awk '{print $1}') 35 | XLXINTDIR=/root/reflector-install-files/xlxd 36 | YSFINTDIR=/root/reflector-install-files/ysfreflector 37 | YSF2INTDIR=/root/reflector-install-files/ysf2dmr 38 | YSFDASDIR=/root/reflector-install-files/ysfdash 39 | XLXWEBDIR=/var/www/xlxd 40 | YSFWEBDIR=/var/www/ysf 41 | DEP="git build-essential apache2 php libapache2-mod-php php7.0-mbstring screen wget" 42 | echo "------------------------------------------------------------------------------" 43 | echo "" 44 | echo "XLX uses 3 digits numbers for its reflectors. For example: 032, 723, 099" 45 | read -p "What 3 digit XRF number will you be using? " XRFDIGIT 46 | XRFNUM=XLX$XRFDIGIT 47 | echo "--------------------------------------" 48 | read -p "What will the name of your YSF reflector be? 16 Characters MAX, this includes spaces. " YSFNAME 49 | YSFNAMEC=$(expr length "$YSFNAME") 50 | until [ $YSFNAMEC -le 16 ] 51 | do 52 | read -p "What will the name of your YSF reflector be? 16 Characters MAX, this includes spaces. " YSFNAME 53 | YSFNAMEC=$(expr length "$YSFNAME") 54 | done 55 | echo "--------------------------------------" 56 | echo "" 57 | read -p "What is the description for the YSF Reflector? 14 Characters MAX, this includes spaces. " YSFDESC 58 | YSFDESCC=$(expr length "$YSFDESC") 59 | until [ $YSFDESCC -le 14 ] 60 | do 61 | read -p "What is the description for the YSF Reflector? 14 Characters MAX, this includes spaces. " YSFDESC 62 | YSFDESCC=$(expr length "$YSFDESC") 63 | done 64 | echo "--------------------------------------" 65 | read -p "What is the FQDN of the XLX Reflector dashboard? Example: xlx.domain.com " XLXDOMAIN 66 | echo "" 67 | read -p "What is the FQDN of the YSF Reflector dashboard? Example: ysf.domain.com " YSFDOMAIN 68 | echo "------------------------------------------------------------------------------" 69 | echo "" 70 | read -p "What E-Mail address can your users send questions to? " EMAIL 71 | echo "" 72 | echo "--------------------------------------" 73 | echo "" 74 | read -p "What is the admins callsign? " CALLSIGN 75 | #Gather dependicies 76 | echo "" 77 | echo "" 78 | echo "------------------------------------------------------------------------------" 79 | echo "Installing dependicies..........." 80 | echo "------------------------------------------------------------------------------" 81 | apt update 82 | apt -y install $DEP 83 | a2enmod php7.0 84 | echo "------------------------------------------------------------------------------" 85 | #Create the install directory and app directories 86 | mkdir -p $XLXINTDIR 87 | mkdir -p $YSFINTDIR 88 | mkdir -p $YSF2INTDIR 89 | mkdir -p $YSFDASDIR 90 | mkdir -p $XLXWEBDIR 91 | mkdir -p $YSFWEBDIR 92 | mkdir -p /ysfreflector 93 | mkdir -p /ysf2dmr 94 | 95 | #Install xlxd 96 | #If the file is here already, then we dont need to compile on top of it. Remove the git clone directory and start over. 97 | if [ -e $XLXINTDIR/src/xlxd ] 98 | then 99 | echo "" 100 | echo "It looks like you have already compiled XLX. If you want to install it again, delete the directory '/root/reflector-install-files/' and run this script again. " 101 | exit 0 102 | else 103 | echo "Downloading and compiling xlxd... " 104 | echo "------------------------------------------------------------------------------" 105 | cd $XLXINTDIR 106 | git clone $XLXDREPO 107 | cd $XLXINTDIR/xlxd/src 108 | make clean 109 | make 110 | make install 111 | fi 112 | #Now the file should be there, if it compiled correctly. 113 | if [ -e $XLXINTDIR/xlxd/src/xlxd ] 114 | then 115 | echo "--------------------------------------" 116 | echo "It looks like XLXD compiled successfully!! " 117 | echo "--------------------------------------" 118 | else 119 | echo "" 120 | echo "UH OH!! I dont see the xlxd application file after attempting to compile. The output above is the only indication as to why it might have failed. Removing install files and directories. " 121 | # Removing install files and Directories 122 | rm -rf /root/reflector-install-files/ 123 | exit 0 124 | fi 125 | echo "------------------------------------------------------------------------------" 126 | echo "Getting DMRID.dat file... " 127 | echo "------------------------------------------------------------------------------" 128 | wget -O /xlxd/dmrid.dat $XLXDMRIDURL 129 | cd $XLXINTDIR/ 130 | cp -R $XLXINTDIR/xlxd/dashboard/* $XLXWEBDIR/ 131 | cp $XLXINTDIR/xlxd/scripts/xlxd /etc/init.d/xlxd 132 | sed -i "s/XLX999 192.168.1.240 127.0.0.1/$XRFNUM $LOCAL_IP 127.0.0.1/g" /etc/init.d/xlxd 133 | update-rc.d xlxd defaults 134 | #Delaying startup on boot 135 | mv /etc/rc3.d/S01xlxd /etc/rc3.d/S10xlxd 136 | echo "Updating XLXD Config file... " 137 | XLXCONFIG=/var/www/xlxd/pgs/config.inc.php 138 | sed -i "s/your_email/$EMAIL/g" $XLXCONFIG 139 | sed -i "s/LX1IQ/$CALLSIGN/g" $XLXCONFIG 140 | sed -i "s/\/tmp\/callinghome.php/\/xlxd\/callinghome.php/g" $XLXCONFIG 141 | sed -i "s/http:\/\/your_dashboard/http:\/\/$XLXDOMAIN/g" $XLXCONFIG 142 | chown -R www-data:www-data /xlxd/ 143 | chown -R www-data:www-data /var/www/xlxd/ 144 | echo "--------------------------------------" 145 | echo "XLXD is finished installing." 146 | echo "--------------------------------------" 147 | if [ -e $YSFINTDIR/YSFClients/YSFReflector/YSFReflector ] 148 | then 149 | echo "" 150 | echo "It looks like you have already compiled YSFReflector. If you want to install it again, delete the directory '/root/YSFReflector-install-files' and run this script again. " 151 | exit 0 152 | else 153 | echo "------------------------------------------------------------------------------" 154 | echo "Downloading and compiling YSFReflector... " 155 | echo "------------------------------------------------------------------------------" 156 | cd $YSFINTDIR 157 | git clone https://github.com/g4klx/YSFClients.git 158 | cd $YSFINTDIR/YSFClients/YSFReflector 159 | make clean all 160 | fi 161 | if [ -e $YSFINTDIR/YSFClients/YSFReflector/YSFReflector ] 162 | then 163 | echo "--------------------------------------" 164 | echo "It looks like YSFReflector compiled successfully. " 165 | echo "--------------------------------------" 166 | else 167 | echo "" 168 | echo "UH OH!! I dont see the YSFReflector application file after attempting to compile. The output above is the only indication as to why it might have failed. Removing install files... " 169 | # Removing install files and Directories 170 | rm -rf /root/reflector-install-files 171 | exit 0 172 | fi 173 | #Copying over files. 174 | cp $YSFINTDIR/YSFClients/YSFReflector/YSFReflector /ysfreflector 175 | cp $YSFINTDIR/YSFClients/YSFReflector/YSFReflector.ini /ysfreflector 176 | #Updating the ini file 177 | sed -i "s/16[ ]*characters[ ]*max/$YSFNAME/g" /ysfreflector/YSFReflector.ini 178 | sed -i "s/14[ ]*characters[ ]*max/$YSFDESC/g" /ysfreflector/YSFReflector.ini 179 | sed -i "s/FilePath=./FilePath=\/var\/log\/YSFReflector\//g" /ysfreflector/YSFReflector.ini 180 | #Creating mmdvm user that is apparently required for this to run. 181 | groupadd mmdvm 182 | useradd mmdvm -g mmdvm -s /sbin/nologin 183 | mkdir -p /var/log/YSFReflector 184 | chown mmdvm: /var/log/YSFReflector 185 | cp $DIRDIR/templates/ysfreflector.service /etc/systemd/system 186 | systemctl enable ysfreflector 187 | systemctl daemon-reload 188 | echo "" 189 | echo "--------------------------------------" 190 | echo "YSFReflector is finished installing." 191 | echo "--------------------------------------" 192 | echo "" 193 | if [ -e $YSF2INTDIR/MMDVM_CM/YSF2DMR/YSF2DMR ] 194 | then 195 | echo "" 196 | echo "It looks like you have already compiled YSFReflector. If you want to install it again, delete the directory '/root/reflector-install-files' and run this script again. " 197 | #exit 0 198 | else 199 | echo "------------------------------------------------------------------------------" 200 | echo "Installing YSF2DMR... " 201 | echo "------------------------------------------------------------------------------" 202 | cd $YSF2INTDIR 203 | git clone $YSF2DMRREPO 204 | cd $YSF2INTDIR/MMDVM_CM/YSF2DMR/ 205 | make 206 | fi 207 | #Now the file should be there, if it compiled correctly. 208 | if [ -e $YSF2INTDIR/MMDVM_CM/YSF2DMR/YSF2DMR ] 209 | then 210 | echo "--------------------------------------" 211 | echo "It looks like YSF2DMR compiled successfully. " 212 | echo "--------------------------------------" 213 | else 214 | echo "" 215 | echo "UH OH!! I dont see the YSF2DMR application file after attempting to compile. The output above is the only indication as to why it might have failed. Removing install files and directories. " 216 | exit 0 217 | fi 218 | #Copying files over 219 | cd $YSF2INTDIR/MMDVM_CM/YSF2DMR/ 220 | cp YSF2DMR /ysf2dmr/ 221 | cp YSF2DMR.ini /ysf2dmr/ 222 | cp DMRIds.dat /ysf2dmr/ 223 | cp XLXHosts.txt /ysf2dmr/ 224 | echo "" 225 | echo "--------------------------------------" 226 | echo "YSF2DMR is finished installing." 227 | echo "--------------------------------------" 228 | echo "" 229 | echo "------------------------------------------------------------------------------" 230 | echo "Installing the YSF Dashboard and configuring apache... " 231 | echo "------------------------------------------------------------------------------" 232 | cd $YSFDASDIR 233 | git clone $YSFDASHREPO 234 | cp -R $YSFDASDIR/YSFReflector-Dashboard/* $YSFWEBDIR/ 235 | mkdir $YSFWEBDIR/config 236 | cp $DIRDIR/templates/config.php $YSFWEBDIR/config/ 237 | mv $YSFWEBDIR/setup.php $YSFDASDIR/original-setup.php 238 | #Copy apache vhost directives 239 | cp $DIRDIR/templates/apache.tbd.conf /etc/apache2/sites-available/$XLXDOMAIN.conf 240 | sed -i "s/apache.tbd/$XLXDOMAIN/g" /etc/apache2/sites-available/$XLXDOMAIN.conf 241 | sed -i "s/ysf-xlxd/xlxd/g" /etc/apache2/sites-available/$XLXDOMAIN.conf 242 | #Copy apache vhost files over for ysf 243 | cp $DIRDIR/templates/apache.tbd.conf /etc/apache2/sites-available/$YSFDOMAIN.conf 244 | sed -i "s/apache.tbd/$YSFDOMAIN/g" /etc/apache2/sites-available/$YSFDOMAIN.conf 245 | sed -i "s/ysf-xlxd/ysf/g" /etc/apache2/sites-available/$YSFDOMAIN.conf 246 | chown -R www-data:www-data /var/www/ysf 247 | echo "--------------------------------------" 248 | echo "Enabling $XLXDOMAIN and $YSFDOMAIN... " 249 | echo "--------------------------------------" 250 | #Enable the sites 251 | a2ensite $XLXDOMAIN 252 | a2ensite $YSFDOMAIN 253 | echo "--------------------------------------" 254 | echo "Starting xlxd and YSFReflector... " 255 | echo "--------------------------------------" 256 | service xlxd start 257 | service ysfreflector start 258 | echo "--------------------------------------" 259 | echo "Reloading apache2." 260 | echo "--------------------------------------" 261 | systemctl restart apache2 262 | echo "" 263 | echo "" 264 | echo "***********************************************************************************" 265 | echo "" 266 | echo " Your 3-in-1 Reflector is finished installing. " 267 | echo " At this time, you have a D-Star and YSF Server installed and running!! " 268 | echo " There is still more configuration to be done..." 269 | echo " Please visit https://github.com/n5amd/Multi-Reflector-Installer For more info.. " 270 | echo "" 271 | echo " Your 2 web dashboards can be found at: " 272 | echo " http://$XLXDOMAIN " 273 | echo " http://$YSFDOMAIN " 274 | echo "" 275 | echo "***********************************************************************************" 276 | echo "" 277 | --------------------------------------------------------------------------------