Page last updated: 07/08/2014 |
Changes to script rc.local
As superuser whilst logged in as
pi@raspberrypi
From command line in the following directory /etc then useing the following
command
sudo nano rc.local amend the existing script as
per the listing below...
Note in the listing below, the blue highlighted text indicates what is to
be added to the existing rc.local script...
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other value on
error.
# In order to enable or disable this script just change the execution bits.
# By default this script does nothing.
# Print the IP address
#*******************************************************************************
#* G4USP/SVXLINK on RPi - improve the RPi performance *
#*******************************************************************************
# run the RPi in performance mode
echo -n performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
#*******************************************************************************
#* G4USP/SVXLINK on RPi using GPIO for TX/RX control signalling *
#*******************************************************************************
#Enable the pin for PTT GPIO:
sudo echo 24 > /sys/class/gpio/export
#Set the direction to output for the pin:
sudo echo out > /sys/class/gpio/gpio24/direction
#Make sure that the svxlink user can write to the GPIO pin:
sudo chmod 0777 /sys/class/gpio/gpio24/value
#Enable the pin for COS GPIO
sudo echo 23 >/sys/class/gpio/export
#Set the direction to input for the pin:
sudo echo in >/sys/class/gpio/gpio23/direction
#sudo echo 0 >/sys/class/gpio/gpio23/active_low
#Make sure that the svxlink user can read from the GPIO pin:
sudo chmod 0777 /sys/class/gpio/gpio23/value
#And the following in /etc/svxlink/svxlink.conf needs to be changed:
#[Rx1]
#SQL_DET=GPIO
#GPIO_SQL_PIN=gpio23
#[Tx1]
#PTT_PORT=GPIO
#PTT_PIN=gpio24
#*******************************************************************************
#* G4USP/SVXLINK on RPi changing audio level settings *
#*******************************************************************************
#Set TX Gain
#amixer -q set PCM 0dB && echo "OK" || echo "Fail"
amixer -q set Speaker 0dB && echo "OK" || echo "Fail"
amixer -q set Speaker 10dB- && echo "OK" || echo "Fail"
#Set RX Gain
#amixer -q set Mic 6dB && echo "OK" || echo "Fail"
amixer -q set Mic 8dB && echo "OK" || echo "Fail"
#*******************************************************************************
#* G4USP/SVXLINK on RPi changing file permissions *
#*******************************************************************************
sudo chmod 0777 /var/spool/svxlink/voice_mail
#*******************************************************************************
#* Wheezy default settings *
#*******************************************************************************
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
#*******************************************************************************
#* Start svxlink *
#*******************************************************************************
svxlink
exit 0