Home Add-ons Connectivity Checker
Connectivity Checker PDF Print
Wednesday, 15 July 2009 09:56

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, multiple key-ups/unkeys, etc.

When this is happening, it's difficult to know if the connectivity problem is on your side, or theirs.  With this script on your IRLP node, you can call it with a DTMF sequence and it will check the status of your connection and report back.  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://irlp.kk7av.com/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>&
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://irlp.kk7av.com/programs/connectivity_check_wavs.tgz

Enjoy!

Last Updated on Friday, 20 August 2010 10:13
 
 

Advertisements