[ltp] Re: battery is gone?

Claudius Hubig linux-thinkpad@linux-thinkpad.org
Wed, 12 Oct 2011 14:45:40 +0200


--Sig_/6m36GA+aogJqpXrk+8g_RGL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Pascal Wittmann <PascalWittmann@gmx.net> wrote:
>On 10/12/2011 11:40 AM, Arno Trautmann wrote:
>> Hi all,
>>=20
>> 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
>>=20
>> cat: /proc/acpi/battery/BAT0/state
>>=20
>> to get information about the battery state. Also, powertop showed me an
>> acpi power usage estimate.
>>=20
>> 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.
>>=20
>> So =E2=80=A6 what's going on here and how can I restore the previous beh=
aviour?
>>=20
>> 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
>>=20
>> on a X61s.
>>=20
>
>I noticed the same behavior on a T61 with Archlinux, too. Maybe this is
>caused by a kernel update.
>
>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=3D$(cat energy_now)
>	full=3D$(cat energy_full)
>	echo $(echo "$current / $full" | bc -l)

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.

However, I wonder why powertop still appears to rely on the =E2=80=93 as far
as I can tell =E2=80=93 deprecated /proc/acpi instead of
using /sys/class/power_supply.

Best regards,

Claudius
--=20
Eat drink and be merry, for tomorrow we diet.
Please use GPG: ECB0C2C7 4A4C4046 446ADF86 C08112E5 D72CDBA4
http://chubig.net/ http://nightfall.org

--Sig_/6m36GA+aogJqpXrk+8g_RGL
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJOlYv0AAoJEMCBEuXXLNukWPgQAM1SUTwYL75Xk6ugaUlidxkS
7iZNsCrwBdJUeM5s5vnOST1ZZxgLGYuGxbuadX1L9CFH0BjRnYjzhNIKUAaHeuAj
OqLhVblE5krH5zAVBtDh2XJhb5biB8AmEClR4CnR8YpjzZiYIl6Y+RI5o+i63zHD
Dv/1hYMYPX+Tu9mX3KLarYLqxjlN0HINrqCYpHDYpAXEM33w+VuVAfQx8MphimNS
YQt7fLFm1XXEbuVP69GW1uVyDOfVWqaTivZGMXFeVwZ8+W6MV+toRZcB8xSPfvu/
lg5p2mETZ8ZUb1pnXL0WZ8k1FXJwgMwgqjK3sIyohfNC0kUwf41UOcBq6DWtCRr5
bTkspQ0R9jL/r5tE3LDYHRWrC9R/uGFI4dCa5QencOgv8nFe3PB1MIHB2vPLEgTp
bF4FCU8lee1uB4H28kJto6dxqjUNXApl0Xsesv2kLI9wkNIW1p/pFrUFBkXYaBjY
g+0UjgAs3Fp5f0ovPGQNVzFS1j80F8ckdF3VduFArDxInu/0k065Vu/WiivmXmBq
s+x9FsgnBRPz0asW7WArNq8QxncIEBlVcqD01bWWJNFtmtk6ziuC0nsM11JgxHHt
sqfERbMGSwNzNsuHI4QubpJHyGEd22eT0lFDSC+DhtheneCDTn7OC1jrr+fQtzcJ
TwtW4nNfcgCxYCmYGYVO
=XSwK
-----END PGP SIGNATURE-----

--Sig_/6m36GA+aogJqpXrk+8g_RGL--