yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] RogerPodacter:
SetAEvolt can only be set in increments of 19.52mV, so it will round it to the nearest point. That's why sometimes its a little off from what you actually set. What I do is just bump it up a little from what I actually want to set.

For example if I want to set 3.201 I'll just enter 3210 which will round it down to my desired setting. Also not sure I mentioned but you can use that set volt file to do this. Just open it with root explorer, clear all the text, type "3210" and save it. That sets it for you. Remember no decimal place is used for it.
[Nexus One Android Development] samarium:
Seems a reasonable test, however see http://xdaforums.com/showpost.php?p=9259355&postcount=886 and you might want to settle for 80%.
[Nexus One Android Development] mtw4991:
Which one or need to enter both?

Nm, set both now full40 is 1558, age is 100, empty is 3201. All should be good right? What should i expect to see, roger?
[Nexus One Android Development] samarium:
I too am having problems with battery comms timeout breaking learn cycle. Sometimes I get 3-4 timeouts in a full 4 hour charge cycle, although, of course, learn is killed by the first.
[Nexus One Android Development] samarium:
Both, as together they represent one number.
[Nexus One Android Development] RogerPodacter:
I can't remember if you've already posted your dumpreg and full40 yet. From that log you posted it doesn't look like your full40 is correct, but I couldn't see the entire log for some reason. It looked like you were only at 1700mAh at full charge. However if you do want to set your age to 79, its:

Echo 0x14 66 > setreg

Similarly, you guys can just save to the setage file, as "95" and save it. That would set to 95%. The only problem is there's a rounding issue so it always saves 1 number lower than what you entered. It's fixed for the next version of the driver..
[Nexus One Android Development] RogerPodacter:
Yeah I kinda feel bad I didn't catch this when we submitted the final driver. Cause all my testing I did I bumped up the time out poll to over 2 hours so that I was able to complete the learn before any time out. But when I submitted I didn't even think bout it and left it at stock value.

Hopefully re submitting wouldn't take too long. But the bigger question is what side effects, if any, does raising time out cause? I didn't see any issues when testing. But what is the point of the time out? Is it a bug? Etc. It basically kinda makes any app useless till we solve it... :-[
[Nexus One Android Development] GunPR:
I have a question about the app that is coming out for this battery issue. This will work on any device running android? or is just for special type of phones/batteries running X version of android..?

And if there is any thing else that will need to be done and installed other than root?

Thanks in advance.
[Nexus One Android Development] mtw4991:
Ok, got full40 set to 1558, age is 100, empty is 3201...currenfly at 83%, 1281mAh and 4140mV prior to setting to 1558... What should i be on the lookout for?
[Nexus One Android Development] difrnt:
I did I think it's back on page 75.
[Nexus One Android Development] EnhancerFIN:
I have 51% battery left now, with 3771mV and 747mAh..

Continuing the drain, still have the full40 set to 1500mAh so we'll see tomorrow whether that is enough high to compensate the lowered AEvoltage which I set to 3201mV.

Gotta say, this is quite huge battery life with this wildmonks avs-bfs kernel as I'm running with 1152min-1152max setcpu profile when screen is on, min384-max652 as the screen off -profile. Everething is very fast and responsive.
[Nexus One Android Development] temasek:
Lol......I think I am doing exactly same test as u using same values.
[Nexus One Android Development] EnhancerFIN:
Copycat :O ;)
[Nexus One Android Development] RogerPodacter:
I would just use your device normally and keep checking your numbers as you go. The goal is to reach empty volt the same time you run out of mAh. I find using normally gives the best results. If I try to purposely drain the battery at max everything, often then high load pulls down the voltage in a non-real-world-conditions way which can kinda throw things off a bit.

After your first full drain I would do another just to make sure everything was lined up correctly. Good luck.
[Nexus One Android Development] RogerPodacter:
Ok I remember now. Just checked and work full40 is set to 3560mAh, so you should be in pretty good shape. Do you see any problems, like turns off early etc?
[Nexus One Android Development] RogerPodacter:
It will only work on any ROM using the new edited battery driver, which right my is pershoots kernel and cyanogm ROM upcoming release. And only for the nexus one. Maybe in the future it could be expanded to other phones, not sure yet.

Plus there's a lot of cool things we could do I guess. But it will have to go thru versions. First one will basically just hit learn mode.
[Nexus One Android Development] chowlala:
So silly. Didn't realize the text pieces was interfering with the values. Thanks bro.

