Sunday, 8 June 2014

Echolink & Svxlink

Following my setting up of the APRS Gateway MB7UZE on 144.800MHz I considered what to do about the Echolink node I was experimenting with last year, running SVXLINK under the callsign MB7IZE. I hadn't used the Voice Gateway for many months, but setting up the APRS gateway made me wonder about resurrecting the Echolink node at the same time.

MB7IZE was licensed for 144.9625MHz and obviously couldn't be used at the same time as a 2m APRS gateway/node. My previous trials of SVXLINK and Echolink proved that due to my location the only station likely to use my Voice Gateway was me.... so perhaps a 70cm port would be acceptable. I set up a new installation of SVXLINK (a self-compiled installation of the current version 13.12) on a Linux PC (eventually I'll move it over to a Raspberry Pi) and connected the PC to an FT817 on 430.050MHz, terminated in a 50 ohm dummy load. This allows me to test the setup, and it seems to work well.

I have applied for an NoV - initially asking for a change of frequency for MB7IZE, to move it to 70cm. This isn't allowed - for some arcane reason unattended simplex voice gateway operation isn't allowed on 70cm in the UK, although it's okay on 10m, 6m, 4m & 2m and unattended duplex voice repeaters are allowed. I've decided to leave MB7IZE alone, with a 2m port, which will be used only when the APRS station is turned off, and to apply for an "attended" NoV under my own callsign GM4SLV on 70cm. This is still in the "vetting" stage with the RSGB.

I now have a VHF/UHF duplexer (a Diamond MX-72A) which will allow me to share the dual-band colinear between the 2m APRS transceiver and the 70cm SVXLINK transceiver and I'm planning to replace the little FT817 with a single-band FT-1907. In the meantime, while I wait for the NoV, I'm running the 70cm SVXLINK node into dummy load. I can still use it from anywhere within the house and garden. Makes you wonder what the point of an "attended" Gateway is.... rather stifles the spirit of experimentation, I feel.

My Echolink node is GM4SLV-L / node number 886089 and is only online when I'm at home, of course. SVXLINK is able to run external scripts on receipt of DTMF tone sequences, so it's now set up to so that I can connect or disconnect from Echolink by sending specific DTMF sequences, so I can enable Echolink when I'm "at home" and disable it before I leave, without needing to sit at a PC screen, it can be done over the air.

I installed SVXLINK following the instructions at the Sourceforge page:

http://sourceforge.net/apps/trac/svxlink/wiki/InstallationInstructions

I then made two config files - one that includes the Echolink Module and one that doesn't.

A bash script "svx_el.sh" starts the program (as a daemon) using the config file that includes the Echolink Module. I've found that svxlink doesn't always exit cleanly, so I "sudo killall svxlink" three times to ensure the current running version is killed before starting the new version.

#!/bin/bash

CFG=/home/gm4slv/svxlink_el.conf
LOG=/home/gm4slv/svxlink.log

sudo killall svxlink
sudo killall svxlink
sudo killall svxlink
sudo svxlink --daemon --logfile=$LOG --config=$CFG
exit 0


Another bash script "svx_noel.sh" kills any existing svxlink and restarts the daemon using a config file that doesn't include the Echolink module. This allows me to control whether I'm logged into Echolink or not, while keeping the basic svxlink functions alive.

#!/bin/bash

CFG=/home/gm4slv/svxlink_noel.conf
LOG=/home/gm4slv/svxlink.log

sudo killall svxlink
sudo killall svxlink
sudo killall svxlink
sudo svxlink --daemon --logfile=$LOG --config=$CFG
exit 0

Adding a "local" event to svxlink's events directory means it's possible to trigger either of these scripts over the air, using DTMF tones.

###############################################################################
#
# Generic Logic event handlers (local extension)
#
###############################################################################

#
# This is the namespace in which all functions and variables below will exist.
#
namespace eval Logic {

#
# Executed when a DTMF command has been received
#   cmd - The command
#
# Return 1 to hide the command from further processing is SvxLink or
# return 0 to make SvxLink continue processing as normal.
#
proc dtmf_cmd_received {cmd} {
  global active_module

  if {$active_module != "" && [string index $cmd 0] != "*"} {
    return 0
  }
  if {[string index $cmd 0] == "*"} {
    set cmd [string range $cmd 1 end]
  }

  if {$cmd == "99"} {
    puts "Executing external command"
    exec /home/gm4slv/svx_el.sh &
    return 1
  }
  if {$cmd == "98"} {
    puts "Executing external command"
    exec /home/gm4slv/svx_noel.sh &
    return 1
  }
  if {$cmd == "5417"} {
    puts "Executing external command"
    CW::play "QRT"
    exec /home/gm4slv/qrt.sh &
    return 1
  }

  return 0
}

# end of namespace
}

