Ubuntu

Battery state always "fully charged"

Reported by Jonas H on 2009-11-01
172
This bug affects 32 people
Affects Status Importance Assigned to Milestone
gnome-power
In Progress
Medium
upower (Ubuntu)
Medium
Unassigned
Nominated for Karmic by Lukas Kettenbach
Nominated for Lucid by Omer Akram

Bug Description

Binary package hint: gnome-power-manager

gnome-power-manager always detects my battery state as "fully charged" in karmic. (on 9.04 it detected the battery state correctly.) - this ends up in data loss because my machine does not perform any shutdown tasks when the it runs out of battery.

The output of acpi -V says:

$ acpi -V
Battery 0: Charging, 22%, rate information unavailable
Battery 0: design capacity 4000 mAh, last full capacity 2980 mAh = 74%
Adapter 0: on-line
Thermal 0: ok, 68.8 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 104.8 degrees C
Thermal 0: trip point 1 switches to mode passive at temperature 88.8 degrees C
Cooling 0: Processor 0 of 7

"Charging, 22%".

The output of devkit-power says:

$ devkit-power -d
Device: /org/freedesktop/DeviceKit/Power/devices/line_power_AC
  native-path: /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
  power supply: yes
  updated: Sat Oct 31 23:31:03 2009 (14629 seconds ago)
  has history: no
  has statistics: no
  line-power
    online: yes

Device: /org/freedesktop/DeviceKit/Power/devices/battery_BAT0
  native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
  vendor: NOTEBOOK
  model: BAT1
  serial: 0001
  power supply: yes
  updated: Sat Oct 31 23:31:03 2009 (14629 seconds ago)
  has history: yes
  has statistics: yes
  battery
    present: yes
    rechargeable: yes
    state: fully-charged
    energy: 32.184 Wh
    energy-empty: 0 Wh
    energy-full: 32.184 Wh
    energy-full-design: 43.2 Wh
    energy-rate: 0.0108 W
    percentage: 100%
    capacity: 74.5%
    technology: lithium-ion

Daemon:
  daemon-version: 011
  can-suspend: yes
  can-hibernate yes
  on-battery: no
  on-low-battery: no
  lid-is-closed: yes
  lid-is-present: yes

"fully-charged".

This might be a devkit-power-bug, though.

Onkar Shinde (onkarshinde) wrote :

I can confirm this on my iBook G4 laptop (powerpc). Following is output from devkit-power even when the AC plug is not connected.

Daemon:
  daemon-version: 011
  can-suspend: yes
  can-hibernate yes
  on-battery: no
  on-low-battery: no
  lid-is-closed: no
  lid-is-present: yes

