Jump to content

Simple Power Cycle for router reboot


Recommended Posts

Did some searching and was unable to find a topic on this, so asking here since I'm pretty new and there may be an easier way:

I want to power cycle my router each night at 3am, but this doesn't seem to do it (router plugged into simple Insteon on/off module):

 

If time is 3:00 am

Then power off

Else power on

 

Instead, I had to write two separate programs, one to turn it off and then another to turn it on a minute or two later.  Is there an easier way?

Sean

Link to comment
2 minutes ago, seanB said:

Did some searching and was unable to find a topic on this, so asking here since I'm pretty new and there may be an easier way:

I want to power cycle my router each night at 3am, but this doesn't seem to do it (router plugged into simple Insteon on/off module):

 

If time is 3:00 am

Then power off

Else power on

 

Instead, I had to write two separate programs, one to turn it off and then another to turn it on a minute or two later.  Is there an easier way?

Sean

If time is 3:00 am

Then
     power off
    Wait 30 seconds
     power on

Else
    -----------

Link to comment

@seanB

OK. This is going to complicate your life but here is the routines I use for Router checking and reboot.

 

Router.OK.initiate - [ID 0103][Parent 00CD]

If
        $sISY.hh.mm > 0    <----this triggers the test every minute based on a v5.* clock program
    And (
             $WC8.updating is $cTRUE   <---- Weather station reports into ISY...each comm program has a status variable
          Or $GathRm.stat.updating is $cTRUE   <----- Ethernet comm based stat
          Or $UtilStat.updating is $cTRUE   <Ethernet comm based stat
          Or $NRb.connected is $cTRUE  <---- custom NR driver on RPi
        )
 
Then
        Run Program 'Router.OK' (If)
 
Else
   - No Actions - (To add one, press 'Action')
 

Power cycle router several times, waiting longer each trial for signal to show up and cancel the running of this sequence. Then will run instead and stop Else running.

Router.OK - [ID 00C4][Parent 00CD][Not Enabled]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Wait  5 minutes <----- avatar will be green when 'Router OK'
        Run Program 'Router.OK' (Else Path)
 
Else
        Disable Program 'Router.OK.initiate'   <---- no interuptions while router power off

        Set 'Gathering Room / WiFi Router' Off   <---- cycle power
        $sRouter.fail.count += 1    <------ keep track of attempts
        $sRouter.fail.count Init To $sRouter.fail.count   <---- copy into permanent memory
        Wait  10 seconds       <----- allow some power supply cool down
        Set 'Gathering Room / WiFi Router' On
                                      
        Enable Program 'Router.OK.initiate'  <----- now allow interuptions, turn on sensing                                    
        Wait  5 minutes      <-----allow time for signals to stop Else, and run Then
        Disable Program 'Router.OK.initiate'  <---interuptions to this program

        Set 'Gathering Room / WiFi Router' Off  <----power cycle router gain
        $sRouter.fail.count += 1
        $sRouter.fail.count Init To $sRouter.fail.count
        Wait  15 seconds    <---- cool down period
        Set 'Gathering Room / WiFi Router' On
        Enable Program 'Router.OK.initiate'
                                                           
        Wait  8 minutes   <----- wait longer each time
        Disable Program 'Router.OK.initiate'
        Set 'Gathering Room / WiFi Router' Off
        $sRouter.fail.count += 1
        $sRouter.fail.count Init To $sRouter.fail.count
        Wait  30 seconds
        Set 'Gathering Room / WiFi Router' On
                                 
        Enable Program 'Router.OK.initiate'
        Wait  12 minutes 
        Set 'Gathering Room / WiFi Router' On
        Enable Program 'Router.OK.initiate'
                                 
        $sAlarm.level  = 3   <----- OK tell the human and ring some bells
        Send Notification to 'Text  Larry' content 'Device comm report'
        Send Notification to 'eMail Larry' content 'Device comm report'
 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...