yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] Deliamber:
I see you're on T-Mobile. If the issue just started last week, you may be suffering the problem we've encountered and investigated here.

T-Mobile support forum thread (started under G2 forum, but many other models are being reported affected)

TL;DR: T-Mobile appears to have borked their HSPA+ network in some areas. The changes are causing many 3G phones not to idle correctly (constantly polling or re-negotiating the 3G connection or something) and they dump their batteries in 6-8 hours, even with no use at all. Forcing 2G/EDGE for the cell connection is the current known workaround until they fix it.

EDIT: Sorry, hadn't seen your later post.
[Nexus One Android Development] RogerPodacter:
Well the kernel compiled without errors, so if anyone really wants to test just let me know. How ironic if this bug is finally killed after all the trouble the timeout bug gave us during this project's activity. Now at the end it's fixed.

Caveat is it's a Froyo build environment do quick nand restore, flash, test one charge cycle, then nand back. I also didn't compile the wifi module.
[Nexus One Android Development] kemkem42:
Hi all,

Few days ago i've received a new battery for my nexus.

I'm not sure now it was a good idea, but i've reset battery stats (by recovery) and proceed to a bump charge, then reset stats again.

I've done it twice because the first time, charge process jump from 55% to 22% and was stuck at this value. (bump charge and reset)

Now, my battery life is quite good (around 20 hours) but battery indicator is crazy.

Just after being unpluged, its drains quickly to 27%, stuck at this value for a while, then drains again to 2% and do the same.

I've drain several times to 0%, but i've read some posts saying that's not a good idea...

Is it a good idea to calibrate battery using this tool ?

Or prior wipe/re-install cm7 ?
[Nexus One Android Development] mtw4991:
wiping battery stats in recovery does nothing for your battery. I would try to calibrate your battery with the app. If you get crazy numbers like 27500mAh, then your battery chip is wacked and cant be calibrated.
[Nexus One Android Development] kemkem42:
I got 27306 in full40

and 104856 in capacity...

So, that's not possible ?
[Nexus One Android Development] waylo:
Nope not possible. Looks like you got one of those bum cheapo batteries that can't be reprogrammed/calibrated.
[Nexus One Android Development] kemkem42:
shiiit !

i just got it from a web shop. it seems to be a real htc product, same model id as the original one !

(cost me 25€)

is it possible that i made a mistake with these several drain to 0% / bump charge i've done ?

i've observed today that the battery indicators are quite better.

instead of drain quickly to 27%, it drain smoothlier to around 58%

is that possible it going better ?

thks for replying !;)
[Nexus One Android Development] RogerPodacter:
no you didnt do anything to ruin the battery. you got one of the knock-offs. how it works is, the app in this thread reads register values from the chip inside all of our individual batteries. official OEM batterys have fully working registers, but some of the cheap batteries we test, the registers are hard coded or locked out. so they dont function correctly. so that's why your percentage is all over the place, because your full40 register and capacity register are hard coded to the maximum possible value of 27,000 which is way off the scale. that's why your readings are not making any sense.

nothing you can do, the registers are locked. you CAN still use the battery, but you just wont be able to rely on the percentage meter.
[Nexus One Android Development] waylo:
These online web retailers for these batteries are really completely unreliable. No way to tell if the chip you'll get is real or not. I doubt some of the sellers even know the difference in what they're selling.

I'm awaiting one right now, sent from Texas, close to where the HTC repair shop is based. According to the ebay posting, it's "guaranteed genuine." We'll see.

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=330465846911&ssPageName=STRK:MEWAX:IT
[Nexus One Android Development] Mayday_XL:
When is a calibration necessary ?

After every CM7 Nightly-Update ?
[Nexus One Android Development] temasek:
For N1 especially, u cannot use your battery till 0% unless u perform calibration.

By performing calibration, your battery will be able to last till 0%. That is how a battery should be in the first place. If your battery dies before 0%, you are not in control cuz u wont know when your battery will die. Is it 10%, 13% or 16%...... if u are not in control, do a battery calibration. :)
[Nexus One Android Development] Mayday_XL:
Thanks for the info.
[Nexus One Android Development] n0w4y:
Some quick question:

I followed the step-by-step guide from mtw4991. When it comes to setting the aEvolts, I only get the possibility to send some code to setreg (only 1 textbox in the app).