Changed in gnome-power-manager (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Jonas H (jonash) wrote :

Btw, works for me since a few days ago. Don't know if there was a package update, though.

devicekit-power 011-1ubuntu1

Is my current version.

Adi Roiban (adiroiban) wrote :

devicekit-power-011-1ubuntu1 here on iBook G4 but devkit-power always reports on-battery: no

urbandk (evans33) wrote :

Same problem here. Battery reports as fully charged even when it's discharging.

Onkar Shinde (onkarshinde) wrote :

Please check my comment on bug #458004. You may need to load module pmu_battery.

Changed in gnome-power-manager (Ubuntu):
status: Confirmed → Fix Released
status: Fix Released → Confirmed
Omer Akram (om26er) wrote :

this problem exists in fully updated lucid, I tried the same on a fedora live cd and it shows the correct status, so not upstream issue i guess

Omer Akram (om26er) wrote :

Pleae fix this in Lucid.

Chris Coulson (chrisccoulson) wrote :

The information there suggests this is not a gnome-power-manager bug. It's either a upower or kernel issue

affects: gnome-power-manager (Ubuntu) → upower (Ubuntu)
Omer Akram (om26er) wrote :

This bug existed when ubuntu used devkit-power now it uses upower and its still there so now, as Chris said is it a kernel bug?

Omer Akram (om26er) wrote :

I have an upstream bug report for gnome-power-manager https://bugzilla.gnome.org/show_bug.cgi?id=611555

Omer Akram (om26er) on 2010-03-23
Changed in upower:
status: New → Invalid
Omer Akram (om26er) on 2010-04-05
affects: upower → gnome-power
Changed in gnome-power:
status: Invalid → New
importance: Undecided → Unknown
status: New → Unknown
Mikael Hjelm (j-m-hjelm) wrote :

Cold be, however i seem to get the indicator working if i add and remove the AC adapter.

Omer Akram (om26er) wrote :

if there is any type of info required please let me know.

Omer Akram (om26er) wrote :

$ sudo killall upowerd
$ sudo /usr/lib/upower/upowerd --verbose 2>&1 | tee /tmp/dkp.log

Updates my batter status.

Omer Akram (om26er) wrote :

dk-dump.txt

Omer Akram (om26er) wrote :

dkp.log

Changed in gnome-power:
status: Unknown → New

Warning: AFAIK this bug is only for the i386 or AMD64 architectures.

If you see a similar problem on a PowerPC computer (e.g. a PowerBook or an iBook G4) and it's fixed by running "sudo modprobe pmu_battery" then you are instead experiencing bug #552597 (<https://bugs.launchpad.net/bugs/552597>).

Changed in gnome-power:
importance: Unknown → Medium
Paul Crawford (psc-sat) wrote :

I am seeing something similar with Ubuntu 10.04 i386 on a Novatech Xplora E16 (AMD Dual Core TK42 1.6Ghz Processor) that I set up for my father. The 'Indicator Applet 0.3.7' has two problems relating to updates:

(1) The AC Adapter is not updated after boot-time, as it shows the boot up power's state, and the 'Refreshed' attribute shows a time comparable to uptime.

(2) The battery state, once charged, is only updated once it is charging again. But it shows the discharge state if it is booted on battery only. For example, once charged, if the AC power is turned off it still shows fully charged as the status until the AC power is restored, when it then shows the true charge and the updating status.

However, both states of the battery is correctly reported in /proc/acpi/battery/BAT0/state and if I try the command acpitool.

How is the Indicator Applet supposed to periodically update? Is it depending on BIOS interrupts, or has it a sleep() style timer that should check periodically?

My Toshiba A300 notebook with Ubuntu 10.04 suffers the same symptoms.
I'm still unable to cope with this problem for about 6 month.
Please, provide the soultion.

2010/9/26 Paul Crawford <email address hidden>

>
> ** Attachment added: "Example of acpitool -e when AC power is off"
>
> https://bugs.launchpad.net/ubuntu/+source/upower/+bug/467825/+attachment/1638796/+files/discharging.txt
>
> --
> Battery state always "fully charged"
> https://bugs.launchpad.net/bugs/467825
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Gnome Powermanager: New
> Status in “upower” package in Ubuntu: Confirmed
>
> Bug description:
> Binary package hint: gnome-power-manager
>
> gnome-power-manager always detects my battery state as "fully charged" in
> karmic. (on 9.04 it detected the battery state correctly.) - this ends up in
> data loss because my machine does not perform any shutdown tasks when the it
> runs out of battery.
>
> The output of acpi -V says:
>
> $ acpi -V
> Battery 0: Charging, 22%, rate information unavailable
> Battery 0: design capacity 4000 mAh, last full capacity 2980 mAh = 74%
> Adapter 0: on-line
> Thermal 0: ok, 68.8 degrees C
> Thermal 0: trip point 0 switches to mode critical at temperature 104.8
> degrees C
> Thermal 0: trip point 1 switches to mode passive at temperature 88.8
> degrees C
> Cooling 0: Processor 0 of 7
>
> "Charging, 22%".
>
> The output of devkit-power says:
>
> $ devkit-power -d
> Device: /org/freedesktop/DeviceKit/Power/devices/line_power_AC
> native-path:
> /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
> power supply: yes
> updated: Sat Oct 31 23:31:03 2009 (14629 seconds ago)
> has history: no
> has statistics: no
> line-power
> online: yes
>
> Device: /org/freedesktop/DeviceKit/Power/devices/battery_BAT0
> native-path:
> /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
> vendor: NOTEBOOK
> model: BAT1
> serial: 0001
> power supply: yes
> updated: Sat Oct 31 23:31:03 2009 (14629 seconds ago)
> has history: yes
> has statistics: yes
> battery
> present: yes
> rechargeable: yes
> state: fully-charged
> energy: 32.184 Wh
> energy-empty: 0 Wh
> energy-full: 32.184 Wh
> energy-full-design: 43.2 Wh
> energy-rate: 0.0108 W
> percentage: 100%
> capacity: 74.5%
> technology: lithium-ion
>
> Daemon:
> daemon-version: 011
> can-suspend: yes
> can-hibernate yes
> on-battery: no
> on-low-battery: no
> lid-is-closed: yes
> lid-is-present: yes
>
> "fully-charged".
>
> This might be a devkit-power-bug, though.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/gnome-power/+bug/467825/+subscribe
>
>

So, after a very long time search for solutions, I think this is a problem for almost ***Acer*** laptops. Hmm, hope Ubuntu dev team should consider this is a serious problem. It prevents your people to use Ubuntu on an Acer machine.

Omer Akram (om26er) wrote :

actually this bug is fixed in natty for me atleast. latest kernel might have solved the problem. i am not sure.

Paul Crawford (psc-sat) wrote :

Most recent 'normal' kernel updates for 10.04 have not fixed my father's Novatech Xplora E16 unfortunately. There is still no update of the indicator on state change, even though /proc shows the correct status.

Lubinda Maimbolwa (lubinda) wrote :

I have this problem with 10.10 on an hp dv3500ea, but noticed when i tried kubuntu 10.04 and 10.10 the lack of an ac is detected from a cold boot, so the problem is probably something to do directly with the gnome power manager as the kde one also uses upower, or just something specific to gnome, hope this gets fixed soon been an issue since 9.10 when i first noticed it.

Lubinda Maimbolwa (lubinda) wrote :

To clarify "first noticed" by that I dont mean thats the version of ubuntu when the problem began just that it was just during using 9.10 that I was in a situation that I allowed my laptop to discharge completely and I had just bought the laptop a month before 9.10 was released.

ehamberg (hamberg) wrote :

I see this problem with 10.10 on a Fujitsu Siemens Esprimo U9200. Gnome power manager always reports the battery as fully charged, not even a reboot without AC power corrects this.

This leads to the machine sudden dying when there is no power left instead of suspending. acpi -b reports the correct charge.

Lubinda Maimbolwa (lubinda) wrote :

Persists in 11.04 beta 2 . Is there no way to simply make your system recheck the AC status that could be put in something like a script? One that does something such as simulating adding and removing the ac cable, what I have to do to get it working now.

strk (strk) wrote :

Same problem on Clevo M722T (aka Syste76 Darter Ultra 3).
Tip in comment #13 fixes it for me as well (kill and restart upowerd).

It's a _very_ annoying bug as you can't safely work with cord unplugged.

Mikael Hjelm (j-m-hjelm) wrote :

If i am correct then the issue is that the upower updates the battery status a few times when the AC is disconnected,
this can be seen by running upower --monitor-detail . This seems to be meant to detect that the battery is discharging, if i am interpreting the code correctly.
However the status it reads when being polled is full, and stays so for a while, a few seconds on my computer (Acer aspire one).
So it does not detect that the battery is discharging when that happens.
Upower does not seem to have any periodical check of the status after that so if the first initial polls miss the discharging status then upower never detects that the battery is discharging.
Conceptually i would like to see a change in the logic such that if there are no power supplies connected then the battery state should be discharging rather than relying on the battery to report this. Alternativly a periodical battery poll with 5s intervals could be introduced.
Another option is to look into the driver for the battery and redo the logic for Full vs discharging logic there so that it reacts faster. With upower --monitor-detail i can see that the voltage drops which to me indicates discharge. I have not looked into the battery driver to see what the criterioin for the discharging logic is but i am guessing it is filtered to avoid false triggers.

Mikael Hjelm (j-m-hjelm) wrote :

Just to clarify that the way that i can see that the battery does not detect that it is discharging is by doing a
cat /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1/status

It reports Full for a few seconds after i have unplugged the cord.

Mikael Hjelm (j-m-hjelm) wrote :

in the function
up_device_supply_refresh_battery
in the file up-device-supply.c
there is a suspicious line
 /* only disable the polling if the kernel tells us we're fully charged,
    not if we've guessed the state to be fully charged */
 supply->priv->enable_poll = (state != UP_DEVICE_STATE_FULLY_CHARGED);

I feel that this disables the polling of the battery, this together with the delayed report that the battery is discharging could lead to the error we see but i do not know the code so i cannot be sure.
I also do not know how to build my own upowerd so that i can test this.

Mikael Hjelm (j-m-hjelm) wrote :

Another suggestion is to add the requirement that the disabling of the poll is only performed if the AC supply is present and charging.

Mikael Hjelm (j-m-hjelm) wrote :

Did an quick and dirty experiment and edited the source file myself and built the upower package and preliminary results are promising.
The gnome power manager now reacts after a while, i think the poll rate is 30s, when i unplug the AC power. Will run this for a while to see that it is not just a coincidence.

This is the line i edited.

diff src/linux/up-device-supply.c src/linux/up-device-supply.c~
549c549
< /* supply->priv->enable_poll = (state != UP_DEVICE_STATE_FULLY_CHARGED); */
---
> supply->priv->enable_poll = (state != UP_DEVICE_STATE_FULLY_CHARGED);

I commented out the whole line, it is perhaps not the grandest solution but it seems to work. I have not found any function to call to see if the computer has AC power so i cannot implement that.

Mikael Hjelm (j-m-hjelm) wrote :

Just to clarify the problems i have seen and what my test has fixed.

On the aspire one the charge is correctly reported from boot until the charge is full.
Then if you remove the powercord gnome power manager reports full charge until the battery dies.
This is due to the fact that upower stops polling the battery when the charge is full.
upower has a poll of the battery on changes in the ac supply but when the battery is fully charged it takes a while for it to start reporting that it is discharging so the automatic polls around ac power event does not catch this and it disables the polling of the battery.

restaring upowerd or plugging in the AC power will remedy this, provided the battery isn't full yet.

Omer Akram (om26er) wrote :

Mikael Hjelm, Could you please also enlighten upower upstream developers with your findings here: https://bugzilla.gnome.org/show_bug.cgi?id=611555

Mikael Hjelm (j-m-hjelm) wrote :

Have reported to the bugzilla but i think the error lies within upower.

As stated before the fix seems to remedy the issue that the battery status isn't updated at all and the gnome power manager reports this correctly. However when battery reaches critical there is no reaction from the gnome-power-manager.
Looking at the printout below i think this is due to the fact that the upower Daemon does not recognize that the computer runs on battery or that the battery is low. If someone that knows anything about the signalling could point out what upower is supposed to report to let gnome-power-manager react then i could try to debug it but the signalling between the processes feels like black art to me.

upower -d
Device: /org/freedesktop/UPower/devices/line_power_ACAD
  native-path: /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ACAD
  power supply: yes
  updated: Tue Jun 28 07:56:42 2011 (7 seconds ago)
  has history: no
  has statistics: no
  line-power
    online: no

Device: /org/freedesktop/UPower/devices/battery_BAT1
  native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1
  vendor: SIMPLO
  model: UM08A73
  serial: 00A3
  power supply: yes
  updated: Tue Jun 28 07:56:47 2011 (2 seconds ago)
  has history: yes
  has statistics: yes
  battery
    present: yes
    rechargeable: yes
    state: fully-charged
    energy: 0.9768 Wh
    energy-empty: 0 Wh
    energy-full: 12.6984 Wh
    energy-full-design: 24.42 Wh
    energy-rate: 10.3452 W
    voltage: 10.222 V
    percentage: 7.69231%
    capacity: 52%
    technology: lithium-ion
  History (charge):
    1309240600 7.692 charging
    1309240585 7.955 discharging
    1309240555 8.829 discharging
    1309240525 9.441 discharging
  History (rate):
    1309240600 10.345 charging
    1309240585 10.578 discharging
    1309240555 10.279 discharging
    1309240525 10.268 discharging

Daemon:
  daemon-version: 0.9.9
  can-suspend: no
  can-hibernate no
  on-battery: no
  on-low-battery: no
  lid-is-closed: no
  lid-is-present: no
  is-docked: no

Mikael Hjelm (j-m-hjelm) wrote :

Or if someone with a functioning system could run the computer until the battery level is below 10% and paste the result of upower -d here.

Paul Crawford (psc-sat) wrote :

Thanks Mikael for your effort. I can't test this just now (as it is my father's laptop) but next time I am through I can try some of your suggestions.

