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

  • Daniel Egger - Thursday, November 21, 2013 - link

    So how much is the power consumption of the device itself? Can WiFi be turned off on the Pro version? Why does the European version need to be so ugly? Questions and more questions...
  • ganeshts - Sunday, November 24, 2013 - link

    Replied to another poster - the power consumption is less than 1 W at idle, but with the network interface up. Wi-Fi can be turned off -- after all, you have SSH access to the unit - you can do anything you want to be done on a persistent basis using some scripts to run on the device at start time.
  • clarkn0va - Thursday, November 21, 2013 - link

    "The mFi controller software (Windows version) needs rework for better stability"

    FTFY. I haven't used the mFi software yet, but UBNT's controller software (Unifi, AirVision, AirControl) is well known for running much better on Linux than Windows. Each product has its own development team, but they pretty much all install great on Linux hosts and start automatically as a service.

    Meanwhile, the Windows version tend to suffer from installation difficulties, stability problems, and the number one complaint in the forums probably being the fact that they aren't designed to run as a service, meaning that you have to actually log into Windows and run the executable before you can connect to it. This shortcoming has been worked around by users in the case of most of the products (thank goodness for the open nature of UBNT's software product development), but the "easy" way to use UBNT's software controllers, ironically enough, is to run them on Linux.

    I realize Anandtech caters to the Windows crowd, but it's not fair to say that a product is unstable when the Linux version isn't, or incompatible when it's available on Windows, Mac and Linux.
  • dylan522p - Thursday, November 21, 2013 - link

    I like ganesh and many of his articles, but this has to be one of your worst articles ever. I really hope you do not fall and.continue to post article of this level because it honestly is a shame to the Anandtech name to have things like this posted.
  • dac7nco - Friday, November 22, 2013 - link

    Ganesh, most UPS have at least ethernet+RS-232, and most I've used connect to a switch or router for management, and a PDU for rack management... This is not new stuff, enabling and disabling power connections, nor are WiFi consoles... I've been doing it since 1995.......

    Daimon
  • ganeshts - Friday, November 22, 2013 - link

    Daimon, I think the integration with mFi which allows rules creation is the primary aspect here. Of course, the reason we even wanted to get this unit in is because of its power measurement capabilities (real-time). And the clincher is the price point!

    We have looked around quite a bit for automating our lab infrastructure and measuring power consumption of various devices during different modes of operation. For example, over the last one year, all the power consumption numbers that I have reported have been gathered through the UFO Power Center. In the future, I hope to use either the UFO Power Center or the mPower unit.

    Please do point me to any UPS / PDU combo which can solve the remote switching as well as power consumption measurement problem for us at this price point, and I am pretty sure both us and other readers will be happy to check those out.
  • dac7nco - Friday, November 22, 2013 - link

    Checkout Cyberpower and APC; these guys "pure-sine wave" products are leaps and bounds above trip-lite. What you are looking for are their systems which have management consoles; hook to switch with a $2 cat-5 and you're done. Your various sytem/rack-peripheral is offline for maintenance on your own terms. Combine this with IPMI (on your switch)and you manage not only power/power-states/RDP, but you have an IP address for power AND management. Win Win.

    Daimon
  • ganeshts - Friday, November 22, 2013 - link

    Do those vendors have any products which are sub-$200 and can still do real time power measurement? The last I checked, they do have $800 - $1K PDUs with management consoles, and even those do not have real time power measurement capabilities on a per-outlet basis.
  • dac7nco - Friday, November 22, 2013 - link

    Yep. USB power reporting.

    http://www.newegg.com/Product/Product.aspx?Item=N8...
  • ganeshts - Friday, November 22, 2013 - link

    I looked into the Cyberpower PowerPanel manual, but it is still not clear whether one can log the power consumed by each outlet at configurable intervals / there is a simple API or HTTP query that one can use to poll these values. There is no information on how often these power consumption values get updated too.

    Otherwise, yes, these UPS management softwares seem to be really feature heavy. As I see in the Newegg comments, $170 is not going to give a network port -- but I can definitely see the appeal for the usage scenario where a UPS is required along with remote switching capabilities

    For this product, the appeal would lie in the fact that the unit runs Linux, one can run custom scripts inside the unit and finally, for our purpose, provide an idea of real-time power consumption with high accuracy and with open APIs. Other than the UFO Power Center and the mPower units, I can't see other good alternatives for the feature set. (The UFO Power Center doesn't run Linux, though, but, can be accessed through simple HTTP commands)

Log in

Don't have an account? Sign up now