yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] samarium:
Note that the "files" you see, ie dumpreg etc, are not really files, they are just a mechanisms to expose data from the kernel to you, and allow you to request the kernel to do things without writing special purpose programs, but rather just use existing programs to do basic I/O to read state and write commands.

The kernel isn't setting LEARNF in the battery, the chip in the battery is monitoring the voltage & current flows, and referring to the set voltage & current levels we set in the battery chip registers/EEPROM.

When the battery is operating, the battery chip detects voltage below the appropriate level and current flow above the appropriate level. The only place the battery looks for the voltage and current levels are in the battery chip registers. It can't look at the pseudo files presented by the operating system, it doesn't have such a mechanism, or a requirement.

When we set VAE via setreg, the kernel intercepts the write request, decomposes it into two hexadecimal byte values, R and V, then sends a command to the battery chip asking it to to to register R and update it with value V. If the register is one that needs to be saved to EEPROM, then the battery will also do that.

When we get age via the /sys/de*/pl*/ds*/age file, the kernel intercepts the read request, and either returns a cached version from kernel memory, or sends a command to the battery chip asking it to return the value V from the age register. This value V is then converted into a numeric string representing the age percentage, and returned to the application doing the read.

The register locations in the battery chip are hardwired in silicon, to change them I guess you would have to use an atomic force microscope to move atoms around, which I would classify as difficult. Not something any of us are going to be doing just to fake a few more ergs out of our battery.

Hopefully that clarifies things for people.
[Nexus One Android Development] mtw4991:
my wife has an atomizer for her perfume...wonder if that would work?;):D

good explanation though!
[Nexus One Android Development] RogerPodacter:
Yeah he pretty much is correct on all that:-). The only thing I would clarify is that all the interface files we added such as age, dumpreg, and status reg, they all give real time instant readings when read, not any cached values. We first started out displaying the cached values such as status reg, which are pulled from the driver which only updates once per minute. But that was not quick enough to give us desired effect, so each file when read calls the battery read register function in real time and gives us the result when that file is read.
[Nexus One Android Development] chowlala:
Haha. Ok, excellent explanation on the battery chips and register. I rest my case on tricking the battery for the time being. Haha.
[Nexus One Android Development] simax:
lol thats funny, how can i reach "shutting down" when my phone turns off before 1%? if i would see a "shutting down" then i wouldnt have to do this tutorial :confused:
[Nexus One Android Development] chowlala:
You can.

When you see the "shutting down" splash screen as your phone is powering off.

Because some of the N1's are shutting down at above 0% battery value.

It's about calibrating your battery.

Anyways, there's a better method to do this already, which is to use the calibration tool. I've updated the OP as of this post.
[Nexus One Android Development] temasek:
Fyi, chowlala is correct. That procedure was before we have the battery app and drivers. The old way as per chowlala still works btw.
[Nexus One Android Development] simax:
i dont see it, my phone (hd2 with android build) goes simply black on about 5%, no shutting down process
[Nexus One Android Development] temasek:
Its posted on Nexus One Forum for a reason.

- It is tested on a Nexus One
[Nexus One Android Development] simax:
saw a link to it in an hd2 thread about batterystats.. i thought it would work with every phone running android os, basically
[Nexus One Android Development] RogerPodacter:
Unfortunately the nexus one uses a different driver and battery model. It may be possible to support your phone, but I've not looked at that driver so I have no idea. Do you happen to know which driver?
[Nexus One Android Development] chowlala:
Lol @ HD2.

Are you dual booting?
[Nexus One Android Development] RogerPodacter:
Ah that's a windows phone, I forgot lol. Dual boot android. All the battery percent meter problems they've had with that project its no wonder they need a battery calibration app. Too bad, our app is exactly what they need lol, but I think its totally different driver issue.
[Nexus One Android Development] somline:
Don't want to highjack, but just for info:

The bumping of ACR doesn't help against shutdown on webOS.

WebOS shutsdown below 3.4V regardless of the mAh.

From the logfile:

BATTERY_IPC: (168.000000mAh, 14%, 14%_ui, 37C, -160mA, 3391mV, authentic)
CHG_LOGIC: Battery level is critical... sending shutdown warning

