DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: restart router after few minutes of inactivity  (Read 17,605 times)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
restart router after few minutes of inactivity
« on: April 01, 2012, 08:41 PM »
hello!

because of the low quality of the telephone line cable in my area and the large distance from the nearest dslam, my router gets filled with errors (not sure what this is, I was told so) and it needs restart to refresh and the dsl line become operational again

is there a software to restart/reset my router after few minutes of inactivity?

thanks!

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: restart router after few minutes of inactivity
« Reply #1 on: April 01, 2012, 08:59 PM »
2 simple solutions:
- Get a better ISP
- Get a better router
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: restart router after few minutes of inactivity
« Reply #2 on: April 01, 2012, 09:04 PM »
Unfortunately i have already done these without success

I need a program that will do this, i know programs that can detect network activity, exist

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: restart router after few minutes of inactivity
« Reply #3 on: April 01, 2012, 09:47 PM »
The hard part will be resetting your router in a programmatical way.  What kind of router is it?  Also, how do you detect when to reset it?  Are you test pinging a site or something like that?

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,073
    • Cody Award
    • Furry Fandom Badge - Furry Fandom
Re: restart router after few minutes of inactivity
« Reply #4 on: April 01, 2012, 10:05 PM »
You can usually reset routers via their config screen. Can you not automate opening the right page and click restart?

Alternatively start arguing with your telephone company that the service they are providing is not acceptable. If your DSL connection is that bad then your telephony is probably crappy too.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: restart router after few minutes of inactivity
« Reply #5 on: April 02, 2012, 12:29 AM »
What's your router make/model ?

Do you have access to your routers configuration settings, (user/password) ?

This will be more easily accomplished by sending commands via telnet I would think but before that we can try turning some things off in the router, (like error logging).

Also, do you do a lot of BitTorrenting, (that can also screw up a router by having too many NAT sessions open - router dependant) ?
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 2,197
Re: restart router after few minutes of inactivity
« Reply #6 on: April 02, 2012, 12:42 AM »
I have live(d) through many broadband issues and definitely sympathize.
Isn't this likely more the domain of a modem rather than router? Having said that, like mentioned, make/model is first thing to know.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: restart router after few minutes of inactivity
« Reply #7 on: April 02, 2012, 01:27 AM »
Isn't this likely more the domain of a modem rather than router?

Unfortunately, router is rather generically used for combined modem/router these days, as is modem when they mean the combined modem/router, (parents).  :-\
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

Innuendo

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,266
Re: restart router after few minutes of inactivity
« Reply #8 on: April 02, 2012, 02:16 AM »
Unfortunately, router is rather generically used for combined modem/router these days, as is modem when they mean the combined modem/router, (parents).  :-\
Quote

Especially since the OP is talking about DSL. It's very rare to see separate routers & modems handed out by DSL ISPs. It's almost always a unit with both built in.

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: restart router after few minutes of inactivity
« Reply #9 on: April 02, 2012, 03:59 PM »
my router is Pirelli (not sure which model)

it does have a way to reboot, by visiting http://router.ip/cgi-bin/restart.exe, I think

I never do bittorrent

so, I guess I can visit the above address every x minutes of inactivity? any hint how to do that?

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,073
    • Cody Award
    • Furry Fandom Badge - Furry Fandom
Re: restart router after few minutes of inactivity
« Reply #10 on: April 02, 2012, 04:34 PM »
You may have the router set up to disconnect on inactivity - you need to check out the idle time in the DSL connection settings and set it to never disconnect (usually if it is done by time just put 0)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: restart router after few minutes of inactivity
« Reply #11 on: April 02, 2012, 04:42 PM »
You may have the router set up to disconnect on inactivity - you need to check out the idle time in the DSL connection settings and set it to never disconnect (usually if it is done by time just put 0)

this cannot be done, because I want it always on (I may connect via my cell phone)

I just want it to reboot after x minutes of inactivity, so that the line will refresh and errors will be refreshed

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,073
    • Cody Award
    • Furry Fandom Badge - Furry Fandom
Re: restart router after few minutes of inactivity
« Reply #12 on: April 02, 2012, 05:48 PM »
my router is Pirelli (not sure which model)

it does have a way to reboot, by visiting http://router.ip/cgi-bin/restart.exe, I think

I never do bittorrent

so, I guess I can visit the above address every x minutes of inactivity? any hint how to do that?

There is usually a setting in the router that sets the time limit an admin can be logged in to the router settings before you are automatically logged out again. Set that to a very large number then open the reset.exe page regularly.

You can probably automate this with Firefox as there is a plugin the does refresh page after so many minutes so just load the restart page and left the REfresh After addon in firefox reset your router after every so many minutes.

It probably won't be very convenient because restarting you router will add regular delays in internet access as each restart can take a couple of minutes.

