Taking Advantage of the Open Platform

Some of the interesting aspects that can be controlled via SSH are outlined in this blog post by a UK reseller. The examples seem to be based on a older version of the firmware, and, other than the relay control, deal more with cosmetic aspects such as the LED flashing rate and colour. In the latest version (2.0.7) of the firmware, we also have tags for the outlets. The power consumption values are also updated on a more frequent basis (once per second for each outlet, compared to one outlet each second in the earlier versions). This allows for development of a real-time power consumption analyzer using the mPower units.

While reviewing the UFO Power Center, I had talked about a custom Perl script that was developed for real-time power measurement. I have been making improvements to the script (to be leaner on resources, and adding more features) over the last year. It has now been pushed out to the open source community. A similar script has been developed for the mPower units too. The source is available here. Readers should feel free to check out the scripts, add / suggest features and report / fix bugs. In our limited testing, it has worked fine on Windows 7 / Cygwin, but other platforms haven't been tested.

One feature that I would like to add to the script above is auto-discovery of mPower units in the network. Currently, the script expects the IP of the mPower unit as well as the login credentials to be supplied as command line arguments. Another interesting feature would be a configurable polling rate. The script currently polls for the power consumption values once every second.

It should be noted that the above script works only with mPower units running firmware version 2.0.7. Later versions should also work, unless Ubiquiti does away with some of the used features. Version 2.0.7 added labels for each outlet, and these are stored in /var/etc/persistent/cfg/config_file. Relay status and active power for outlet X are available in /proc/power/relayX and /proc/power/active_pwrX. relayX is writable, with a write of 1 to turn the outlet on, and 0 to turn it off. active_pwrX (as well as v_rmsX, i_rmsX and pfX under /proc/power) report values accurate up to 9 decimal places.

One of the downside of the mPower is the fact that any power consumption below 1W is reported as 0. Unfortunately, this is the intent of the design. Ubiquiti indicates that they found too many issues with AC power systems (noise, inductive loads etc.) to provide enough accuracy at power levels below 1W. Pulling down sub-1W power values to 0 also simplifies rules (particularly, to ensure that rules based on non-zero power don't trigger when nothing is connected and there is leakage current).

Inside the mPower Concluding Remarks
Comments Locked

61 Comments

View All Comments

  • profquatermass - Friday, November 22, 2013 - link

    I really want a Powerstrip that can operate via 3G as I often find the Router goes belly up approx. once a month. Can't turn the Router of/on again without a working line to the Internet.

    In true IT fashion I want to save myself a 40 mile round trip to Work late at night just to turn it off and on again....
  • ganeshts - Friday, November 22, 2013 - link

    That is probably a very niche market :) What I can suggest for you is to get a PC with a 3G SIM slot (The Habey fanless unit we reviewed a couple of months back comes to mind -- I think that was the BIS-6922). Use that as a mFi host, and your problem is solved (and it opens up lots of other possibilities too). That way, your 3G subscription is not just tied to a power-strip, but, can be used to automate your whole office / be used for other purposes too, as the BS-6922 is a complete fanless industrial PC.
  • TheCrackLing - Tuesday, December 3, 2013 - link

    From the way this device sounds, you could make a script that runs via a cronjob that would ping several well known sites that generally respond to pings, and if all fail to respond then power cycle the port the router is on. Of course also make certain to log the time, and not power cycle again for X time after.
  • dblagent - Tuesday, December 3, 2013 - link

    they absolutely make this, you want what is called and "IP Powerstone" by multi-link inc. They are not much, and they work GREAT! There are a few models, ours is around $100 I believe.

    You give it power via a standard computer style power cord and it has two outlets. It is connected via cat5 to your router and you set what sites (up to 5) to ping and how often. If it misses a ping it will wait and try again in a few minutes. If not available then it powercycles the outlets. One at a time, or both. Timing is set by you. I wait 5, then 15, then one hour. After three times you'll possibly have to make the trip.

    I use 80 of these at remote locations and they work great! Used to I'd dispatch someone to head to the location where now we just wait. Maybe once every month or two someone has to go onsite now. It used to be weekly with 80+ locations that are remotely controlled!

    Hope this helps you, it is an amazing help for us that's for sure!
  • Dantze - Saturday, November 23, 2013 - link

    Been following Anandtech for yeaaarss.. but finally had to say it. Is there an option to view the articles in one page format rather than having to click on drop down for each different section ?

    I think it's... cumbersome.. should have an option like HowStuffWorks where you can see the article as a one page (long) article.
  • ganeshts - Saturday, November 23, 2013 - link

    Click on 'Print this article' at the bottom of the screen :) I thought this was a well-known feature.
  • Dantze - Sunday, November 24, 2013 - link

    Thanks that works! :D
  • DBissett - Monday, November 25, 2013 - link

    That's a small improvement. It would be a great improvement if the Print view would give you the article full screen width and get rid of all the junk on the right. If you want to let readers concentrate on reading an article why include headlines, tweets, etc. on the screen?
  • Catsweeper - Monday, November 25, 2013 - link

    Looks like a great product
  • raptorl3 - Tuesday, December 3, 2013 - link

    Is there any chance of sending an on/off command to the strip without using the dedicated app? I'm thinking, for instance, of turning on a dedicated stereo amplifier over WiFi. I control the XBMC source with a tablet or phone. By creating a Tasker or Llama action (in Android, obviously) I could both switch on the amp and launch the XBMC remote on the device. A similar task could switch the amp off after a period of non-use.

    This would be much more difficult if all actions must be handled through the app or SSH only.

Log in

Don't have an account? Sign up now