06-27-2017 04:44 PM
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
- ssh into the mPower device
- edit /tmp/system.cfg, change pwdog section to the following
pwdog.command=/etc/persistent/bin/pwdogcmd.sh pwdog.delay=900 pwdog.host=188.8.131.52 pwdog.period=10 pwdog.retry=6 pwdog.status=enabled
- edit/create /etc/persistent/bin/pwdogcmd.sh
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
- run the following commands
chmod +x /etc/persistent/bin/pwdogcmd.sh