I would suggest your best bet would be to argue with your telephone provider and/or ISP to get the problem resolved or find a better way to connect to broadband that works properly.

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
Re: restart router after few minutes of inactivity
« Reply #13 on: April 02, 2012, 06:10 PM »
...
is there a software to restart/reset my router after few minutes of inactivity?
...
When you say "inactivity", your goal is to have the reset happen when you are not working and would therefore not be inconvenienced by a reset?

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: restart router after few minutes of inactivity
« Reply #14 on: April 02, 2012, 06:21 PM »
...
is there a software to restart/reset my router after few minutes of inactivity?
...
When you say "inactivity", your goal is to have the reset happen when you are not working and would therefore not be inconvenienced by a reset?

yup
reset after 30 minutes of inactivity will rarely cause problems, because being inactive for that long, will probably mean that I am afk
when I return to keyboard, it will be much more probable to be in the time between two resets, so the internet connection will be operational and already refreshed

firefox trick would work, autohotkey would probably do it better (without me having firefox always on), the problem is how to detect inactivity

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,073
    • Cody Award
    • Furry Fandom Badge - Furry Fandom
Re: restart router after few minutes of inactivity
« Reply #15 on: April 02, 2012, 06:35 PM »
the problem is how to detect inactivity

You could always make a screensaver to do it ;)

Seriously I think in Windows 7 you can schedule a task to run after so much inactivity.

Another (and simple) altenative would be to set your router to connect on demand and give it an idle timeout to disconnect. Almost all routers I have seen have this option (though I don't know your model specifically).

Connect on demand is pretty quick (much faster and less hassle than a router reset).

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: restart router after few minutes of inactivity
« Reply #16 on: April 02, 2012, 06:44 PM »
screensaver will not detect network inactivity, it will detect GUI inactivity
that connect on demand is interesting, but I found nothing about it in my router's webpage :S

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: restart router after few minutes of inactivity
« Reply #17 on: April 02, 2012, 06:49 PM »
For the moment, let's just assume that Kalos cannot improve the quality of his DSL connection.  Here's an AHK script that will check every minute for physical inactivity (not network inactivity).  If the physical inactivity exceeds 30 minutes, the aforementioned URL is run.  You can change the myIdleTime variable to what minutes value you would like:

Code: (autohotkey)
#Persistent

myIdleTime := "30" ; Value in minutes.
 
SetTimer, CheckIdle, 60000 ; Check every minute.

Return ; End of auto-execute section.


CheckIdle:
{
    If ( A_TimeIdlePhysical > ( myIdleTime * 1000 * 60 ) )
    {
        Run, http://router.ip/cgi-bin/restart.exe
    }
}
Return

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: restart router after few minutes of inactivity
« Reply #18 on: April 02, 2012, 06:52 PM »
that would be a handy workaround thanks!

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
Re: restart router after few minutes of inactivity
« Reply #19 on: April 03, 2012, 01:36 AM »
You could always make a screensaver to do it
that's what I was thinking.  Plus I'd have a shortcut to manually activate the screensaver/reset script whenever I was getting up from the computer for more than a few minutes, so even if I came back in 5 minutes, the reset would be finished.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: restart router after few minutes of inactivity
« Reply #20 on: April 03, 2012, 03:44 AM »
Task Schedule for Windows 7, (may have to tweak since I don't have a Pirelli), attached below.

You'll need wget.exe which is in the archive, I've put it in C:\ for this purpose but just move it wherever and change the Task accordingly.

1) Open the Task Scheduler and import the Reset Pirelli.xml file
2) Task is listed, double-click to edit

2012-04-03_13-34-46.jpg

Change the parameters as you like.

A bit more info on what constitutes an Idle state wrt the Task Scheduler:
Quote
Idle Conditions
You can set a condition that tells the task to run only if the computer is in an idle state for a specific amount of time when a trigger is activated. When you set this condition, you also set the amount of time to wait (after the task is triggered) for the computer to enter an idle state.

The Task Scheduler service will check if the computer is in an idle state every 15 minutes. A computer is considered to be in an idle state when a screen saver is running. If a screen saver is not running, then the computer is considered to be in an idle state if there is 0% CPU usage and 0% disk input or output for 90% of the past fifteen minutes and if there is no keyboard or mouse input during this period of time. Once the Task Scheduler service detects that the computer is in an idle state, the service only waits for user input to mark the end of the idle state.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: April 03, 2012, 05:08 AM by 4wd »

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,888
    • Participated in NANY Challenge Six Times
    • Coding Snacks
    • Gathering Badge
    • Cody Award
    • Volunteers/Staff
Re: restart router after few minutes of inactivity
« Reply #21 on: April 03, 2012, 09:25 PM »
My IdleStart application can launch an app after a user specified length of idle time. I just tested it and it works with URL's too.

Just use the URL of the restart page instead of the path to an application in the command line parameters.

It will relaunch that page again and again, whenever that length of idle time is reached, until you either close the application or pause it from the tray icon. So just set it and forget it, and it won't bother you while you are using the PC.

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: restart router after few minutes of inactivity
« Reply #22 on: April 04, 2012, 09:27 PM »
excellent
thanks

Original address: https://www.donationcoder.com/forum/index.php?topic=30506.0