yashsingh1/xdaforums huggingface dataset:
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
I am just guessing here. Your battery acts quite different from either of mine.

Yes, give 2512 a try. Or 1600*1.6=2560.

2512/1.6=1570 mAh. Maybe your battery was 1600 mAh. The equivalent units for a 1600 mAh battery are 2560.

Yes, that would be a side-effect of having too low a battery_capacity.

You don't really know that it is charged until OS Monitor shows less than 20 mA charge going into the battery. Hmmm, maybe the kernel should know that? Don't mark the battery 100% unless current <= 20 mA? Maybe...

No, elander, I got your message, but have been busy. Sorry if it seemed I was ignoring you. Your suggestion is good but takes a lot of effort. If enough people want to contribute data, I can crunch the numbers and see if they give us better calibration. But first I want to know if you all are happy with the accuracy of the initial guess that is made when you take out the battery, put it in, and boot. If that initial guess is close enough, we don't need any better calibration. Frankly, I am almost ready to consider the battery issue solved and move on to the next problem.
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
Elander's suggestion:

I have a similar battery, a couple of weeks old. I don't use wifi much since 3G works so well for me. I use the "Toggle 2G/3G" app to automatically switch to 2G when the phone is idle. Last night I kept the phone off of the charger from when I went to bed (11PM) to when I got up (9AM), and the phone had 50% charge when I woke up. With no data plan at all I would expect to see even better. So I believe we do see different performance.

One caveat: I have edited the keypad code to make sure my keyboard backlight is never on when the keyboard is pushed in. L1q1d will make that change (or a similar one) and push it out soon. If your backlight is on when the keyboard is pushed in, that will drain your battery quickly. Let's assume that is not happening.

If anyone thinks the suggestion is good, that we all contribute information about our phones and battery consumption, then post it here and I will look at it. Yet, my own opinion is that we are 90% there, and we will not see much improvement from here. Therefore, my own interest in the subject is quickly waning.
[Tilt, TyTN II, MDA Vario III Android Development] elander:
Ok, thanks for answering, and forgive me if it looked like I was rushing you to answer, it's just that those pm were my firsts (pity, I know :D ) and I could tell if they were actually sent at all, and to be honest I haven't tried taking the battery out and then put it and boot again, I mean I have done that hundreds of times, but no specifically to calibrate the battery with your mods, so how do I do it? do I have to fresh install both the kernel (attempt 6?) and the system and then let it boot, shut down, take the battery out, put it back then boot to let it charge? do I have to drain the battery before doing all that? lots of questions I know, but I wanna make sure I'm doing everything exactly as it is supposed to be done. thanks again for your terrific work, without it (along with the work of others) I'd probably have just stayed @ WM "house horror". thanks again.
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
That is a lot of questions, with unclear answers.

It is a good idea to pull the battery before installing a kernel. Or at least I do it, and I have heard it recommended. Probably not necessary. But it is not required to re-install a kernel or system image when pulling the battery.

What is special about pulling the battery? It resets the power-on-reset bit of the DS2746 status register. That's it.
[Tilt, TyTN II, MDA Vario III Android Development] -Arturo-:
Hmm that's strange it says on the battery that it's 1350 mah so that can't be right. I will try the settings and will report back.
[Tilt, TyTN II, MDA Vario III Android Development] -Arturo-:
N2rjt ok I did as I was told and basically theproblem still exist.TheOs monitor shows that maximum battery units have been changed to 2510 but still themeter behavesin the similar way. I,ve been at 1% battery charge for over 10 minutes and the phone hasn,t died on me yet. The os monitor shows 0/2510 units. Also a guestion if 20 mA or less indicates fully charged battery then whatnumber indicates discharged battery?
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
The phone will shut down to protect the battery when voltage gets as low as 3.0V.

When voltage is regularly under 3.1V, it is very close to discharged, within a few percent. I would suggest getting my latest 10-10-10 attempt from the kaiser kernel thread, and then just take some time, experiment, and learn how things work for you.
[Tilt, TyTN II, MDA Vario III Android Development] -Arturo-:
Actually it has just switched itself off so I see a progress, 10+ minutes is much better than 30+.

