New Member
Posts: 1
Registered: ‎12-27-2014
Kudos: 1

How to create a ping watchdog to powercycle outlets on Internet outage, manual powercycle from cloud

There really isn't any new information in this post, I just compiled various bits and pieces from different threads and put it all in one spot. At the bottom I'll link to the threads I referenced, sorry if I forgot one.


The mFi controller cannot be used to perform a ping watchdog on an outlet. Additionally, if the controller is in the could you cannot use it powercycle a device that interrupts the Internet, even if the internet is still live.


However, you can use the pwdog method on the mPower device itself to perform those functions.



Features and tips on setup process, refer to linked threads for details:

  • power cycles outlet4 and outlet2 when pinging Google DNS fails for one minute (6 consecutive failures, 10 seconds apart)
  • turns outlets back on after one minute even if turned off manually/accidentally from the controller/app. (i.e. always on)
  • repeats power cycle once every 15-16 minutes while internet is offline.
  • works whether or not outlet is in a locked state
  • address the 'pwdog command is too long issue' by running the command in a switch
  • logs the date when power cyles occur
  1. ssh into the mPower device
  2. edit /tmp/system.cfg, change pwdog section to the following
  3. edit/create /etc/persistent/bin/
    date >>/tmp/pwlog
    echo 0 >/proc/power/lock4
    echo 0 >/proc/power/lock2
    echo 0 >/proc/power/output4
    echo 0 >/proc/power/output2
    sleep 10
    echo 1 >/proc/power/output4
    echo 1 >/proc/power/output2
    echo 1 >/proc/power/lock4
    echo 1 >/proc/power/lock2
    killall pwdog
  4. run the following commands
  5. chmod +x /etc/persistent/bin/