View Full Version : Laptop Battery Charge Management
toad
Apr 13th 2010, 07:18 AM
Great write up!
fwiw - haven't experienced any of the above in Arch or Sidux on my T41.
And wildly off topic:
I'm trying to get my T41 to stop charging the battery automagically as it reaches 80%. Have you got any experience with that?
kubicle
Apr 13th 2010, 07:38 AM
fwiw - haven't experienced any of the above in Arch or Sidux on my T41.
My guess is this might be ubuntu specific, possibly related to some issues (and attempts to solve them) with hardware controlled vs. software controlled backlight (and other extra buttons).
And wildly off topic:
I'm trying to get my T41 to stop charging the battery automagically as it reaches 80%. Have you got any experience with that?
Not really, are you trying to increase battery life with such a setting?
toad
Apr 13th 2010, 07:46 AM
Yep, it is bad if batteries get charged to 100% and you keep charging them after that. I checked tp_smapi in thinkwiki and am told that the T41 is capable of a lower threshold but not an upper threshold. I am not trying to sort out a workaround but have not made any inroads yet :(
kubicle
Apr 13th 2010, 09:12 AM
Yep, it is bad if batteries get charged to 100% and you keep charging them after that. I checked tp_smapi in thinkwiki and am told that the T41 is capable of a lower threshold but not an upper threshold. I am not trying to sort out a workaround but have not made any inroads yet :(
We're getting seriously off-topic here :)
I was about to suggest tp_smapi, but also noticed it's not fully functional in T41s.
For what it's worth, I'm under the impression battery is not charged any further when it reaches "full" capacity...so I don't think it "keeps charging them after that".
I'm aware that it is recommended to keep battery charge in the mid ranges (and not at 100%) for maximum battery life, but in my experience (though I'm no expert on the subject) heat is just as big a factor in reducing battery life...so you just might be better off by removing the battery while on AC power (and storing it in a cool place). Li-ion batteries are usually fairly good in keeping their charge while stored. Even better if you yank it out while it's under 80% capacity.
toad
Apr 13th 2010, 09:24 AM
Okay, last post off topic...
Yanking it out is what I do, but it is a pain (call me lazy!) - so I am still looking for an automated, hands free, lazy friendly way of doing it :)
And thanks for hearing me out!
toad
Apr 13th 2010, 12:16 PM
Okay, REALLY last post off topic, but since you are a T41 owner you may be interested in it.
I've just finished editing the archwiki page which can be found here (http://wiki.archlinux.org/index.php/Tp_smapi). All the instructions are there.
Now I am no programmer, but if one could throw something up that would periodically check battery status and have line 1 kick in automatically when it reaches 80% and have line 2 kick in when it falls below 40% would be fantastorgasmic ;D
At the mo I've put an alias for each in my .bashrc but I'm sure one could knock up a little bash script to get full acpi functionality...
kubicle
Apr 13th 2010, 01:25 PM
Now I am no programmer, but if one could throw something up that would periodically check battery status and have line 1 kick in automatically when it reaches 80% and have line 2 kick in when it falls below 40% would be fantastorgasmic ;D
That's certainly doable. One could, for example, create a root cronjob to run every 5 mins that checks the battery status, compares it to set values and executes the commands as necessary.
Probably a ten liner or so, depending on how fancy you want to get.
There are several ways to read current battery charge% from a script, but I'd use cli programs like 'acpi' or 'acpitool' (installable from the repos) to show battery status.
You need some 'grep and cut' or 'awk'ing to store only the %-value to a variable than can be compared to your charge thresholds:
#Just an (ugly) example how to read the numerical % value into a variable, if there are more than one battery present, you'll need grep as well.
CURRENTCHARGE=$(acpitool -b | cut -d, -f2 | cut -d. -f1 | cut -b2-)
(you can try running 'acpitool -b | cut -d, -f2 | cut -d. -f1 | cut -b2-' to see that it returns the charge value)
kubicle
Apr 13th 2010, 02:10 PM
Here's a short "proof-of-concept" script:
#!/bin/bash
CURRENTCHARGE=$(acpitool -b | cut -d, -f2 | cut -d. -f1 | cut -b2-)
# The following command is for testing/debugging purposes, can be removed
echo "charge is $CURRENTCHARGE"
if [ x$CURRENTCHARGE == x ]; then
# The following command is for testing/debugging purposes, can be removed
echo "Cannot get a charge reading"
#Exit if cannot get battery charge reading, like when battery is removed
exit 0
fi
if [ $CURRENTCHARGE -gt 80 ]; then
#Replace the following line with the command you wish to run when charge is over 80%
echo "Charge is greater than 80%"
exit 0
fi
if [ $CURRENTCHARGE -lt 40 ]; then
#Replace the following line with the command you wish to run when charge is less than 40%
echo "Charge is less than 40%"
exit 0
fi
exit 0
Note that the script can only handle 1 battery "as it is"
If a moderator sees this, this battery discussion could be moved to a new topic
toad
Apr 13th 2010, 02:54 PM
kubicle - cool! Will try it in due course - MANY thanks and hope you find the info useful as well :)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.