About your 10-10-10 attempt is that 4-10 or 10-10 kernel with new battery fixes?
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
It is based on 10-10 with battery changes.

They probably don't change anything for you, but you are still best to use the most recent.
[Tilt, TyTN II, MDA Vario III Android Development] shanbh:
where is you my latest 10-10-10 attempt,please?
[Tilt, TyTN II, MDA Vario III Android Development] elander:
n2rjt I did as you suggested me on the whole, take the battery out and put it back in , start with new kernel and charge, and to be honest I saw and improvement (or at least I perceived it that way) as the battery went SMOOTHLY from 100% to 82% after about an hour and 15 of playing music thru the speaker (volume almost at maximum) so to me thats a big improvement, and also the battery draining while sleeping was less than before, so again another improvement, however I tried using wifi when I had like 72% and after like 5 minutes it when down to 4%, I don´t think the battery meter was lying when it told me I had 72%, because I was watching the voltage closely and it dropped from something like 3775mv to 3120mv, so I believe that the meter when down to 4% because of the voltage, thats something you have always mentioned, i know, but the thing is that I turned off wifi and restarted, and guess what, the meter went back to 22% and the voltage wnet from 3120 to 3462 and was getting higher by the minute, so like five minutes after I rebooted the voltage was back to 36xx, so I think the reason why I always seem to get such an awful performance with battery is only because wifi demands too much juice at once, in which case, after I turned it off I get the voltage back to normal, but the meter gets messed up for good, so I guess if I keep restarting and restarting I could get the meter to show a more accurate reading (in case the battery isn´t actually reaching the bottom 3.0v). I know you have looked into it, (I know that´s one of the things you proposed as a solution)so is it there any advice on how to "tell" the meter to way more before asuming a sudden drop in voltage means a drained battery? I´d really apreciate that, thanks!!

P.S: My battery has never gone beyond 4184mv, is it like the top voltage for a new original 1350mah battery, or it should be able to go higher?.
[Tilt, TyTN II, MDA Vario III Android Development] wolframio74:
any news????

PD: this thread must be stick on top!!!!!!
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
In 10-10-10 and later kernels, the kernel says something like this:

I think that some of you are getting the meter stuck below 100% even when charging overnight because the voltage never reaches 4190 mV. I will commit a change today lowering the voltage threshold, because the current threshold is more a important indicator of a complete charge.

Also I am working on a Kaiser and Polaris battery meter application. Post your requests here. This would be my first Android app, so it might take a while for me to learn. I would appreciate any help if you are experienced at writing Android apps.

The goals I have for the application are:

view the current battery level and capacity, of course.

perhaps view a chart or log of the recent battery level based on the dmesg logs.

change the battery capacity value without re-installing the kernel.

Set the battery meter to any percentage, if you know that the meter is wrong.

Automatically calibrate the battery capacity, even across reboots.

The application will need to be able to read /proc/kmsg (or execute dmesg) and read and write /sys/modules places, so it probably has to run as root, or perhaps come with a native Linux component. Yes, this is ambitious, and I might never finish it. So please no "is it done yet" comments, only "how can I help" comments. :)
[Tilt, TyTN II, MDA Vario III Android Development] -Arturo-:
n2rjt, I have some strange issues with my battery/battery meter. I would appreciate if you could help me. I've been using your battery status for a few weeks now and suddenly I started experiencing strange issues. First I will provide you with OS monitor readings as they are very strange... 3755mV -354mA charge 100/100

(-1469/4320 units, -919/2700mAh) I've tried a few version o '25 kernel with your patch and I still get those strange readings. Well at the moment my battery shows that it's full therefore when i connect charger it says that it's charged and it doesn't charge. My battery drops from 100% to 1% after few hours of usage and then when I connect the charger it does indeed say that the battery is being charged but it stays at 1% all the time(even though the battery is being charged because I can use my phone for hours after disconnecting the charger) When I disconnect the charger I get this pop up saying that I need to connect my charger the meter shows 1% but after a while it starts showing 100% all over again. My battery is kind of old so I 'm wondering whether it's an issue with the meter or maybe my battery's life is nearing to an end?
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
Oh, that is so bizarre! The units are supposed to never go negative.