#
# This file has not been truncated
#

This file is saved as  /usr/share/svxlink/events.d/local/Logic.tcl

In this example sending the DTMF tones "*99#" will trigger the "Connect to Echolink" script and sending "*98#" will trigger the dis-connect from Echolink script. Sending "*5417#" will play "QRT" in morse code over the air, and then trigger the script "qrt.sh" which simply kills svxlink. A Remote Shutdown....

#!/bin/bash

sleep 10
sudo killall svxlink
sudo killall svxlink
sudo killall svxlink

SVXLINK runs as a "daemon" so to keep an eye on it, I use a log-file, which I can monitor using "tail -f":

Here's what is shown in the log as I send the "*99#" command to restart SVXLINK, and connect to Echolink:


Sun Jun  8 11:20:06 2014: Rx1: The squelch is OPEN (1.66469)
Sun Jun  8 11:20:06 2014: SimplexLogic: digit=*
Sun Jun  8 11:20:09 2014: Rx1: The squelch is CLOSED (5.2813)
Sun Jun  8 11:20:09 2014: Tx1: Turning the transmitter ON
Sun Jun  8 11:20:25 2014: Tx1: Turning the transmitter OFF
Sun Jun  8 11:21:17 2014: SimplexLogic: digit=*
Sun Jun  8 11:21:17 2014: Rx1: The squelch is OPEN (2.07459)
Sun Jun  8 11:21:17 2014: SimplexLogic: digit=9
Sun Jun  8 11:21:18 2014: SimplexLogic: digit=9
Sun Jun  8 11:21:20 2014: SimplexLogic: digit=#
Sun Jun  8 11:21:22 2014: Rx1: The squelch is CLOSED (5.26572)
Sun Jun  8 11:21:22 2014: Executing external command
Sun Jun  8 11:21:22 2014:
Sun Jun  8 11:21:22 2014: SIGTERM received. Shutting down application...
Sun Jun  8 11:21:22 2014: SvxLink v1.3.0 (Jun  3 2014) Copyright (C) 2003-2013 Tobias Blomberg / SM0SVX
Sun Jun  8 11:21:22 2014:
Sun Jun  8 11:21:22 2014: SvxLink comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
Sun Jun  8 11:21:22 2014: welcome to redistribute it in accordance with the terms and conditions in the
Sun Jun  8 11:21:22 2014: GNU GPL (General Public License) version 2 or later.
Sun Jun  8 11:21:22 2014:
Sun Jun  8 11:21:22 2014: Using configuration file: /home/gm4slv/svxlink_el.conf
Sun Jun  8 11:21:22 2014: --- Using sample rate 48000Hz
Sun Jun  8 11:21:22 2014:
Sun Jun  8 11:21:22 2014: Starting logic: SimplexLogic
Sun Jun  8 11:21:22 2014: Loading RX: Rx1
Sun Jun  8 11:21:22 2014: Loading TX: Tx1
Sun Jun  8 11:21:22 2014: Loading module "ModuleHelp" into logic "SimplexLogic"
Sun Jun  8 11:21:22 2014:       Module Help v1.0.0 starting...
Sun Jun  8 11:21:22 2014: Loading module "ModuleParrot" into logic "SimplexLogic"
Sun Jun  8 11:21:22 2014:       Module Parrot v1.1.0 starting...
Sun Jun  8 11:21:22 2014: Loading module "ModuleEchoLink" into logic "SimplexLogic"
Sun Jun  8 11:21:22 2014:       Module EchoLink v1.2.0 starting...
Sun Jun  8 11:21:22 2014: SimplexLogic: Event handler script successfully loaded.
Sun Jun  8 11:21:23 2014: EchoLink directory status changed to ON
Sun Jun  8 11:21:24 2014: --- EchoLink directory server message: ---
Sun Jun  8 11:21:24 2014: EchoLink Server v2.5.9997
Sun Jun  8 11:21:24 2014:
Sun Jun  8 11:21:24 2014: ECHOEC2-3: Herndon, VA USA
Sun Jun  8 11:21:24 2014:

1 comment:

  1. Nice explanation. Its made my setting up a lot easier. can you let me in on what he CFG is on your script. Linux is not my strong point

    thanks

    Alex, g7kse

    ReplyDelete