As you can see, rest capacity was bumped to 200mA (now 168mA) and voltage is below 3.4V but webOS shutsdown.

I never saw something in the manuals that the battery sends some shutdown message. I think the shutdown criteria is implemented in the OS.

However: Changing IMIN to 20mA gave me 2% or 20mAh more than stock 55mA.

I'll try to find something else.
[Nexus One Android Development] RogerPodacter:
Yeah to be honest we searched and searched our code and could never find anything that deals with sending any shut down message. We also checked all kernel code and found nothing except our main battery driver and header file. And the main driver contains nothing about shut down at all.

The only solid conclusion we've found is that android somehow shuts down at whatever volt we set as AEvolt. It obeys that set point no matter what, but we never could see exactly why. So the conclusion I came to is that the battery itself must do some type of power termination which just forces the OS to follow suit. But I really don't know for sure.

For webOS it seems to me from your posted log that the AEvolt set point must also be stored somewhere else in addition to the ds2784 chip since you received that shut down warning message. Where do those messages come from, power config? Is it possible palm anticipated the empty volt point and hard coded it into another location in the kernel somewhere?

I'm out of ideas after that. Not sure how it works, but if you'd like to take a look at the nexus source code maybe you could find something...
[Nexus One Android Development] somline:
Thanks for your idea,

I think the shutdown code is in the webOS service "powerd" which is not open source.

I assume the 3.4V limit is hardcoded there. Still searching for other solutions.
[Nexus One Android Development] RogerPodacter:
Ah powerd, I knew I was forgetting the name. Yeah perhaps that is where its stored.
[Nexus One Android Development] zdiamant:
So I am looking to buy a 3200mAh battery. I like my 2400 one, but I figure since I am using the extended size anyways, I might as well get the larger capacity. My question is which one is a better battery... Mugen or Seidio?

Thanks
[Nexus One Android Development] temasek:
Based on http://batteryboss.org/ I think Seidio is a better choice.
[Nexus One Android Development] zdiamant:
Thank you, I just bought the Seidio one from amazon, we'll see how it stacks up. :)
[Nexus One Android Development] temasek:
Pls post your results as Roger & the rest of us also wish to know the outcome :)
[Nexus One Android Development] zdiamant:
I will.. It is supposed to arrive between Jan 6-10
[Nexus One Android Development] karst40:
My battery is 1850 mAh, can you help me?
[Nexus One Android Development] temasek:
Post in this thread.

http://xdaforums.com/showthread.php?t=765609
[Nexus One Android Development] vaina001:
I have a nexus one and my phone could never powerdown lower than 15%, in other words the lowest the battery went before turning off itself was 14-15%, tried cm6, stock froyo, rodriguez style miui (all versions up to date), stock gingerbread, etc.

Now im able to fully charge my phone and use 100% of the battery, my phone dies at 0% battery and get a great battery life (11+hr heavy data usage) on 3G and more using wifi. I did this by first using clockwork recovery to erase full wipe then going to mount option and erasing each individual partition data, system, boot, cache, dalvik, and battery stats. Then i flash thru adb the amon ra recovery because this does a true wipe of the battery stats but doesnt have the options to erase each partion.

Once thats done then installed cm7 rc2 which has new cm kernel which provides the system with superb battery eficiency.

[/IMG]
[Nexus One Android Development] mtw4991:
Chow, perhaps it is time to ask the mods to close this thread as everything had moved to the other one? Or else they will keep posting here...
[Nexus One Android Development] karst40:
okay,thanks :)
[Nexus One Android Development] chowlala:
Sure.

Mods, could you close and lock this thread? With reference to go over to the one with the utility apk. Thanks!
[Nexus One Android Development] theloginwithnoname:
We should have listened to this soothsayer back in post 8 (Jun 2010)!! ;)
[Nexus One Android Development] Leno2002:
Are there any possibility to add support for the program desires the data path have respected snq-

aosp / cm kernels provide / sys/devices/platform/ds2784-battery

snq-we have / sys/bus/platform/devices/ds2784-battery.0

sorry for the lack of English translation using Google's
[Nexus One Android Development] filippogiad:
I recently bought an original BA-S410 battery for my Nexus One that gives me these strange data you see in the screenshot.

