yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] mtw4991:
then it's not just me. I just checked the ds-2784battery file and had 2 "getFull40" files in there..wtf?? deleted one of them and rebooting now...will report.

Edit: damn, deleted one of the files and rebooted...Double getfull40 files again. It's in CM6.1 Nightly #290 kernel or rom I guess. Gonna try WM's and see if it fixes it.

EDIT#2: It's definitely the kernel in Nightly #290, I flashed WM custom 1190 kernel and there is not a "double file for getfull40" in it. Both v.8.7 & v.8.8 working fine. I'll let Cyan know.
[Nexus One Android Development] Smokeaire:
Great report....pity that CMs kernel is causing the issue. I might try WMs kernel. Again, thank you.
[Nexus One Android Development] RogerPodacter:
yeah the problem is on the nightly build unfortunately. if 2 identical files show up that may give the app problems. perhaps we could add some kind of error check for a future version so it at least doesnt give a force close.

anyway you will just have to wait till the next nightly comes out with a fixed driver, or temporarily switch back to a different kernel. thanks:)
[Nexus One Android Development] overground:
Given your recent experiences with your stock battery (#2), do my numbers still appear erroneous as seen here: http://xdaforums.com/showpost.php?p=9731430&postcount=621? Thanks for everything.
[Nexus One Android Development] RogerPodacter:
there is no way for me to know from your screenshot because i couldnt see your mAh numbers near the top of your learn cycle when it was about to finish. did you have a jump to full etc? normally when age stays at 100% that means the learn did not complete, or you didnt reboot for the age to updte itself.

for my learn cycle last night, i was able to watch the mAh keep going during the charge up and up passed 1400 with no jump whatsoever. but unless you watch it and look for a jump or not, there's no way to know from just a static image snapshot. sorry i cant help more. do you remember what happened during your cycle?
[Nexus One Android Development] overground:
Well, the info is kind of confusing. How am I supposed to watch it when I am told to have the screen off after hitting the learn flag? I'll keep reading and try it again soon. Thanks for the response.
[Nexus One Android Development] RogerPodacter:
right well i take a peak quickly every so often, though sure you do risk failing it if its close to the top. you can of course just look at the dmesg log in OS monitor after the learn is completed, which would show you the last few hours of battery numbers such as mAh, volt, current, etc.
[Nexus One Android Development] overground:
Thank you. I'll try again.
[Nexus One Android Development] mtw4991:
Battery Monitor Widget on the Market will monitor the charge every 50s like OS Monitor while the phone is asleep but will go 1-2 days so it's good for overnight.
[Nexus One Android Development] Nighthound:
I had previously done the learn cycle and have a battery age of 85.

Yesterday, I forgot to charge my phone and it ran flat out of battery and shutdown. After I charged the phone, I restarted it and realized my battery age got reset back to 94.

1. How do I manually set it back to age 85? I assume I have to use some setreg command because there isn't any function in the app to set age.

2. Can this function be added to the battery calibrator app? Currently there is only the button to set age max. Can it be modified so that we can specify what age we want to set to as well?
[Nexus One Android Development] mtw4991:
1) 0x14 6e to reset to 85%

2) I think several optimazations are in the works
[Nexus One Android Development] RogerPodacter:
Yes we are thinking of making an advanced tab with some of the commonly set registers so It's easier than using setreg all the time. Maybe we'll start that next...
[Nexus One Android Development] RogerPodacter:
Damn my battery was attempted delivery today. That's 7 days from Hong Kong for only 24 bucks, 19 of that for the battery. How is that possible...
[Nexus One Android Development] mtw4991:
Its called a jet airplane;)
[Nexus One Android Development] RogerPodacter:
Tee hee Hoo lol, I meant for 4 bucks they can ship like same day air! Then it sat in dispatch for few days... ;-)
[Nexus One Android Development] Nighthound:
Thank you! Is there any reference on the 1st post that explains how to arrive at 6e for age 85? I looked at the spreadsheet documenting the various registers, but it doesn't explain how to do the conversion of age to the value to be written to the register.
[Nexus One Android Development] Annihlist:
Maybe converting making a decimal input instead of hex will be easier in a GUI. for the not so technical folk ie set age: 87 increase mah: 400. Just a suggestion instead of referring directly to registers.
[Nexus One Android Development] dvgrhl:
An age of 100% is represented by the integer 128, or in hex, 80.

