You are not logged in.
Pages: 1
Hello all,
I wondered, (being the sort of person that regularly rebuilds his laptop,) when calibrating the potential time left in a laptop battery it is advised to let the battery run flat so that the hardware knows more precisely when the battery will run out in future - my question is where is this information stored? Is there memory storage within the battery pack, laptop or upon the HDD? I.e: upon a rebuild is this information lost?
Many thanks for scratching this itch!
Frazer
Last edited by frazer (2014-03-01 15:08:09)
Offline
Hi
Just found this: https://bbs.archlinux.org/viewtopic.php?id=154857
So I would say battery firmware. Would mean no, not lost.
Also see e.g. the PDF that comes on second place for google "laptop battery information firmware", looks neat (Edit: Title: "Battery Firmware Hacking")
.
(Can't link it here cause it's too much PITA to get a PDF URL from gooo...
(Edit: Oh, thanks anonymous_user, see below!) !)
Cheers
Last edited by rebootl (2014-02-13 16:29:47)
Personal website: reboot.li
GitHub: github.com/rebootl
Offline
Offline
You're just jealous because the voices only talk to me.
Offline
Thanks very much everyone!
Mmmm - 'smart' battery hacking? I have enough to worry me already...
I still have the 'complete discharge, then charge, occasionally' pattern burnt into my brain. I've tried, but I can't seem to get it out of there?!?
Offline
Hi all,
Thank you very much for all the info - I feel a bit of a twit to ask, but could somebody please tell me how to close this post as answered?
I'm glad I posted on Newbie Corner...
Offline
Edit your first post and add [SOLVED] to the title. Regards
Personal website: reboot.li
GitHub: github.com/rebootl
Offline
A web more:
http://batteryuniversity.com/
Because not all of us are native English speakers, try no to use slang or abbreviations, thank you.
Offline
Thank you very much.
Offline
General-purpose tips: http://www.reddit.com/r/askscience/comm … laptop_to/ .
Now he does have more than enough material to cover.
Offline
Ah, (one more), here's I little script I wrote once to monitor my battery status:
#!/bin/bash
#
# Shell script to check battery status and perform a shutdown
# or another action at a critical low battery status
#
### Check if on ac power and exit if yes
if grep -q 1 /sys/class/power_supply/AC/online; then
exit 0
fi
## Debug print
#echo "On Battery"
### Get the battery values
ENERGY_FULL_DESIGN=`cat /sys/class/power_supply/BAT0/energy_full_design`
ENERGY_FULL_LAST=`cat /sys/class/power_supply/BAT0/energy_full`
ENERGY_NOW=`cat /sys/class/power_supply/BAT0/energy_now`
### Set low and critical values in percent
ENERGY_LOW_PRC="20"
ENERGY_CRITICAL_PRC="10"
### Calculate current energy values in percent
# (using ENERGY_FULL_DESIGN to eventually get more accurrate values)
ENERGY_NOW_PRC=$((ENERGY_NOW*100/ENERGY_FULL_DESIGN))
## Debug prints
#echo $ENERGY_NOW_PRC
## Debug setting
#ENERGY_NOW_PRC=9
### Perform the checks and take actions
if [ $ENERGY_NOW_PRC -le $ENERGY_LOW_PRC ] && [ $ENERGY_NOW_PRC -gt $ENERGY_CRITICAL_PRC ]
then
# send a warning to all terminals (login) and the X server (using xmessage)
wall <<HERE
Warning: Battery low ! Remaining power at $ENERGY_NOW_PRC%
Will perform auto-shutdown at $ENERGY_CRITICAL_PRC%
HERE
echo -e "Warning: Battery low ! (Remaining power at $ENERGY_NOW_PRC%)\nWill perform auto-shutdown at $ENERGY_CRITICAL_PRC%." | xmessage -file -
# log event
logger "Battery low warning triggered by ACPI, warning sent to login terminals and X..."
fi
if [ $ENERGY_NOW_PRC -le $ENERGY_CRITICAL_PRC ]
then
# initiate timed shutdown in one minute
shutdown -h +1 &
# send message to X
echo -e "Battery reached critical energy level, shutdown initiated !\nSystem will go DOWN in one minute.\nUse shutdown -c to cancel." | xmessage -file -
# log event
logger "Battery critical triggered by ACPI, shutdown initiated in one minute..."
fiNote that I used /sys/class/power_supply/BAT0/energy_full_design as 100%. This is the design value of the battery. I would say it doesn't change, even w/ a calibration.
So when using this value you always get the "real" amount of loading. This is what i3-wm does in it's status bar as well.
Regards
Edit: The script does look for /sys/class/power_supply/BAT0/energy_full but it's not used.
If I'm right you wouldn't have to worry about calibration at all.
Last edited by rebootl (2014-03-02 12:21:56)
Personal website: reboot.li
GitHub: github.com/rebootl
Offline
Pages: 1