Mikael Hjelm (j-m-hjelm) wrote :

Running upowerd with verbose revealed that the printout of upower -d was not correct so please ignore that statement, although I think that could be a bug in it self.
Have to sleep now but I will check what upowerd --verbose says when battery goes to critical tomorrow.

Mikael Hjelm (j-m-hjelm) wrote :

Ok so the Upower seems to do its job right now, with the changes in #32.
The messages on DBUS is accurate.
Now i only need to get gnome-power-manager to shut down when i reach critical, it responds correctly with its graphical symbols but newer shuts down.

I have disabled use_time_for_policy in the gconf-editor to see if it will react on percentages.
I have also increased the critical and action percentage a bit to see if that alllows it to shut down in a proper manner.
Doesn't work.
I'll see if there is a bug report on that behaviour.

Mikael Hjelm (j-m-hjelm) wrote :

Ok so the powerdown works with the original upower if the battery charge is detected.
I consider commenting out the line as i did in #32 solves this issue.

It would be great if anyone could help me in how to buld the upower package so that it fits within ubuntu and the connection to gnome-power-manager works.

I have done
sudo apt-get source upower
sudo apt-get build-deps upower

sudo ./configure
sudo make
sudo checkinstall

The thing is that checkinstall fails and i have to create a number of directories to make it work and i do not think i should have to do that manually if everything is correct.

