Subscribe to our RSS news feed
AAPL 199.94 (-1.25)

21 Pages V   1 2 3 > »   
Reply to this topic Start new topic
AppleACPIBatteryManager for Tiger and Leopard, (UPDATE: 10/25/2008) Showing battery meter on your notebook
******
  • Group: Members
  • Posts: 400
  • Joined: 5-December 07
  • Member No.: 160,019
Hi guys,

Here is the beta AppleACPIBatteryManager I have been working on. It will work with original PowerManagement and you don't need AppleACPIPowerSource. Although some values may have "0" value, it should display "Time" and "Percentage" but I am not sue if it is accurate or not. Also, "Power source" should detect correctly and icon should change correctly. If you are using the notebook, you can give it a try.

It is based on original AppleSmartBatteryManager and linux driver. It should work both on Tiger and Leopard. (I used Tiger to compile the source code and it work on my 10.4.11 and 10.5.4)

Again, it is just the beta version and you need the original PowerManagement with it. Make sure that you don't have AppleACPIPowerSource Installed or it will cause error.

Chun-Nan

=====
Battery Information:

Model Information:
Serial Number: TOSHIBA-PA3399U -Li-Ion-3658Q
Manufacturer: TOSHIBA
Device name: PA3399U
Pack Lot Code: 0000
PCB Lot Code: 0000
Firmware Version: 0000
Hardware Revision: 0000
Cell Revision: 0000
Charge Information:
Charge remaining (mAh): 4400
Fully charged: Yes
Charging: No
Full charge capacity (mAh): 4400
Health Information:
Cycle count: 1
Condition: Good
Battery Installed: Yes
Amperage (mA): 0
Voltage (mV): 11100

=====
Attached File  PowerManagement.original.zip ( 224.78K ) Number of downloads: 4357
(only English)
=====
Update: 7/6/2008
1. Using "fCurrentVoltage" to FAKE "fCurrentRate" if "fCurrentRate" is read as 0.

Attached File  AppleACPIBatteryManager.zip ( 182.06K ) Number of downloads: 248


UPDATE: 7/7/2008
1. Using "fMaxCapacity" to FAKE "fCurrentRate" if "fCurrentRate" is read as 0.
2. Change battery dectection funcion. (battery inserted and removed)
2. Change poll time from 10 seconds to 30 seconds

Attached File  AppleACPIBatteryManagerb2.zip ( 206.74K ) Number of downloads: 104


UPDATE: 7/9/2008
1. Make sure "fMaxCapacity" is always equal to or larger than "fCurrentCapacity".

Attached File  AppleACPIBatteryManager_b3.zip ( 509.08K ) Number of downloads: 81


UPDATE: 7/10/2008
1. Added "Battery Information" and "Battery Status" so that it will show on ioreg.
2. Using "fMaxCapacity" to caculate remaning time while battery is charging.

Attached File  AppleACPIBatteryManager_b4.zip ( 218.71K ) Number of downloads: 130


UPDATE: 7/11/2008
1. Cleaned up some unused codes.
2. Tried to fix the percentage issue.

Attached File  AppleACPIBatteryManager_b5.zip ( 467.69K ) Number of downloads: 68


UPDATE: 7/13/2008
1. Serial Number will show type and serial number instead of 0 if it reads any data.
2. Tried to fix more than one battery bay issue by using "_UID" flag. (need feedbacks)

Attached File  AppleACPIBatteryManager_b6.zip ( 324.82K ) Number of downloads: 252


UPDATE: 7/21/2008
1. Tried to fix OSString/OSData issue on battery info. (need feedbacks)
2. Tried to fix more than one battery bay issue. (need feedbacks)

Attached File  AppleACPIBatteryManager_b7.zip ( 426.92K ) Number of downloads: 73


UPDATE: 7/21/2008
1. Tried to fix more than one battery bay issue by using "_STA" flag. (need feedbacks)

Attached File  AppleACPIBatteryManager_b8.zip ( 217.69K ) Number of downloads: 279


UPDATE: 7/26/2008
1. Added CycleCount caculation and CellVoltages information. (need feedbacks)
2. Added "SMBIOS Informaiton" table for MaxErr, SerialNumber, and ManufactureDate. (need feedbacks)

Attached File  AppleACPIBatteryManager_b9.zip ( 478.22K ) Number of downloads: 68