6e in hex is the integer 110.

110/128 = 0.859

I'll probably make a way to enter in a new age as an integer the same way we do for writing to the ACR. Maybe allow a range of 70-100 or something. I'll try that for next release.

On an unrelated topic, I finally tried my first learn mode tonight and it worked so I guess we're doing something right. :)
[Nexus One Android Development] zen kun:
ok i posted before my screens of my battery im using a 3000 mah chinesse battery ho wmuch i set up in full40 3000??? there is like 2700 in full40 right now, its weird because i wiped battery stats when full but i got a really drain from 99%-70% but here its weird stop drain fast and now the percent drop slow, and something weird happen yesterday i see 70% then i check my twitter and i saw 68% and then again like 10 min i see the clock and was again in 70% o.O i drain the battery and shutdown at 0%

well i will try calibrate my stock battery then :S

i will try follow of fisrt post

so in "learn mode" i remember i should full charge and then drain? with the learn mode? so what should i do? expect drain or use my device as always? using 3g BT headset, music or just let battery die doing nothing? in 2g?

well sorry if has been asked but i really try figure out and i missed in all pages ._.

ps. i read about edit regex in stock battery how about in 3000 mah?? what hex number should i use

thanks a lot
[Nexus One Android Development] mtw4991:
I did a learn mode last night with the 12/12 app and it worked flawlessly. All the app really needs for most people is a way to enter the age as an integer as previously stated...then it is very easy to do. Regardless of app used, I always get 87% or 88% upon completing the learn cycle and that is just probably a rounding up/down by the app.
[Nexus One Android Development] RogerPodacter:
actually you can just use the app, and on the second tab type in your desired full40 value, click save, and it will set the new full40 value for you.
[Nexus One Android Development] mtw4991:
I would do the following for my 1st learn cycle to see if your 3000mAh battery can really hold that much juice:

Set to 3500mAh in app on LearnPrep tab.

Set age to 100% in app on LearnPrep tab.

Set aEv to 3201 in setreg: 0x66 a4

Set end charge <20mA in setreg: 0x65 06

Check the boxes for both Wake Lock & ACR Adjustment in app settings.

Charge the phone a few minutes.

Turn on some apps so Current draw stays above -200mA (pandora+hotspot?)

Turn on Detect Learn Mode in LearnMode tab of app, it should say "Waiting..."

Watch as Real-Time Voltage drops to around <3201 and a popup should appear telling you to plug the charger in as Learn Mode is Active..PLUG IN NOW.

The LearnF button should be lighted and you should see in the status reg 0x71.

Turn off hotspot, pandora or any apps you used.

You can continue to use the phone normally until charging current gets to approx.<100mA, then turn on airplane mode and turn screen off and wait.

I don't have a clue how long a 3000mAh will take to charge-to-full. 5-6hrs?

The learn cycle will be complete when the charging current drops to <19mA avg. over two consecutive cycles, but don't peek near the end!

Good luck.

PS-with that big of a battery, I'd get it into learn mode at night and go to bed:p
[Nexus One Android Development] RogerPodacter:
Well I just popped in my new battery and took screens of all original values. My status register has those 2 flags on, under volt and power on. And my full40 was set wrong to 1452, so I set it to 1652 for now.

I don't have any of those ff registers like some people had. And my first impression is this seems like a high quality battery, just physically looking at it. When I get back to the office I will post my dumpreg.

Charging it now, it was 52% at 3.7volts out of the box.
[Nexus One Android Development] starfarer:
link to batt pls.
[Nexus One Android Development] RogerPodacter:
www.htcrepairparts.com
[Nexus One Android Development] RogerPodacter:
OK so i have now had to raise my full40 from 1600, to 1700 then 1800 and now i'm at 2000mAh for my full40 because the charging keeps going above it.

but i'm not so sure that means extra usable capacity, i will have to time the actual usage vs the voltage thru the day to compare. i went in the dumpreg and checked the current offset bias and RSgain registers for each, and they are set differently. these are quoted as being responsible for how the current is measued, and i've seen some crazy high currents on both of these, like -1050mA using google maps. never seen that high before. so i dont know what those values mean.