Paul Crawford (psc-sat) wrote :

Good luck with that Mikael, but I don't hold out much hope.

I tried to fix something in the clock applet, reported the lack of make/install working as Bug #596869 and was eventually told to "try moving that discussion to the answer tracker or some user mailinglist" which I did, and got absolutely no help at all :(

Omer Akram (om26er) wrote :

i recommend you try

./configure and make without sudo

On Mon, Jul 11, 2011 at 4:29 PM, Paul Crawford
<email address hidden> wrote:
> Good luck with that Mikael, but I don't hold out much hope.
>
> I tried to fix something in the clock applet, reported the lack of
> make/install working as Bug #596869 and was eventually told to "try
> moving that discussion to the answer tracker or some user mailinglist"
> which I did, and got absolutely no help at all :(
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/467825
>
> Title:
>  Battery state always "fully charged"
>
> Status in Gnome Powermanager:
>  New
> Status in “upower” package in Ubuntu:
>  Confirmed
>
> Bug description:
>  Binary package hint: gnome-power-manager
>
>  gnome-power-manager always detects my battery state as "fully charged"
>  in karmic. (on 9.04 it detected the battery state correctly.) - this
>  ends up in data loss because my machine does not perform any shutdown
>  tasks when the it runs out of battery.
>
>  The output of acpi -V says:
>
>  $ acpi -V
>  Battery 0: Charging, 22%, rate information unavailable
>  Battery 0: design capacity 4000 mAh, last full capacity 2980 mAh = 74%
>  Adapter 0: on-line
>  Thermal 0: ok, 68.8 degrees C
>  Thermal 0: trip point 0 switches to mode critical at temperature 104.8 degrees C
>  Thermal 0: trip point 1 switches to mode passive at temperature 88.8 degrees C
>  Cooling 0: Processor 0 of 7
>
>  "Charging, 22%".
>
>  The output of devkit-power says:
>
>  $ devkit-power -d
>  Device: /org/freedesktop/DeviceKit/Power/devices/line_power_AC
>    native-path:          /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
>    power supply:         yes
>    updated:              Sat Oct 31 23:31:03 2009 (14629 seconds ago)
>    has history:          no
>    has statistics:       no
>    line-power
>      online:             yes
>
>  Device: /org/freedesktop/DeviceKit/Power/devices/battery_BAT0
>    native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
>    vendor:               NOTEBOOK
>    model:                BAT1
>    serial:               0001
>    power supply:         yes
>    updated:              Sat Oct 31 23:31:03 2009 (14629 seconds ago)
>    has history:          yes
>    has statistics:       yes
>    battery
>      present:             yes
>      rechargeable:        yes
>      state:               fully-charged
>      energy:              32.184 Wh
>      energy-empty:        0 Wh
>      energy-full:         32.184 Wh
>      energy-full-design:  43.2 Wh
>      energy-rate:         0.0108 W
>      percentage:          100%
>      capacity:            74.5%
>      technology:          lithium-ion
>
>  Daemon:
>    daemon-version:  011
>    can-suspend:     yes
>    can-hibernate    yes
>    on-battery:      no
>    on-low-battery:  no
>    lid-is-closed:   yes
>    lid-is-present:   yes
>
>  "fully-charged".
>
>  This might be a devkit-power-bug, though.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gnome-power/+bug/467825/+subscriptions
>

Mikael Hjelm (j-m-hjelm) wrote :

Omer,
I would if it wasn't the case that when i do
sudo apt-get source upower
The whole tree is owned by root so I cannot do configure and make without sudo.

Omer Akram (om26er) wrote :

no need for sudo
apt-get source upower would do it

On Wed, Jul 13, 2011 at 11:15 PM, Mikael Hjelm
<email address hidden> wrote:
> Omer,
> I would if it wasn't the case that when i do
> sudo apt-get source upower
> The whole tree is owned by root so I cannot  do configure and make without sudo.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/467825
>
> Title:
>  Battery state always "fully charged"
>
> Status in Gnome Powermanager:
>  New
> Status in “upower” package in Ubuntu:
>  Confirmed
>
> Bug description:
>  Binary package hint: gnome-power-manager
>
>  gnome-power-manager always detects my battery state as "fully charged"
>  in karmic. (on 9.04 it detected the battery state correctly.) - this
>  ends up in data loss because my machine does not perform any shutdown
>  tasks when the it runs out of battery.
>
>  The output of acpi -V says:
>
>  $ acpi -V
>  Battery 0: Charging, 22%, rate information unavailable
>  Battery 0: design capacity 4000 mAh, last full capacity 2980 mAh = 74%
>  Adapter 0: on-line
>  Thermal 0: ok, 68.8 degrees C
>  Thermal 0: trip point 0 switches to mode critical at temperature 104.8 degrees C
>  Thermal 0: trip point 1 switches to mode passive at temperature 88.8 degrees C
>  Cooling 0: Processor 0 of 7
>
>  "Charging, 22%".
>
>  The output of devkit-power says:
>
>  $ devkit-power -d
>  Device: /org/freedesktop/DeviceKit/Power/devices/line_power_AC
>    native-path:          /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
>    power supply:         yes
>    updated:              Sat Oct 31 23:31:03 2009 (14629 seconds ago)
>    has history:          no
>    has statistics:       no
>    line-power
>      online:             yes
>
>  Device: /org/freedesktop/DeviceKit/Power/devices/battery_BAT0
>    native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
>    vendor:               NOTEBOOK
>    model:                BAT1
>    serial:               0001
>    power supply:         yes
>    updated:              Sat Oct 31 23:31:03 2009 (14629 seconds ago)
>    has history:          yes
>    has statistics:       yes
>    battery
>      present:             yes
>      rechargeable:        yes
>      state:               fully-charged
>      energy:              32.184 Wh
>      energy-empty:        0 Wh
>      energy-full:         32.184 Wh
>      energy-full-design:  43.2 Wh
>      energy-rate:         0.0108 W
>      percentage:          100%
>      capacity:            74.5%
>      technology:          lithium-ion
>
>  Daemon:
>    daemon-version:  011
>    can-suspend:     yes
>    can-hibernate    yes
>    on-battery:      no
>    on-low-battery:  no
>    lid-is-closed:   yes
>    lid-is-present:   yes
>
>  "fully-charged".
>
>  This might be a devkit-power-bug, though.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gnome-power/+bug/467825/+subscriptions
>

Paul Crawford (psc-sat) wrote :

You need 'sudo' for installing the build dependencies, such as:

$ sudo apt-get build-dep upower

But not for getting the source tree, as this is sufficient:

$ apt-get source upower

If you used sudo for that, the source files and their directories it will be owned by the root user. To change this use:

sudo chown -R mikael:mikael upower-0.9.1

Assuming your user name on this system is 'mikael' and you are in the directory you downloaded the source tree to.

To install, normally you need once again to use something like:

$ sudo make install

However, there is a whole world of special building environment/tools that have been created that may be needed by software developers who, it seem, have too much time on their hands and are not satisfied with 'make install' doing some copying :(

Finally a warning! Be very careful with chown/chgrp/chmod and the possibility you can recurs to an unexpected place (e.g. don't use '.*' or similar as that will include '..' which then goes up a level and -R takes you down all directors that are parallel to your current one).

Mikael Hjelm (j-m-hjelm) wrote :

Ok so no i have figured out how to build upower properly, now it shuts down properly and warns when it should.

sudo apt-get build-dep upower
apt-get source upower
cd upower-......
./configure --prefix=/usr --sysconfdir=/etc --libdir=/var/lib --localstatedir=/var
make
sudo checkinstall

I avoid using make install since it borked upower for me so bad i had to reinstall ubuntu, there was no indication of a battery available at all.

Tried reporting this back to the devkit-devel mauling list which handles upower but the reply i got was that i should try to fix the bug instead.

My response is that it would be either the driver or the BIOS/hardware that is broken and i cannot fix either.
I and content with upower as i run it with the removed line.
The only issue i have is that upower updates as soon as there is any update of ubuntu. Not sure what else i can do to fix this.

Mikael Hjelm (j-m-hjelm) wrote :

To be specific the configure line became word wrapped so the end of the line shall be.
--localstatedir=/var

Omer Akram (om26er) wrote :

Mikael, Could you provide me with a patch with your fix/workaround. I'd be happy to upload that to a ppa for testing.

Mikael Hjelm (j-m-hjelm) wrote :

Ok so finally i have created a patch, wasn't too hard.

Will add changelog too.

Mikael Hjelm (j-m-hjelm) wrote :

Suggested changelog

Omer Akram (om26er) wrote :
Download full text (3.1 KiB)

i have uploaded upower with your patch to my ppa
https://launchpad.net/~om26er/+archive/test it will take a few hours
to build as launchpad builders are quite busy. Anyone facing the issue
plz test it and report if it fixes the issue. Its only packaged for
Ubuntu 11.04 for now

On Wed, Aug 3, 2011 at 1:48 AM, Mikael Hjelm <email address hidden> wrote:
> Suggested changelog
>
> ** Attachment added: "Changelog"
>   https://bugs.launchpad.net/ubuntu/+source/upower/+bug/467825/+attachment/2250248/+files/changelog
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/467825
>
> Title:
>  Battery state always "fully charged"
>
> Status in Gnome Powermanager:
>  New
> Status in “upower” package in Ubuntu:
>  Confirmed
>
> Bug description:
>  Binary package hint: gnome-power-manager
>
>  gnome-power-manager always detects my battery state as "fully charged"
>  in karmic. (on 9.04 it detected the battery state correctly.) - this
>  ends up in data loss because my machine does not perform any shutdown
>  tasks when the it runs out of battery.
>
>  The output of acpi -V says:
>
>  $ acpi -V
>  Battery 0: Charging, 22%, rate information unavailable
>  Battery 0: design capacity 4000 mAh, last full capacity 2980 mAh = 74%
>  Adapter 0: on-line
>  Thermal 0: ok, 68.8 degrees C
>  Thermal 0: trip point 0 switches to mode critical at temperature 104.8 degrees C
>  Thermal 0: trip point 1 switches to mode passive at temperature 88.8 degrees C
>  Cooling 0: Processor 0 of 7
>
>  "Charging, 22%".
>
>  The output of devkit-power says:
>
>  $ devkit-power -d
>  Device: /org/freedesktop/DeviceKit/Power/devices/line_power_AC
>    native-path:          /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
>    power supply:         yes
>    updated:              Sat Oct 31 23:31:03 2009 (14629 seconds ago)
>    has history:          no
>    has statistics:       no
>    line-power
>      online:             yes
>
>  Device: /org/freedesktop/DeviceKit/Power/devices/battery_BAT0
>    native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
>    vendor:               NOTEBOOK
>    model:                BAT1
>    serial:               0001
>    power supply:         yes
>    updated:              Sat Oct 31 23:31:03 2009 (14629 seconds ago)
>    has history:          yes
>    has statistics:       yes
>    battery
>      present:             yes
>      rechargeable:        yes
>      state:               fully-charged
>      energy:              32.184 Wh
>      energy-empty:        0 Wh
>      energy-full:         32.184 Wh
>      energy-full-design:  43.2 Wh
>      energy-rate:         0.0108 W
>      percentage:          100%
>      capacity:            74.5%
>      technology:          lithium-ion
>
>  Daemon:
>    daemon-version:  011
>    can-suspend:     yes
>    can-hibernate    yes
>    on-battery:      no
>    on-low-battery:  no
>    lid-is-closed:   yes
>    lid-is-present:   yes
>
>  "fully-charged".
>
>  This might be a devkit-power-bug, though.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gnome-power/+bug/467...

Read more...

tags: added: patch
Mikael Hjelm (j-m-hjelm) wrote :

Seems to work for me. However since i have compiled it myself before it might be my compiled version installed, do not think so an synaptic says that the 0.9.9-4ubuntu1~mikaelfix1 is the version installed but safest if anyone else tests.

Mikael Hjelm (j-m-hjelm) wrote :

This is a patch for 10.04 0.9.1 upower version.

Mikael Hjelm (j-m-hjelm) wrote :

I am kind of curious that no one else has this issue anymore. Am i the only one left?

Paul Crawford (psc-sat) wrote :

I don't know, as I have to tried my father's laptop recently or attempted to use your patch.

Will let you know when I do.

Changed in gnome-power:
status: New → In Progress
Kevin Claypool (socioteq) wrote :

I wanted to throw in my two cents on this one. I am having the same problem with 12.04, but there isn't a PPA for the patch fix, so I've been stuck at 86% on my brand new battery. I had a feeling this issue didn't have to do with ACPI. Is there any way someone could get a patch worked up for 12.04? It would help me out so much. This laptop is my daily driver at my clinicals this summer, and being able to make my battery last is very important to me. Thanks - K

bp0 (bullet-proof-0) wrote :

This bug appeared for me when I upgraded to 13.04 (raring). The procedure in comment #13 works, but it would be nice to have a proper fix.

Thorsten Goetzke (th-goetzke) wrote :

Same here, i need to restart upowerd to get the correct charge status on my laptop.
My upower version is
0.9.22-1ubuntu2 i386

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.