I will inspect the source code, to see how the units can possibly go negative.

In the meantime, you might try one of these:

1) Set the battery level manually:

Use "adb shell" to connect your computer to the phone.

Then use this command:

echo 20 > /sys/module/board_kaiser_battery/parameters/set_percentage

That will set the battery meter to 20%, setting the units to 430.

2) Force the kernel to do a coarse calibration:

Shut down, pull the battery out, re-insert the battery, boot.
[Tilt, TyTN II, MDA Vario III Android Development] -Arturo-:
Thanks N2rjt. I ll do that as soon as I figure out how to setup adb shell. Also I have flashed the latest '25 kernel this morning and there is a progress...I changed unit number to 2600 using a hex editor and os monitor showed me 2513/ 2600 units so the negative numbers are gone. Unfortunately the monitor doesn't update unit numbers and it was stuck @ 2513 units and 98 percent in battery monitor until it discharged completely.
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
What happens when you pull the battery and then reboot?
[Tilt, TyTN II, MDA Vario III Android Development] -Arturo-:
Well I did that and after boot first a pop up showed up saying that I need to connect a charger after about 30-40 seconds the meter showed battery as full....and also negative numbers are back in os monitor:) I'm going to do adb shell commands now to see if it helps.

I've just remembered that on the day the issue occured for the first time I had pulled out the battery while the phone was connected to charger. Could that messed up something?

N2rjt I have some trouble setting up adb shell. I get "error device not found" error all the time. I have installed windows xp usb drivers(the one downloaded using android sdk) I've managed to install them after second attempt and indeed there's an entry in my device manager called Android Composite ADB interface but there is a exclamation mark next to it so it looks like a problem with drivers. Could you send me your drivers provided that you use win. xp? Thanks
[Tilt, TyTN II, MDA Vario III Android Development] daedric:
Just for the Info, my bat is at 4.194V, 87.0%, 36.8ºC charging from USB, Wifi On (not connected), Bluetooth ON (not being used), 3G ON (being used).
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
I'm thinking something is wrong with your phone. The ds2746 chip is not working like it should.

I use Linux, not Windows.

Maybe you can capture the dmesg logs by using the OsMonitor app, and send to me? I don't think I can do anything for you, but I am curious what could possibly be broken.

Try this attached 2.6.32 kernel. It is the latest, same as l1q1d's but I have patched the battery meter so that it cannot possibly go negative. Does it help, or just change the problem?
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
When the voltage exceeds 4.17V (originally 4.18 but recently lowered), the metering code starts to look at the current. When the current is positive (charging) but less than 40 mA, the meter calibrates to 100%. If the current is high, like 300mA, the 87% is probably accurate.

The temperature never changes, does it? That part of the code isn't finished, except for Vogue.
[Tilt, TyTN II, MDA Vario III Android Development] -Arturo-:
N2RJT this version of kernel seems to be working fine; no negative numbers, the units and percentage meter are adjusted(although they fall down kind of fast-it might be the new kernel) Could I have a '25 version of kernel with this fix please?

EDIT:

The strangest thing has just happened. I have just reflashed to my previous '25 kernel and it is also working fine . Seems like the new kernel fixed the issue also for the old kernel.:) Will test some more and report back if anything breaks again. Thanks N2RJT.
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
I have committed the change to 2.6.25 as well.

Here is an image built from the current 2.6.25 sources.
[Tilt, TyTN II, MDA Vario III Android Development] -Arturo-:
There's something wrong with the kernel it doesn't boot at all. After "smart mobility" screen it just goes blank.

Also I think that "battery capacity" entry is missing in the kernel.
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
:confused: I think I don't know how to build a 2.6.25 NBH.

I'll try again, and test it myself before uploading it.

Sorry.
[Tilt, TyTN II, MDA Vario III Android Development] -Arturo-:
Thanks for your help.

Also just reporting that my old '25 kernel is showing negative numbers again it happened after pulling battery out.:(
[Tilt, TyTN II, MDA Vario III Android Development] alkis87:
After two days of reading I just installed "kernel-11-5-n2rjt" and the battery meter went form 100% with the "kaisimg-panel2-240x320-2.6.32-tilt-froyo-09-09-10_21" to 25% with the new one.

