Custom SVXLink Configuration

Warning: This is an advanced topic. You will need to have a decent understanding of the Linux command line and file system, how SVXLink it’s self works and is configured, as well as understanding of the PHP programming language. If you don’t feel comfortable with these areas, then do not proceed with these instructions.

So you want to make ORP do more that what it can out of the box and you are OK with doing some coding? Perhaps you have specialized needs that are not built into ORP yet or are more niche to your setup. This article will help point you in the right direction. If won’t go into what those SVXLink configurations are, but rather it will point you to where to make the modifications.

Some Background First

Firstly, it is important to understand how OpenRepeater is structured and how it works. If you don’t already know the OpenRepeater Project combines a number of elements into a prepackaged setup to run on single board computers like the Raspberry Pi. These elements include the base OS (Debian), the SVXLink program which is our core logic, a web server and other components that make the ORP Web Front end function. This web front end its part of the ORP project that helps with configuring some of the most common setting for the basic operation of a repeater. When you log into the web front end and make changes they will immediately get saved into a database. At this point no changes are made to the SVXLink configuration. You will notice that a prompt appears at the top of the page prompting you to “rebuild & restart”. When changes are made, a flag is set to make this prompt appear. Once you are done making changes, you can click on the “rebuild & restart” button. What this does is runs a PHP build script that reads all the settings from the database and performs some conditional logic and writes out multiple configuration files including the main SVXLink configuration file, some other configuration and override files (like custom TCL logics) to modify the behavior of features such as identification & courtesy tones, GPIO setting to initialize the GPIO pins with the OS, and then it will restart SVXLink to read in the new configurations. The main SVXLink configuration file is located here: This is an example of what that code might look like. If you want to see what your file looks like after you makes changes you can CAT the contents of the file with the following command: This uses some of the most common settings and sections required to run a repeater. This is the main file that SVXLink will read in upon startup or restarting. To see what additional features that the SVXLink core program supports, view the SVXLink manpages.

Where to Make the Modifications

As you can probably figure out by reading above, you can certain make changes to the SVXLink.conf file and other config files that are written to by ORP, but if you make changes within the web interface and “rebuild & restart” then those changes are going to be over written. The way around this is to modify the svxlink_update.php file or it’s included files. The SVXLink_update.php file is located here:

At The Top of the File...

You will see where the files are called in that read from the database.

At The Bottom of the File...

Where it writes out the configuration files. ...and clears the flag and restarts SVXLink...

All the Magic Happens in the Middle...

Here is an example of one section of code. The example sets some EchoLink settings. It goes without saying...make a backup copy of this file before you start making changes to it. As you can see, SVXLink expects things grouped into sections. Some of these settings are hard coded (which you could change here if you'd like) and other have the variables inserted. In some cases some additional PHP logic is added, or things are grouped into functions, or external files are called to help keep things more organized. Knowing this, it should give you a good understanding of how to reverse engineer this for your own needs. It's probably best to make small changes at a time. When done, save the file and go to the web gui, initiate a change to invoke the "Rebuild & Restart" bar. When you run that this file will be called. If all goes well, you changes will be applied to the SVXLink configuration file and be loaded. If you see a white screen or an error message, then that is usually a good indicator that you have improperly formatted code. Happy Modding!
in Advanced / Command Line