How bout the setreg? Can't seem to modify this one no matter what. Even pulling it via adb tells me some I/O error.
[Nexus One Android Development] RogerPodacter:
Well setreg won't show anything when read. It's a write-only file. So it shows blank, and you just write 2 values to it, the register you want to write followed by the value you want to write to that register. Space between the 2 values. There's no way to read an individual register on command, so that's what dumpreg does, just spits out a summary of every register.
[Nexus One Android Development] GunPR:
Thanks for the reply.

Well in my case i think i have to wait then. This battery issue is driving us (X5A) users thru the wall. Is a shame that we have a nice gadget and this battery crap is preventing us to give the proper use because the OS is shutting down and giving erratic readings on the battery.
[Nexus One Android Development] chowlala:
Heh. Crazy.

Same thing goes with the getFull40? I tried entering some values, but no changes show up when I view it.

EDIT:

Heh, nevermind, just realized I gotta dump it into the setreg. Brain so not with me this morning. =)

EDIT 2:

Ok, getting in on the nudie battery scene.

Testing out: full40 at 1558 mAh. Setage at 100. AEvolt at 3201. Will report findings at the end of the day.
[Nexus One Android Development] RogerPodacter:
Well I have not looked at the battery driver for that device. It's possible if it uses the same battery chip that the same changes could be made to interact with and pull the battery values. Long shot but who knows. Is the source code released yet?
[Nexus One Android Development] mtw4991:
So basically, im looking to see somewhere around 3200mv when it hits around <20mAh before shutdown, right?
[Nexus One Android Development] GunPR:
No, thats the big problem here. This a chinese product as well you know this guys dont follow the GNU code, telechips which is the chip maker blame the company that makes the tablet for it for not releasing the source and they (telechips) still wont release no code or nothing. We are stuck in this device and is a shame man really it is because is a really nice gadget, other than the battery problems i love this thing.

It sucks that we have a dual battery 7.4v (dual core 1300mAh = 2600mAh) according to the seller. And the tablet is shutting down @ 1hr and half or 2hrs at most with low usage already showing 10% warning..

Then we have to squeeze the remaining battery life turning on the tablet again lasting for 1hr to 2hr showing 10% till it goes no further and starts freezing while booting up..

The only way i found to squeeze everything at once, is charging the battery while the tablet is off, opening recovery and erasing the battery stats.bin. Thats the only way i can run the tablet all the way without the automatic shutdowns. Battery readings are still wrong dont matter what.

But the funny thing is, the OS knows when the battery is really low (when i do the charging while is turned off and the wipe battery method) because it do the automatic shutdown once the 4-6hrs battery (depends of the task you are doing) It dont do a blackout (running the tablet all the way till the battery run out of juice) instead it do the auto shutdown once and thats when you know you need to recharge again.
[Nexus One Android Development] pwig:
from my original post #937 requesting help, here are my two files. I renamed them to .txt because I couldn't upload them otherwise. got them by using file manager and then copying them to my sdcard root.

Thanks in advance for your help.

I have done some research and this battery is probably counterfeit. Its lifespan over a day may be about the same as my original batteries, but I can't be sure.

View attachment dumpreg.txt

View attachment getFull40.txt
[Nexus One Android Development] RogerPodacter:
well you should take a look thru every possible folder to identify which battery model its using. for example this thread is about the nexus ds2784 battery, which you can find by going to /sys/devices/platform/ds2784-battery/.

check thru your folders and see if you can find something similar, maybe a different model. note it could be anywhere, not just in the sys/devices path. so look everywhere.
[Nexus One Android Development] Hacre:
Brand new Nexus One, charged once via mains when it arrived (while switched off) to 100%, used all day, sometimes on battery sometimes on usb.

Just ran it dead, last measurement I saw about 5 minutes ago was:

4% battery level at 3508mV. Shortly after I noticed this in System Monitor the phone shut down.

Turned it back on, it booted into the OS then shut off again.

Power on #2, booted to lock screen, touch screen wouldn't respond.

It refuses to accept a power on #3. Leaving it off now to put on mains charge.

Hope this helps someone. Thanks for the advice on first use calibration Marine6680.
[Nexus One Android Development] fruitsalt:
ive been trying to recalibrate mine and will follow the advice on this forum.