the actual readings now are: level 25%, volts 4216mV and temp 36.6 (temp has not changed). After 2 minutes a got 26% and for now i am still at 26%. This charging rate look more real to me and i hope its gonna keep this way charging and discharging. n2rjt thanks a lot for the help . if you want me to try anything please let me know. This is my first HTC and I am looking forward to see it working as it should.
[Tilt, TyTN II, MDA Vario III Android Development] alkis87:
after the charge was done the battery was realy hot and the discharge went worst

the reading showed 99-98-97-96% and then 3% and went of.

any help plz!
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
The code I have modified improves the meter, does not affect actual battery performance. The temperature code is not implemented.

If you want to see details of what is happening use OsMonitor to view dmesg logs and filter for "ds2746".

If battery meter jumps from nearly 100 percent to very low, maybe the battery capacity you have entered is too high. That might also explain why one kernel said 100 while the newer one said 25. Use atools and enter the actual capacity with the tool.
[Tilt, TyTN II, MDA Vario III Android Development] alkis87:
I have the kais 130 device and from what you have written i suppose that we have the same device so i installed as it was. (Am I right?)

From the OsMonitor i got (while the device is charging) the following conclusions.

a) the "units adjusted " started with 2160 and the current was 126mA .

The current started to drop from 126 mA until 57mA while the rate started from 96% and reached 99%

then "units adjusted " started readjusting its units keeping the 99%.

The charging hasn't finished and now i have 54mA @99% with 2160/2160 units and 2174 units adjusted.

b) i suppose that for a full charging i should have 0mA and an unit adjustment that is close to the real capacity something like 2200 units or more.

From what you see can you tell me if the patch is working ?

I will be happy to provide you with any other detail for solving this annoying problem.

How many hours does your battery work now?

Once again thanks n2rjt for the help
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
This was all explained in earlier posts.

The adjusted capacity is a guess, nut authoritative. All of the units are supposed to mean mAh x 1.6.

The battery is considered charged when the current stays under 40 mA for 30 seconds without going negative.

From what you describe, it seems to be working. I am guessing that you have a 1350 mAh battery. If it drops from almost 100 to under 5 percent suddenly, that would mean the battery voltage is far less than it should be, probably an old battery.
[Tilt, TyTN II, MDA Vario III Android Development] alkis87:
You are right the battery is two years old but in WM it worked fine for at least 2 days.

I reached 8mA in charging with 2375 units but the discharging didn't go very well.

the phone was drying in an average of -250 mA or one unit per 10sec (refresh rate of the OsMonitor). This looks too much for me!!!

The battery has 3.7v and 1.35Ah=5Wh (normal for a mobile battery)

supposing tha its gonna last for 2 days (48 hours) in GSM mode it shoud dry

5Wh/48h=0.1 w or 100mW

100mW/3.7volt=28mA if i am correct

as it shows it dries 10 time much more

an the question is : Do I have an old battery or the phone is taking too much energy?

Can you tell me your current consumption and for how long does your battery last?
[Tilt, TyTN II, MDA Vario III Android Development] albertorodast2007:
questions questions... so much questions!! lol :D had a similar issue... how much higher is consumption in the .32 i kernel, is it way too much? or is it just giving inaccurate readings? or in the worse of cases both!!??? used both kernels over a donut instalation and the difference in consumption is almost twice!
[Tilt, TyTN II, MDA Vario III Android Development] xnakeg:
man im using fat free froyo with your test #6 this is the last one????

how can i help u for do testing

i have a at&t kaiser battery 1350 no overclock

test #6 and i put 1350 in normal settings in atools

fat free froyo
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
My discharge is 300 to 800 mA.

Android drains much more than Windows.

For me, I have two batteries.

The old one is rated 1600 mAh but seems to actually hold about 800 to 900. If I configure for 1350 mAh the meter jumps when discharging, but if I set battery capacity to 850 x 1.6 it works well.

My new battery is 1350 mAh. The meter works well with it. That battery lasts 4 to 6 hours normally. It lasts longer if I don't use the phone.