also, notice in your dumpreg, b0 and b1, those are not really zero. mine shows 9d and 0d for my original battery. the problem is the driver code when i submitted it, for some strange reason those 2 registers only give correct readings with a certain version of the driver (the version with dmesg log expanded). all other times it falsly reports zeros for those values. i'm stumped as to why and was never able to solve it. maybe someone better than i can do it. i copied and pasted the dumpreg code EXACTLY, yet on one it works (shows b0 and b1), and one it does not (shows zeros there). yet all other registers show fine on both. craziest thing i've ever seen.

the point is that is the factory RSgain value for reference.
[Nexus One Android Development] RogerPodacter:
also, my aged capacity is set to 1395 which is wrong for this battery (stock is 1393 anyway). and age was set to 100% out of the box.

we know stock nexus batteries are "broken" because their age never counts down like its supposed to, and it resets itself to 94% all the time. i wonder if these after market batteries will actually have a dynamic age value that counts down over time. considering the proper brand new condition is 100%, and these meet that, maybe these will work properly.
[Nexus One Android Development] starfarer:
thanks for the link. Please updates on the battery as I'm interested to get one of these rather than getting from ebay.
[Nexus One Android Development] gaeng4665:
Hi, do i need to calibrate my battery every time i flash a new rom? Or will the learn cycle be stored somewhere?
[Nexus One Android Development] RogerPodacter:
no, once you calibrate, you now know your correct age value. this is stored inside the battery chip, so it shouldnt change between ROMs. however it does reset itself every once in a while (its a glitch) so just periodically check your age, and if its not set to your new age value, manually set it yourself. eventually we can make the app do this automatically for you, but for now just manually set it...
[Nexus One Android Development] mtw4991:
curious to see your results over a couple of learn cycles...and still waiting on my battery from HK. Mine musta been sent with the stork, not the jet:D
[Nexus One Android Development] gaeng4665:
what do i have to type in setreg to pump up the battery so it doesn't die prior to 3201mV??

My battery is at 8% and mV not near 3201. I remeber there was something i could type insetreg, but can't remember or find it in the thread....
[Nexus One Android Development] RogerPodacter:
Yeah I'm curious to see my actual usage times. My workday schedule is like a rock so I know exactly where I'm at thru the day. Will be interesting to compare.

I finally hit full charge, my full40 ended up being 2000mAh. One thing I'm noticing is I'm pulling down enormous current values, -1250mA just browsing the web. Me thinks the offset is definitely not calibrated / properly set, which is why we see such high full40 values. Still though that doesn't mean anything bad, will just have to monitor real world results.

Eventually I could set the current offset to the same as our stock battery and see how that works. Will report more later.
[Nexus One Android Development] mtw4991:
0x10 04 in setreg
[Nexus One Android Development] gaeng4665:
whoa your info just came in time...:eek: phone almost shut down at 3%

thanks again
[Nexus One Android Development] mtw4991:
Next time, use the Battery Cal app v.8.8 and check the boxes in the settings menu. This way the ACR will bump up your mAh automatically when your mV get to <3400mV. If you are still running out of mAh prior to getting to <3400mV, then use the setreg command to save the day!;)
[Nexus One Android Development] martin0285:
How much better battery life are people actually seeing using the calibration??? If your battery lasts to 1% already is there any need for this???

I've read almost every page and couldn't find the answer, sorry if I missed it...
[Nexus One Android Development] RogerPodacter:
you really dont need to do a learn cycle if you make it all the way down to 1%. but i would suggest that you make sure you arent under using your battery since you make it all the way. check if you run out of mAh at the same time that you approach empty volt. cause you possibly could raise your full40 if you arent using all your capacity.

then of course you could lower your empty volt from 3.416 to 3.201 to extend your battery range a bit. as well as lower min charge current from <80mA to <20mA to give a slight boost at the top end. both of those help give an extra squeeze out of your battery.
[Nexus One Android Development] redstar3894:
This was probably due to the recent changes theloginwithnoname submitted to CyanogenMod... I noticed it when I tried committing it to my kernel... merged okay, the code itself looks okay, but it definitely breaks something in the battery calibration app.... :confused:

https://github.com/CyanogenMod/cm-kernel/commit/41a604909b8dff4c08036cd11ab6eb0efaab153e

