# Power consumption



## Seeker (Nov 23, 2009)

I need a command line tool, which would display, system's current power consumption.
And I am not talking about laptop, but a desktop.

It might also be in real time.

For example, I aim on adding another 160GB HD.
This tool would show me, is current power supply adequate, regarding all other power sucking components.


----------



## graudeejs (Nov 23, 2009)

It's not a command line tool, but it's the best: http://en.wikipedia.org/wiki/Multimeter also take a look at See Also section 
P.S.
I don't think there is such a cmdl tool available or even possible (at least for Home-PC)


----------



## Seeker (Nov 23, 2009)

Ha ha! Very funny.
Someone has been sarcastic. 

LOL!

This *is* _FreeBSD_!
So it _must_ be possible, as _FreeBSD_ is *alpha and omega*.


----------



## graudeejs (Nov 23, 2009)

Wanna make a bet?


----------



## SirDice (Nov 23, 2009)

No, it's simply not possible as the data isn't available. Without any sensors in the PSU there's no way to tell how much power is being consumed.


----------



## mickey (Nov 23, 2009)

killasmurf86 said:
			
		

> It's not a command line tool, but it's the best: http://en.wikipedia.org/wiki/Multimeter also take a look at See Also section



What you need is more like http://en.wikipedia.org/wiki/Wattmeter.

Even if there was a command line tool available, it would not be of much worth, as it probably would only measure DC Watts. But when it comes to power consumption, you want to know how much AC Watts your PC drains from the mains, which in turn depends on the efficiency of your PSU :e


----------



## graudeejs (Nov 23, 2009)

mickey said:
			
		

> What you need is more like http://en.wikipedia.org/wiki/Wattmeter.
> 
> Even if there was a command line tool available, it would not be of much worth, as it probably would only measure DC Watts. But when it comes to power consumption, you want to know how much AC Watts your PC drains from the mains, which in turn depends on the efficiency of your PSU :e



As I said, see See Also section.
I picked multimeter, because they usually have everything you ever need


----------



## Ruler2112 (Nov 23, 2009)

killasmurf86 said:
			
		

> I picked multimeter, because they usually have everything you ever need



And you can get them for $3 on sale most of the time at Harbor Freight.


----------



## fronclynne (Nov 23, 2009)

mickey said:
			
		

> What you need is more like http://en.wikipedia.org/wiki/Wattmeter.



PferdestÃ¤rke is more atavistic.


----------



## aragon (Nov 23, 2009)

I don't think desktop boards have the circuitry and ACPI facilities to give you the information you want, and not even all laptops do either.  For laptops that do, there's acpiconf(8).


----------



## Seeker (Nov 26, 2009)

mickey said:
			
		

> ...Even if there was a command line tool available, it would not be of much worth, as it probably would only measure DC Watts. But when it comes to power consumption, you want to know how much AC Watts your PC drains from the mains, which in turn depends on the efficiency of your PSU :e



So, it would be viable, only if PSU, would be one, to provide power consumption data, to the OS.
Then, that depends on PSU manufacturer, to implement that tech. :stud


----------



## vivek (Nov 26, 2009)

Only server and workstation grade hardware provide this kind of data via sensor. And most of them dependents upon proprietary drivers and java front ends. Few drivers are there in both Linux / FreeBSD that support command line options via ipmitool to read the data via CLI. But as I said you really need server or workstation grade hardware.


----------



## Seeker (Nov 26, 2009)

_Ah!_
Not yet there...


----------



## Ruler2112 (Nov 30, 2009)

I had a thought about this while in the shower last night.  If you're into hardware hacking, you could buy several of the $2-3 multimeters from Harbor Freight and use these for what you want.

Basically, take each multimeter apart.  Discard the shroud.  Find out how the switch works and short out the correct contacts so that it thinks it's always set in the same position.  Discard the dial switch.  This basically leaves an LCD with a few circuit boards and a battery.  Wire up the battery supply wires to your PSU (I'm guessing that the 3.3 and 5 volt rails would be enough to power it in place of the 9-volt battery), or just leave the battery in.  If you like neither of these, it'd be trivial to wire up a standard 9 volt AC-DC transformer to power the whole bank of multimeters.  Solder a chunk of wire from where the probes end up in the multimeter and splice the other ends into your various PSU wires.  You can either mount the contraption on the inside of your case so that only the LCD is visible.  Better yet, build an enclosure for many of these LCDs and have a group of wires with a plug hanging off of it; the mate of this plug would be accessible on the outside of your case and you could plug it in at will.  (I'm visualizing something like a 20-pin ATX power molex connector - 2 pins for power and the rest for signaling.  If 9 sensors aren't enough, you'd have to find something else.)

BAM - you have a device that can measure just about any property of each power rail coming from your PSU.  What you can monitor is solely dependent on how many multimeters you want to cannibalize and how big you want to limit the device to.


----------



## Graaf_van_Vlaanderen (Dec 1, 2009)

If you want to know the total effective power consumption, you will
have to use an expensive power meter which has all the features like GPIB, USB connection, etc...
Otherwise you can find a second hand ammeter, voltmeter and power factor meter, where: P = U.I.cos(phi)


----------



## Seeker (Dec 1, 2009)

Ok, guys, thanks, but that is, kind of, an overkill for me. 
If I would *really badly* need this feature, than I would go for some *nasty hardcore hacking*...


----------



## Carpetsmoker (Dec 3, 2009)

On OpenBSD I can see the power consumption with the hw.sensors sysctl (hw.sensors.acpibat0.raw1 to be precise) for my thinkpad.

I'm not sure if FreeBSD also has such an sysctl, you can try checking the acpi_battery and acpi_ibm manpages (Last one being Thinkpad specific).

The availability of this kind of information also greatly varies with laptop models.


----------



## fronclynne (Dec 3, 2009)

[cmd=c:\>]acpiconf -i0[/cmd] will give your battery discharge rate, if the ac line isn't plugged in.  I'm not sure that is entirely useful, though, since that can vary a LOT from second to second.


----------



## oliverh (Dec 10, 2009)

Carpetsmoker said:
			
		

> On OpenBSD I can see the power consumption with the hw.sensors sysctl (hw.sensors.acpibat0.raw1 to be precise) for my thinkpad.
> 
> I'm not sure if FreeBSD also has such an sysctl, you can try checking the acpi_battery and acpi_ibm manpages (Last one being Thinkpad specific).
> 
> The availability of this kind of information also greatly varies with laptop models.




http://www.leidinger.net/blog/2009/12/06/freenas-sensors-for-freebsd/

There isn't much of a framework in FreeBSD and there are some people eager to avoid such things.


----------



## allbanddxer (Dec 12, 2009)

I use a device called Kill-A-Watt... Its a great device.
Highly recommended for tracking down wasted energy and tracking energy usage. At the moment my desktop is running at a nice and cool 111 watts (), before installing 8-Rel it was consuming much more power  

A software solution would be nice but I am not sure if it is really worth the effort, at least for me. There are plenty of sites which explain how to calculate system load for choosing a PSU size. Its not that hard to calculate... To bad a Kill-A-Watt cant do that also, it only works on 120v


----------



## osx-addict (Mar 16, 2010)

How about this Kill-a-Watt mod:

http://www.bit-tech.net/news/2009/01/26/the-twitt-a-watt/1


----------

