Announcement

Collapse
No announcement yet.

Power cycle modem / router / switch on internet connectivity loss

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Power cycle modem / router / switch on internet connectivity loss

    I am trying to set up a remote location to self diagnose loss of connectivity and power cycle the equipment above.

    My homeseer system (HS3) is running on a raspberry pi.

    I wanted to use Jon00s network monitoring scripts but they are for windows only.

    Can anyone lead me to a direction where I can identify a loss of connectivity and send that to an event? I was considering Ultramon but it's hasn't been updated in years.

    Thanks,

    Devan

    #2
    I found a simple script that I can create a CRON job to run every hour or so:


    #!/bin/bash
    wget -q --spider https://google.com
    if [ $? -eq 0 ];
    then echo "Online"
    else echo "Offline"
    fi

    Simple enough and works. How can I trigger an event in homeseer if the script reports "offline"?

    Comment


      #3
      How about using http request to send the controldevicebyvalue JSON command to HomeSeer to set the state for a virtual device.

      Comment


        #4
        I know how to create a virtual device and create events to control it.

        I have no idea about JSON or http request. Are those VB script references?

        Comment


          #5
          Originally posted by devanb View Post
          I found a simple script that I can create a CRON job to run every hour or so:


          #!/bin/bash
          wget -q --spider https://google.com
          if [ $? -eq 0 ];
          then echo "Online"
          else echo "Offline"
          fi

          Simple enough and works. How can I trigger an event in homeseer if the script reports "offline"?
          Best to ask Uncle Michael

          You can use a Z-wave outlet or other (It's the modem you want cycle)


          Eman.
          TinkerLand : Life's Choices,"No One Size Fits All"

          Comment


            #6
            About 10 years ago I used a product that ping’d a couple common Servers (e.g. yahoo.com, Microsoft.com) and when it failed it would recycle power on two plugs. The first would be the cable modem and the second the WiFi router. It worked very well to assure a remote connection maintained internet connectivity.

            i believe you can do the same thing with a dual output smartplug running Tasmota using rules to do the same monitor/recovery logic. This would be $10 solution that is not dependent on a PC/HS or other things that introduce other failure modes. One could also do a more DIY approach using Arduino and a custom sketch, but if one is dependent upon WiFi at the remote location then a monitor that includes WiFi in the loop would seemed preferred (Tasmota is simpler than a custom sketch)

            Comment


              #7
              Google Tasmota...

              Wow, way over my pay grade!

              I did some research and found Blades Blade plug in BLLan. It works very well for my purpose.

              I added a computer called google with the url www.google.com.

              If BLLan is unable to ping google, the status of the Google device becomes "0". I can then create an event.

              Let me know if my logic is wrong so far.

              Comment


                #8
                Here are my events:

                Comment


                  #9
                  Originally posted by devanb View Post
                  Google Tasmota...

                  Wow, way over my pay grade!

                  I did some research and found Blades Blade plug in BLLan. It works very well for my purpose.

                  I added a computer called google with the url www.google.com.

                  If BLLan is unable to ping google, the status of the Google device becomes "0". I can then create an event.

                  Let me know if my logic is wrong so far.
                  I like that ...


                  Eman
                  TinkerLand : Life's Choices,"No One Size Fits All"

                  Comment

                  Working...
                  X