i just updated my kernel to wldmonks 800mv bfs for froyo, and put it on charge,

was showing 94% when i plugged it in and after like 5 mins the led was orange, i checked to see and the battery was at 86%... dont know why it went from 94 to 86 on charge ... any idea guys ??

and its charging at 1% a minute
[Nexus One Android Development] jettrue:
Sometimes I think the battery display gets "stuck", then all of a sudden it gets "unstuck" and shows the right number. Perhaps your phone was showing 94 incorrectly for a while, and then BAM, it showed the right #. I've had this happen.
[Nexus One Android Development] chowlala:
Yeah, I noticed a slight fluctuation this morning, when my readings showed 4.1xx then next thing 4.0xx, then it was back at 4.1xx.

Was a really brief occurrence though.

Anyone with ideas on what an app for battery could look like and how it would function?

So far we've agreed on having a standard way to measure the battery.

So I suppose we're saying we want something that monitors:

1) Last unplugged

2) Average power usage over that period of time

3) Helps us calculate % loss per hour (so we don't need to do all this work, rofl)

What else?
[Nexus One Android Development] theloginwithnoname:
OS Monitor will tell you this. Say your phone jumps from 94 (x) to 100 (like mine did on Froyo 72 last night):

check how many minutes it was on x-2 and how many minutes it was on x-1 (it writes/displays another battery line every 50 seconds on mine)

if the number of lines for x was similar to x-2 and x-1, it's not got stuck - if they are way out, it did!

I've also noticed that, even when at 100%, it still "trickles" the mAh value up a bit - worth leaving it on for 10-15 mins after 100% and see what I mean. Mine trickled up from 1340 all the way to 1361 yesterday.
[Nexus One Android Development] SiNJiN76:
Mine goes down to 1%...and stays there for quite some time before powering down. This is on Froyo and CM508. Prior to those versions of the N1 ROM, the phone would shutdown @ ~15%.
[Nexus One Android Development] chowlala:
I've definitely been experiencing better battery life by simply turning off the phone once it hits 100% and leaving it charging for about an hour more every morning. I can easily hit 12 hours and be on 50% still right now.

Still doing more testings. Applying the use of a memory killer now.
[Nexus One Android Development] fosormic:
That is because the charger slows the process down in order to avoid damaging the battery. See Marine's post in this thread, this exact phenomenon is explained. It will reach 100% when the phone is off, as being of doesn't drain any poser (hence you will not see the gauge keep goin up).

Now, if the gauge is supposed to indicate 100% [my Nexus does] when the actual charge status is 95% then best thing would be to follow Marine's advice: let it die and then charge while off, but dont do this every time or you will wear it sooner than its design lifetime...
[Nexus One Android Development] fosormic:
sorry, I posted duplicate info...
[Nexus One Android Development] Dai323:
Hmm..strange this is an issue with so many people. My Nexus One powers down normally at 1 or 2%, I ve never had it go down with anything over 2%.

I ve always had success with wiping battery stats after the phone dies. I just charge while the phone is off until light is green, boot to recovery, wipe the stats and then reboot. Phone is getting very good life on newest Cyan build.

I also use alot of widgets and have 7 homescreens, but I havent ever had really bad problems with this. One thing i do notice is that people who use SetCpu seem to have this issue more, and not less, despite the customization options.
[Nexus One Android Development] chowlala:
Interesting. Are you running on stock kernel? Since you seem to suggest you don't use SetCPU.

I know one thing is pretty certain though, and that is the stock kernel by Google is still the beast in terms of battery life.
[Nexus One Android Development] Marine6680:
My gauge always gets to the 0% red battery outline with a slash in it. It will stay that way for a few minutes before shutting down. I am running full stock ATM.

Also, for you people charging the device (on or off) when you see the green LED leave it charging for a little while longer; that ensures the battery truly is topped off.
[Nexus One Android Development] chowlala:
Actually. The battery will never fully top off if it's charging while it's on. It'll only truly hit the top when you turn it off and allow it to continue charging. =)
[Nexus One Android Development] RogerPodacter:
Today I got my battery to 1368 mah at 99 % which was a little higher than anyone posted before. I thougt that was strange.
[Nexus One Android Development] theloginwithnoname:
I got 3172mAh today when I powered on from an off-charge!
[Nexus One Android Development] daveid:
theloginwithnoname, You got 3172mV probably, the battery is a 1400mAh battery. It would explode long before 3172mAh could be pumped into it.
[Nexus One Android Development] sstang2006:
From HTC customer service
[Nexus One Android Development] theloginwithnoname:
yep, I made a typo - should have been 1372mAh; whoops!
[Nexus One Android Development] chowlala:
Wow. This is pretty interesting. Will give this a try tomorrow. =)
[Nexus One Android Development] rori~:
From HTC customer service

