Table of Contents

Status of Internet connexion

To verify that your repeater is still online on the internet, we will add a DTMF command that tells you by an announcement on request.

Create a copy of Logic.tcl file

Copy the file Logic.tcl in sub-directory local. This allows us to never change the original file Local.tcl (original file in /usr/share/svxlink/events.d/.)

cd /usr/share/svxlink/events.d/
sudo mkdir local
cp Logic.tcl ./local/Logic.tcl

Modification of the Logic.tcl file

In Logic.tcl file, searching the function that will handle our remote commands on receipt of DTMF codesdtmf_cmd_received, and copy the following lines (between if {$cmd == “25”} { # DTMF 25 et return 1 })

sudo nano /usr/share/svxlink/events.d/local/Logic.tcl
#SEND DTMF CODE 25#
 if {$cmd == "25"} {
  set result [catch {exec ping -c 1 google.com }];
  if {$result == 0} {
     puts "Internet online :Connected"
     playMsg "Default/internet_status" "Internet_Connection_Active";
     #speeling of the internet public IP address
     set runcmd [exec curl http://ip.42.pl/short 2>&1];  #Internet IP adress
     puts "Internet IP Adress : $runcmd"
     set splitip [split $runcmd .]
     lassign $splitip ip1 ip2 ip3 ip4
     spellWord $ip1;
     playMsg "Default" "decimal";
     spellWord $ip2;
     playMsg "Default" "decimal";
     spellWord $ip3;
     playMsg "Default" "decimal";
     spellWord $ip4;
} else {
     puts "Internet online :Disconnected"
     playMsg "Default/internet_status" "Internet_Connection_Inactive";
}
    return 1
  }
 
  return 0
}

In this TCL code , we also integrate from the line #speeling of the internet public IP address a few lines that will allow players to play one character at your public IP address . This reading uses the standard function spellWord .

Both read messages are two sound files wav to set up in a subdirectory , eg /usr/share/svxlink/sounds/fr_FR/internet_status/.

Files available on https://github.com/F8ASB