SVXLink and Raspbian Stretch
Installation from scratch
- 1. Raspberry Pi B+, 2 or 3:1
- 16 Gb MicroSD Card:
- USB Sound Card:
- Time Allotment: 60 Minutes
Tip: You do not need to be an expert in Linux but in following this guide you will understand everything you need to know for this project
- On the PC install a suitable image writer.
- Download from Raspberry.org the latest version of Raspbian Stretch – the Full version.
- Save the download and expand the image to a suitable location using 7-zip.
- Insert the SD Card and run the ImageWriter program, selection the .img from the previous step.
- Write the image and wait for the prompt upon completion.
- Before removing the card from the PC, create an empty file named “ssh” without a file type and save it to the boot sector on the MicroSD card, but don’t save it in the /boot folder. Tip: This action permits SSH access on boot up, and you won’t need a screen or keyboard.
- Remove the card from the PC
Tip: Before booting the raspberry with the new SDCard, ensure that it is connected on an adequate power supply and connected to the same network as the PC. You will need the application AngryIP scanner, and SSH app installed on the PC.
- Boot the Raspberry
- Run AngryIP scanner to determine the IP address of the Raspberry.
- Note down the IP address, and close AngryIP.
- Open SSH and type in the IP address for the Raspberry
- Open the terminal screen and type the user pi and password raspberry
- Now you are ready for the next steps in raspbian linux. Be careful of your syntax as all commands are lower case, but if an uppercase is shown it must be used.
Updating the Raspberry
Tip: This step is absolutely necessary. Type the commands at the prompt, and wait for each of the commands to complete. There is no need to expand the operating system in the MicroSD Card, as Stretch does this on first boot.
- sudo raspi-config to open the configuration menu then at option 5 enable VNC
- At option 7 Advanced options, select A5 for Mode 16
- Exit raspi-config, but do not reboot yet.
- At the prompt type sudo apt update
- At the prompt type sudo apt-get upgrade
- When the commands have all finished type sudo reboot. Exit the SSH app.
Entering the Raspberry by RealVNC
- On the PC, run VNCViewer and use the IP address to enter the Raspberry Desktop.
- Use the username and password from the previous steps. You will see the graphic appear of an open road. In all aspects the desktop is similar to a Windows desktop.
- At the top menu bar click on the terminal icon to open a terminal window in the desktop. You are now ready to continue the preparation of the Raspberry for Svxlink.
- The next steps may require a reboot, but always return to this position to continue the set up.
Installation of the USB Soundcard
- Install the USB Sound Card on the Raspberry then in the terminal screen type the following command at the prompt.
- sudo nano /etc/modprobe.d/raspi-blacklist.conf
- and type the following line.
- blacklist snd_bcm2835
- then save the file (cntrl-o) and exit (cntrl-x) then type
- sudo nano /lib/modprobe.d/aliases.conf
- locate the following line
- options snd-usb-audio index=-2 and insert a “#” before it, then save and exit.
Sound Card Configuration
- Re-open RealVNC viewer to the raspberry pi.
- Re-open a terminal screen and type the following command at the prompt.
- sudo alsamixer
- you should now see that your USB sound card is the default sound card. type cntrl-f5 to view all the sliders.
- set the first slider to around 60% the second to zero, the third to a maximum of 12 and in the fourth type M to mute the amplifier.
- Type escape then type
- sudo alsactl store This will save these settings even after re-booting.
- sudo adduser svxlink (This will prepare the card for the installation of SVXLink.)
- Make the password svxlink, as you won’t need to use this any further.
- Test the installation by sudo aplay -l.
Compiling SVXLink successfully
- To insure git is installed, type sudo apt install git, although I have found it installed as standard.
- At the prompt in the terminal type sudo git clone http://github.com/sm0svx/svxlink.git
- This will give you a download of the the latest master of svxlink.git including svxreflector, svxserver and svxremote into a folder called svxlink in the current user.
- When it is safely downloaded, go to the instructions page to add all the necessary additional software. The list is very important and is found on the project page of svxlink.org at install.adoc. Some of the software is standard in Raspbian Stretch so you may find the system reporting this fact. The list of -dev packages is more difficult, but I will show you the following pointers.
- To install the top list of software simply type sudo apt install gcc g++ make cmake groff gzip doxygen tar git
- For the second half of the list install each of the packs individually.
- sudo apt install libsigc++-2.0-dev
- sudo apt install libpopt-dev
- sudo apt install tcl8.6-dev
- sudo apt install libgcrypt20-dev
- sudo apt install libasound2-dev
- sudo apt install libgsm1-dev
- sudo apt install libspeex-dev
- sudo apt install librtlsdr-dev
- sudo apt install libqt4-dev
If the system responds with a y/n query always go for the y and you will have no issues. The final line sudo apt install alsa-utils may attract the response that the latest tools are already installed.
Now follows the commands below.
- cd svxlink/src
- sudo mkdir build
- cd build
Now we start compiling. Type the following line EXACTLY, including / \. as they are important for the syntax. This command must go one one line. The final two .. after a single space are important too. The command will take several minutes to execute.
- sudo cmake -DCMAKE_INSTALL_PREFIX=/usr -DSYSCONF_INSTALL_DIR=/etc \ -DLOCAL_STATE_DIR=/var ..
- sudo make – This command will take 30-45 minutes to run dependent on processor used.
- sudo make doc – This prepares all the documentation and manual files.
- sudo make install – This compiles all the software into the operating system.
- sudo ldconfig
Installation of the Sound Files
The software is now installed, but not yet ready for use. We need the Language files. My preferred method is as follows.
cd /usr/share/svxlink/sounds – We are now in the correct directory. There is a useful command wget that downloads a file from a web source.
sudo wget http://(websource) filename
If you want the french language…
sudo tar xzvf fr_FR.tar.gz – unwraps all the necessary files into their proper folders.
If you want the en_US files they are on svxlink.org.
If you want to make your own then download DSpeech from Dimio and play with that. However the finished .wav files need to be imported into Audacity, trimmed and exported as microsoft .wav files. This changes the twelfth bit from Hex 12 to Hex 10, to enable them to work in svxlink.
Setting up the GPIO ports
We need to setup the GPIO ports. The simplest way is to add the following lines to the file rc.local.
- sudo nano /etc/rc.local
#GPIO SCRIPT #
#TO BE INSERTED#
#ON START-UP #
# GPIO 17 as PTT to TX2
echo 17 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction
sudo chmod 777 /sys/class/gpio/gpio17/value
# GPIO 18 as Squelch to RX2
echo 18 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio18/direction
sudo chmod 777 /sys/class/gpio/gpio18/value
#GPIO 24 as PTT to TX1
echo 24 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio24/direction
sudo chmod 777 /sys/class/gpio/gpio24/value
# GPIO 23 as Squelch to RX1
echo 23 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio23/direction
sudo chmod 777 /sys/class/gpio/gpio23/value
#end of GPIO Section
#Remove # at start of next line for permanent reboot on power loss.
#sudo svxlink –daemon –logfile=/var/log/svxlink.log
These lines go immediately before the final
- Save and exit the file.
- The final steps are to set the parameters in /etc/svxlink/svxlink.conf and /etc/svxlink/svxlink.d/ModuleEchoLink.conf to enable your installation, paying attention to syntax and whether you are operating simplex or duplex.
- I have plenty more tips, but most of the answers are in the documentation on your MicroSD Card.
- Don’t forget to remove the # from the run line in /etc/rc.local to make your installation run at boot up.
- KISS principle – Do not overcomplicate your system. Ask yourself – Do I really need it? when considering changes. Why do you think that people want to see what’s occurring on the repeater when all they have is a radio and want to talk?