Do I have to type

Register:0x 66 Value: a4, press save and

Register:0x 65 Value: 06, press save

into the same box, or does the kernel which I use not support calibration?
[Nexus One Android Development] mtw4991:
No, put 66 in the Register box and a4 into the value box, then press Save. Now go back and put 65 into the Register box and 06 into the Value box, press Save.

Done!
[Nexus One Android Development] jbbandos:
Hello all,

I'm having problems calibrating a 3700mAh battery. I wasn't finding it very strange that it would have a life similar to the original 1400mAh one, but when I started calibrating (with less than 10% left, according to my N1), the voltage was still above 3850mV. I've left it running the learn mode detection all night, and now the voltage is still 3615mV, and the percentage left has been reset many times. It has entered airplane mode some times, and has stopped recognizing the SIM a couple of times too, making me shutdown and power the N1 back on again to be able to leave airplane mode. I'm running MIUI 1.7.30 with Wildmonk's AVS kernel.

Am I doing right by letting it keep depleting the battery so much below the (very high) point where the N1 thought it was empty? How do you guys recommend I proceed with this battery?
[Nexus One Android Development] RogerPodacter:
First thing is to determine the quality of your battery, post a screen shot of your dumpreg, or a shot of the first tab in the app so we can see your values. From what you initially say it seems like you are not getting the full capacity of your battery. And we've seen this before, high capacity battery with a wrong full40 value, causing you to only get the same usable capacity as a stock battery.

Then the next step could be a learn cycle if it looks necessary.

Edit:damn the give sway is if your full40 is set to near stock. It should be near 3700 or whatever size battery you purchased.
[Nexus One Android Development] jbbandos:
The full40 was set to near stock indeed, 1700 or something. After two more hours the battery finally reached 3201mV, the final steps from 3500mV down were relatively fast.

Probably I did something stupid when I started using the battery, as it does seem to have a lot of capacity above the standard one, but the N1 was detecting it as empty when it was still above half (3900mV).
[Nexus One Android Development] jbbandos:
Well, it seems that the battery is ok - after a full calibration the age is 100%, and the Full40 2700. Seems like using it as a 1450mAh instead of the real 2700mAh has helped protect it a bit.
[Nexus One Android Development] mtw4991:
Is your battery 3700mAh or 2700mAh? your original post said 3700? If 2700, I would set full40 to something like 3500mAh and redo the learn cycle. You may have a better battery than its' rated for, i.e. 2900mAh or 3300mAh. If you set full40 to 3500 and learn cycle auto-corrects age to something like 77%, then you know its a 2700 battery.
[Nexus One Android Development] RogerPodacter:
Well remember there is nothing that needs protecting, these values don't harm, its only blocking the full range of usage. Make sure you set full40 to a proper value before doing a learn cycle, otherwise the cycle ia wrong and worthless.
[Nexus One Android Development] waylo:
I just received the battery from this seller. Looks like it is a real HTC stock battery, with a programmable chip. Set the age, min voltage, etc. Stock capacity is 1452. Trying a learn cycle now, will let you know the batt age.
[Nexus One Android Development] jbbandos:
Yes, I mistyped on the first post, sorry for that. After the calibration and the reboot, I've had it go down to 50% and charged again, and the battery full charge seems to be 2684mAh. Close enough to the 2700mAh it is rated for.
[Nexus One Android Development] jbbandos:
By "protecting" I meant I was using it on a subset of its capacity, and wasn't stressing it much, never going below 60% of its real capacity.

Also, as I wasn't seeing much difference between it and the original battery, I had started to use it only as an emergency replacement for the original 1450mAh battery, so the usage was pretty low after the first couple of weeks. Now, thanks to you guys, I can really use it as my "main" battery!
[Nexus One Android Development] schizophrenia:
OT question.

is the battery the very fat type?

if not, where did you get it?

thanks.

By the way, anyone tried this one? Is this calibrate'able?

http://cgi.ebay.com/ws/eBayISAPI.dl...&ssPageName=ADME:X:AAQ:US:1123#ht_2523wt_1163
[Nexus One Android Development] jbbandos:
Yes, it is the very fat one. The hologram sticker has JDX1005, and I got it in a pack like this, from the same vendor. I've already bought some stuff from him over the last couple of years, and I am satisfied with the goods and the emails I received from him.

