"On battery" is not recognized

I have just bought a lovely ThinkPad Edge 11 which have ~6 hours of surfing in Windows 7. But unfortunately, a clean Ubuntu 10.10 give me max 4 hours which is not satisfactorily. Therefore I have installed laptop-mode-tools and powertop.

In the sequence of installing and using these tools something have gone wrong. Now, the laptop don't recognize when the power is plugged off so the screen etc. is not dimmed. It still makes a sound when power is plugged in and taken out but I suspect that this is not through Ubuntu. I have tried uninstall of the tools and, of cause, rebooting - but nothing helps. I'm not a pro with Linux so some expertise would be appreciated. Any ideas to how I can restore the settings or get it to recognize "on battery"?

Update: I have tried reinstalling acpi-support, pm-utils and laptop-detect without luck.


Solution 1:

I discovered that /proc/acpi/battery/BAT1/info was erased somehow. So I found out that the battery-information will be reset when:

  1. Shutdown
  2. Take battery out
  3. Turn on
  4. Shutdown
  5. Plug in the battery
  6. Turn on

It works now :)

Solution 2:

In my opinion not recognizing the battery really isn't a Ubuntu problem but a Linux kernel problem. I also have it with openSuse 11.4 and kernel 3.1.0-rc5-1-vanilla. I have found out that the battery is detected when one of the following happens:

  1. Disconnect and connect the external power supply ("AC")
  2. Open the lid of the notebook.
  3. and the most weird: do as described above.

The static properties of the battery where detected but not shown in the /sys subdirectories because the dynamic properties (current voltage, current, load, load state), especially battery_present, where not detected and hence the battery information is removed from /sys by the kernel.

With Windows 7 the battery was immediately recognized.

It would be nice to inform the kernel developers of this ... but bugzilla.kernel.org now has been down for some time ...