cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

automatically set my router to reset with timer

Mikey1963
Investigator
Investigator

How do i automatically set my router to reset with timer please.

7 REPLIES 7
XRaySpeX
Grand Master
Grand Master

@Mikey1963 : Which router do you have?

What do you mean by "reset"? Turn itself off & on? Why would you want to do that? Switching routers on & off frequently is not a good idea.

If you think I helped please feel free to hit the "Thumbs Up" button below.

To phone EE CS: Dial Freephone +44 800 079 8586 - Option 1 for Mobile Phone & Mobile Broadband or Option 2 for Home Broadband & Home Phone

ISPs: 1999: Freeserve 48K Dial-Up => 2005: Wanadoo 1 Meg BB => 2007: Orange 2 Meg BB => 2008: Orange 8 Meg LLU => 2010: Orange 16 Meg LLU => 2011: Orange 20 Meg WBC => 2014: EE 20 Meg WBC => 2020: EE 40 Meg FTTC => 2022: EE 80 Meg FTTC (no landline number)
monitorcurve
Established Contributor
Established Contributor

You could easily create a python script using something like Selenium that spins up a headless chrome browser which would navigate to the router page and restart it every x hours, but the question is why and what are you trying to accomplish by doing that?

Hi pal, i have a ee smart hub.
         Kindest regards 
                Mike...

Hi pal, to clear cache & stop the router from freezing/crashing because every now & then i have to switch it off & back on again to update.

                        Kindest regards

                              Mike...

monitorcurve
Established Contributor
Established Contributor

I just wrote this in Python that will open the router page using Selenium 4, spin up a chrome browser and restart the router for you if you can get the script up and running on a task scheduler it should work just fine:

import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

ROUTER_URL = "http://192.168.0.254/DashboardScreen"
ADMIN_PASSWORD = "enter-your-router-password"

service = Service()
options = webdriver.ChromeOptions()

driver = webdriver.Chrome(service=service)

driver.get(ROUTER_URL)

# wait max 60 seconds for router page to be visible.
restart_hub_button = WebDriverWait(driver, 60).until(
    EC.visibility_of_element_located((By.ID, "RestartHub"))
)

restart_hub_button.click() # click on restart router button

# find input field for password in popup modal and enter the password
admin_pass = driver.find_element(By.ID,"pwd_field")
admin_pass.send_keys(ADMIN_PASSWORD)

time.sleep(1)

ok_button = driver.find_element(By.ID,"admin_password_popup_ok_button")
ok_button.click()

# on the next page wait until there is the 2nd restart button and click on in to restart the actual router
restart_hub_button2 = WebDriverWait(driver, 60).until(
    EC.visibility_of_element_located((By.ID, "restart"))
)

restart_hub_button2.click()

time.sleep(60)

driver.close()
driver.quit()

 

bobpullen
Prodigious Contributor
Prodigious Contributor

Is the above script even targeting the right local IP for EE routers? Question stands: why are you wanting to do this? What router do you have and what problems are you suffering?

monitorcurve
Established Contributor
Established Contributor

I changed the default subnet on my router to end in 0.254 rather than the default 1.254

It's too late to edit that post now, so i'll just add the following:

ROUTER_URL = "http://192.168.0.254/DashboardScreen" # the default EE Hub Smart Hub router IP address is 192.168.1.254