UPDATE: 7/29/2008
1. Using "fCurrentVoltage" to caculate temperature.
( [fCurrentVoltage * fCurrentRate] should be used to caculate temperature. However, when the battery is FULL, fCurrentRate will be 0 and will make temperature become 0. To make it simpe, just use fCurrentVoltage untill I find a better solution.)
2. Fixed wrong "Power Unit" issue.

Attached File  AppleACPIBatteryManager_b10.zip ( 220.23K ) Number of downloads: 132


UPDATE: 7/29/2008
1. Changed [class AppleACPIBattery] to [class AppleACPIBatteryDevice]. Hopefully, it will fix the random KP due to the duplicated class AppleACPIBattery while ApplePowerSource is also installed at the same time.
2. Tried to fix more than one battery bay issue by using "numBatteriesSupported()" first. When the returned value is more than 1, it will check "_STA" flag. Otherwise, it will skip the "_STA" flag check. Also, rewrote the "_STA" flag check function. (need feedbacks from those who has more than one battery bay in the notebook.)

Attached File  AppleACPIBatteryManager_b11.zip ( 220.65K ) Number of downloads: 397


UPDATE: 8/11/2008
1. Removed "_UID" flag and related function.
2. Improved battery inserted/removed detection function.
3. Set "fUnitFactor" to 1 if it is read/caculated as 0. (Make sure denominator is not 0)
4. Moved "setExternalChargeCapable" function from "setBatteryBIF" to "setBatteryBST" rountine.
5. Reset "fAverageRate" to 0 when the state of battery changes.

(Now it will show "Calculating" first, then "Time" later, while plugging in or pulling out the AC power, like my MacBook does. tongue.gif )

Attached File  AppleACPIBatteryManager_b12.zip ( 223.45K ) Number of downloads: 228


UPDATE: 8/15/2008
1. Fixed long "Calculating" problem.

Attached File  AppleACPIBatteryManager_b13.zip ( 348.12K ) Number of downloads: 492


UPDATE: 8/22/2008
1. Tried to fix more than one battery bay issue while ApplePowerSource is also installed at the same time. (need feedbacks)

Attached File  AppleACPIBatteryManager_b14.zip ( 222.46K ) Number of downloads: 1729


UPDATE: 10/25/2008
1. Fixed the problem that battery meter doesn't show 100% after finished charging.
2. Changed to only read last three bit for "fCurrentRate" in case that the value read from ACPI table is too big.

Attached File  AppleACPIBatteryManager_b15.zip ( 450.24K ) Number of downloads: 7977
PM Profile Card
Go to the top of the page
+ Quote Post
Group Icon
  • Group: X Lab Developers
  • Posts: 1,395
  • Joined: 4-June 07
  • From: Moscow
  • Member No.: 112,217
Good work, Chun-Nan!
It's a pity I already resolve a problem with battery indicator. I have other related question. Have you sources of IOSMBusFamily?
I see you got battery information from registry if present. Full solution will be rewriting hardware access to battery through SMBus.
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 25
  • Joined: 3-January 07
  • Member No.: 73,374
Wow. Thanks. It works perfect on Acer Travelmate. Everything looks correcty.
Battery Information:

Model Information:
Serial Number: SANYO -GC86508SAT0 -0-0
Manufacturer: SANYO
Device name: GC86508SAT0
Pack Lot Code: 0000
PCB Lot Code: 0000
Firmware Version: 0000
Hardware Revision: 0000
Cell Revision: 0000
Charge Information:
Charge remaining (mAh): 3597
Fully charged: Yes
Charging: No
Full charge capacity (mAh): 3597
Health Information:
Cycle count: 0
Condition: Good
Battery Installed: Yes
Amperage (mA): 0
Voltage (mV): 12484

System Power Settings:

AC Power:
System Sleep Timer (Minutes): 10
Disk Sleep Timer (Minutes): 10
Display Sleep Timer (Minutes): 10
Automatic Restart On Power Loss: No
Display Sleep Uses Dim: Yes
Battery Power:
System Sleep Timer (Minutes): 5
Disk Sleep Timer (Minutes): 10
Display Sleep Timer (Minutes): 1
Display Sleep Uses Dim: Yes
Reduce Brightness: Yes

Hardware Configuration:

UPS Installed: No

AC Charger Information:

Connected: Yes
Charging: No
PM Profile Card
Go to the top of the page
+ Quote Post
Group Icon
  • Group: Moderators
  • Posts: 7,558
  • Joined: 5-July 05
  • From: Mexico City
  • Member No.: 123