The battery has strange behaviour: it charges completely and it sometimes reach 101/102% of charge, it drains quite rapidly until 25% and then it drains slowly until 0%, then the phone turns off.

I attach also a graphic made by Battery Monitor Widget showing this strange behaviour.

EDIT: Sorry, i inserted wrong links for images ;)
[Nexus One Android Development] theloginwithnoname:
A bit more of the same and a phone call, 13% down in 9 hours!

Even if I adjust the figures to not include the first 1% drop (which took 2.5 hours), that's still only 1.85% loss per hour.

Will try and post again before turning off the phone this evening...
[Nexus One Android Development] mtw4991:
I just did this bump charge thing following HTC's directions so I'm gonna test it also. I also wiped batt stats before putting it back on charger for the final stage so it would be a fresh read.

FYI, when I took it off charger and booted up OS Monitor showed 4197mV and 1427mAh at full charge...which is the highest I've seen on my N1. btw, I thought this was a 1400mAh battery...how can it read 1427mAh???
[Nexus One Android Development] rydr1:
@ mtw, the reason the battery is rated at 1400mAh is because manufacturers only round the numbers to consider it 1400 instead of 1427.

Consider a car battery, everyone calls it a 12 volt battery but it can show 12.6 volts fully charged.
[Nexus One Android Development] stuff:
I believe what the HTC rep wanted us to do was charge it to 90% (when the green light comes on) then power off and finish the extra 10% with the phone off.

Because when the phone is on, it's using juice. So it can't get 100% much. if you've noticed, when it hits 100% and you take it off the charger, it will drop to 99% within a minute or 2.
[Nexus One Android Development] mtw4991:
TEST RESULTS using the method exactly as specified:

93% left after 6 hours 28 mins. HOLY CRAP....how'd that Monkeys' song go..."now Ima believer" :eek:
[Nexus One Android Development] chowlala:
Yeah. It seems the best way to calibrate the battery is to get it to MAX charge with the phone turned off.

And I realized, that the radio refresh rate is the ultimate killer for the batt. You'll notice this especially if you're in an area where your signal fluctuates between EDGE and 3G. Sometimes, it's better to just force it to use either one. Sad though, cuz that puts a dent in speed sometimes.

We need an APP that does one switch between GSM only or 3G only. And I'm not talking bout the widgets that activate it. I'm talking bout the one in the secret settings. Haha.
[Nexus One Android Development] hackm0d:
My battery life is terrible, in that I get 9-10 hours tops with my moderate usage.

I'm going to follow these HTC instructions posted a few pages back and see how that pans out.

btw how hot does your Nexus One get while charging? I can't even touch mine while it charges with the power on and the temp recorded is 43.5 to 45 degrees Celsius.
[Nexus One Android Development] chowlala:
Whoa. That's smoking. I found it's better for the phone if you use a task killer and do a force kill all kinda thing before you go to be charging or something. Sometimes some apps that aren't well designed hang around and heat up. =(

But that's pretty hot yo...
[Nexus One Android Development] hackm0d:
I force kill compulsively after every app I use, since I'm used to the Symbian and WM ways...

I'm using the battery calibration method posted earlier, and will post results. In the meantime I don't think there's anyting I can do about the charging temperature.

btw would it help if I wipe battery stats somewhere during the process?

Like so?

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.) Wipe battery stats in recovery.

7.) Disconnect the phone, power it on, and use it.
[Nexus One Android Development] mtw4991:
reporting back after 20 hours 5 minutes..55% battery remaining with avg useage 2.2% per hour drain...incredible!
[Nexus One Android Development] imfloflo:
@hackm0d just test this methode too i'll report,

FYI i have MCR r21 :

one exchange with push account

one gmail with "push" too

3G

all widget/sociales apps are set to sync manually

Auto brightness on

WLAN off for the moment

CPULedStatut
[Nexus One Android Development] hackm0d:
Are you using the battery calibration method the HTC rep provided?
[Nexus One Android Development] blas4me:
You got it