PS: From my ebay history, I have the battery for over one year, so it doesn't seem too bad that it charges to 2684, even if after the first month I've only used it as emergency replacement.
[Nexus One Android Development] CAL7:
Thanks, waylo. I'll get one myself. Let us know how it goes.
[Nexus One Android Development] waylo:
Learn cycle got up to ~1419mah, so almost 98% of full40.

Had some strange fluctuating current draw at the very end, so possibly could have pushed just a bit more juice in. But all-in-all, pretty good, for a first calibration.

Looks like the seller raised the price $1 since I bought it, but still, a good source.
[Nexus One Android Development] waylo:
My first extra battery looked like that, and did have a good programmable chip, and it's still my primary battery, batt age is 90% of full40 of 1600mah. It's been about 6 months.

However, I know of many others with the same looking battery where the chip was crap. The seller I got it from, in fact, started supplying the cheapo battery after his existing stock was gone.

So, in essence, there's no way to guarantee it. I stuck with a "OEM" HTC battery, even though it has a slightly lower capacity.
[Nexus One Android Development] mtw4991:
That is mine also, but as Waylo said, I think seller is replacing with cheaper ones now.
[Nexus One Android Development] schizophrenia:
if you dont mind me asking, how exactly do you guys know he is using cheaper ones now?

less capacity of the battery?

unstable current?
[Nexus One Android Development] waylo:
That's not the *exact* seller. But the appearance of the battery is the same.

The seller I bought mine from 6 months ago was featured on this forum. I think a few of us bought from him. And then a month or so afterwards, someone reported getting a non-programmable battery from the same guy.

The seller was here:

http://myworld.ebay.com/r3cube_sales/

He's no longer selling N1 batteries.
[Nexus One Android Development] mtw4991:
Some have bought them and the chips were programmed incorrectly so they couldn't be calibrated.
[Nexus One Android Development] Dr Byte:
Progress on testing the TIMEOUT bug fix?

Any luck with that GB build, RogerPodacter? Any results from the FroYo test build?

I'd love to have a go at this myself, but it's a very long, steep learning curve to set up a build environment. From what I gather so far, you guys tend to use an Ubuntu VM for this job. Any particular version requirements? I have a few old DVDs around with dated versions of Ubuntu.

My phone has been unstable more often than I'd like lately. I'm not 100% sure if it's the voltages, the kernel, or CM. I'm likely to update to 7.1RC1 soon, which will put me back on the CM kernel instead of EViollet's ManU 2.0... that reduces the variables by one.

The two most common symptoms are: locking up tight with a BSoD - as if the battery is flat; and spontaneous reboots that sometimes complete, and often end up still spinning at the Cyanogen circular arrow forever. Both end up needing a battery pull :(

I think it might be time to make a special one-off version of my "volt fix" script, and push all the voltages well into the safe zone. That, at least, I can do while the Kernel is baking. Intuition says it's a temperature/voltage interaction. Low temperature, in this case.

Edit: Did both; now running CM7.1rc1 - and a new script for the ManU kernel, but EViollet is on holiday so the stock kernel will have to do.
[Nexus One Android Development] RogerPodacter:
No I ran out of hard drive space when syncing the repository, so I just made your change to the Froyo kernel, compiled it and its ready to go. I never got anyone to test it.

But if we could get someone to test it, and it works, I could just push the fix up to the main cyanogen 7 repo, so that in the next nightly it would be available to everybody.

Its actually not too bad setting up a build environment, there's a really helpful guide from cyanogen. I used virtual box and installed ubuntu 10.04, then just follow the steps.

I'm not familiar with your bsod issues unfortunately. Shoot me a message if you decide on trying out a build setup, its prob easier than one might think only because they provided a great guide.
[Nexus One Android Development] Dr Byte:
I'd be more than willing to test it as an installable kernel for GB, but my only FroYo backups are Stock (Sense) ROMs I'm afraid.

My server is VMware, and space is the least of my worries; I found cyanogen's wiki on setting up to build kernels (http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source), but it has a huge amount of assumed knowledge on Linux. I have a running Fedora VM, but it's only used as an "appliance" because most of my Unix knowledge is BSD based (particularly FreeBSD). Binary-only machine. If I could work out how to install the packages, I might have a hope. It's like going to the US. They use all the same words for different things! Or going to a bathroom in Europe - every one has unique and elaborate plumbing that needs twelve different adjustments to have a shower.

Even the man pages say to do exactly what I've been doing - but probably fail to mention that they've configured defaults elsewhere, such as where to find packages.

I think this would be of general interest, if there's a good, no-assumed-knowledge walk-through :) My attempts so far have ended in frustration. I know the "what" but not the "how." Details are everything :) Link, please, unless it's the one above :)