Chun-nan Battery indicator is showing fine, calculation on time is working, percentage is also working but on Energy Saver Pane is showing as 123% ohmy.gif I have a Super Baterry tongue.gif

Also I can't select Custom Scheme on Battery Icon Menu and pmset command on Terminal shows an error:
pmset -g
pmset: internal error!

Thanks biggrin.gif
PM Profile Card
Go to the top of the page
+ Quote Post
******
  • Group: Members
  • Posts: 400
  • Joined: 5-December 07
  • Member No.: 160,019
QUOTE (macgirl @ Jul 6 2008, 12:23 PM) *
Chun-nan Battery indicator is showing fine, calculation on time is working, percentage is also working but on Energy Saver Pane is showing as 123% ohmy.gif I have a Super Baterry tongue.gif

Also I can't select Custom Scheme on Battery Icon Menu and pmset command on Terminal shows an error:
pmset -g
pmset: internal error!

Thanks biggrin.gif


Hi macgirl,

That is interesting that you got 123% on battery. If possible, can you post the "Power" information here like I did on the 1st post.

I can select "custom" on Battery icon on my machine. I am not sure if it is related or not but are you using the original powermanagement? About pmset, I didn't get the error when I use "pmset -g". However, I will check it.

Chun-Nan
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 9
  • Joined: 2-March 08
  • From: Ho Chi Minh City, Viet Nam
  • Member No.: 194,128
Hi Chunnan,

Can u up origin Powermanagement.bundle? Now indicator on my laptop is quite good, but I want to try this one.

Thanks,
PM Profile Card
Go to the top of the page
+ Quote Post
********
  • Group: Members
  • Posts: 1,141
  • Joined: 17-June 07
  • Member No.: 115,331
Works well on Inspiron 9400;
Energy Saver Pane is also showing battery as 123%, but hacked powermanagement.bunble showing as 113% smile.gif
QUOTE
Can u up origin Powermanagement.bundle? Now indicator on my laptop is quite good, but I want to try this one.

Extract it from 10.5.3 update with pacifist.
PM Profile Card
Go to the top of the page
+ Quote Post
******
  • Group: Members
  • Posts: 400
  • Joined: 5-December 07
  • Member No.: 160,019
QUOTE (sonotone @ Jul 7 2008, 05:48 AM) *
Works well on Inspiron 9400;
Energy Saver Pane is also showing battery as 123%, but hacked powermanagement.bunble showing as 113% smile.gif

Extract it form 10.5.3 update with pacifist.


Hi sonotone,

I have updated b2 version. You can give it a try.

I think "123%" and "113%" probably have something to do with the values of "fMaxCapacity" or "fDesignCapacity" but I am not sure yet.

Chun-Nan
PM Profile Card
Go to the top of the page
+ Quote Post
***
  • Group: Members
  • Posts: 171
  • Joined: 12-September 05
  • Member No.: 10,391
Lenovo ThinkPad T61, 14" WXGA+, 4 cell battery.
I, too, had a working battery indicator, but this looked pretty cool. Extracted vanilla AppleACPIPlatform.kext and PowerManagement.bundle, and installed the kext. I do have a battery/power meter again, but my Power panel is still odd:
CODE
Battery Information:

  Model Information:
  Serial Number:    XXXX-YYYY-0-0
  Pack Lot Code:    0000
  PCB Lot Code:    0000
  Firmware Version:    0000
  Hardware Revision:    0000
  Cell Revision:    0000
  Charge Information:
  Charge remaining (mAh):    0
  Fully charged:    No
  Charging:    No
  Full charge capacity (mAh):    0
  Health Information:
  Cycle count:    0
  Battery Installed:    No
  Amperage (mA):    0
  Voltage (mV):    0

System Power Settings:

  AC Power:
  System Sleep Timer (Minutes):    0
  Disk Sleep Timer (Minutes):    10
  Display Sleep Timer (Minutes):    10
  Automatic Restart On Power Loss:    No
  Wake On Clamshell Open:    Yes
  Display Sleep Uses Dim:    Yes
  Battery Power:
  System Sleep Timer (Minutes):    7
  Disk Sleep Timer (Minutes):    10
  Display Sleep Timer (Minutes):    2
  Wake On Clamshell Open:    Yes
  Display Sleep Uses Dim:    Yes
  Reduce Brightness:    No

