I recently switched DSL providers from Telocity to COFS.NET. The service so
far has been an order of magnitude better than Telocity's and the connection
has been mostly consistent.
With one exception.... Every few days the DSL modem would drop connectivity.
A reboot would always fix the problem, but this didn't help me if I was not
onsite or could not convince a family member to brave the server room and
reboot the modem. Though I could dial in to my PPP server, rebooting the
router/firewall would not help.
I posted a question on flux asking for
suggestions. The best solution turned out to be a ttyS0 controlled X10 module
that could bounce power to the modem. The Radio Shack parts are as follows:
- 61-2417 Home Control Center ~$5
- 61-2684 Appliciance Remote-Controlled Module ~$14
Grab the
heyu Software to control the
units from Linux. Because the site is sometimes down, I've archived a copy
here. To build, cd to the heyu.dir directory,
the run Configure and make.
A sample .x10config file follows below. Place it in the home directory of the
user ID that will be used to reboot the modem. This does not need to be the
root user if the un-privileged ID has read/write access to the serial port.
modem A 1
#
# set default housecode -- the one the switches will use
HOUSECODE A
#
# Set the port the program will use.
TTY /dev/ttyS0
# The NEWFORMAT directive allows version 1.28 and higher to display more
# informative messages.
NEWFORMAT
# The file listed with MACROXREF is where HEYU will store the addresses
# where macros are loaded in the CM11A. If you don't use this directive,
# The macros addresses will not be cross-referenced.
MACROXREF .x10macroxref
I added the following entry to root's crontab:
*/5 * * * * /root/bin/watch_cofs 2>/dev/null
The watch_cofs script is:
#!/bin/bash
STATUS=`ping -c 2 -q 216.4.122.128 2>/dev/null`
CODE=$?
NOW=`date`
if [ $CODE -gt 0 ]; then
echo $NOW DOWN >> ~/temp/status
/root/bin/heyu turn A1 off
sleep 15s
/root/bin/heyu turn A1 on
else
echo $NOW UP >> ~/temp/status
fi
Place the script and heyu binary in an accessible path. Note that the PATH
variables are not always defined when the CRON executes. For this reason, it's
safest to put the entire path to the heyu binary. The above script will log
the UP/DOWN times into a status file. Make sure to change the IP address to
an IP that *should* be available when your Internet connection is active. A
good choice is often the primary or secondary nameservers of your ISP.
If you are moderately proficient with scripting, you could also choose to do
several tests and only if all fail do you reboot. I'll leave this as an
exercise for the reader :D.
Connect the Home Control Center to the controlling computer via the serial
cable. Plug the modem into the Appliance Remote Control Module. These do not
need to be the same machines, but the control PC must be on continuously.
Someone else has also done this:
http://ralf.alfray.com/photos/Misc/DSL-X10/