Maybe someone in the CM community could compile it for us and squirt it back as an installable .ZIP? As I mentioned, I'm more than willing to be the guinea-pig.
[Nexus One Android Development] RogerPodacter:
You're in luck cause before I wiped my old ubuntu install I saved the cyanogen wiki guide from last year. You're right the current wiki has some things removed which makes it a bit hard for a first timer. You basically can just copy and paste from the old one and get setup. I have them just in case now.

We can take off line to not clutter this thread. Maybe someone could do the setup and document it exactly and post a new thread guide. I did a new setup last week based on it, got all packages installed, stopped at the gingerbread repo sync due to space. So it should work.

Worst case i'll switch to a usb hard drive with ample space, compile gb, and should be good to go. Lately I've been trying to build the atrix kernel which is a bit different. And im still a noob of course!:)
[Nexus One Android Development] schizophrenia:
http://www.ebay.co.uk/itm/1600mAh-B...699?pt=LH_DefaultDomain_3&hash=item56456746d3

anyone tried this one from this seller?

does it have the chip for accurate calibration?

thanks
[Nexus One Android Development] jukyO:
Thanks for a great hOWTo. Can it be used on Desire?

This is my issue:

anyone managed to use Battery Calibrator tool on MIUI? I've downloaded it and installed it, but whichever values I enter inside, they are not accepted.

If I enter 1b,c and 2a,b press save, they are not shown in the tool. Or it can be only used on N1?

Thanks,

jukyO
[Nexus One Android Development] pdazevedo:
Thanks and thanks!
[Nexus One Android Development] jukyO:
Obviously it was kernel issue. Changed kernel form default XPART MIUI to tiamat kernel. Now I was able to do as per instructions.

Thanks once more.
[Nexus One Android Development] Dr Byte:
Kernel building & Timeout bug

Had a few spare hours last night and gave it a go.

Eventually got it to work, after the first sync failed due to a timeout before the build tools arrived. Sigh. Rather dumb algorithm, it went and downloaded everything again. Modern programmers are used to infinite resources. Rather than being given the latest generation hardware, they should be FORCED to use two-generation old hardware :D

Anyway, I have a "before" and "after" zImage ready to build into a kernel ZIP for flashing, but haven't yet put my hands on a suitable ZIP to stick it in (I don't have adb).

I don't have a ZIP for the stock CM7.0.3 kernel (or 7.1rc1 which I'm running now), but I do have several for the ManU kernels, so I'll have a look at those unless I can find a CM one. One would think that the makefile for a kernel would produce one anyway.. but that would be too logical.

It'll be a good day or so before my battery is low enough to charge for long enough to matter, so in the meantime I'll hone the debug code and search for a "carrier" ZIP to use in Recovery.