Haven't been able to get a logcat of it happening yet, other issues cropped up and I ended up reverting the commit....

I'll try to look into this a little more later if I have time... :p
[Nexus One Android Development] dvgrhl:
A birdie told me that if you do a search in the market for "battery calibrator" you will find the newest version of the app. I don't know whether I believe it or not, but if I did search for it I would be sure to uninstall any previous version first.

In all seriousness, thanks to everyone for testing things out for us. Roger and theloginwithnoname did a tremendous job on the battery driver. Without that work, none of this would have been possible. And Roger put an enormous amount of time into this app. If his enthusiasm would have burned out anywhere along the way, this thing wouldn't have happened. He is what kept things going. So please show him your appreciation.

So now that we are in the market, updating should be much easier. I realize in my excitement to publish to the market, I didn't update the version so we are still at 0.8.8 even though some things have changed. Oh well. We're working on some UI enhancements with Cosmin (nemuro) so expect a much more polished looking app soon.

We're open to requests for features, so please let us know what you'd like added or changed.
[Nexus One Android Development] temasek:
Great work and congrats! I had the honor to be 1st to comment in the market. Nice. :)
[Nexus One Android Development] pwig:
It force closes ever since I updated to nightly 293. Anyone else?
[Nexus One Android Development] temasek:
For the moment you have to flash other kernel like wildmonks or pershoot.
[Nexus One Android Development] chowlala:
Congratulations everyone! What a journey! Never imagined the brainstorm thread would've sparked off something so incredible like this. =) Let's keep pushing the boundaries! Haha.

Btw, androidpolice posted up a pretty good write up on some battery stuff, just thought maybe some of you might be interested.

Link: http://www.androidpolice.com/2010/1...bump-charging-and-inconsistent-battery-drain/
[Nexus One Android Development] RogerPodacter:
My 1600 battery ended up having full40 of 2550mAh after all was done (which I honestly think the current is just not calibrated). Seems really strong so far! Today at work will be the interesting test.

I purchased the app battery monitor widget. I wish our app can do that function at some point:-).
[Nexus One Android Development] chowlala:
OKOK! I'll buy the damn battery too! JEEZ! Haha. Where's the link? :rolleyes:
[Nexus One Android Development] streamleaf:
Hi, I'm using stock N1 battery.

I have done the calibration twice, but can't get to solve this problem.

I followed the procedures, except the setcpu part (as I didn't do any overclocking).

After the learn cycle was completed, I rebooted the phone. Everything seemed fine, with age displayed as 100%.

However, the phone showed the "connect charger" reminder when it hit 15%, and then shut down by itself immediately.

So I connected the charger, and turned the phone back on shortly after; but then the age was again displayed as 94%.

Did I miss out something? I'm now doing the third cycle.

Your advice is much appreciated. thanks!

p/s: another weird thing is that after I turned the phone back on (after it shut down by itself), the battery level would be around 5%, then I activated the learnmode to start another learn cycle. However, at one point, the battery level would be bumped up to ~30%
[Nexus One Android Development] mtw4991:
I pm'd cwirl yesterday about the double file and he posted #teamdouche, so they should be aware of it now. Also tweeted @cyanogen, @chrissoyars and @pershoot...so somebody will fix it, lol.

Btw, congrats for getting the app in the Market so quickly. Figures Temasek would be all over it!;)
[Nexus One Android Development] mtw4991:
The stock N1 battery shouldn't show 100%...that tells me that the learn cycle got interrupted at some point, probably a wake lock timeout issue. Try using Pershoots latest kernel which has a 3 hour timeout mod, do the learn, then switch to WM or whatever.

Also, don't really worry about the setcpu part as it's not really needed. I put it in the instructions as just a double backup..just in case. Don't reboot the phone next time, power off manually then power on and it should reset age if the learn cycle was completed correctly.

In OS Monitor or Battery Monitor Widget(my fav) you should see the current(mA) going into the battery drop to like 21,20,19,19>100% for a successful learn cycle...AFTER it is done. Don't peek, lol! If it jumps from like 34mA>100% then learn got interrupted. Don't use the phone at all once current mV gets under 100mV, just put it into airplane mode so you don't trigger a spike which would drop current to <20mA and end the cycle prematurely.

