[ltp] Re: battery is gone?
Arno Trautmann
linux-thinkpad@linux-thinkpad.org
Sat, 15 Oct 2011 23:03:12 +0200
Claudius Hubig wrote:
> Pascal Wittmann<PascalWittmann@gmx.net> wrote:
>> On 10/12/2011 11:40 AM, Arno Trautmann wrote:
>>> Hi all,
>>>
>>> again I have in interesting behaviour of my machine: It doesn't consume
>>> any power!
>>> At least if I beleave what it tells me: A few days ago, I could use
>>>
>>> cat: /proc/acpi/battery/BAT0/state
>>>
>>> to get information about the battery state. Also, powertop showed me an
>>> acpi power usage estimate.
>>>
>>> Now, the file is just gone and I don't get any estimate. The machine
>>> kind of claims there is no battery, but it runs fine without AC
>>> connection. I can only notice that the battery is running low by the
>>> orange LED instead of the green one.
>>>
>>> So … what's going on here and how can I restore the previous behaviour?
>>>
>>> 3.0-ARCH #1 SMP PREEMPT Fri Oct 7 11:35:34 CEST 2011 x86_64 Intel(R)
>>> Core(TM)2 Duo CPU L7500 @ 1.60GHz GenuineIntel GNU/Linux
>>>
>>> on a X61s.
>>>
>>
>> I noticed the same behavior on a T61 with Archlinux, too. Maybe this is
>> caused by a kernel update.
Maybe, yes. Good to know it's not only me …
>> In the meantime you can use:
>>
>> /sys/class/power_supply/BAT0/
>>
>> there is no direct state, but you can calculate it something like that:
>>
>> cd /sys/class/power_supply/BAT0/
>> current=$(cat energy_now)
>> full=$(cat energy_full)
>> echo $(echo "$current / $full" | bc -l)
Works fine, thanks!
(and now I know bc, too …)
> In addition to that, you can get more details with tp-smapi (m-a a-i
> tp-smapi on Debian) which presents the /sys/devices/platform/smapi/-
> Interface when loaded, which contains, apart from others, the file
> remaining_percent.
I installed tp_smapi now, but there is no /sys/devices/platform/smapi/
on my system, also no file remaining_percent anywhere.
> However, I wonder why powertop still appears to rely on the – as far
> as I can tell – deprecated /proc/acpi instead of
> using /sys/class/power_supply.
Who is to be feature-requested for this?
Thank you guys for your quick answers!
cheers
Arno