Had to do that for better reading ;)

................................................

The following steps should significantly extend the battery life on your phone.

1.) Please connect the phone to the charger with the phone powered on, and allow the phone to charge until the notification LED is green, indicating the device is fully charged.

2.) Disconnect the phone from the charger, and power it off.

3.) Reconnect the phone to the charger with the phone powered off, and allow the phone to charge until the notification LED is green.

4.) Disconnect the phone from the charger and power it on.

5.) Once the phone is powered completely on, power it off again and reconnect it to the charger until the notification LED is green.

6.) Disconnect the phone, power it on, and use it.

You need to use this sequence only once.

If the issue of battery life on our phone persists, I recommend you contact our HTC accessory department directly, by dialing 1-888-716-3594.

Their business hours are Monday to Friday 8:00 AM – 8:00 PM Eastern
[Nexus One Android Development] RogerPodacter:
ok so this is definitely some kind of weird knock off, or something like that. your full40 registers are maxed out at FF FF (or 255 for each), which if you happen to crunch the numbers gives a full40 value of 27306mAh.

so what you could do is try to set a reasonably full40 value. with the current setup i have no idea how your battery has been functioning correctly lol.

what is even crazier is that your AEvolt register is also maxed out at FF, or 255, which gives an empty volt of 4.977 v which doesnt even make any sense. i'd set that to 3.2 volts as well.

those are 2 big errors that could really fix up your battery. try this:

echo 0x66 a4 > setreg to fix your AEvolt

you said its a 2700 mAh battery? set it to 2750:

echo 0x6a 19 > setreg

echo 0x6b c8 > setreg
[Nexus One Android Development] RogerPodacter:
you got it.
[Nexus One Android Development] GunPR:
2ble post................
[Nexus One Android Development] GunPR:
The folder name of the battery is tcc-battery i cannot see no log whatsoever there. Trying to watch log with OS monitor Message 0.

The only messages im seeing is:

POWER_SUPPLY_ONLINE=1

POWER_SUPPLY_TYPE=MAINS

POWER_SUPPLY_NAME=ac

and

power_supply A: 2 P: /devices/platform/tcc-battery/power_supply/ac

Went inside the folder also only 4096 file which are 0kb files if im not mistaken.

The battery reads goes in 10%'s, there's no 3% not 42% or 91%.

It goes like this 100% => 90% =>80% =>60% from there it drops all way down to 10%.

While in the OS if i decide to use the AC it goes straight to 90% and sits there the entire charging. Then it goes to 100% and reads 8400mV stays there a couple of minutes and starts the process again.
[Nexus One Android Development] temasek:
:D:D:D:D Great minds think alike :D:D:D:D -----:p:p

Anyway my mAh going to finish soon, cross finger if not have to up the full40 again coz the mAh died b4 my end voltage of 3.201

trying to match End voltage 3.201 approx = 0 of mAh

Rather difficult and long testing LOL
[Nexus One Android Development] samarium:
I have a "2700" mAh battery, and the most I seem to be able to charge is to 2550 mAh, and getting it to have a low enough voltage when it gets to 0mAh is a problem.

I've tried charging/discharging with ful40 set at 2750, and the battery is often still at 3550-3600 mV when capacity is < 20 mAh. Only got it to hit learn once by using the torch & maps & gps and so dragging about 1700 mA out of the battery. Tried another 10 or so times and haven't managed it again, which is a pity since the timeout bug killed the learn cycle.

I've currently got full40 set to 2550, and am waiting for it to die, however on normal use this can take 24-30 hours. I'm hoping that with a more accurate full40 then capacity measure will be better too.
[Nexus One Android Development] theloginwithnoname:
(0x81 indicates full only, unfortunately. Look at the bits of the status register again)

Both of you have experienced the "off-charge not on a learn cycle resets battery" issue that I get, as I mainly did* off-charges overnight. RP doesn't see this because he never turns his phone off to charge ;)