That's the trick, that's how I get excellent life out of my batteries. You notice when the phone is on, the light is green and it will read 100%, but when you turn it of the light goes orange/red whatever that color is, so if off mode you see the true state of your battery. I posted a thread about this in tips & tricks, about two weeks ago.
[Nexus One Android Development] hackm0d:
Okay so I performed the calibration explicitly as specified by the HTC Rep:

Result doesn't look very promising.

Battery dropped to 97% from 100% in just 12 minutes.

I've got:

Auto brightness on

WLAN on when necessary

EDGE and Push services for GMail on (No 3G)

Widgets: Fancy widget, System Info Widget, IP Address Widget, JuicePlotter widget, Lamppu widget, Twitter widget.

LauncherPro

TaskPanel X with all inactive tasks FCed whenever necessary (compulsively out of habit with Symbian and Windows Mobile)

I also noticed that during the first charging stage the battery temperature was 47.3 degrees Celsius.
[Nexus One Android Development] rookie1082:
@hackm0d

on step 5, did you disconnect the charger "once" the light went to green? Most people find that if you leave it on an extra 30-45 minutes after the light turns green, you get a better charge.
[Nexus One Android Development] hackm0d:
Not really. The light was already green when I plugged it in, and then I waited 10-15 minutes before proceeding to step 6.

Does this mean I have to do it again?

If so, how would I fare if I wipe battery stats after step 5 and before step 6?
[Nexus One Android Development] rookie1082:
That's one thing I don't understand... When wiping the stats in step 6, you're essentially getting rid of the information prior to that..

You could basically power it down, charge till green + 30 minutes after that, then boot up to recovery, wipe stats, and reboot. Same thing, no?

This is what I did -- or am in the process of doing. I did a full, comprehensive calibration (found earlier in this thread), and now amd doing the HTC bump up charge to compare. I am not wiping the stats in the bump up charge though, it seems point less to me. I got great stats from my comprehensive calibration last weekend (almost 2 days on moderate/light use), and will compare this bump up charge to a normal days use.

EDIT: I don't think you wouldnt have to do the whole process again. Just repeat steps 5 (add 30 minutes after light goes green), 6, and 7.
[Nexus One Android Development] hackm0d:
That's my bad, those weren't the HTC instructions, they wouldn't ask you to even go into recovery. I added the sixth step to see if this guide would help. In the actual instructions, the sixth step isn't included.

I'll try doing the HTC recalibration and then wipe the battery stats before the last step and report back.
[Nexus One Android Development] imfloflo:
I'm now at 86%

after 04h15
[Nexus One Android Development] rookie1082:
I'm at 89% after 3hours and 23min

Display - 51%

Voice Calls - 12%

WiFi - 11%

Cell Standby - 8%

Phone idle - 7%

Android System 6%

Launcher Pro - 2%

Dialer - 2%

Messaging - 2%
[Nexus One Android Development] hackm0d:
I performed the battery calibration and then wiped battery stats before the final step. Here's how it pans out:

81% after 1h 58m

Display 73%

Android System 8%

Cell standby 4%

HTC_IME mod 3%

Browser 2%

akmd 2%

Wi-Fi 2%

Mediaserver 2%

Phone Idle 2%

XDA 2%

Android OS 2%
[Nexus One Android Development] chowlala:
Quite sure your widgets could be killing your battery. The task killer too. But hard to say, I don't use em. Heh. And wiping the battery stats might not always be a good idea. So, I'd remove it as part of the recalibration process.
[Nexus One Android Development] hackm0d:
Okay so what I've done is set the Twitter and FeedR update interval to 4 hours, remove most of the widgets and replace them with the Quick Settings app, and now have Fancy Widget update my weather every hour.

I'm seeing as how the steps I performed (thst included the battery wipe) are doing okay so far, just a smidge more battery life, like 10 minutes haha.

After I do a couple of daily usage battery discharges and charges - so as not to tax the battery too much - I'll see what other options I have to increase the battery life, since this method didn't help much.

any thoughts on what else I could do?
[Nexus One Android Development] mtw4991:
I used the method provided by the HTC rep, but at the last step I booted into recovery and wiped batt stats, then turned off and plugged in for an additional 30 mins. I just plugged the charger back in a while ago and it was at 30% remaining after 27.5 hours = 2.55% per hour drain with moderate usage. Mod usage to me means reading lots of XDA, some calls, SMSs, a couple of games, playing with the phone, twitter checkups on CM6, etc,etc. The phone slept for 6 hours overnight fyi.

