-   Linux - Hardware (
-   -   Please explain acpi and similar battery status reports (

SaintDanBert 07-18-2011 05:18 PM

Please explain acpi and similar battery status reports
There are various commands and apps that will read and report the status of a laptop battery. I don't believe that the battery has smart-parts that software can query, so:

where are the smarts that know what is going on with the battery?

Do these smarts remember battery details and need some sort of hard reset from time to time -- for example, battery replacement or swapping "identical" batteries among "identical" laptops?

Thanks in advance,
~~~ 0;-Dan

SaintDanBert 07-18-2011 06:48 PM

I found this as background...

~~~ 0;-Dan

Bill Gates 666 07-19-2011 10:39 AM

Go straight to the source. The /proc file structure!!

On my ASUS laptop (that I'm writing this message on):

$ cat /proc/acpi/battery/BAT0/state
present:                yes
capacity state:          ok
charging state:          charged
present rate:            0 mW
remaining capacity:      35673 mWh
present voltage:        12386 mV
$ cat /proc/acpi/battery/BAT0/info
present:                yes
design capacity:        51260 mWh
last full capacity:      36817 mWh
battery technology:      rechargeable
design voltage:          11100 mV
design capacity warning: 5126 mWh
design capacity low:    506 mWh
cycle count:              0
capacity granularity 1:  506 mWh
capacity granularity 2:  506 mWh
model number:            F8---24
serial number:           
battery type:            LIon
OEM info:                ASUSTEK

That should be fairly reliable as the /proc filesystem is a virtual filesystem maintained by the kernel. I would believe that output. If the kernel doesn't know about a Smart battery, or your battery isn't SMART, you will simply see less file/directories under the /proc/acpi folder (assuming you have ACPI support at all :cry: ).

Run some tests with the battery. Change the power draw (put on a flash video :D ). If the power-drain goes up and the capacity goes down - you are at least seeing that the basics work.

I guess battery monitoring software checks stuff like the design capacity of the battery vs. actual capacity. Naturally you have to fully drain the battery charge to check the current capacity (accurately). Not sure what else it might have access to?

Hope that's useful!

Mr Gates

SaintDanBert 07-19-2011 03:56 PM

Thanks for the /proc details. I am looking for information one layer below this.

The /proc data gets written by something -- a driver/module? This software interrogates
specific hardware. My brain dates back to the days when every "device" was a set of addresses in memory or specific numbered "ports". One used move instructions to read memory contents. There were I.O instructions that read numbered "ports".

What happens in the modern (sic) battery powered workstation? Is there a "device" that knows all about voltages and temperatures, battery present or absent, AC power present or absent, and so on? Does this "device" have a "driver" other than acpi parts? Does the same "device" track battery temperature &c details that tracks CPU temperature &c details? Again, is that acpi or some other "driver"?

Thanks in advance,
~~~ 0;-Dan

The background article indicates that there is some sort of conversation between the battery pack "firmware" and other "software" running on the workstation.

All times are GMT -5. The time now is 03:31 AM.