Automatic Cable Modem Power Cycling


If you’ve got a cable modem, you know the drill when it goes offline. Unplug it, wait 30 seconds, plug it back in, reset your dhcp request. I’m pretty sure that [brian] mentioned this in a comment a while back, but now he’s written it up. He’s using a cron job on his linux box to check the internet connection, and if the test fails, power cycle the hardware with some X10 hardware and a little scripting. (Just don’t tell your friends or they’ll be outside trying to guess the code.)

21 thoughts on “Automatic Cable Modem Power Cycling

  1. I actually did something similar some time ago with my ancient 3Com homeconnect DSL modem. The device has a serial port that was password protected; a simple hardware hack to get the password and a serial cable connected to the linux box serves the same purpose. With the added bonus that I set up a simple web page to check the modem’s status, current link rate and the option to manually resync the link or reboot the modem.

    Luckily when it dies, the link goes down but the software is still running so the serial interface is sufficient.

    I wrote up the hardware bit ages ago if anyone’s got one of these from their provider and wants to get the password:

    http://404.gotroot.ca/index.php?/archives/10-3Com-HomeConnect-ADSL-Password-Recovery.html

  2. A friend of mine used this trick to bruteforce an access code to a device that would stop responding after a few failed attempts. He wore out a number of X10 modules, since they’re apparently only good for a few hundred thousand cycles each and it took many, many attempts to guess the code.

  3. Comcast seems to have a LOT of problems with bad cable modems. I’ve had the service about a year and I’ve already had my modem replaced twice by them. Have a few friends who have had to have theirs replaced too. It takes some hassle to get them to give ya a knew one, but usually you can google it and find your modem has a history of problems. I have a feeling they just take the ones that don’t work quite right and give them to someone else, since a lot of them only break in high traffic, which a lot of people don’t have too often.

  4. I had a problem with an old 802.11b access point that locked up constantly, so I rigged up a dot matrix printer attached to a linux box to print a blank line whenever the connection between the two APs failed, then spliced the power line across the print head and the case of the printer.

    It was sloppy, but worked great.

    Wish I had had some of those x10 devices back then, but it probably wouldn’t have looked as cool.

  5. Don’t use the LM14A, it’s a lamp module and it uses a SCR to control the power going to the appliance. Appliances with power supplies don’t like getting this modified power (the SCR cuts off part of the AC signal). This can cause the premature death of your appliance. It’s OK for lamps (what it’s intended for). Second thing is that the applaince module, such as an AM14A, uses leakage current to monitor for manual on/off of the appliance. What this means to you is that the modem won’t really turn off as there’s always some current flowing and it just enough to keep the modem from a proper reboot. To fix this visit:

    http://www.geocities.com/idobartana/Modifying_Appliance_module.htm#Modifying%20appliance%20modules%20for%20local%20control

    You just need to clip the appropriate diode and you’ll fix the problem.

    And yes I know what I’m talking about. I wrote the book: “Linux Smart Homes For Dummies” and I have a chapter on using X10 to control a printer in a similar manor. :-)

  6. I have had for few years same kind of application. Cron checks few netsites to get information about the network status. If all thoe netsites are down, it first tries to get new IP from the DHCP. If this does not help, it powers of the ADSL-modem, waits for 30 secs and tries then again to get the IP and connection.

    If this fails, it waits 5 minutes and tries again.

    Paraller port lights up led-light to control the ADSL’s power, there is light-controlled power switch for booting ADSL-modem when the led lights up. So the computer’s paraller port is totally isolated from the electrical network.

  7. i did something like this but it went to the modems site and restarted it from the modem gui from the 192.168.100.1 and it would reset the modem then my router automatically would renew the dhcp lease once it looses the internet connection

  8. I’m not usually one to put down a hack, and this one is certainly cool, but when I started having cable modem problems I returned the rental unit, bought my own, opened it up and put bigger heat syncs on everything that got hot. Now my modem doesn’t need to be reset, it just runs all the time instead. IMO the most elegant solutions are the best. though, I suppose this hack might be worthwhile if you’re forced to rent the equipment instead of buying your own.

  9. @neil, either you do not know what you are talking about or you are lying to us. smps supplies (as are included with most electronic equipment these days) could care less what the voltage looks like coming in, so long as the p-p voltage is between about 150-250v (varies from supply to supply), and that there is a pulse at least 50 times a second (otherwise the internal filter caps are too small). Likewise, a lamp module would work fine–just don’t expect the supply to work correctly if you set it for 10% brightness.

    Furthermore, plugging an x-10 module into the batter lines of an UPS will work most of the time, as the the majority of all ups just have a relay that connects your computer to the wall when you are not on battery. When you switch to battery power obviously the modules not on the battery powered output of the ups won’t respond (since they don’t have power), but everything on the battery line of the ups will work fine. There will be a little more noise from the inverter circuitry, but since the modules are right next to each other they still work fine. There is no chance of damaging the x10 module.

    In any case, I prefer the insteon implementation of the x10 standard (I have found it to be much more reliable, and often times much faster), but then again the ‘original’ x10 stuff is usually much cheaper.

    And now that your computer is on the x10 network it is time to start having it control everything else in your house!

  10. In response to ‘…’ (Krazerlasers) – I do know what I’m talking about (I’ve been using X10 since ~1982) and I’m not lying. You are correct that a good smps (_not_ included with most cheap consumer grade equipment) should work with the LM14A (at 100% power). The problem is that majority of consumer power supplies are either linear or cheap smps. These expect a relatively clean AC signal, a tighter voltage range and/or frequency range. I think that the consumer smps have improved but the majority of the equipment in the field is still linear.

    The other problem is that lamp and appliance modules support a thing called local control (current sense). The problem that appears is that either the device doesn’t fully shut off (very bad if your rebooting a router and it doesn’t reset) or you shut it off and a couple of seconds later it turns it self back on. I’ve seen this problem with my old Netgear router (linear) and 3Com Audrey (switching, rated 50/60 Hz 100-120VAC). Neither would properly reset because the voltage outputs never dropped low enough for a proper reset.

    On the subject of the UPS (I didn’t mention this), if a UPS were simply a relay controlled power source it would work fine but it’s not. Most UPS have some form of filtering and the X10 signal gets eaten (a black hole). When on battery backup X10 usually fails because it’s not a true sine wave. I’ve been told that high end UPSs reproduce a much more faithful sine wave but the normal UPSs fail. Whether it’s because it sees the pseudo-sine wave as multiple zero crossings, the pseudo-sine wave makes a bad carrier or something else I don’t know. The filtering is usually enough to keep X10 from not working so it’s avoided. My X10 is on the utility side of the UPS and it the UPS has a ‘filter’ to make the UPS’s impedance look close to infinite to the X10 signal (no black hole).

    All of these subject have been covered on the newsgroup: comp.home.automation

    BTW, I prefer the Insteon technology also. Too bad the Insteon products have of problems also (I won’t go into that right now). I’m also looking into UPB.

  11. In pure “hack” terms I guess this is ok, but it’s fixing the symptoms of the problem, not the root cause. Most DSL/ADSL Modem/Routers suffer from these problems due to a combination of overheating (poor case design, not enough ventilation) and crap firmware. The first is easy to fix with better case ventilation or even a small fan and larger heatsinks as suggested in another comment. Poor firmware is more difficult, but by getting a router that can run OpenWRT http://openwrt.org/ you stand the best chances of a stable system.

  12. @Mike Rigby-Jones:

    I’m running a custom linux router using Shorewall. The router is not the problem. The actual dsl line is not the problem. The *modem* is the problem. I had a linksys router prior to this, and it only muddied the waters when it came to fixing the internet when the modem blanked out – turn off the modem, turn off the router, pluf the modem directly into the computer, turn the modem on, request a webpage, plug the modem back into the router, reset the router … pass. This is simple and automated. As i stated in the article, when this stops working, i’ll buy a new modem. No big deal.

  13. I definitely agree with the other comment about using a setup more reliable than X10 for this – the concept is good, but if you have to send the X10 signal 5 times before it’s received and the modem reboots it’s a lot less useful.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.