Android keeps the data connection active all the time. Windows does not. That makes a big difference.
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
By the way, I like your analysis.

I think that 48 hours is too much to expect even in Windows Mobile.

But, your analysis shows that Android will last no more than about five hours.

That also sounds sadly accurate.

My son has a Samsung Captivate, and its battery only lasts five or six hours. So I think the problem is Android, not Kaiser.
[Tilt, TyTN II, MDA Vario III Android Development] waterpolo:
Same on the Polaris.

The battery life is short with Android then Windows.

May it's possible to disconnect the data connection after ie one hour?

The same applies for bluetooth.
[Tilt, TyTN II, MDA Vario III Android Development] alkis87:
First of all I have to tell you that my battery is about two years old in normal condition on WM 6.1 but at least in WM it keeps running more time.

Somewhere in XDA I found a thread about radios and their uptime period. I am suspecting (nothing personal :p ) that the radio version is what makes the

consumption change in different OS.

I can't think of any way that one OS dries more power than one other. That's why I believe that radios might be an other aspect of the problem.

Does any other has the same opinion?

albertorodast2007 did you change the radio or only the OS? and for the record how much does your battery last?

n2rjt I have read all the tread about the batteries and your patches but 6 hours is not satisfying for a phone don't you think?
[Tilt, TyTN II, MDA Vario III Android Development] albertorodast2007:
yup, i changed it, I used a 1.65.xx.xx radio when using winmo (those boring days.... :D ), then i changed to a froyo release (and a .32 kernel) using the same radio but it was a total disaster! :( I still dunno if battery readings where totally inacurate or if froyo ate my baterry just as my toddler drinks a bottle full of milk! I almost couldnt use it without been plugged to an USB or the charger... then I found the wise advice of warbyte, changed my radio to the latest one (found it over the winmo rom dev forum) a 1.71.xx.xx, changed my kernel and build too for the ones he made, and everything went from hell to heaven!! :D well i have something to clarify, before updating to android i changed my OEM batt for a Seido 1600 mAh... so I cant compare winmo's batt "hunger" against andriod's one... but right now with a mid use (couple of hours in wifi or 2g, no bt nor gps, some emails, facebook, a lot of ebuddy messaging lol, 5-10 sms, 3 or 4 calls no more than 15 mins long) last me from 6AM when wake up for work till 12-1PM.... I realize winmo lasted me almost the same but as I said... it was a 1 n a half year old batt with 1350 mAh vs a brand new one with 1600 mAh....

EDIT: i tried to use os monitor to find out how much it lasted for me but couldn't succed cause the #$%@!!! app fc before the batt drain all over.... but what i could DO see is that both "units" (dunno whats that!) and mAh reached 0 and like 15-20 mins (just before it FC and freeze) my tilt was still on!! maybe it fc BECAUSE of the unaccurate reading? or just a pure coincidence....

what do you think bout my case n2rjt??? could i just reflash the same .25 kernel but just trying to use a higher value of mAh?? ohh! that was another Q? i had! if i DONT enter any value? wich value should android will use? i mean... wich is the default value on the kernel? or it just guesses it just like winmo?? (like when u buy a new batt and had to drain it all over and charge it all the way up like 2 or 3 times before the readings are accurate)
[Tilt, TyTN II, MDA Vario III Android Development] n2rjt:
Didn't you report earlier that your battery meter dropped from 90-something to almost zero, or was that someone else? Because that sudden drop means either the battery capacity is far less than configured, or the battery is weak and doesn't hold its voltage very well under a current draw.

The symptom you just reported means the opposite. If the units say zero but the phone is still alive, the battery capacity is higher than configured, OR any earlier calibration was overly pessimistic. I think that the FC is probably unrelated, since OsMonitor just reads the dmesg log.
[Tilt, TyTN II, MDA Vario III Android Development] albertorodast2007:
I guess i made that report when I used the old radio, froyo and the .32 kernel. Well gonna try using 1800 mAh on the batt advanced option in atools, then I'll see how much batt life i got and maybe with some calculations i could come up with a more accurate % in the reading of my batt, even though i wont use the correct mAh value of it.... I'll post my results latezz...