Hardware Configuration:

  UPS Installed:    No

AC Charger Information:

  Connected:    Yes
  Charging:    No
PM Profile Card
Go to the top of the page
+ Quote Post
********
  • Group: Members
  • Posts: 1,141
  • Joined: 17-June 07
  • Member No.: 115,331
QUOTE (Chun-Nan @ Jul 7 2008, 09:49 PM) *
Hi sonotone,

I have updated b2 version. You can give it a try.

I think "123%" and "113%" probably have something to do with the values of "fMaxCapacity" or "fDesignCapacity" but I am not sure yet.

Chun-Nan

Still at 123%, but i guess you're right, look:
Model Information:
Serial Number: XXXX-YYYY-0-0
Pack Lot Code: 0000
PCB Lot Code: 0000
Firmware Version: 0000
Hardware Revision: 0000
Cell Revision: 0000
Charge Information:
Charge remaining (mAh): 7200
Fully charged: Yes
Charging: No
Full charge capacity (mAh): 5852
Health Information:
Cycle count: 1
Condition: Good
Battery Installed: Yes
Amperage (mA): 0
Voltage (mV): 12542

7200 of 5852 is 123%. Full Charge capacity is not correctly displayed.
PM Profile Card
Go to the top of the page
+ Quote Post
****
  • Group: Members
  • Posts: 212
  • Joined: 20-September 07
  • From: Trou du *** du monde
  • Member No.: 135,759
Beta 2 don't change percentage problem for me too :

Informations de la batterie :

Informations sur le modèle :
Nº de série : ASUSTEK-YYYY-0-0
Fabricant : ASUSTEK
Pack Lot Code : 0000
PCB Lot Code : 0000
Version du programme interne : 0000
Révision du matériel : 0000
Révision de pile : 0000
Informations sur la charge :
Charge restante (mAh) : 3769 ------> Charge remaining
Charge complète : Oui
En cours de chargement : Non
Capacité de charge complète (mAh) : 4112 --------> Full charge capacity
Informations sur la santé :
Comptage de cycles : 1
Conditions : Bonne
Batterie installée : Oui
Intensité de courant (mA) : 0
Tension (mV) : 12499

Thanks Chun-Nan !!!
PM Profile Card
Go to the top of the page
+ Quote Post
****
  • Group: Members
  • Posts: 180
  • Joined: 28-January 08
  • From: Javea Spain
  • Member No.: 179,170
Hi how do I Install it?????
PM Profile Card
Go to the top of the page
+ Quote Post
****
  • Group: Members
  • Posts: 212
  • Joined: 20-September 07
  • From: Trou du *** du monde
  • Member No.: 135,759
Unzip

excl.gif excl.gif excl.gif excl.gif be sure to delete ACPIPOwersource kext (in ACPIPlatform if you have it) before (KP in perspective)

Search into the build->release folder and copy the AppleACPIBatteryManager kext into your extensions folder (use Kexthelper can be good biggrin.gif ).

Copy vanilla PowerManagement bundle into SystemConfiguration folder (The "/System/Library/" one), repair permissions in doubt, delete caches and reboot.

Test, and post your information (in system profiler) !

Then kiss Chun-Nan ! huh.gif tongue.gif
PM Profile Card
Go to the top of the page
+ Quote Post
****
  • Group: Members
  • Posts: 180
  • Joined: 28-January 08
  • From: Javea Spain
  • Member No.: 179,170
Ill do that as soon as I get new battery
thanks for info wink.gif
PM Profile Card
Go to the top of the page
+ Quote Post
******
  • Group: Members
  • Posts: 429
  • Joined: 16-December 06
  • From: Singapore
  • Member No.: 69,220
sweet biggrin.gif i'm gonna test it out now


what i have found:

battery source is detected even though power adapter is plugged in,
displays "Calculation..." when power is plugged in
when battery is fully charged, it shows 83% full
the calculation is not very accurate

hope this will allow you know what bugs to fix for the new release
PM Profile Card
Go to the top of the page
+ Quote Post
****
  • Group: Members
  • Posts: 212
  • Joined: 20-September 07
  • From: Trou du *** du monde
  • Member No.: 135,759
POst your system power information to see why your indicators are wrong !
PM Profile Card
Go to the top of the page
+ Quote Post
******
  • Group: Members
  • Posts: 429
  • Joined: 16-December 06
  • From: Singapore
  • Member No.: 69,220
