I just got a response from the developer of the app, "Battery Monitor Widget Pro" in regards to a completely unrelated question. The dev said that in some Android devices, the kernels will have the battery size hardcoded into the kernel.
Does anyone know if this is true for our device and if so, how to change it without having to jump through a bunch of hacking an reprogramming hoops?
I ask because I bought the Hyperion 1800mAh extended battery for my phone and want to be sure that the phone is reading its size correctly. Currently, with the new battery installed, the battery level will sometimes randomly drop about 30% after a reboot (although, I have read this as being a common occurance for other people too) and when charging, the phone will stop charging and claim to be at 100%, but then will drop down to around 95% once unplugged. I have tried recalibrating the battery several times with no improvement, so after hearing about this "hardcoded into kernel" thing, I started thinking that this could be my problem.
For the record, I am on UCKH7 stock, with the exception of being rooted. (UCKK6 gave me phone call problems so I reverted back).
Another Q:
I should also ask if there is any way to force the system to properly read the battery level.
No - hardcoding the battery size only applies to fuel gauges of the "coulomb counter" type - these measure every bit of energy that goes in and out of the battery and track it, so they need to know how much energy the battery has at maximum.
These types of gauges are highly accurate when properly calibrated, but they drift over time and can become wildly inaccurate in many situations. Such fuel gauges can go utterly nuts if you swap batteries, unless the battery itself has memory in it.
Our fuel gauge is of a different type that uses the voltage history of the battery to provide an estimate of the charge - it is somewhat less accurate (could be as much as +/- 5% I'm guessing, except in corner cases such as a reboot at low charge state, which throws it off temporarily) but has the advantage of always converging on reality over time, so it never requires one to pay attention to calibration.
If your fuel gauge is really wacked out (such as a reboot at low charge, which confuses it with high load after a reset), the following will reset it again:
Code:
echo "1" > /sys/class/power_supply/fuelgauge/fg_reset_soc
Of course, this can make things worse if your battery is in any situation other than light load.
Thanks for the reply.
Will that code (used in a terminal on the the phone, I suppose? Correct me if I am wrong please) work the same way as deleting the batterystats.bin file?
Also, if i were to use that command you gave, what would I need to do? By this I mean, does the phone need to be charged to 100%, do I need to do it while still plugged into the charger as well, etc etc.
I don't want to go off and do something that could screw up my phone, but am definitely interested in knowing more about what that command can do for me.
I look forward to your reply
spexwood said:
Thanks for the reply.
Will that code (used in a terminal on the the phone, I suppose? Correct me if I am wrong please) work the same way as deleting the batterystats.bin file?
Click to expand...
Click to collapse
No, since this actually does something. Deleting batterystats.bin on our device does nothing.
Also, if i were to use that command you gave, what would I need to do? By this I mean, does the phone need to be charged to 100%, do I need to do it while still plugged into the charger as well, etc etc.
I don't want to go off and do something that could screw up my phone, but am definitely interested in knowing more about what that command can do for me.
I look forward to your reply
Click to expand...
Click to collapse
Just do nothing, although ideally to prevent the fuel gauge from getting confused again, do it when the phone has been under very light load, and then don't use the phone much for a few minutes afterwards (turn the screen off).
None of that "charge to 100%" stuff is applicable to our phone due to the way the gauge works - it's only for devices that have coulomb counter fuel gauges (the ones that need the battery capacity hardcoded).
Thank you and don't worry because I wasn't really going to do that unless I REALLY had to. I just like to know this stuff.
After some some full charge/discharge cycles, my battery seems stable now. Battery life could be better though, but at least I get through the day while it is on standby.
Thanks for all the info
Is it the same for the captivate? I have 2 captivates, both on identical roms, flashed identical ways, but for some reason, the battery is awful on one.
Could it be possible the gauge is just way off? I've deleted batterystats.bin but does it even do anything on that phone?
I obviously cannot answer your whole question, but I can answer the one about the batterystats.bin.
The purpose for deleting the batterystats.bin file is to help Android to relearn the upper and lower limits of the battery (ie where 100% and 0% is). So, if you delete that file, then you need to let to phone charge to 100% and then let it drain until the phone turns itself automatically. This process needs to be repeating for several days.
The rest I cant answer since it is all new info to me
I wouldnt recommend that command that was given earlier because if it has potential to mess MY phone up, it will probably be the same for you too.
lourivellini said:
Is it the same for the captivate? I have 2 captivates, both on identical roms, flashed identical ways, but for some reason, the battery is awful on one.
Could it be possible the gauge is just way off? I've deleted batterystats.bin but does it even do anything on that phone?
Click to expand...
Click to collapse
If they are running the EXACT same firmware, then the battery may simply be defective.
The Captivate has a fuel gauge similar to ours - MAX17040 instead of MAX17042. The 17040's datasheet is public, the 17042 (ours) is not, but from reading the kernel source and such, the 17042 in ours is almost identical - it adds a few features Samsung isn't using.
spexwood said:
I obviously cannot answer your whole question, but I can answer the one about the batterystats.bin.
The purpose for deleting the batterystats.bin file is to help Android to relearn the upper and lower limits of the battery (ie where 100% and 0% is). So, if you delete that file, then you need to let to phone charge to 100% and then let it drain until the phone turns itself automatically. This process needs to be repeating for several days.
The rest I cant answer since it is all new info to me
I wouldnt recommend that command that was given earlier because if it has potential to mess MY phone up, it will probably be the same for you too.
Click to expand...
Click to collapse
JESUS FREAKING CHRIST! DID YOU READ A SINGLE THING I SAID?
batterystats.bin has NO effect on the fuel gauge on our phone. PERIOD.
STOP BLINDLY APPLYING HTCISMS TO A SAMSUNG PHONE.
In fact, please refrain from commenting on this subject on a Samsung phone ever again until:
1) You have read and understand the Maxim MAX17040 IC datasheet
2) You have read and understand the kernel source for our fuel gauge driver in max17042-fuelgauge.c
While I appreciate your earlier help, I THOUGHT I WAS understanding it!
THERE IS ABSOLUTELY NO REASON TO BE SUCH A JERK TO PEOPLE JUST BECAUSE THEY DONT FULLY UNDERSTAND YOU!!!! IF NORMAL PEOPLE LIKE ME DO NOT UNDERSTAND WHAT YOU SAY, THEN IT IS YOOOUUUUR FAULT BECAUSE YOU ARE USING LANGUAGE THAT IS TOO GEEKY FOR US TO UNDERSTAND IN THE FIRST PLACE!!!!!
Just because you made a custom kernel and some other crap, doesn't make you king of the forums and give you the right to talk down on people!!!
spexwood said:
While I appreciate your earlier help, I THOUGHT I WAS understanding it!
THERE IS ABSOLUTELY NO REASON TO BE SUCH A JERK TO PEOPLE JUST BECAUSE THEY DONT FULLY UNDERSTAND YOU!!!! IF NORMAL PEOPLE LIKE ME DO NOT UNDERSTAND WHAT YOU SAY, THEN IT IS YOOOUUUUR FAULT BECAUSE YOU ARE USING LANGUAGE THAT IS TOO GEEKY FOR US TO UNDERSTAND IN THE FIRST PLACE!!!!!
Just because you made a custom kernel and some other crap, doesn't make you king of the forums and give you the right to talk down on people!!!
Click to expand...
Click to collapse
Look, while I dont agree with the way that Entropy answered you, he didnt break any rules. He answered you and then had to re-answer you. If you didnt like his answer or found it jerkish, then move on. This post does not help the matter at all, in fact it could be viewed as a troll.
He didnt use "geeky language" at all, in fact those terms are used in the development forums quite often. If you dont understand those, then either search to look them up or Google them to get a better understanding. Its not his fault at all because he did not make up the names or the commands. Again, if you dont understand any of this, then you probably have no business tinkering with your phone.
Entropy has arguably one of the best kernels for our phone right now, not just some kernel... and his "other crap" is widely used and appreciated. If you dont like his work, then dont use it but DO NOT put down his work that he does for free and then offers his work for free for people to use.
Since this thread got too geeky, and the main question has been answered, Im going to close this thread to prevent any further bickering.
I was looking at Googles API lists and found that you can get information on the battery, but the resulting information is in relation to the percentage value that the OS is seeing for the battery. Are there any API's (published or unpublished) that would allow me to determine the actual mAh remaining (plus capacity, voltage, etc) of the battery?
Hmmm i'm waiting for this answer too..coz many fake battery now sell in ebay.
I want to safely using replacement battery
"Battery calibration", not sure if it's on the Market, I got it with a ROM, I could extract it for you, but I think it needs root...
Sent from my Desire HD using XDA App
You can let it calculate with battery monitor widget. It isnt the exact value but +-20.
Thanks. I'll take a look at it. I assume that it requires you to monitor for a while to determine the mAh?
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Thanks ✟
Moving to Q&A
I've come across some people that say the GS2 battery should not be drained completely since for this type of battery it's not good.
lckh said:
I've come across some people that say the GS2 battery should not be drained completely since for this type of battery it's not good.
Click to expand...
Click to collapse
http://www.google.com/search?q=Is+it+bad+to+completely+drain+a+lithium+ion+battery?
ctomgee said:
http://www.google.com/search?q=Is+it+bad+to+completely+drain+a+lithium+ion+battery?
Click to expand...
Click to collapse
Pants - is the only way to describe that post, false info.
It does no harm at all to fully discharge, more problems are caused by giving regular, short charges, than 1 long full charge so i wouldnt believe that.
He also says to charge it 8-10 hours, that total rubbish as well, these batteries dont need 8-10 hours to prime, on average 3-4 hours for a full charge is more than adequate.
I think few year back batteries were far inferior and did indeed need longer charging periods, but not any more, and if ya flash roms a lot and need to calibrate your battery after flashing to a new custom rom indeed part of the calibration process is completely running down the battery, my s2 is well over a year old and has been drained flat many a time and i still get 14 - 20 hours out of it on average, which is damn good for any smart phone these days, That post is on a HTC Thread by the way, Htc notoriously have batteries with a crappy life span, i had a wildfire s, used to get about 6 hours out of the battery.
I don't think that's true.
http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
graemeg said:
ctomgee said:
http://www.google.com/search?q=Is+it+bad+to+completely+drain+a+lithium+ion+battery?
Click to expand...
Click to collapse
Pants - is the only way to describe that post, false info.
It does no harm at all to fully discharge, more problems are caused by giving regular, short charges, than 1 long full charge so i wouldnt believe that.
He also says to charge it 8-10 hours, that total rubbish as well, these batteries dont need 8-10 hours to prime, on average 3-4 hours for a full charge is more than adequate.
I think few year back batteries were far inferior and did indeed need longer charging periods, but not any more, and if ya flash roms a lot and need to calibrate your battery after flashing to a new custom rom indeed part of the calibration process is completely running down the battery, my s2 is well over a year old and has been drained flat many a time and i still get 14 - 20 hours out of it on average, which is damn good for any smart phone these days, That post is on a HTC Thread by the way, Htc notoriously have batteries with a crappy life span, i had a wildfire s, used to get about 6 hours out of the battery.
Click to expand...
Click to collapse
My post is full of false info? The one linking to direct Google search of the OP's question? Interesting.
ctomgee said:
My post is full of false info? The one linking to direct Google search of the OP's question? Interesting.
Click to expand...
Click to collapse
Hmmmmmm, no, you didnt start the thread, i was replying to the starter of the discussion, not yours.
More importantly, where is your link meant to point, coz from what i can see it only points to a google search and not to any specific document, unlike donalgodon who posted a very interesting and intriguing link indeed with so much info
graemeg said:
Hmmmmmm, no, you didnt start the thread, i was replying to the starter of the discussion, not yours.
More importantly, where is your link meant to point, coz from what i can see it only points to a google search and not to any specific document, unlike donalgodon who posted a very interesting and intriguing link indeed with so much info
Click to expand...
Click to collapse
Which was actually one of the results of the google search, if you bothered to look.
I was trying to impart the fact to the OP that he could easily find this info himself.
Also, if you were replying to him, then why did you quote my post, saying "Pants - is the only way to describe that post, false info"? Context is important.
ctomgee said:
Which was actually one of the results of the google search, if you bothered to look.
I was trying to impart the fact to the OP that he could easily find this info himself.
Also, if you were replying to him, then why did you quote my post, saying "Pants - is the only way to describe that post, false info"? Context is important.
Click to expand...
Click to collapse
aBSOLUTLEY, QUOTING YOURS WAS INDEED AN ERROR ON MY BEHALF, SPOSE DUE TO TIRED EYES SO APOLOGIES IF THAT CONFUSED YOU INTO THINKING I WAS MEANT TO QUOTE YOU, WAS INTENDED FOR THE ORIGINAL THREAD STARTER.
See what i mean, just realised i hit caps lock instead of shift, hmmmm, oh also yes i agree completely, google is completely the place to look so point taken, its suprising what you can ask google and still get an answer, i dont think some people realise that if they have a question in mind, then the likelihood is, someone else already asked it, yet they still dont google it, or maybe its just down to laziness that people dont goole anymore.
graemeg said:
aBSOLUTLEY, QUOTING YOURS WAS INDEED AN ERROR ON MY BEHALF, SPOSE DUE TO TIRED EYES SO APOLOGIES IF THAT CONFUSED YOU INTO THINKING I WAS MEANT TO QUOTE YOU, WAS INTENDED FOR THE ORIGINAL THREAD STARTER.
See what i mean, just realised i hit caps lock instead of shift, hmmmm, oh also yes i agree completely, google is completely the place to look so point taken, its suprising what you can ask google and still get an answer, i dont think some people realise that if they have a question in mind, then the likelihood is, someone else already asked it, yet they still dont google it, or maybe its just down to laziness that people dont goole anymore.
Click to expand...
Click to collapse
Mine was a rhetorical question, but it's all good, dude.
Lol, short version: Depending on the battery type you will want to drain it completely before charging or never drain it completely. Let it charge fully overnight or it only needs a few hours.
Seriously, do some reasearch on batteries. Figure out what types there are, how they are different, and what makes them different. each has advantages and disadvantages.
Every battery type is a little different. For our phones will be different than for your rechargable nicad batteries at home, or the batteries in your remote control vehicles.
Bottom line: We COULD tell you, but that would be defeating the purpose. Instead we are pointing you in the right direction to acquire the knowledge yourself. Happy hunting! let us know how it works out!
In simple, it actually causes more harm discharging the battery to empty.
There is alot of do's and donts to preserve the battery,
Info:
The Li‑ion charger is a voltage-limiting device that is similar to the lead acid system. The difference lies in a higher voltage per cell, tighter voltage tolerance and the absence of trickle or float charge at full charge. While lead acid offers some flexibility in terms of voltage cut‑off, manufacturers of Li‑ion cells are very strict on the correct setting because Li-ion cannot accept overcharge. The so-called miracle charger that promises to prolong battery life and methods that pump extra capacity into the cell do not exist here. Li-ion is a “clean” system and only takes what it can absorb. Anything extra causes stress.
Most cells charge to 4.20V/cell with a tolerance of +/–50mV/cell. Higher voltages could increase the capacity, but the resulting cell oxidation would reduce service life. More important is the safety concern if charging beyond 4.20V/cell. Figure
Discharging:
Li-ion should never be discharged too low, and there are several safeguards to prevent this from happening. The equipment cuts off when the battery discharges to about 3.0V/cell, stopping the current flow. If the discharge continues to about 2.70V/cell or lower, the battery’s protection circuit puts the battery into a sleep mode. This renders the pack unserviceable and a recharge with most chargers is not possible. To prevent a battery from falling asleep, apply a partial charge before a long storage period.
Battery manufacturers ship batteries with a 40 percent charge. The low charge state reduces aging-related stress while allowing some self-discharge during storage. To minimize the current flow for the protection circuit before the battery is sold, advanced Li-ion packs feature a sleep mode that disables the protection circuit until activated by a brief charge or discharge. Once engaged, the battery remains operational and the on state can no longer be switched back to the standby mode.
Do not recharge lithium-ion if a cell has stayed at or below 1.5V for more than a week. Copper shunts may have formed inside the cells that can lead to a partial or total electrical short. If recharged, the cells might become unstable, causing excessive heat or showing other anomalies. Li-ion packs that have been under stress are more sensitive to mechanical abuse, such as vibration, dropping and exposure to heat.
And may i point out, this is a community, People ask questions and peoples feedback, the web is not always correct and nor is the information you find.
It takes more effort to argue with someone and to point someone in the right direction, instead of just answering there question.
We have all been New here once before.
dave7802 said:
In simple, it actually causes more harm discharging the battery to empty.
There is alot of do's and donts to preserve the battery,
Info:
The Li‑ion charger is a voltage-limiting device that is similar to the lead acid system. The difference lies in a higher voltage per cell, tighter voltage tolerance and the absence of trickle or float charge at full charge. While lead acid offers some flexibility in terms of voltage cut‑off, manufacturers of Li‑ion cells are very strict on the correct setting because Li-ion cannot accept overcharge. The so-called miracle charger that promises to prolong battery life and methods that pump extra capacity into the cell do not exist here. Li-ion is a “clean” system and only takes what it can absorb. Anything extra causes stress.
Most cells charge to 4.20V/cell with a tolerance of +/–50mV/cell. Higher voltages could increase the capacity, but the resulting cell oxidation would reduce service life. More important is the safety concern if charging beyond 4.20V/cell. Figure
Discharging:
Li-ion should never be discharged too low, and there are several safeguards to prevent this from happening. The equipment cuts off when the battery discharges to about 3.0V/cell, stopping the current flow. If the discharge continues to about 2.70V/cell or lower, the battery’s protection circuit puts the battery into a sleep mode. This renders the pack unserviceable and a recharge with most chargers is not possible. To prevent a battery from falling asleep, apply a partial charge before a long storage period.
Battery manufacturers ship batteries with a 40 percent charge. The low charge state reduces aging-related stress while allowing some self-discharge during storage. To minimize the current flow for the protection circuit before the battery is sold, advanced Li-ion packs feature a sleep mode that disables the protection circuit until activated by a brief charge or discharge. Once engaged, the battery remains operational and the on state can no longer be switched back to the standby mode.
Do not recharge lithium-ion if a cell has stayed at or below 1.5V for more than a week. Copper shunts may have formed inside the cells that can lead to a partial or total electrical short. If recharged, the cells might become unstable, causing excessive heat or showing other anomalies. Li-ion packs that have been under stress are more sensitive to mechanical abuse, such as vibration, dropping and exposure to heat.
And may i point out, this is a community, People ask questions and peoples feedback, the web is not always correct and nor is the information you find.
It takes more effort to argue with someone and to point someone in the right direction, instead of just answering there question.
We have all been New here once before.
Click to expand...
Click to collapse
Indeed, not everything on the web is correct.
But may I point out that all you did was copy and paste text from this page, which donalgodon linked in post 4, and again, I feel I must point out, was actually one of the results in the Google search I linked him to.
The point I was trying to make, and seems lost on you, is teaching people how to look for stuff on their own. No one should just expect to be spoon-fed information. That is lazy to just post a question on a forum, sit back, and watch the answers roll in. You should do your own legwork and research.
As the old adage states: give a man a fish, and you feed him for that day. Teach a man to fish, and he is fed forever.
Hello,
I have spent many hours of reading trough internet, including xda-developers forums and lots more. Maybe I'm not lucky and just didn't find the one right page/post where is what I need.
I have very simple problem, I suppose many people at some point gets to that question - is my phones battery in good shape and if I buy replacement is it at least close to promised capacity.
So only way to get that info is measure or approximate real battery capacity.
As there in system are available all required parameters for calculation - current, percentage/voltage and of course clock. It shouldn't be hard to calculate estimated capacity.
Of course it'll have to gather some data to calculate data, but it is quite simple, and can get more accurate as more data is acquired and saved.
I have found few projects who claims to do so, but unfortunately without luck.
Battery Monitor Widget - shows all data needed, but as capacity shows some kind of calculation between charge level and manufacturer/entered capacity, so it shows charge level in mAh, but there is nothing like estimated battery capacity.
https://play.google.com/store/apps/details?id=ccc71.bmw
Found post with Current Widget usage, but unfortunately it doesn't work for my Galaxy S5.
Post: http://forum.xda-developers.com/showthread.php?t=1019786
As conclusion, I suppose it shouldn't be very difficult to make such app, unfortunately I'm not developer and even familiar with mobile platforms development. Maybe there are someone who is interested in same stuff and can develop
Any comments are welcome
Cheers!