yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] erklat:
Step by step what to do is in the first post here. You can start with the kernel link in my sig.
[Desire Android Development] skilqki:
ok but this is something bout wifi ??? i dont need wifi fix i need battery fix ....
[Desire Android Development] erklat:
The top kernel has battery fix included.
[Desire Android Development] skilqki:
ok so it doesnt matter what rom i use i just flash the zip with twarp and tahts all right ? :confused::confused: this zip u mean kbase_WifiSensorplus_180612_161153
[Desire Android Development] erklat:
As long as you use Sense rom, yes.
[Desire Android Development] skilqki:
and the kernal that is in the zip wount effect nothing but the battery ... ?
[Desire Android Development] erklat:
It has some other fixes too, but neither of them will bring any ill effects to your phone.
[Desire Android Development] skilqki:
oookkk i isntalled the kernal but when i try to calibrate my batt. i can`t cuz the phone turns off on 15 % and the mv are at 3400 at that moment and for calibration i have to go to 3201 .... how can i manage a calibration ?!?!? :silly::silly::silly:
[Desire Android Development] erklat:
Yeah, that happens a lot. Most likely you'll need to calibrate under aosp rom and then restore your current rom from nandroid backup after procedure is complete.

Pay close attention to that part where it explains how to properly calibrate for the fix to stick even if you charge while the phone is off.
[Desire Android Development] skilqki:
i managed to keep the phone up till the numbers dropped to 3240 not 3201 byt i hope its close enought for the calybration :)

i was one time to 3201 but the phone shutted down verry fast even i managed to plug in the charger :D

lets hope i have made the settings right i`ll feedback later have few more hours for the cycle to end :)
[Desire Android Development] theGanymedes:
Tiamat's and thalamus (also CM) kernels do use a different (modded) drivers, so you don't need this patch - however, calibration part is still valid for you. Follow the links at the first post for that.
[Desire Android Development] Droidzone:
Probably because the driver I have has some additional modifications. Alex, did it patch correctly for you? I think you use my driver?
[Desire Android Development] theGanymedes:
Yeah, I think that's my bad: some whitespace differences might have caused it... Whatever, it's fixed now ;)

And about my toolchain: apparently latest Linaro GCC cannot compile kernels well - FSF's GCC managed to make one. Will upload in 15 mins.
[Desire Android Development] theGanymedes:
Well, in order to complete the circle and allow our Sense kernels run the calibration app successfully, we need to find a way to symbolically link "/sys/devices/w1 bus master/32-000840f8f0b5/ds2784-battery.0" folder to "/sys/devices/platform/ds2784-battery" folder. Standart "ln" command, unfortunately, doesn't work.

Any suggestions?
[Desire Android Development] Alex-V:
tried right now...patched without a problem..now compile.. :)

with kind regards
[Desire Android Development] Alex-V:
mmhh..i dont know much about such symbolic links..sorry..but maybe its not only the ln comment...i just looked into a data2ext script...and a symlink for data/data...looks like this:

$BUSYBOX mkdir /mnt/asec/extdata/data
$BUSYBOX chown 1000.1000 /mnt/asec/extdata/data
$BUSYBOX chmod 771 /mnt/asec/extdata/data
if [ -d /data/data ] && [ ! -h /data/data ]; then
$BUSYBOX cp -a /data/data/* /mnt/asec/extdata/data/
$BUSYBOX rm -rf /data/data/*
fi
if [ -h /data/data ] || [ ! -d /data/data ]; then
$BUSYBOX rm -rf /data/data
fi
#$BUSYBOX ln -s /mnt/asec/extdata/data /data/data
$BUSYBOX mkdir /data/data
sync
sleep 1
$BUSYBOX umount /mnt/asec/extdata
sleep 1
$BUSYBOX mount -t ext4 -o noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p3 /data/data
#$BUSYBOX mount --bind /mnt/asec/extdata/data /data/data

with kind regards
[Desire Android Development] Alex-V:
mmhh..i can patch without a problem but if i compile (using gcc 4.40) i get this error..:

drivers/power/ds2784_battery.c: In function 'ds2784_battery_algorithm':
drivers/power/ds2784_battery.c:1184: error: expected ')' before 'htc_batt_info'
drivers/power/ds2784_battery.c:1187: error: expected expression before '}' token
make[2]: *** [drivers/power/ds2784_battery.o] Fehler 1
make[1]: *** [drivers/power] Fehler 2
make[1]: *** Warte auf noch nicht beendete Prozesse...

anyway...must go to bed now...but will look again tommorow.... :)

with kind regards
[Desire Android Development] theGanymedes:
May you try with the file I gave? Or with the patch I made? Apparently, yours is a syntax error because of a misaligned patch, because I did compile :D
[Desire Android Development] marius.a:
Compile is working, droidzone made allready 2 kernels with this file, now problem remains to see if working without sym links
[Desire Android Development] resadent:
REALLY great post and great solution for all of us desire users. I had calibrated my batt with CM7 some time ago and when I came back to a sense rom I didn't calibrate it inmediately after. I did a week ago and I noticed my battery life was worse since calibration.

I will try your fix ASAP, but for now I'm going to sleep.

Also, I would like to note that I never had reboot problems with gingercake's kernel.
[Desire Android Development] Droidzone:
Yup. There's a bracket missing in the file on line 1184
[Desire Android Development] Alex-V:
Ok..thx for answers..will try again if im @home
[Desire Android Development] Denimo:
Awesome! Thank you so much for a solution, finally!

Just to make this clear, will this [.zip file for recovery] work with every GB Sense kernel?
[Desire Android Development] ironjon:
I think the patch file writes this:

if ((htc_batt_info.rep.guage_status_reg & 0x80)
// && (htc_batt_info.rep.batt_current <= 80))

I removed // , then:

if ((htc_batt_info.rep.guage_status_reg & 0x80)
&& (htc_batt_info.rep.batt_current <= 80))

and now I compile without errors

That's right??
[Desire Android Development] Droidzone:
Not really. That comment is intentional. :)

You need this:

if ((htc_batt_info.rep.guage_status_reg & 0x80))
// && (htc_batt_info.rep.batt_current <= 80))

OR

if (htc_batt_info.rep.guage_status_reg & 0x80)
// && (htc_batt_info.rep.batt_current <= 80))
[Desire Android Development] theGanymedes:
Normally, changing ROMs doesn't require recalibration, but this buggy piece was causing our calibration to be erased; so I just changed that.

The real credits should go to Thalamus for the idea at the driver and the others at the Battery Calibration Tools topic - I just merged their idea for Sense.

BTW: The Battery Calibrator APK is published in the first post, that's edited to work with our kernel. Jon Richards and the others DID publish the source codes in github, I found it and edited.
[Desire Android Development] theGanymedes:
It IS Gingerbread Sense kernel already :) Don't attemp to use it on Froyo, I don't know if it would work for Froyo :)

The recovery zip is a modified gingercakes kernel.
[Desire Android Development] theGanymedes:
Comment was intentional, alright, but in the old file, I changed 80 to 50 there, so it was why I commented it. Your patch file seems to have missed it.

After a few tests, I saw that those modifications were actually not needed, so I removed them. Please apply the patch at the first post - it's the latest.
[Desire Android Development] Droidzone:
I kind of did a cherry pick of your file with a visual diff as there were some things which were different in the batt fix code. I have some modifications there. So that patch I uploaded will work only for Alex or someone who uses my driver.
[Desire Android Development] nomatterbv:
good work, downloading and testing. I'll report any bug/problem regarding these fixes as soon as I'll find some.

thumbs up and keep up the good work.

---------- Post added at 02:21 PM ---------- Previous post was at 01:35 PM ----------

Flashed the new kernel/fix, installed the app and after the boot I had the first FC, com.android.phone, after a while the second, HTC Sense is not responding.the phone is moving very slow and it's laggy.

I'll wait more and see how it behaves after I'll let it to settle down.
[Desire Android Development] WatsonDue:
Just flash an aosp rom and calibrate from there, it happened to a lot of people. Even if you plug-in the charger at 3201mV, the phone will shut down. :)
[Desire Android Development] skilqki:
sorry for the noob ? but what is aosp ? :confused::confused:
[Desire Android Development] jmcclue:
AOSP = Android open source project. in other words a rom built from scratch and not just pulled from another device. example - Runnymede aio sense 3.5 for our device is pulled from the HTC Sensation XL. obviously theres alot more to it but ul get what i mean :)

Sent from my HTC Desire
[Desire Android Development] skilqki:
well when i made the callibration the register shows 0x81 which as in the guild is told is perfect for the calibration, but if there is any problems with the batt i`ll try the way u told me :) :good::good:
[Desire Android Development] skilqki:
one more thing can u offer me some good AOSP rom that will work with the data2sd mode for the big internal memmory ?
[Desire Android Development] WatsonDue:
Just search on this forum, there are many aosp rom, and usually it's all written in the first post. :)
[Desire Android Development] jmcclue:
read the thread by Mr Mefisto, full list of AOSP roms there, its ur phone at the end of the day, not what some1 tells u their opinion of what "the best rom" is. have a good read at them all n go for what suits u best :)

Sent from my HTC Desire
[Desire Android Development] skilqki:
i just downgradet to froyo superburst rom with the data2sd script will see how its working and for the battery i think this rom will do the job cuz it`s a DESIRE rom after all :) thc for the advices :) :good::good::good:
[Desire Android Development] erklat:
Froyo kernels don't have battfix!
[Desire Android Development] skilqki:
uuff.... realy :D but does froyohave the % problem or not ?
[Desire Android Development] Olleman:
followed The guide to the letter and charged the phone overnight (8 hours). Battery status was 0x85 and not 0x81. Rebooted and new age was 85%, so it seems to have worked, right? When bat % was at 89% I decided to do the last thing where we make the callibration stick. Calculated my value to 1313 and entered this under full40 (learn prep tab). My battery immidietly jumped to 95%!? Could someone explain what happened here?

Also, I've got two batteries, since all the calibration data is written to the battery itself it would be ok to callibrate two batteries for the same phone or would this mess things up?

Running mild wild 5.0 with manu kernel btw.

,Olle
[Desire Android Development] WatsonDue:
The calibration doesn't affect battery, but the chip that controls charge and discharge.

Also, you need to flash a kernel with the proper fix in every sense rom (if it's not included by default) immediately after flash. Otherwise you will screw up the calibration at the first charge.
[Desire Android Development] Olleman:
Ok, so calibrating two batteries is not a good idea then.

I'm using an aosp rom so according to my understanding I don't need to flash a special kernel. Anyone else got any idea why the batt % changed after I input my Full40 (1313)?

---------- Post added at 09:28 AM ---------- Previous post was at 09:09 AM ----------

Hmm, when charging the phone while off the batt age gets reset to 94, so perhaps to get correct % showing after inputing real Full40 (1313) the batt age needs to be reset to 94% again?
[Desire Android Development] jmcclue:
huh? is ur phone not supposed to be booted to calibrate it properly when u fully charge it and set Min/Max to 998? thought thats what i had to do ages ago

Sent from my HTC Desire
[Desire Android Development] Olleman:
Yes, I rebooted and then proceeded with the last step, eg imputing the new full40 value
[Desire Android Development] jmcclue:
heres a pic of mine, i think its done right (i hope lol) done it ages ago, maybe some1 can tell me if its not

Sent from my HTC Desire
[Desire Android Development] Olleman:
That doesn't seem right, your batt age is 100% and should most likely be between 80-90% after a successful calibration.
[Desire Android Development] nlooooo:
+1

He's right. Also your Full40 should be less than 1452, that's for new battery and that's the value that makes problems with early shut down.
[Desire Android Development] erklat:
It should be 94% after the calibration is finished properly.
[Desire Android Development] jmcclue:
So why does it say to set it to 1452 in the guide?

If it is 94% after calibration then its wrong and u have to do it again.

(im just going by what the guide says)

Sent from my HTC Desire
[Desire Android Development] nlooooo:
Yes, to set it before you start the process, but at the end when you get the real battery age you have to recalculate it and enter that value. I got 84% for battery life and recalculating something about 1284 for Full40. Entering that value you finish calibration.

Sent from my HTC Desire using Flashes and Thunders
[Desire Android Development] erklat:
You have to manually set it when doing the part which will stop calibration to fail on first charge while phone is off. It is going to end up at 94 anyway.
[Desire Android Development] jmcclue:
Im just in the middle of doing it again, il post once im done :)

Edit: ok so i done it again and it shows 94% age. I let it die over night and shut down 10 mins ago at 2% so that will do fine. Also i know that something had work coz it took like 8 hours to f*****g charge. I swear im never doing this again, a whole fkng day to do it. Soo even if its wrong this time..... Well.... Fu** *t lol :)

Sent from my HTC Desire
[Desire Android Development] punky.mtp:
Hi,

With faulted calibration due to reboot under sense, I had 0x81 in status, but 94% for batt age.

After calibration under AOSP Rom, I have 81%, wich seems normal after 2 years of intensive use ;)

I've been trying 4 times under sense without success. For my girlfriend's desire, I will go to an aosp rom without trying first under sense
[Desire Android Development] Olleman:
I've done this with two original batteries now. The first one worked like a charm and reported 85% age and is shutting down at 0%. The other one just wont calibrate, I'm using the exact same method, flight mode, CPU, close all apps etc but I always end up with 100% age and 1430 as reported capacity.

Any suggestions?
[Desire Android Development] WatsonDue:
Calibration may not be possible with aftermarket batteries, so I think it's "normal".
[Desire Android Development] Olleman:
Hmm but it says HTC on the battery and part number etc are the same....perhaps another sceam from all of these eBay sellers.

Would it be possible to set Full40 manually and by trial and error find a good value?

Edit: it seems to work to do the calibration backwards, so to speak. My battery was reporting 1430 at fully charged and shut down at about 280. Set full40 to (1430-280)/0.94. Reset age to 94 and it seems to work.
[Desire Android Development] Ronok:
I finally managed to calibrate my battery! The battery age was 85% so I also corrected full40 to 1312. I'm now at 3% and still running so I suppose it worked. (Runny Rom 7.0)

I had to flash an AOSP ROM because my sense rom was unable to keep itself alive after the draining procedure.

Edit: but now I've got this:

It's been on 99% for about 2 hours now, while it takes "only" 2 hours to go from 3% to 99%. So this is normal? I also had the feeling my battery percentage stayed on 100% for longer right after the calibration. 99% and downwards drained at a normal pace.
[Desire Android Development] zorglub!:
HI guys

Looks like I have a problem with calibration..

I'm using a Desire under MIUI XJ ( Gingerbread) and Manu 2.1 kernel.

Even if I follow carefully Adavance Battery Calibrator tutorial ( setting correct Age, Full40 and register values ) my phone dies prematurely, claiming 0 charge when the real time voltage is still a 3.740400uV which is well above the 3.201mV. Any idea/suggestion to circumvent this problem ?

Thks and rgds
[Desire Android Development] nlooooo:
It can happen when Calibrator doesn't have root privileges, so it can't push up resting voltage.
[Desire Android Development] daxsm:
I'm using CronMod-bravo/bravoc and phone is shutting down at 20%, and as I can see this is fix for SENSE roms, and CronMod is not SENSE rom so can I still use this fix or...?
[Desire Android Development] jmcclue:
yh but download the Battery Calibrator by "Jon Richards" from the market for the N1

Sent from my HTC Desire
[Desire Android Development] luminata:
Hi Guys.

Thanks for all the info in the guide.

I am also suffering to calibrate because of the Sense Issue. Using Droidzone's Supernova.

May I ask if it is at all possible to create a ROM which is used only to calibrate the battery.

Raw Gingerbread with no add-ons just root and calibration drivers/apps. If it is possible, are there any volunteers!? :P

I am not a good cook.....always make a mess in the kitchen.

I did not understand if I need to do something else after I calibrate the battery, i.e discharge the battery to 3120mV, plug charger, let it charge until the led turns green (4hrs to 8hrs) and check the battery age after reboot, should not be 94%.

Edit: I took nand backup and flashed

Oxygen small Rom. Applied the kernel and managed to get the battery to calibrate on the first try. When calibration completed the capacity was 1435(without using formula) same battery life is remaining 100 percent. Powered off and restarted phone several times but no change. My battery is 1.5 years old. Any idea what I can do please.

Thanks
[Desire Android Development] luminata:
Hi. Were the questions I asked already answered in the past?

Sent from my HTC Desire
[Desire Android Development] andreipaval:
Hi guys, I tried to calibrate my Desire original battery, followed very carefully the tutorial and everything seemed to work fine,

but in the end when the tutorial says the register should have value 0x81, my value was 0x87, does anybody know what this means,

was the calibration successful ? Because after reset the battery age was shown 82%, so this means the calibration must be successful.

After changing the Full40 value accordingly to this age, the phone still shuts down at ~20% and not at 0% or 1% how it was supposed to.

Please give me some advice. Thank you.
[Desire Android Development] milows:
Help Please!

Hello I have this kernel "http://supernova.droidzone.in/wp-content/plugins/download-monitor/download.php?id=86" and i tested kernels from this thread and in battery calibration app is clean values. My desire cant read values from battery :( please help. I have Stock Hboot and Runymede AIO 6.0.4.3 S.E. But i dont know how to calibrate my battery.. My phone shutdown at 15% and about 82% is fully charged. :( Please help.:crying:
[Desire Android Development] milows:
Please Help !

This thread is dead :(

I have done with kernel i have values in battery calibrator and i cant calibrate battery. My phone shut downs at cca 3205mV

But i dont know how i set this registers (62,63 how values in this) when my batt shutdown at cca 3205-3210mV, please help
[Desire Android Development] jmcclue:
why dont u boot into recovery, Nandroid backup then flash an AOSP rom, runnymede aio is a huge rom, so it probably needs more power on the battery to shut down correctly. flash a nice small AOSP rom, dont add any apps, just the battery calibrater app (the one for the N1 in the market) and try again. Then if it works, just boot into recovery, Full wipe and restore backup.

Sent from my HTC Desire
[Desire Android Development] Igor2410:
people please help any way you can. my battery is all messed up. with each calibration I make it is worse. nothing helps. I tried with various ROMs and kernels. The problems started when I was at Supernova and not in the begining but after few months of using it. Last night I put Cronomod with manu kernel and immediately calibrated. Phone was charging overnight, I plugged it off at 9 am and he died at 9:10 at about 90%

*

and all the time it dies at about 85-90 %.

I still left with only two possibilities that I will try. Put cronomod with cyanogen kernel and try again, and then with oxygen which was last that it worked.

It worked when i calibrated it with oxygen last time, but as soon as i changed rom it was the same

*

For each calibration shows me that it was successful.. Chgtf is lit and value is 0x81. After each calibration in my batery batery calibrator shows age 50%.

*

I noticed that when the battery is at 0, it charges about up to some 20% and then immediately jumps to 100 and the indicator lights green.

Is it possible that the battery is bricked or something else?
[Desire Android Development] milows:
:(

I flash small aosp ROM (CronMod) and install battery calibrator and battery die at cca 3205 sometimes later but not pop up screen "plug in ..." :( please help...
[Desire Android Development] jmcclue:
Did ya go into settings and check all the boxes and then turn on learn mode?

Sent from my HTC Desire
[Desire Android Development] milows:
Help Please!

i have checked this boxes, and i step by step by manual in this thread... :( and yesterday is lucky i have done learn flag but after restart i have curr.batt age: 86% but battery status register is 0x87 :( and i charge with airplane mode kill all apps except battery calibrator. Could it be that I charnging about 9 hours? (Over night).
[Desire Android Development] robas1:
Hi Ganymedes.

I have RSK Odexed ROM installed on my Desire.

I also have the problem with shuting down at 15%

Is it posible to implement your fixes to this kernel (as you can see below) I have in my ROM?

Will it help with the problem of shuting down at 15%?

Note: I have not done the calibration from post # 3 yet (http://xdaforums.com/showthread.php?t=765609)
[Desire Android Development] impactor:
Does this calibration is permanent, i.e. survives ROM changes, or do I have to do it every time I change rom?
[Desire Android Development] erklat:
It is permanent if you do it right and use compatible kernel.
[Desire Android Development] impactor:
But the compatible kernel is only needed DURING calibration, not afterwards, right? Because what for? The changes are already written into battery EPPROM.
[Desire Android Development] WatsonDue:
If you use antoher Rom without a patched kernel, that data will be overwritten again, screwing up calibration again.

So you need only to flash a good kernel just after flash a new ROM.
[Desire Android Development] impactor:
And we know a kernel is a 'good' kernel when it shows values in Battery Calibrator, right?

Also, that means if I restore a nandroid backup of calibrated rom after installation of a wrong kernel, then the calibration is lost anyway, right?
[Desire Android Development] WatsonDue:
You know that it's a good kernel when you read in the op or in the changelog that it has the battery fix.

If you restore a ROM from nandroid, just flash the kernel before restarting your device.:)
[Desire Android Development] impactor:
Do you mean

» evo: fix battery life issue (correct sysfs device selection implementation) (cayniarb)

?

Not every kernel mentions wheter this function is in it.

Can a not-good kernel show values in Battery Calibrator?

You didn't understand me.

1. I have a rom with successful calibration on it, and a right kernel. I back it up with nandroid.

2. I install a non-compatible kernel rom. I boot the system.

3. My calibration goes to hell (right?).

4. I restore full nandroid backup.

BUT the calibration itself is not restored and I have to do it again. Is that correct?