does not show anything helpful :s

CODE
Battery Information:

  Model Information:
  Serial Number:    XXXX-YYYY-0-0
  Pack Lot Code:    0000
  PCB Lot Code:    0000
  Firmware Version:    0000
  Hardware Revision:    0000
  Cell Revision:    0000
  Charge Information:
  Charge remaining (mAh):    0
  Fully charged:    No
  Charging:    No
  Full charge capacity (mAh):    0
  Health Information:
  Cycle count:    0
  Battery Installed:    No
  Amperage (mA):    0
  Voltage (mV):    0

System Power Settings:

  AC Power:
  System Sleep Timer (Minutes):    0
  Disk Sleep Timer (Minutes):    10
  Display Sleep Timer (Minutes):    20
  Wake On Clamshell Open:    Yes
  Wake On LAN:    Yes
  Display Sleep Uses Dim:    Yes
  Battery Power:
  System Sleep Timer (Minutes):    15
  Disk Sleep Timer (Minutes):    10
  Display Sleep Timer (Minutes):    5
  Wake On Clamshell Open:    Yes
  Display Sleep Uses Dim:    Yes
  Reduce Brightness:    Yes

Hardware Configuration:

  UPS Installed:    No

AC Charger Information:

  Connected:    Yes
  Charging:    No
PM Profile Card
Go to the top of the page
+ Quote Post
******
  • Group: Members
  • Posts: 400
  • Joined: 5-December 07
  • Member No.: 160,019
Hi guys,

I have updated b3 edition. It will make sure "fMaxCapacity" is always equal to or larger than "fCurrentCapacity". It should fix the "percentage" issue on Energy Saver Panel.

BTW, the following inforamtion will always show 0 snice there is no data to be read.

Pack Lot Code: 0000
PCB Lot Code: 0000
Firmware Version: 0000
Hardware Revision: 0000
Cell Revision: 0000

Others will depend on your BIOS or ACPI table.

Chun-Nan

QUOTE (xfidelity @ Jul 9 2008, 08:10 AM) *
does not show anything helpful :s

[code]Battery Information:

Model Information:
Serial Number: XXXX-YYYY-0-0
Pack Lot Code: 0000
PCB Lot Code: 0000
Firmware Version: 0000
Hardware Revision: 0000
Cell Revision: 0000
Charge Information:
Charge remaining (mAh): 0
Fully charged: No
Charging: No
Full charge capacity (mAh): 0
Health Information:
Cycle count: 0
Battery Installed: No
Amperage (mA): 0
Voltage (mV): 0

.....

Hi xfidelity,

It showed that you don't have battery installed. Which version of AppleACPIBatteryManager did you use? If possible, try b3 edition and post your information here again. (Make sure you are using the original PowerManagement) Thanks.

Chun-Nan
PM Profile Card
Go to the top of the page
+ Quote Post
******
  • Group: Members
  • Posts: 429
  • Joined: 16-December 06
  • From: Singapore
  • Member No.: 69,220
tried b3 and still the same result. i'm sure every thing is original as i did a clean installation of leopard.

battery indicator works fine only when i use the powersource kext and the modified power management bundle
PM Profile Card
Go to the top of the page
+ Quote Post
****
  • Group: Members
  • Posts: 212
  • Joined: 20-September 07
  • From: Trou du *** du monde
  • Member No.: 135,759
Still same pb with b3:

Informations sur le modèle :
Nº de série : ASUSTEK-YYYY-0-0
Fabricant : ASUSTEK
Pack Lot Code : 0000
PCB Lot Code : 0000
Version du programme interne : 0000
Révision du matériel : 0000
Révision de pile : 0000
Informations sur la charge :
Charge restante (mAh) : 3828
Charge complète : Oui
En cours de chargement : Non
Capacité de charge complète (mAh) : 4212

Informations sur la santé :
Comptage de cycles : 1
Conditions : Bonne
Batterie installée : Oui
Intensité de courant (mA) : 0 ----> negative value when unplug... normal ?
Tension (mV) : 12431


That's strange, coconutBatterry recognize good my battery it can say its original capacity !
But it it do the same error
PM Profile Card
Go to the top of the page
+ Quote Post
21 Pages V   1 2 3 > » 
Reply to this topic Start new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 21st November 2009 - 02:30 AM