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

  • Hrel - Thursday, November 21, 2013 - link

    Does the review even really matter? If you buy Mac products you're going to buy Mac products. IT's always the same thing and there's never any choice. Review isn't really necessary.
  • melgross - Friday, November 22, 2013 - link

    Very funny. It's sad though, if you keep buying Windows products after you buy the first one.
  • DanNeely - Thursday, November 21, 2013 - link

    Ganesh hasn't done any Apple reviews in at least at year; his review of this product has nothing to do with Anand finding time to write a review about the MBP.
  • ydeer - Thursday, November 21, 2013 - link

    With the dive in quality that the reviews on this site have taken lately, that doesn’t bother me nearly as much as it used to.

    I _bet_ the MBP review won't address the well documented and quite severe "yellow tint" screen issue because it won’t be there on their cherry picked review sample and "testing" the Xbox One is evidently more important than biting the hands that feed this site.
  • Flunk - Thursday, November 21, 2013 - link

    I'll give you the gist of that review. It looks like last year's MacBook Pro, has Haswell and has better battery life, a PCIe SSD. A bit better GPU performance, almost the same CPU performance.

    Seriously, there are a lot of reviews out there.
  • stadisticado - Thursday, November 21, 2013 - link

    You realize that more than one person works at Anandtech right? Its not like Anand or Brian personally reviewed this item...
  • jason32 - Friday, November 22, 2013 - link

    You're going to buy it anyway. Why bother reading reviews?
  • edwpang - Thursday, November 21, 2013 - link

    Why do I need these kind of device? . Apparently, we cannot use it to control computers. My TV and home theater receiver are just in standby which use less than 5W in total. We do need to control the lights but we need wifi-enable switch for that. What else do we need it for?
  • alinot - Thursday, November 21, 2013 - link

    I'd actually like to use it with my fish tank. There's a lot of parameters to control that run on electricity, including light, bubblers, filters, and heat that can effect the water. This matters a lot in smaller tanks especially, if one parameter goes out of whack unsupervised, your whole tank could die in a few hours. The fact that this is open source and hackable and controllable means I could implement it in my probes and measurements to automatically adjust as needed.

    This strikes me as a product that has more practical application in the enterprise and business environments than at home, though.
  • jason32 - Friday, November 22, 2013 - link

    Why not use an Arduino and some peripherals if you're going to write your own code? Most of the use cases I see that require using your own custom code with these mFi products can be done with simple microcontroller boards and accessories.

Log in

Don't have an account? Sign up now