You are visiting:Home arrow Connectivity Checker Saturday, 05 July 2008
Connectivity Checker PDF Print
Written by Administrator   
Monday, 16 October 2006
This handy little script can be used to verify your connection to the Internet.  Sometimes you experience packet loss during a conversation on your local IRLP node.  It shows up as broken audio and even multiple key-ups/unkeys, etc.

When this is happening, it's not easy to know if the connectivity problem is on your side, or theirs.  However, with this script on your IRLP node, you can call it with a DTMF sequence and it will check the status of your connection.  Because it runs the ping utility with the ,"-f" switch (flood mode), it requires elevated privileges to run.  Since we will be executing this script as user, "repeater", something has to be done to allow it un-hindered access to the ping utility.  This obstacle is easily overcome by adding the following to your /etc/sudoers file:
repeater ALL= NOPASSWD: /bin/ping
Be sure to use the visudo command to open your sudoers file for editing!

This script is designed to send 100 packets of very similar size to the normal UDP audio-data type traffic, to your Internet router's default gateway.  It does this in rapid succession, firing the next packet upon receipt acknowledgment of the last packet, thus completing the test within just a few seconds.  Then, it detects how many packets (if any) were lost during the transfer.  Based on that information, the script returns a, "0" with an exit status of 0, if the packet loss was under a reasonable threshold, else it returns a, "1" with an exit status of 1.

The script can be downloaded here:

http://rob.pectol.com/irlp/scripts/connectivity_check 

 An example code snippet for calling this via a DTMF sequence follows.  It would go somewhere in your /home/irlp/custom/custom_decode file:

 

 # check connection to the 'Net
if [ "$1" = "A1" ]; then
        "$BIN"/key
        sleep .5
        play "$AUDIO"/custom/connectivity_check.wav >&/dev/null 2>&1
        sleep 1
        if $CUSTOM/connectivity_check 2>/dev/null; then
                play "$AUDIO"/custom/connectivity_good.wav >&/dev/null 2>&1
        else
                play "$AUDIO"/custom/connectivity_bad.wav >&/dev/null 2>&1
        fi
        sleep .5
        "$BIN"/unkey
        exit 1
fi

 

 In this example, sending the DTMF sequence, "A1" would call the script.  It assumes that the location of the connectivity_check script is in the /home/irlp/custom directory.  It also assumes you have some custom wav files (for audible feedback of script execution) located in the /home/irlp/audio/custom directory.  Sample wav files can be found here or you can make your own:

http://rob.pectol.com/irlp/scripts/connectivity_check_wavs.tgz

 Enjoy!

Last Updated ( Saturday, 09 February 2008 )
 
< Prev   Next >
  • JoomlaWorks AJAX Header Rotator
  • JoomlaWorks AJAX Header Rotator
Search My Site
Misc. Scripts
Connectivity Checker
PTT Timeout Override
IRLP Watchdog Timer
Uptime Announcer
Time Announcer
Send Serial Data
Node Rebooter
Connection Status
Audio Data Sensor
Star69