OpenBSD Journal

Developer blog: marco

Contributed by marco on from the ACPI-starts-spilling-beans dept.

More ACPI news. Jordan did a bunch of work and now we can actually read values out of batteries and stuff with AML. This makes the code almost useful! So for debugging purposes I rigged the acpibat and acpiac devices to export some useful data through the sensors framework. Word of warning here, this is for debug only! Pretty cool to see the battery charge/discharge and other status percolate to userspace. And in good debug fashion I found out that we are leaking some memory somewhere which causes the updates to seize after a while. Jordan is plugging memory leaks as we speak. Anyway Jordan is making solid progress and I am just simply using it in the little device drivers. What is important here is that we already have received some reports from the field that it works. We have also received some pretty useful bug reports which are being fixed as soon as we get to it. More later. Here is some output:
hw.sensors.0=acpiac0, power supply, indicator, On
hw.sensors.1=acpibat0, last full capacity, percent, 76.00%
hw.sensors.2=acpibat0, warning capacity, percent, 10.00%
hw.sensors.3=acpibat0, low capacity, percent, 10.00%
hw.sensors.4=acpibat0, voltage, OK, volts_dc, 11.10 V
hw.sensors.5=acpibat0, battery charging, OK, raw, 0
hw.sensors.6=acpibat0, rate, raw, 1
hw.sensors.7=acpibat0, remaining capacity, percent, 100.00%
hw.sensors.8=acpibat0, current voltage, OK, volts_dc, 12.54 V
Fun statistic is the "last full capacity". In my case you can see that my battery has lost 24% of capacity since I got it. I guess this is the statistic no one wants to advertise :-)

(Comments are closed)


Comments
  1. By Simon (84.57.78.203) on

    Nice to hear that there's so much progress on the ACPI field.
    Looking forward to use/test it.

  2. By Anonymous Coward (217.31.185.139) on

    It would be nice to have some discharge limiting when on battery... Thinkpads are supposed to turn off when there's 4% left in the battery, or else the lifetime of the battery gets shortened (according to IBM FYI).

    Otherwise, nice work on acpi!

    Comments
    1. By Marco Peereboom (67.64.89.177) on

      That's the "low capacity" entry. I wear through batteries like no one else so I am not surprised its this far down since i got it (less than a year ago). I ordered some more :-)

  3. By Anonymous Coward (68.125.87.215) on

    "hw.sensors.1=acpibat0, last full capacity, percent, 76.00%"

    Very nice function.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]