CM10 Green Lens battery issues - Defy Q&A, Help & Troubleshooting

Hello! I flashed CM10 on my green lens defy quite some time ago (2 months) and I had no problems at first. Then after flashing a new nightly (can't remember which one exactly, probably the 0904 one) I noticed that my battery is draining much faster than usual. Then two battery drops appeared - from 69% to 50% and 35% to 19%. My Defy shut down automatically once and I connected the charger to it ... the phone booted itself to the screen where it shows that it charges the battery and it showed 49%. Then I booted my Defy as usual and the battery icon showed only 4%. Hope I was clear and you guys can understand me! Is there a fix to that? Thanks in advance!
P.S. Forgot to mention I'm using Quarx's ROMs, if that's of any help.
Sent from my MB525 using xda app-developers app

u have to use battery fix search in forum ,u can find it

Thanks, I tried using red lens battery fix with no success. I tried wipe data and flashing the latest Quarx CM10 nightly and again - no success. I tried to use CM7 Kernel instead of Epsy's Kernel - NO success.

I have the same problem..help someone!!!

"Recently many users of the Motorola Defy phone have encountered sudden drops in battery charge after installing a new ROM. Such as, drops from 67% to 49%, from 34% to 19%, from 7% to 4%, etc.
I also have encountered such problem when installed CM7.2 after being used stock Froyo ROM for more than an year. I had searched forums for possible fix, but no method has helped.
Finally, I have made some tests with my phone and found interesting points about Defy battery that explain battery percentage drops.
Our Defy have very simple battery controller (it is referred as cpcap by Motorola). The controller does not calculate and provide battery percentage. It provides only a battery voltage and a current. The battd daemon do the battery percentage estimation. It seems some overcomplicated estimation algorithm is used to do that (I've seen the Coulomb counter technique is mentioned in the battd sources).
There are several battery percentage checkpoints at 5%, 20%, 50%, 80%, 100%. It seems the battd daemon have a voltage-percentage mapping table for these checkpoints. When a battery voltage reaches a checkpoint value then the percentage is immediately set to a corresponding value. All other intermediate percentage values are estimated by the battd daemon. The estimation is based on a battery capacity (requested from the battery itself) and the active current. A stock battery reports 1500 capacity. A 1700mAh Chinese battery, I also have, reports only 1200 capacity battd stores the last calculated battery percentage and voltage in the /data/battd/cc_data file. Data from the /data/battd/cc_data file is read on start-up and the percentage from this file is used as base and reported to the system. When battery is drained, the percentage is decremented. When you delete the cc_data and reboot, battd uses the current voltage and looks for the nearest checkpoint voltage value and sets the percentage accordingly.
How have I found the checkpoint values above?
Assume we have a brand new original Defy battery and it shows 25% of charge.
If you delete the cc_data file and then reboot the phone, battd will recreate the file and request the battery controller(?) for the current battery status. The controller will return 50% and battd show 49% to you (not 49% not 50%, due to rounding to the lowest integer). But the real charge is 25%! Now let the battery discharge. It will show to you 48%, 47%, 46%, etc. Great! But at 40-44% you get the instant drop to 19%, since the battery controller had reported real 20% charge at that point and battd has been forced to sync its estimated charge value to the real charge value.
When a battery is wearing its actual capacity is decreased. For example, it may be 1300 mAh after an year of usage. But battery still reports it have 1500 capacity and battd uses this capacity for its calculations. battd should decrement percentage a bit faster for this worn battery, but it still use the same decrement speed as for a new 1500 battery. When battery voltage reaches a check point value, battd updates percentage to corresponding checkpoint value and you register a drop.
battd has some battery information and correction data in the /pds/public/battd folder. This data helps battd to estimate battery charge more correctly. This folder contain 3 files:
Code:
batt_offset_data
batt_phasing_data
batt_tuning_data
Without this correction data you may encounter slight drops even on a new stock battery,
For Defy there at least 2 versions of battd. (Defy+ uses a different battd) Let's name them as old and new ones. To find out which version you have, check the size of the /data/battd/cc_data file.
cc_data = 16 bytes - old battd,
cc_data = 24 bytes - new battd.
Early stock Froyo ROMs have the old battd, newer stock ROMs have the new battd. CM7.2 is bundled with the new battd.
Is the battd version makes any difference in the battery readings? YES. The difference is in a user account which is used to run a battd daemon.
The old battd uses the mot_accy user account, The new battd uses the system account. The corresponding owner and group should be set for the /pds/public/battd folder and files inside it. Otherwise battd will not be able to read battery data from the /pds/public/battd folder and defaults will be used, which cause inaccurate estimations.
If you have used stock old Froyo ROM or old custom ROM, you had the old battd. The /pds/public/battd folder has permissions for the mot_accy user account only.
You install the CM7.2 ROM with the new battd and it can not read battery data from the /pds/public/battd folder, since battd is run under the system user account. You have inaccurate battery estimation and percentage drops even on a brand new battery.
That's why installing the old battd (and its companion lib libbattd.so) on CM7.2 resolves battery drops issue for some users.
If you are using CM7.2 or any newer CM you can just change the owner and group for the /pds/public/battd folder and files inside it. Set both owner and group to system and the new battd will be able to read battery data files.
If you still have battery drops then your battery is worn to some degree and battd can not estimate its charge properly between checkpoints.
Is it possible to correct this? Probably yes.
I was able to adjust checkpoint voltage values and eliminate drops on checkpoints. BUT the discharging speed is still the same and I have good discharge without drops from 100% to 10% and phone is turned off on 10% since a battery reaches critical voltage of 3.050V.
To adjust checkpoints it is needed to change the /pds/public/battd/batt_offset_data file. I have changed the last 3 bytes to 0xA0. It offsets voltage value for checkpoints on 50%, 20% and 5%.
The batt_phasing_data file have not helped at all in my tests. It contains correction values for displayed voltage, temperature, current.
The batt_tuning_data file is total mystery atm.
So the goal is to find a way to force battd to decrement percents faster for worn batteries. The simplest way is to patch the battd with hardcoded capacity value (e.g. 1300) instead of reading this value from the battery.
The other (better) option is to create a custom battery driver and use a very simple mapping from current voltage to percentage. Such method is used to display battery status in touch boot menu. Also Quarx started a custom battery driver some time ago in his git repository.
Important:
The battery calibration is a myth! The /data/system/batterystats.bin file is not related to battery charge/life/status (exactly as Google devs stated earlier).
In case of our Defy, charge the battery to 100% and keep charging for few hours after that. Then disconnect it battd will display correct 99%. That's all you need when changing ROMs or batteries! Do not waste your time on "battery calibration"!
Conclusion:
Find out which version of battd you are using.
Check owner and permissions for the /pds/public/battd folder and files inside it. Correct owner/permissions if needed.
Charge your battery to 100% and keep charging for few hours more.
If you still have battery percentage drops after that, your battery is worn to some degree. The sum of dropped percents indicates how bad is your battery (-10%, -15% etc, compared to a new battery). There is no way to magically increase real life for this battery. Drops just a display issue due to crappy cheap battery controller in our Defy and weak battd estimation logic. That's why stock ROMs have 10% steps for battery charge - to hide such issues."
Here from this thread: http://forum.xda-developers.com/showthread.php?t=1778492&highlight=battery

Related

battery metter unreliable

i have noticed that the battery metter is completely unreliable
for example it shows 28% left (btw, i installed FInixNOverBattery for percentage indication) and after a soft reset it shows 41%
or it shows 50% and after soft reset it shows 31%
in this way i can never estimate how long the battery will last
does anybody faced this issue? any solution fot it? (i also tryed to calibrate by completely drain the battery followed by complete charge withe the device turned off)
thank you in advance!
noris08,
it is completey normal to experience big jumps in % after a reboot. The battery % is just a representation of the actual voltage of the LiPoly battery, which usually recovers (rises) quite a bit when there is no load on the battery (even for a short time).
maybe what you say it is true, but i never experienced this behaviour with any of my previous phones. and i had a few, including wm for a few years
and variations of 10-15% - i find them too big
I noticed the same thing. Any explanation for this? Or it is just that FInixNOverBattery is not reliable/compatible/accurate ?
Voltage may vary/jump around due to environmental changes and power consumption or voltage sensor may be insufficiently accurate to provide reliable voltage readings for 1% steps. This is one of the reasons why many battery drivers in WM only provide remaining charge percentage in 10% steps.
In this light, voltage on its own is not a sufficient indicator of remaining charge percentage. Other parameters, such as voltage deviation and other factors, such as power consumption and temperature may need to be taken into account to obtain a more accurate evaluation.

[REQ] Battery calibration tool...

http://forum.cyanogenmod.com/index.php?/topic/2354-request-seidio-extended-battery-level-fix/
The state-of-charge of all non-oem batteries are registered incorrectly, resulting in soft shut-downs when the android os assumes the battery state-of-charge to be low, when in fact it is not.
By some educated guesswork, it is assumed that the moto droid uses a hall effect sensor to detect current, and then integrates to find the current state-of-charge. This calculation requires a calibration, which is obviously set for the stock battery.
Is it possible to find where this calibration value is, and change it manually, to allow the droid to register the correct state-of-charge for extended life batteries?
Is the following of any relevance? AmonRa's series of Recovery Roms include the option: Wipe the battery stats in /data. This post claims: It's thought that if you fully charge, delete the battery data file, use your phone completely, recharge fully that your phone's battery stats are changed and helps battery life.

Editing batterystats.bin

I just had an idea if it was possible to edit the batterystats.bin file. This way we do not have to calibrate whatsoever and possibly "trick" the phone to use the battery longer before shutting down.
As I understood from the forums, full charge 100% is around 4.2v and flat 0% around 3.5v. This bring us a delta of 0.7v = 100%. If we could edit and write say 3.3v at 0% then we would gain 0.2v and extend the battery life for another 20%+?
What do you think? Probably for a start, those with excellent battery life could help to post their batterystats.bin file and let the others with draining issues try out your calibration file?
Well it wont work.
First that file is basicly a logfile.
Second the sgs need that power to work right.
Third you can damage the battery if you try to lower the power to much.
So if you want better battery time you need to se what app you use and that kind of things.
You can also buy a battery so you have more power.
You can also try to change it under the day.
**DamianGTO Steam kernel. 348MB Ram. 1000HZ. ext2/jfs . js3 base**
Thanks for the reply.
Just thought that since the phone load is the same and thus power consumption rate remains, only possible issue would be the battery information to the phone is not accurate:
battery is either not yet fully charged before the phone cuts off charging and/or the battery is not yet fully depleted before the phone force shutdown thus showing the 'effect' of fast drain
coatercup said:
Thanks for the reply.
Just thought that since the phone load is the same and thus power consumption rate remains, only possible issue would be the battery information to the phone is not accurate:
battery is either not yet fully charged before the phone cuts off charging and/or the battery is not yet fully depleted before the phone force shutdown thus showing the 'effect' of fast drain
Click to expand...
Click to collapse
Well all is a calculation on the power in the battery, but the phone need to now what is the max value and the low value the battery have to make a right calculation. Thats way it often works to delete the file when you have full power.
So its very hard to use others file, it will not be how your battery is.
Maby there is some place in the system you can tweak this, but its not good for the battery to over load it or lower the power to much.
MAby you get a better battery life for some time, but the battery will get broken and bad alot faster, then you need to buy a new battery. So i dont see any gain on that..

[Q] Battery under charge that jumps to higher values

I'm experiencing the following issue:
I discharge the telephone completely and I put it under charge.
I check the phone and it says, for example, that it's charged at 3%. Ok reasonable, I've attached to the charger just few minutes ago.
After a 5/10 minutes I check it back and it's 33% charged!
Today I made a reboot while charged and after the reboot, from 32%, it went up to 66%!
I couldn't charge it to 100%, it stuck at 98%.
I've installed under /etc/init.d/ the script 87calibrator.sh by Brainmaster since I'm using CNA 1.6.0 ROM (with Air Kernel 3.9.5 voodoo standard - gov: lazy; scheduler: deadline - DeepIDLE: on, NO Screen Off Max Freq enabled).
I feel there's something that needs to be fixed... it doesn't behave like this each time... in between the ROM changes I've experienced just a few times...
(Wipe Data/Cache+Wipe Dalvik and if passing from a ROM to another I also format /system).
Is anybody else experiencing this issue?
Android is terrible with actual battery stats, just don't look at it while charging
Sent from my Nexus S using XDA
Issue? I don't see one.
The Nexus S uses a State of Charge method which can be somewhat inaccurate initially, but as time progresses will become more accurate. Often while charging and booting simultaneously, the charge will go up by a fairly large percentage. This is obviously incorrect, but over the next few hours it will settle itself at it's approximate true charge. I'm still unsure if this effects the final charge % as i havn't tested it that much, but it likely does, though it will progressively get better.
Also, it is a hardware restriction regarding charging to 100%. Stock Nexus S only charges to 96% or so without dodgy methods to actually get it up. Anything else that says 100% is purely cosmetic - this cosmetic change can be found in various kernels.
Harbb said:
Issue? I don't see one.
The Nexus S uses a State of Charge method which can be somewhat inaccurate initially, but as time progresses will become more accurate. Often while charging and booting simultaneously, the charge will go up by a fairly large percentage. This is obviously incorrect, but over the next few hours it will settle itself at it's approximate true charge. I'm still unsure if this effects the final charge % as i havn't tested it that much, but it likely does, though it will progressively get better.
Also, it is a hardware restriction regarding charging to 100%. Stock Nexus S only charges to 96% or so without dodgy methods to actually get it up. Anything else that says 100% is purely cosmetic - this cosmetic change can be found in various kernels.
Click to expand...
Click to collapse
Hi, thank you for your answer. I wasn't aware about the dynamic calibration!! Yes the 100% charge it's not physic but cosmetic, I know. It was just to mention that I don't get to full 100%.
So if the battery calibration is "by design", do you know how Brainmaster's script affects this calibration?
It doesn't. That script deletes the batterystats.bin file (somewhere in the /data directory). All this file does is tabulate human-readable battery statistics for you to view when you look at Settings > Battery, so you know how much power has been drained by each app or service, and the graphing over time. This is all it does. A charge to ~90% or higher will automatically delete this file, as you can see by the battery screen resetting itself.
Harbb said:
It doesn't. That script deletes the batterystats.bin file (somewhere in the /data directory). All this file does is tabulate human-readable battery statistics for you to view when you look at Settings > Battery, so you know how much power has been drained by each app or service, and the graphing over time. This is all it does. A charge to ~90% or higher will automatically delete this file, as you can see by the battery screen resetting itself.
Click to expand...
Click to collapse
Ah ok, than that's explaining why they all say that the deleting stats it's not useful to calibrate the device
Thank you very much man!! Much appreciated!
You're welcome mate

Change battery... what i must do???

Hi, i' m changing Defy' s battery from 1500 mah to 1700 mah, but i' m a bit confused, and i have some questions:
1) This new battery needs, for the first charging, to be charged for 12 hours... right?
2) I' m on WIUI GB, does i need to wipe battery stats, or delete any file after new battery' s full charge?
3) Will the second charging of new battery shows uncorrected values of real battery percentual charge?
Please, responds to me
P.S. Sorry for my bad English
You need new battd files so your Defy will be fully charged.
3) I think yes. It will not show a correct battery status.
sack148 said:
You need new battd files so your Defy will be fully charged.
3) I think yes. It will not show a correct battery status.
Click to expand...
Click to collapse
So, what i can do to shows correct battery status???
1)Charge to 100% , calibrate with the zeppelinrox script , when the battery drops to 60% charge again, never let it drop to 0, reduces the lifetime of the battery
2)Download Die Hard battery calibration ! :fingers-crossed: http://forum.xda-developers.com/showpost.php?p=18703418&postcount=5021(open with SManager ads)
3)Yes , with a few cycles charge / discharge the battery lasts a little more
Please ask all questions in the Q&A section. Thread moved there.

Categories

Resources