Suggestions for a good, safe vehicle to get my new zImage into the phone? (noting that this is a 7.0.3 kernel going into a 7.1rc1 OS - for some bizzare reason, the 7.1 branch isn't in the repository.)
[Nexus One Android Development] RogerPodacter:
You can just flash the zImage directly to the phone as it is. You don't need to package it into a zip. Just use fastboot.

fastboot boot zimage zImage

That loads the kernel as a one time test, next reboot will revert back to your previous kernel.

fastboot flash zimage zImage

That flashes it permanently to your phone.

Personally I sometimes had trouble with the first command for some reason. It was some weird thing, it only worked half the time. Permanent flash worked everytime.

Both commands the zimage needs to be in the same folder as your fastboot, sdk/platform tools folder.
[Nexus One Android Development] resynx:
Can this battery be calibrated?

http://www.seidioonline.com/product-p/basi16hnx1.htm
[Nexus One Android Development] RogerPodacter:
Seido can usually always be calibrated, along with mugen, both are always high quality the best you can buy.

Note Seido was selling false capacity sizes, selling 1100 mAh as 1300 mAh, and the only reason users found out is due to the ds2784 chip and this calibration process. It was from palm pre and somline pioneering this.

Yes buy Seido though, its fine for nexus users.
[Nexus One Android Development] resynx:
Ah thank you very much for the quick response!
[Nexus One Android Development] Dr Byte:
Good theory. As I said, I didn't have the SDK (no adb) available. After more than an hour of frustration installing the (unwanted) JDK and SDK, "fastboot.exe" complained about the missing adb dll - which I solved too, but neither of these commands work.

D:\Software\Android\android-sdk\platform-tools>fastboot boot zimage zImage

creating boot image...

creating boot image - 3667968 bytes

downloading 'boot.img'...

OKAY [ 0.641s]

booting...

FAILED (remote: not allowed)

finished. total time: 0.641s

D:\Software\Android\android-sdk\platform-tools>fastboot flash zimage zImage

sending 'zimage' (1789 KB)...

OKAY [ 0.312s]

writing 'zimage'...

(bootloader) signature checking...

FAILED (remote: signature verify fail)

finished. total time: 0.516s

Despite claiming to have succeeded, the first one didn't load the image at all; a brief charge attempt showed no diagnostic messages from my code. I rebooted right from the fastboot menu immediately after the PC-triggered reboot failed. Bizzarely, a "fastboot reboot" command worked without a hitch, but even when done immediately after - had no effect. No diagnostics in log.

The phone is not S-OFF, and I have no plan to make it so.

I think I would have been better off spending the same amount of time building a ZIP instead - and I wouldn't have all this mess on my PC.

So much for the 'easy' option. The Universe is determined to stop me doing this.
[Nexus One Android Development] mtw4991:
Don't know if this would help, but:

Is adb/fastboot seeing your device? code: fastboot devices

Did you try it in a root shell?

For the latter, you can turn off signature verification in recovery and should be ok, or resign the file and rename it.
[Nexus One Android Development] Dr Byte:
Yes, it saw the device. This was the first thing I did. The phone was connected to an XP box; my only lin*x box is a VM on a server - no USB. The uploads even work, and the phone sees the computer too - it just won't do the next step. The critical one.

This is fastboot, not CWR - sig verification is turned off in Recovery but I can't see how to do it in fastboot. As for signing, I've seen a java commandline for doing it, but I don't know if I have the keychains or applets to do it. This is all new stuff for me.

I noticed there is a "getvar" command, (update) you can do a "fastboot getvar all" but there is nothing useful there.

Looking around the 'net, it seems that you *do* need S-OFF to get these commands to work.

HOWEVER, I did find something more than a little intriguing.

I charged the phone from about 70%, for over an hour... without a timeout error. The only difference is that this charge was immediately after a power-up from cold (battery pull.)

I plan to do this next time as well, in a few days' time - perhaps it is, as I thought earlier, a typecasting problem within the timeout() function: that is, larger values of the "uptime" may not produce predictable results as per a freshly booted phone. The time definitions are convoluted.

This bears testing - anyone else want to try that? Shut down, boot, charge from <70% for >2 hours and look for TIMEOUT errors in dmesg

Of course, it still doesn't explain how the PC (program counter) gets into that else if() clause in the first place - the charge current should be over 1ma. Something is definitely not right in the state of Denmark. I have a handle on why, but need the diagnostics to confirm it. Chicken and egg.

Actually: bad analogy. It has been firmly established that eggs were around long before chickens.
[Nexus One Android Development] Dr Byte:
TIMEOUT bug not present in 7.1rc1?

Actually, it seems much more basic than that.

Perhaps the reason I can't find timeout errors in my log, or a logic fault in the current battery driver source... is that the code has changed since 7.0.3, and now that I'm running 7.1rc1 the problem simply doesn't exist because the code now works!

Roger - you might want to try 7.1rc1 if you're not there yet. I just charged the phone again, with no timeouts... and it's been up since the earlier posting quoted above.

If I can dig it out, I'll try to find out from the repository when 7.0.3 was built, and whether it was before this latest incarnation of the driver as I suspect.

Anyone getting timeouts in 7.1 using the standard CM7.1 kernel?

I did, on 7.0.3 with ManU 2 kernel (which has different logic)

I can certainly see how the older driver in ManU can throw this error as of the code in the ManU2.0 repo tonight. However, despite trying hard, I can't find a 7.1 repo (let alone a 7.1 kernel) to absolutely prove the point.