Using CM6-A1 with Wildmonks kernel 0705_2.6.35-rc4_925mV_BFS-oc'd to 1036/245 ondemand. Only profile is for sleep = 245/245 ondemand. Advanced setting at 40000 (not 20000) and up threshold is 85=pershoots settings btw.
[Nexus One Android Development] stuff:
I've always taken care of my battery, and today proved it.

Basically I had to be at work at 6:30am. I unplugged my phone at 6:14am and went on my way. I didn't touch my phone until about 10:00am.. and it was at 98% battery. Then I sent and received about 4 text messages (8 total). Then I placed my phone down. By 12:00p, I was leaving work. I had 94% battery remaining.

that's 1% average drain on idle per hour. (with a little usage in there)
[Nexus One Android Development] hackm0d:
I'm on CyanogenMod-5.0.8 so I'm using setCPU and have done 1113/245 ondemand and put a sleep profile for 384/245 ondemand. I've got pershoots settings too so I think I'm okay.

Btw is it possible to install that kernel on 2.1?
[Nexus One Android Development] mtw4991:
I don't know if it will run on 2.1 or not, but it sure runs on 2.2 CM6_A1. Also, when you have it set to 1113, I'm pretty sure that AVS isn't used, only SVS=static voltage scaling. If so, then setting it to 1075 would allow AVS to reduce power fed to the CPU unless needed vs. SVS which is full power all the time. Battery savings should result with little noticable difference except for benchmarking maybe, lol.
[Nexus One Android Development] hackm0d:
I've done that lol, battery life is still unimpressive...

Guess I'll get a replacement battery anyway.
[Nexus One Android Development] chowlala:
I tried using the wallcharger for a change vs the usual usb charger yesterday. Powered it off and charged it an extra hour at "100%" and surprisingly, it stayed at 100 for a good 2 hours with some usage.

And I feel it's possible to push the battery capacity limit further on the "top end" if you're willing to keep it off and keep it charging. Will continue to test this theory.

So far my highest charge has shown 4.187v.
[Nexus One Android Development] RogerPodacter:
What is different with this setting you just posted vs just leaving the CPU stock since it automatically adjusts CPU clock speed based on load. Stock is 245 mhz min to 998mhz max. I'm a noob and don't know what AVS and SVS is lol. :-)
[Nexus One Android Development] flak0:
I only did steps 1-3 and did not wipe battery stats. This is with normal use.

3.28% drain/hr
[Nexus One Android Development] mtw4991:
:plol, told ya so...j/k. my highest was 4197mV with 1427mAh(the important one I think). So this proves that a specific charging sequence makes a difference??? It sure worked for me. I also got over 2 hours at 100% :eek:
[Nexus One Android Development] mtw4991:
I highly doubt you are a newbie with almost 800 posts unless that is all you do, lol.:D Check out the first page of Wildmonks thread for a def. of avs/svs here -

http://xdaforums.com/showthread.php?t=693375
[Nexus One Android Development] theloginwithnoname:
HTC/Bump charge method - additional step?

All,

Used this method the other day. As an additional step (after fully charging with phone off the first time, powering on, then after powering off and charging again), I pulled the battery, waited a short time, then reconnected the charger and reinserted battery. Charging light went to red again, and took 10 mins or so to go green.

Might just get a little more juice into it...
[Nexus One Android Development] mtw4991:
ummm...gonna try this today and see. might just work, ynk. fyi, 26 hours and 39% remaining = 2.34% per hour drain with moderate use. Sweet!

EDIT: did you wipe battery stats?

EDIT #2: 34 hours and 20% battery remaining!!!
[Nexus One Android Development] theloginwithnoname:
nice stats!

I did, but cannot remember when. Likely just before powering device back on after all charging finished (when it is closest to 100% I guess)...
[Nexus One Android Development] chowlala:
I'm starting to realize that, after all these weeks of battery calibration and using the new .35 r5 kernel, the battery has become pretty mean.

Seems the key to the calibration is the top-charge level. But I'm still shutting down at 10%~. Any ideas how we can fix this one?