The reason that it bumped up to around 30% is that the ACR is called when you are <70mAh remaining and under 3400mV. It's there to keep you from running out of mAh before reaching aEvolts of 3201.
[Nexus One Android Development] temasek:
During learn cycle my capacity can reach max around 2545mAh before settling to a modest figure below my full40 of 2500mAh. I might also change to 2550mAh ;)

My 1600mAh battery into its 1 week plus usage and now I am regularly clocking I considered a solid performance of 12 hrs ++ per 50% battery on average usage. As per your findings, I also find the voltage rather strong for a 1600mAh rated battery.

I am happy. :)
[Nexus One Android Development] streamleaf:
Thanks for your advice! I have downloaded the battery monitor widget so that I know what went wrong if the third calibration fails also :D touch wood....
[Nexus One Android Development] mtw4991:
Updated in-thread instructional post. Login, can you update Post #3 on OP page please.

http://xdaforums.com/showpost.php?p=9583271&postcount=340
[Nexus One Android Development] tech338:
I've tried this several times with my stock battery and it seems that my age is not being set automatically. I've drained the battery with flashlight/pandora/hotspot and successfully set the learn flag. Plugged in and powered everything down and put into airplane mode.

My log seems to indicate that it was successful and my battery age should be 91%

http://pastebin.com/RLegD9JM

So I guess I can just set my battery age at 91%. I guess my Full40 stays at 1452 and my capacity/aged capacity will be updated automatically?

On thing I've seem to notice is my PORF flag (POR flag?) is set and never seems to change...:confused:

Using Geo's ROM, latest battery app from the market (great job BTW) and Wildmonks Kernel (2.6.35.8 w/o 720p.)
[Nexus One Android Development] RogerPodacter:
I'm not sure why your age wouldn't update after a reboot. But from your log just set age to 91% and you should be good to go.

By the way your stock battery voltage at full charge is the highest we've seen up at 4.192 at full charge.
[Nexus One Android Development] Old MuckenMire:
Thanks for all the work you guys put into this app!!!! I just installed yesterday and now it's in the market...pretty cool!

Quick question: my battery age says 94%....does this mean that when I charge to 100% that it is actually at 94%, and that when I hit 6% it will shut down? And would setting the age to 100%, would that give me abything on the top end, or just make it shut down at 0% rather than 6%? Hope this makes sense :)
[Nexus One Android Development] mtw4991:
Are you rebooting or powering the phone off & on manually? You need to power off/on manually to reset age, not reboot.
[Nexus One Android Development] mtw4991:
No, it doesn't mean it will shut down at 6%...more like 10-15%. Setting age to 100 would make it shut down at an unknown point.

You need to do a successful learn cycle to know the true age of your battery.
[Nexus One Android Development] Old MuckenMire:
Oh okay thanks man :)
[Nexus One Android Development] theloginwithnoname:
double file is by design (it will be removed when app uses lower-cased filename) and, as *nix OS/filesystem, should not cause any issues.

Jon/RP, can you debug through and see what's failing? If OK using lower-cased filename, update market and I'll get the other file removed and pushed out.
[Nexus One Android Development] theloginwithnoname:
Done, sir!
[Nexus One Android Development] tech338:
I am powering off/on manually. I tried that several times (not rebooting). Perhaps it is related to my ROM or my kernel. I am not running Cyanogen, but instead a close-to-stock ROM. Also, I am running a wildmonks kernel that is targeted to a more stock froyo experience without the 720p code.

Everything else seems to work well. Only issue is I have to check the OSmonitor logs to find out the age of my battery and set it manually. NBD.
[Nexus One Android Development] Annihlist:
Bought a 1600Mah battery from Ebay. Completed my first learn cycle with max set to 1700Mah. Came out at 93%. So I basically got the 1600Mah battery I paid for. No more juice.
[Nexus One Android Development] RogerPodacter:
I actually do a reboot using quickboot app, and that seems to update my age properly after learn cycle.
[Nexus One Android Development] mtw4991:
another weird thing..I have to power off/on to reset age, reboot always stays at 100%, idk, but nbd.
[Nexus One Android Development] beatmania82:
Does this app needs to be rooted inorder to use?

tried to install BatteryApp20101203.zip, open the app, and it exit right away.

tried latest version in market 8.8, it will force closed.

Thanks.