23

My Asus EEE netbook performs a hard shutdown when it reaches low battery power, without giving any warning - i.e. the power just goes off, without any shutdown process. I can't find anything in the syslog, and no error messages are printed before it happens. I've had this problem on previous (K)Ubuntu versions, and hoped updating to Ubuntu Precise would help resolve the issue, but it hasn't.

The option in the Power application for "when power is critically low" is currently blank - the only options are a (grayed-out) hibernate and "Power off".

I have re-installed indicator-power to no effect. The time remaining reported by acpi is unstable, as is the time remaining reported by gnome-power-statistics. (For example, running acpi twice in succession, I got 2h16min, and then 3h21min remaining. These sorts of jumps in the remaining time are also in the gnome-power-statistics graphs.)

It might be possible to write a script to give me advance warning (as per @RanRag's comment below), but I would prefer to isolate why I don't get a critical battery notification from the system before this happens, so that I can take action as appropriate (suspend/shutdown/plug in power) when I get a notification.

Some additional information on the battery:

kroon@minia:~$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/PNP0C0A:00/power_supply/BAT0
  vendor:               ASUS
  model:                1005P
  power supply:         yes
  updated:              Fri Aug 17 07:31:23 2012 (9 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    energy:              33.966 Wh
    energy-empty:        0 Wh
    energy-full:         34.9272 Wh
    energy-full-design:  47.52 Wh
    energy-rate:         3.7692 W
    voltage:             12.61 V
    time to full:        15.3 minutes
    percentage:          97.248%
    capacity:            73.5%
    technology:          lithium-ion
  History (charge):
    1345181483  97.248  charging
    1345181453  97.155  charging
    1345181423  97.062  charging
    1345181393  96.970  charging
  History (rate):
    1345181483  3.769   charging
    1345181453  3.899   charging
    1345181423  4.061   charging
    1345181393  4.201   charging

kroon@minia:~$ cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          ok
charging state:          charging
present rate:            332 mA
remaining capacity:      3149 mAh
present voltage:         12612 mV
kroon@minia:~$ cat /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         4400 mAh
last full capacity:      3209 mAh
battery technology:      rechargeable
design voltage:          10800 mV
design capacity warning: 10 mAh
design capacity low:     5 mAh
cycle count:              0
capacity granularity 1:  44 mAh
capacity granularity 2:  44 mAh
model number:            1005P
serial number:            
battery type:            LION
OEM info:                ASUS
4
  • 3
    @SteveKroon: You can create a small bash script for yourself which runs in background. The pseudo code will be something like if battery_status < 10% than notify-send "battery low" and put my system to suspended state(sudo pm-suspend). To get your battery status take a look at this post and than use sed/awk/cut tools to extract the required info.
    – RanRag
    Aug 15, 2012 at 8:16
  • I had this problem once on an old laptop which I had to boot with the acpi=off option. Maybe some ACPI problem could also be blamed in your case.
    – Christoph
    Aug 20, 2012 at 12:14
  • @Christoph When I boot with acpi=off, my battery power indicator disappears, gnome-power-statistics doesn't show the battery, and the upower instruction above fails with an error message failed to set path: cannot refresh: Cannot get device properties for /org/freedesktop/UPower/devices/battery_BAT0: Couldn't call GetAll() to get properties for /org/freedesktop/UPower/devices/battery_BAT0: Method "GetAll" with signature "s" on interface "org.freedesktop.DBus.Properties" doesn't exist Sep 4, 2012 at 17:40
  • @RanRag See askubuntu.com/questions/603285/… for a working example of this pseudo-code...
    – landroni
    Mar 31, 2015 at 15:22

5 Answers 5

19
+100

When a battery reaches to the point of time to take critical action taking level , Ubuntu won't warn you about this, instead it just perform the action required (such as suspend, hibernate, shutdown etc, based on your choice). This is the setting and it can't be changed. But Ubuntu should give you a warning, when battery reach low level and critical level.

By default, Ubuntu uses time remaining as a trigger of it's pre-defined action.

  • You will be given a low battery warning, before 1200 seconds (20 minutes) to be empty.
  • You will be given a critical battery warning, when it reaches 300 seconds (5 minutes) remaining
  • Battery critical action is performed when only 120 seconds (2 minutes) remaining.

The power statistics from your output suggests a bad/damaged battery. In these cases, it is hard for Ubuntu to measure actual time remaining data. Also the battery drains quickly between from 300 seconds to 120 seconds, so just try to shut down the PC which is configured in the settings.

I suggest you to do this,

  • First change the policy of trigger from time to percentage.

    gsettings set org.gnome.settings-daemon.plugins.power use-time-for-policy false
    
  • Then raise the percentage required to give you a warning, the default is 10%. Change it to 30%.

    gsettings set org.gnome.settings-daemon.plugins.power percentage-low 30
    
  • Then raise the percentage required to be considered as critical to 20%, default is 3%.

    gsettings set org.gnome.settings-daemon.plugins.power percentage-critical 20
    
  • Then raise the percentage required to take the critical action, it is now 2%. change it to 15%

    gsettings set org.gnome.settings-daemon.plugins.power percentage-action 15
    
  • Then change the critical action to be taken to hibernate, instead of shutdown. You need to first enable the hibernate option.

    Then use this command to change it to hibernate.

    gsettings set org.gnome.settings-daemon.plugins.power critical-battery-action hibernate
    

I think, this should solve your problem. If you still have problems with level, raise the levels even higher.

6
  • I did the above with low power at 70%, critical at 50%, and action at 30%, with critical action set to interactive. I took it off mains power (showed about 2h30 of battery time) and used it until it hard shut-down on me (at about 0h30 min remaining time this time). No warnings on low or critical level appeared at all. Sep 15, 2012 at 14:25
  • @SteveKroon have you changed the policy from time to percentage? I'm asking this because it worked for me
    – Anwar
    Sep 15, 2012 at 14:29
  • yes, I changed the time to percentage. Extra information: after I started the machine up again, and worked on it off battery now, I got the critical battery notification this time. Still waiting to see what happens when the battery gets even lower... Sep 15, 2012 at 17:36
  • @SteveKroon If you get the critical battery notification I think it is working. The notification system's job is notify you. But, if battery drains so quickly, then critical battery action may not be performed. But, I hope this will work and you can get the hibernation.
    – Anwar
    Sep 15, 2012 at 17:49
  • The critical battery action was also performed yesterday. Weird that it didn't do it the previous time... (Also, I tried this earlier based on another answer, and it didn't work then...) Sep 17, 2012 at 5:54
10
+50

Try using percentage instead of time based notifications. This helped fix a similar issue on my Asus Eee PC 1000.

See the following post: How to change critically low battery value?

The important point in my case was changing the 'use-time-for-policy' option to false.

I also found this post, which suggests the same fix:

http://ubuntuforums.org/showpost.php?p=11377274&postcount=6

1
  • Unfortunately, this still didn't help - I still don't get low battery notifications, and the machine still hard shutdowns without warning.... Aug 26, 2012 at 16:00
4

The personnel implementing power management in 12.04 did not do it correctly.

Power management is fully functional in all aspects in Ubuntu 10.04.

The volume of anecdotal information on the net about the issue of critical battery function provides no real insight or explanation as to WHY there is this systemic failure of power management in 12.04.

Obtaining correct power parameter values and with the proper metrics is fundamental to proper power management.

These metrics are "wonky" in 12.04 but accurate in 10.04.

Regardless, on critical low battery the system will suspend correctly in 10.04.

12.04 does not correctly suspend (or hibernate) using either:

gsettings set  org.gnome.settings-daemon.plugins.power   use-time-for-policy    false

or:

gsettings set  org.gnome.settings-daemon.plugins.power   use-time-for-policy     true

with

gsettings set  org.gnome.settings-daemon.plugins.power   percentage-low           20
gsettings set  org.gnome.settings-daemon.plugins.power   percentage-critical      10
gsettings set  org.gnome.settings-daemon.plugins.power   percentage-action         5
gsettings set  org.gnome.settings-daemon.plugins.power   time-low                2400
gsettings set  org.gnome.settings-daemon.plugins.power   time-critical           1200
gsettings set  org.gnome.settings-daemon.plugins.power   time-action              600
gsettings set  org.gnome.settings-daemon.plugins.power   critical-battery-action suspend

The percentages 20, 10, 5 are excessive. The equivalent times are 40, 20 and 10 minutes. (my battery performance is 100% ~ 3.5 hrs. > 200 mins. or 12000 secs.) For 10.04 the effective settings are equivalent to the %'s 8, 5 and 3. Even with 3% battery capacity the machine can stay in suspension for at least 12 hours before the battery is drained.

The real issue seems to be that the hardware ACPI interfacing metrics used in 12.04 are incorrectly programmed. This is seen with "wonky" times when booting 12,04 with a half dead battery. The capacity metrics are all over the place as either incorrect time remaining or % left. Rebooting into 10.04 the battery metrics are quiescent and stable with "reasonable" values.

Notes:

  • The following, invoked manually in 12.04 are both functional:

    pm-hibernate
    pm-suspend

  • It is the power management implementation of the ACPI battery metrics to trigger their automatic invocation that is faulty in 12.04.

  • The 12.04 power manager indicator (version?) and power & brightness and lock settings interface do not accurately reflect the org.gnome.settings-daemon.plugins.power values above. Interfacing, not only to hardware but also to soft tissue is faulty.

3

Please post the output of the following commands, by typing them in a console:

upower -i /org/freedesktop/UPower/devices/battery_BAT0

cat /proc/acpi/battery/BAT0/state

cat /proc/acpi/battery/BAT0/info

Also you can try reinstalling the battery applet:

sudo apt-get purge indicator-power

sudo apt-get install indicator-power

And if you want a more detailed Battery Status Indicator:

sudo add-apt-repository ppa:iaz/battery-status && sudo apt-get update sudo apt-get install battery-status

1
  • I've updated the post with this info, and re-installed the battery applet. Aug 27, 2012 at 6:40
-1

It seems that it considers this a “critically low voltage”.

Rather than run until it just dies, At some voltage, your laptop decides to give up. To Take its remaining energy and gracefully shut down.

Click on the battery meter on taskbar & click more power option. On your current power plan click change plan settings. Click on Change Advance power Settings. Scroll to botton and click the + sign of the battery, a list will appear at bottom. Click on low battery level and change the following setting: on battery to: 40 % (if ur system shut downs at 30% this will warn you battery low at 40%)

now click on Critical battery level and change the setting to 35%.

now click on critical battery action and change the setting to hibernate.

This will hibernate you system before the battery is over and prevent it from sudden shutdown. If possible set the battery %age to little more less as the sudden shutdowns differs everytime.

Charge to 100% then let it work until it dies then recharge. If same thing happens, buy a new battery

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .