Battery Management Software issues
-
TSMR - 11 November 2004
ioreg no longer returns a useful value for "Amperage" in all cases. (This started happening long before 10.3.6)
It may return something like 18446744073709551208 when plugged in. While it is debatable what should be returned, that is not one of the more reasonable answers. :-)
I can think of --
* what the computer is consuming
* what the battery is soaking up (when charging)Right now my battery is charging, and while ioreg returns that highish value above, Xbattery displays "Amperage: 360"
That definitely is the charging current.
I wonder how it gets it?Perhaps it guesses it by integrating "charge" over time
In 1 minute, battery charge content ("Current") rises by 6mAh, (from 992mAh to 998mAh) so that amounts to 360mA.
Anyone here *know*?
If anyone is interested --
/usr/sbin/ioreg -p IODeviceTree -n battery -w 0 | grep IOBatteryInfo
gives you the battery status.
I think that the only reliable part is the Voltage.
The rest is guesswork, based mostly on the value
of "Capacity" which is what calibration is supposed to estimate.The following shell script may be useful in monitoring what's happening with your battery during calibration:
bat.sh ## contents may settle during shipment ##
#! /bin/sh
# bat.sh ## monitor battery while discharging or charging ## Peter RenzlandMINUTES=0
while :
do
echo -n " $MINUTES "
set -- ` /usr/sbin/ioreg -p IODeviceTree -n battery -w 0 \grep IOBatteryInfo | tr '[\"\=\(\{\)\}\,]' ' ' `
shift 4
while :
do
echo -n "$1: $2 "
shift 2
case $# in 0) break;; esac
done
date "+ %H:%M:%S"
sleep 60
MINUTES=`expr $MINUTES + 1`
done-- Peter
Download Power Manager and start saving.