[ltp] battery is gone?

Pascal Wittmann linux-thinkpad@linux-thinkpad.org
Wed, 12 Oct 2011 14:21:18 +0200


This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigB5D1CB1E1B1CAB6B26EDC953
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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 be=
haviour?
>=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)


--------------enigB5D1CB1E1B1CAB6B26EDC953
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iEYEAREKAAYFAk6VhkEACgkQyJms5+IyKFK+PwCggE+YZNkwh2GQAHcp8vx4K10E
w0cAn1Hoa2wUFncYwFFnFIhosnktLz1B
=J8am
-----END PGP SIGNATURE-----

--------------enigB5D1CB1E1B1CAB6B26EDC953--