7

We have a Windows 7 64 bit computer at a remote location that connects via a broadband USB modem to get to the Internet. Sometimes this modem will just "switch off" or otherwise become unavailable to the computer. Removing and re-plugging it back into the USB port always gets it going again.

I always have to drive out to the remote location to do this. However I was wondering if there was software available that would occasionally ping the Internet, and when it cannot connect that it would automatically reset the USB port. Is there anything out there that will do this? Thanks for any advice!

  • 2
    Some modems (and many routers, BTW) have a feature in their firmware to perform auto-resets after a configurable duration. You may want to check if your modem has such a feature. – RockPaperLizard Apr 20 '15 at 21:59
  • 3
    definite question here is what OS? And this may be less a software rec than a full blown SU question since information on your modem might be useful too. You may have other ways to solve the issue, like restarting the modem in software. – Journeyman Geek Apr 21 '15 at 3:56
  • 2
    And buying a new router seems like the best course of action. What you're asking is an second-best alternative that does not fix the real issue. Your modem will still be down for some time. – user416 Aug 20 '15 at 7:42
  • There are power reboot plugs available that reboot your cable modem/ router when it senses the connection is gone. I could not refind the podcast I was listening to that mentioned this, sorry. – user416 Jun 19 '16 at 18:31
1

If on Mac OSX or Linux I would suggest Monit. You can easily configure it to run a command if an address is unreachable.

Monit website: http://mmonit.com/monit/

Worth noting is the control file. From the Manual: http://mmonit.com/monit/documentation/monit.html#THE-MONIT-CONTROL-FILE

CHECK HOST ADDRESS

A /etc/monitrc file similar to this would work in your case:

check host myhost with address 1.2.3.4
    if failed port 80 protocol http then exec /path/or/command/to/restart
    if 3 restarts within 5 cicles then exec /sbin/reboot

Obviously, tweak the command to your needs. You can find many scripts for resetting USB on various Linux distributions.

If on windows, Munin is the closest you can get. I'll skip right to the manual since it's on the same domain and all: http://guide.munin-monitoring.org/en/latest/tutorial/alert.html

Munin allows you to run an external script, possibly something like DevCon (From Microsoft itself): devcon restart *ROOT_HUB20*

A blog post with details on using Devcon: http://digital.ni.com/public.nsf/allkb/1D120A90884C25AF862573A700602459

1

On Windows, this can be done with a Batch file, and DEVCON (program for working with USB).

  1. Download DEVCON
  2. Enter the following code in a batch file

    @echo off
    
    SET wait = _number_of_seconds_to_wait_+1_
    
    :main
    
    ping www.google.com
    
    if %errorlevel%==0 goto main
    
    start /w devcon disable *nameofmyusbdevice
    
    start /w devcon enable *nameofmyusbdevice
    
    ping 127.0.0.1 -n %waitTime% > nul
    
    goto main
    
  3. Place this batch file in the Autorun folder

  • 1
    Warning: Devcon does not disable the power output of a USB port. – Ciprum Sep 18 '16 at 23:40
0

Make an Arduino controlled power strip (example). There are number of tutorials available.

When your internet monitor fails, run the necessary commands to power cycle the device.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.