In both cases, simply go back and set your age to the learnt value and all will be well.

*since my last learn mode, I have only done on-charges so maintain the age and also test whether I get higher voltages (that should result in higher capacity). First time I got +2mAh full cap over learn, last time I got +6mAh over learn; both times I've hit 4.182mV. I'll probably do one final on-charge then let the battery drain to empty to see what the off mV/mAh are now.
[Nexus One Android Development] theloginwithnoname:
Nice. I'd been wondering if a CM-based phone had startup/shutdown scripts, as I wanted to use the shutdown script to record the final mV, mAh, avg mA, and status reg before the phone died.

Is there a corresponding shutdown/rc0.d script, do you know samarium?
[Nexus One Android Development] temasek:
Failed miserably.

Voltage start dropping fast below 3.5mV. About 3.260mV I still had 304mAh left and it auto powerdown.

My full40 was 1550

Age 100

Stock battery

Lol......now is => buy new battery
[Nexus One Android Development] pwig:
I would like to take your advice but I don't know how.

Please point me to some reading a I would be happy to learn how to edit these files.

This battery is supposed to be 1400mah, actually.
[Nexus One Android Development] difrnt:
Yeah, it was turning off at 25% before. :(
[Nexus One Android Development] samarium:
Not that I can see. You might be able to do something with /system/etc/init.local.rc, however I haven't found the doco as yet.
[Nexus One Android Development] chowlala:
Ok.

So at mAh 1550, AEvolt at 3201, setage at 100.

My battery shut down at 22%. Heh.

So now what?
[Nexus One Android Development] RogerPodacter:
so if you are having a problem of running out of mAh when still at 3.6 volts, i'd think you want to increase your full40 value, no? give that a try next and see. 3.6 is pretty early with a good amount of capacity left so maybe try adding like 200-300 mAh onto your full40 and then see if you run out of mAh.
[Nexus One Android Development] RogerPodacter:
damn really? what were your numbers originally, i.e. how early did it die before these changes? i thought you were well on your way. i'm surprised it dropped that fast at 3.5 but i guess that's about right. i usually see the fast drop start at 3.4-3.2 or so. oh well, i guess that means try setting back to stock full40 with age 100 and see if it dies early.
[Nexus One Android Development] RogerPodacter:
so its a stock battery, but not an OEM? ok if you are running pershoots kernel withthe latest battery changes, in /sys/devices/platform/ds2784-battery/ you will find a file called setreg. open it and save these commands:

0x6a 0d

0x6b 9d

and save the file. do it twice, one for each command, and save. then check the getfull40 file and make sure it shows correct.
[Nexus One Android Development] RogerPodacter:
damn well i guess we are crapped out then. i dunno, maybe when that 1600 battery arrives we can compare that one, and it its worth it buy those as replacements.

i will say that getting a new battery made a difference for me. my original battery from march dies very early. but a new stock OEM i ordered recently can last the whole way down to 0% at 0mAh and that is using age = 100 so its going thru the full 1452mAh. my old battery goes thru like 1100mAh before dieing. so maybe these battery's are just cheap and need to be replaced?
[Nexus One Android Development] chowlala:
Maybe the idea is to be able to align the mAh and the volts as close as possible? Meaning at 1% it should be near the aevolt shut down point?
[Nexus One Android Development] RogerPodacter:
sure but it seemed like it was so far off with a 300mAh difference, like we only have 1200mAh batteries or something. technically you want mAh to reach 18 mAh right at AEvolt, which is so close to zero its basically the same. i would try setting full40 to 1400 and trying again...?
[Nexus One Android Development] chowlala:
Maybe we should lower the aevolt? Cuz I remember having mAh still. I believe the phone shuts down when it triggers the aevolt right?
[Nexus One Android Development] pwig:
So I should do this with terminal emulator?
[Nexus One Android Development] RogerPodacter:
yes you can do it two ways, either terminal emulator, or root explorer/file manager.

terminal emmulator, navigate to the battery folder path. then type:

echo 0x6a 0d > setreg

echo 0x6b 9d > setreg

those are 2 commands, so do each.

or just open up the setreg file in root explorer, enter:

0x6a 0d

0x6b 9d

and save the file. do it twice, save the first command. then open setreg again, enter the second, save it.

then check your full40 file and make sure you see your new setting is there.