yashsingh1/xdaforums huggingface dataset:
[Xperia Arc General] Bazoocaze:
Thank you.

<3>[ 6.701660] bq27520 0-0055: Failed recover ROM mode
<6>[ 6.701751] bq27520 0-0055: PATCH: entering failure recovery
<3>[ 6.702056] msm_i2c msm_i2c.0: (00aa) Error during data xfer (-5)
<6>[ 6.702178] bq27520 0-0055: PATCH: get_status: failed to write - 0xfffffffb
<6>[ 6.702331] bq27520 0-0055: PATCH: first status: 0xfffffffb
<6>[ 6.702453] bq27520 0-0055: PATCH: reseting controller
<3>[ 6.706390] msm_i2c msm_i2c.0: (00aa) Error during data xfer (-5)
<3>[ 7.719360] msm_i2c msm_i2c.0: (00aa) Error during data xfer (-5)
<6>[ 7.719512] bq27520 0-0055: PATCH: get_status: failed to write - 0xfffffffb
<6>[ 7.719635] bq27520 0-0055: PATCH: reset status: 0xfffffffb
<6>[ 7.719757] bq27520 0-0055: PATCH: factory restore controller
<3>[ 7.719970] msm_i2c msm_i2c.0: (00aa) Error during data xfer (-5)
<3>[ 8.729339] msm_i2c msm_i2c.0: (00aa) Error during data xfer (-5)
<6>[ 8.729461] bq27520 0-0055: PATCH: get_status: failed to write - 0xfffffffb
<6>[ 8.729614] bq27520 0-0055: PATCH: factory restore status: 0xfffffffb
<3>[ 8.729827] msm_i2c msm_i2c.0: (00aa) Error during data xfer (-5)
<6>[ 8.729949] bq27520 0-0055: PATCH: get_status: failed to write - 0xfffffffb
<3>[ 8.730163] bq27520 0-0055: PATCH: failed

Lines containing "PATCH:" are the recovery commands I'm sending to the controller during driver load. The problem is worse than I'm thinking - the fuel gauge is not responding for the write commands.

But I see that two important case tests that I wrote did not execute at all. I will correct this bug and generate another kernel version.
[Xperia Arc General] Bazoocaze:
Sorry. Locked bootloader only allow kernel and firmwares signed by Sony, for security reasons. Customs Kernels/firmwares only with unlock-BL.
[Xperia Arc General] jojora:
Try fix battery 0%

Hi Bazoocaze

this is log of my arc with the new kernel
[Xperia Arc General] cesar7:
not work for me.

My LOG attached

thx
[Xperia Arc General] masray:
Plz,we need your help,waiting for your solution.

:p
[Xperia Arc General] nKsyn:
Let me have a try.
[Xperia Arc General] acquaviva.julien:
So what's more ? Is it working for the neo ?
[Xperia Arc General] SireJoe:
If you are able to, might I suggest looking at the 146 rev. and compare it to the 283 rev. to see what differences it is sending/receiving to the battery or the i2c driver?

Im pretty sure anyone who flashes to rev.283 (the original) has no luck at all in regards to any battery status change, but with rev.146 I believe everyone has had the 1% battery status, so whatever the 146 is doing is allowing for some form of percentile increase of the battery charge.

I wonder if in the 146 the driver starts for a short burst of time and then crashes right away giving it the 1% mark that we all see, where as in any other version it doesnt even get far enough to show the 1%.

I dunno, there has to be something there that is pretty drastically different that we can go from using the phone all day to not being able to use it at all unplugged.
[Xperia Arc General] Bazoocaze:
Thank you for your point, I will diff the drivers to look for changes.

Until now, my research on this showed that the fuel gauge has it's own firmware, that are upgraded if needed each system startup (the firmware are 2 files contained in the system ROM). Moreover, the firmware is merged with proprietary battery data local to the fuel gauge before each firmware upgrade. I think that the system downgrade resulted in failure to downgrade the fuel gauge firmware/local data, leaving the fuel gauge in an invalid internal state.

Anyway, I'm working on a driver version that fakes the battery status, showing 100% all the time, to help people with no warranty options from Sony.
[Xperia Arc General] SireJoe:
Can you upload the kernel.sin? Or would I even be able to flash it seeing as how it may not be signed?

If you could even upload it anyways. I am always looking to try something out to get this issue resolved.
[Xperia Arc General] Bazoocaze:
Hi. I wrote a new version (v3) that try to (fake) lock the battery capacity to 100%.

Try this, and report back if it function properly on your phone. In case it fails, pelase post the log dump.

I think the charger will still works, because the charging process is based on the real battery voltage, and not on the reported value from the dead fuel gauge.
[Xperia Arc General] DAVIDSIKH:
It works on my neo! :) now it shows 100% all the time. Thank you for your hard work:rolleyes:
[Xperia Arc General] SoraHaru:
Me Too!! It's Work !! ^^.....!! Thanks Bazoocaze to let me live together with my Arc again!!!!
[Xperia Arc General] danielnghk:
I would like to see your solution.

But how can I find it?:)
[Xperia Arc General] FiDra:
Hi guys,

As Bazoocaze has mentioned before:

- If we let the phone charges in about 3 hrs, it can be fully charged.

- The battery level can be modified via a shell script.

- The phone only continues to charge if there is change on the battery level.

So, as a temporary fix for our Arcs can be fully charged, I've made an Android APK to update the battery level every 5 minutes. It works good on my phone :D.

So, I share this to you guys can use on your arc and wait for Bazoocaze to release new version of his patch.

Some notes:

- You need to have root access to use this.

- Please use Home button to leave the app. Don't use Back button. If you use Back, the app will stop working. And if you use the Back button, then you start the app again, it will reset the battery level to 3%. It's not important. Because if you let the phone charge in 3 hrs, it still has a fully charged.

How to use:

- Download and install the apk on your phone.

- Plug in the charger (currently, I've just checked for AC charge).

- Open the app call ArcBatteryFix. Allow the root access.

- Now, the app will set the battery level to 3% and will update it every 5 minutes.

- Just leave it with the HOME button.

Hope this helps when we waiting for Bazoocaze :D.

Thanks!
[Xperia Arc General] shahzaib.khan:
Fidra u r awesummmm thnx alot

But what is the exact thing.i mean does this shows and works only if we charge the phone or it will decrease also when we remove the charger ?
[Xperia Arc General] FiDra:
As you know, the phone just continues to charge if there is something change on the battery level.

So, instead of changing it by manually type in the terminal as Bazoocaze has mentioned before, I have it done automatically.

It's only update the battery level when the charger is plugged in. I did not test to see what happen if we unplug the charger. But as in my code, if you unplug the charger after run the app, it still update the battery level :D.

So, please follow the instruction, plug you charger first. And once your phone is fully charged, just unplug, reboot it and enjoy as normal :)
[Xperia Arc General] shahzaib.khan:
I wish there is some guy who is working on the fuel gauge also if this fuel gauge this will be solved most of the tention will gone easily
[Xperia Arc General] itachi naruto:
no support for neo ???
[Xperia Arc General] steryman:
I think it works on Neo too, if it's based on shell script, setting the percentage every 5 minutes
[Xperia Arc General] peacekeeper38:
FiDra thks a lot for that work is good to have people like u helping to those who knows nothing about this. i mean ME.
[Xperia Arc General] feydz:
Whoa! runs smooth and perfect on my Neo, tested, thanks FiDra :)

Now waiting for v4...;)
[Xperia Arc General] peacekeeper38:
FiDra just one question i am using 2.3.4 version 4.0.2.A.0.42 i am followed your intructions in how to plug into ac charger, and then run the app,

at the beginning the battery icon started to work as you said but after some time stop and the percentage it says 10% , and dont move from there.

is because of the version or should be something else?

Using in an xperia arc
[Xperia Arc General] lucifer.x:
Me too.
[Xperia Arc General] ajennn@163.com:
HI guys

my english is poor，，，

1.do you use the shell command 'echo > 3% 、sys/class/power_supply/bq27520/xxxxxx ' at 5 min in a loop ?

2.the count 3% can be change to any% ?? right or wrong ?

3.this apk can use for NEO yet???

4,can you change the 3% to 21% ,and the effect is the same?

parden me please`~~~~~~~.my english is poooooooooooooooorrrrrrr:D:D:D:D
[Xperia Arc General] FiDra:
Don't worry guys, the % just to tell you how much time your phone has been in charged.

For example: it shows 10% it means that your phone has been charged for 50 minutes.

It's not important that the % did not move on for a while. It's important that the phone is still charging :). The % did not move on may be due to the memory management of Android that put the app in the sleeping mode.

To make sure the app still work, you can open it again and leave it with the Home button.

1. Yes, I use that command, but the % is increase every 5 minutes, not static.

2. Yes. You are right. You can change to any value.

3. May be yes, it bases on shell script.

4. Sure, as I said above "the % just to tell you how much time your phone has been in charged."

I'm so happy to see that my app helps you guys.

Thanks!
[Xperia Arc General] peacekeeper38:
Ok i more or less undestand your explanation about the %,

another thing i noticed is when reach the 10 minutes stop charging and if i go to the settings, status of the battery it says discharging, ther battery icons is in red color and no signs of charging at all.

I uninstalled and installed again the app without reboot and still the same, no movement in the battery icon, red color,

is there a way to repeat all the process and see the movement in the battery icon or from now the battety will stay red all the time?

Right now i can see a message of the superuser granting permission to the app and right now its on 6%
[Xperia Arc General] FiDra:
It seems that the app can be killed by the android memory management.

I've changed the interval to about 2 minutes.

Let's try again:

- Plug in the phone.

- Start app.

- Unplug and re-plug in the phone.

P/S: if your phone stop charging, unplug and re-plug in the phone.

Hope Bazoocaze will release v4 soon :D
[Xperia Arc General] Bazoocaze:
Thank you FiDra, for your great work on this. I will post your APK on the first post to easy things.

Can you confirm to me the set_capacity file permissions? I remember to put its permission to writeable by user, to not need root to write capacity values, but you said your APK needs root access to change capacity level.

The v4 solution will be via an APK, as your solution is. I'm planning to run it as a service, to not get stopped by Android memory management.
[Xperia Arc General] FiDra:
Hi Bazoocaze,

I've just tested that file's permission by manually run the echo command in the terminal and it said that "permission denied" :)
[Xperia Arc General] Bazoocaze:
Ok. Can you run this command in terminal?

ls -ls /sys/ ... /bq27520/set_capacity

Change the "..." for the correct path of set_capacity file.

Thank you.
[Xperia Arc General] FiDra:
- With normal user: no such file or directory.

- With su: yes. It lists the file and the permission is root :)
[Xperia Arc General] fcb13:
Does this app let us use any other rom? Or do we have to stick to 2.3.4
[Xperia Arc General] FiDra:
:D I did not test on other roms yet :)
[Xperia Arc General] itachi naruto:
run v3.1 the apk your run , no setup 3.1 apk don't run :confused::confused: and pin no change
[Xperia Arc General] lenathou972:
I Left the forum some days ago...and i'm not verry good in english so I don't find my soluce. Anyone know what to do when the patch 3.1 gone after reboot the fone?
[Xperia Arc General] anhviet030295:
Does it work with NEO?
[Xperia Arc General] feydz:
Yes, tested with my neo, works! ;)
[Xperia Arc General] ajennn@163.com:
thanks ..we are very happy to see this ,,,thanks very much
[Xperia Arc General] shahzaib.khan:
Hey fidra there is something i want you to look for it..can you try this arc fix apk file on 0% devices??.cuz i think the problem with 0% bettery cells is the percentage of 0% so if this match shows 3 or 2 % the phone shouldnt shutoff itself right?
[Xperia Arc General] steryman:
The app can run only on this patched KERNEL if it's based on set_capacity, as only this kernel(patched) have the files
[Xperia Arc General] electrash:
http://xdaforums.com/showthread.php?t=1327024

maybe this will help to devs :)
[Xperia Arc General] masray:
I heard that if keep playing with the kernel,then can only get the fake battery status,is that true
[Xperia Arc General] itachi naruto:
apk use after a transfer time of 85% is free software, or error by apk :confused::confused::confused:
[Xperia Arc General] Bazoocaze:
Good News :D : the apk to auto-fix the battery capacity is almost done.

Here is a screen shot from the Android emulator:

http://imageshack.us/photo/my-images/819/fuelgaugeshot.png/

On the next days I will be posting here the finished APK, for you to test and send feedback.
[Xperia Arc General] shahzaib.khan:
Bazoocaze i knw can do it u r jus simplyy awesummmmm dudeee ....but i also knw that sooner or later u r gonna fix this ****in kernel thing also ;) gud luck
[Xperia Arc General] FiDra:
I'm so excited to know that Bazoocaze :D

Thank you so much :)
[Xperia Arc General] shahzaib.khan:
Fidra n bazoocaze cant u guyz create a full custom kernel for our devicea?..i mean fully customized with bettery fix percentage or els
[Xperia Arc General] FiDra:
Hi hi, sorry I can't :D

Because I have less knowledge of Linux programming so I cannot make a custom kernel.

I'm just a .Net and Front-end developer only :). So, I just can make some small apps only to help us while we are waiting for Bazoocaze :)
[Xperia Arc General] shahzaib.khan:
Hmm oki fidra just keep helping gud luck :) ...
[Xperia Arc General] masray:
AWESOME!!

I'll be here waiting for the release and do the test.
[Xperia Arc General] fcastillousfq:
That image is so nice!!!

I was wondering if we could make use of the LiveWare™ Manager app so the application can be started automatically everytime a charger is detected, withouth having to have the service running all the time (saves batery?) ;)

Would it be a good idea to create a constant icon on the notification area to prevent Android killing the app? (Like WidgetLocker does for example)

Also, does this app detects the discharge of the battery? Even though is just software calculated and it's just an estimate, does it? Because that would be great!!! :D

And maybe I'm asking for too many things but, if the discharge is actually working (estimate or not) could we have the option to not use it if we don't want it, so we always see a constant battery and the phone will turn off without notification. I suggest this because by just estimating the battery % we might be cutting the time we can use our phones before they turn off, while extending the use as much as they can (even if it's at the expense of killing their batteries) might be more important for other people.
[Xperia Arc General] uyo_kun:
wooo!! :eek: you ROCK! :D
[Xperia Arc General] peacekeeper38:
Bazoocaze thnks in advanced for your effort and continuous work, trying to help us with this issue, really appreciated man!!!!!!

And FiDra we can't leave you behind so thnk you too.
[Xperia Arc General] laceex:
Muito obrigado for your hardworkings... ;)
[Xperia Arc General] Bazoocaze:
Hi.

My plan is to run the APK as service all the time, starting at system startup. The CPU usage is light: runs every 60 seconds on screen off, and every second with screen on, coleting peripheral usage and calculating simulated coloumb count. The simulated coloumb count is based is current drain statistics collected on my Arc, therefore the values will be a reasonable aproximation.

It has a charger and discharger counter - battery will increase with the charger connected and decrease running on battery only.

The decrease is based on peripheral usage: wifi / mobile data / talking time / airplane mode / bluetooth. This version will not take in count the CPU usage / CPU clock, but I allready had good ideas on how to do this in a later version.

Also, the battery never reachs 0%, the minimum will be 1%, therefore the system will never shutdown without user command, or battery termination.
[Xperia Arc General] fcb13:
Bazoocaze, will this apk let us install other roms? Or will we be stuck to using 2.3.4. Cause i know when i try to install CM7, i get a constant reboot due to the 0% battery.
[Xperia Arc General] Bazoocaze:
Hello,

The APK needs a kernel with the patched version of bq27520 driver that exposes the set_capacity virtual file, which permits battery capacity update from the APK.

Maybe its possible in a near future, but for now only our patched kernel + apk.
[Xperia Arc General] Bazoocaze:
Here is the APK Fuel Gauge Fix helper :)

[Updates]

v1.2: :rolleyes: new version - test this - must use kernel patch v4

v1.1: :( failed - found a noob bug on APK - sorry

v1.0: :( failed

[Description]

Its a service that runs all the time, calculating battery consumption / charge, and updating the battery % of the phone, trying to mimic te lost functionality of the defective fuel gauge.

I cant test the battery update on my device, because its isnt faulty, so I want you to test and see if it can update the % status of battery. If the apk cant write to set_capacity, it falls back to try to write to file using ROOT access. Please let me know if it works, and if it asks for root access.

[How to use]

- Install the latest patched kernel from this thread, and this APK.

- Open the APK (Fuel Gauge Fix), Click "Start monitor", and configure the "Charger Monitor" to start on boot.

- Test the APK to see if it changes the battery % on phone.

- If it wont work, look into the screen of APK, last line on field "Patched status", and report here you problem.

- If it works now you can use your phone normally.

[How it works]

- Runs every 1 minute on screen disabled, and every 1 second on screen enabled.

- Scans for connected / enabled hardware, like charger, screen, bluetooth, wifi, celular. For now, it doesnt take in count the CPU clock / usage.

- Generate consumption prediction for enabled hardware.

- Simulate coloumb counting on in memory battery stats, charging / discharging the stats accordingly, and updating the battery % show by phone.

- There is an 1% limit, that is, the phone will never shutdown while there is power on the battery.

- The stats will learn the battery limits if you leave your device running until it runs out of power. You can see if its working on the "Full capacity" field. For now, it will only expand capacity - in a later version I will make that it will retract the full capacity to compensate a high usage.

Enjoy :D
[Xperia Arc General] itachi naruto:
neo no changes the battery % on phone
[Xperia Arc General] mehdi.xterra:
this apk show 85% battery always
[Xperia Arc General] lenathou972:
Someone know why the patch don't stay after reboot??
[Xperia Arc General] masray:
yes. the battery indicator stays

how can i post the log?
[Xperia Arc General] lenathou972:
When you "post a reply" there is a icon "manage attachment" lower. I asked why the patch is removed when I shut the fone down.
[Xperia Arc General] Bazoocaze:
The sooner you post the logs, sooner I can figure out whats is wrong and can make the APK functions corretly.

The patch % is fixed to 85% in kernel. Changes to this will persist until next reboot, when the % comes back to 85%.

The APK helper will correct this, but we need to known whats wrong with the APK.

I am waiting for you, testers. With the log, report phone version, kernel version, firmware version, and if you have a rooted device. Only with this info I can correcty the APK.

Thank you.
[Xperia Arc General] shahzaib.khan:
i jus sell my phone at 1000 saudi riyals n got another one of 1130 riyals....im out of this **** problem....
[Xperia Arc General] MistaGanja:
battery icon is moving showing that its charging didnt do that before so i guess thats good
[Xperia Arc General] danielnghk:
dmesg with your APK here
[Xperia Arc General] :
Hi Bazoocaze! I haven't been in forum for couple days , but now I see lot is going on! Thank You so much for helping us! It is really appreciated.

I set battery on 3% (cause it was empty for really), started Monitor as well Start on boot, but % don't move...I was waiting for ~20 min. It does show that it is charging (EDIT: doesn't any more) , but for some reasons Battery % doesn't move.

My Kernel : 2.6.32.9

Phone : Arc

Device rooted : YES

My Log :
[Xperia Arc General] FiDra:
I'm testing it now. Will let you know soon.

Thank you so much for your hard work, Bazoocaze :)
[Xperia Arc General] lenathou972:
I Can't post the log it's too big...
[Xperia Arc General] FiDra:
Hi,

- In Hardware Status: "Battery capacity" remains the same all the time.

- In Software Status: "Calculated battery" seems works as you've said, Bazoocaze.

May be you forget to excute the shell command to update the battery level. So I think that's why it always remains the same.

Thanks!
[Xperia Arc General] danielnghk:
Just post the log with a text file attached in your reply
[Xperia Arc General] lenathou972:
There is my log.
[Xperia Arc General] jojora:
this is my new log
[Xperia Arc General] peacekeeper38:
i don't know how to get the log sorry, but if someone tells me i learn quickly :D
[Xperia Arc General] itachi naruto:
How to file log ? thank :D
[Xperia Arc General] danielnghk:
http://developer.android.com/guide/developing/tools/adb.html

Sorry, I just find some doc of above link about capturing dmesg.

The execute file is in flashtool folder called adb.exe

Just press shift and right click in the folder contain adb.exe -> select open a command prompt option and issue the below command:

adb shell dmesg > log.txt

you will get file log.txt of the same folder with the file adb.exe
[Xperia Arc General] peacekeeper38:
Excellent info danielnghk i'll do it and post the log results. Thank u very much
[Xperia Arc General] itachi naruto:
thank no world , i use logcat on market , did not know there was no such , logcat to file such a
[Xperia Arc General] Bazoocaze:
Thank you for all the logs. I analysed some of them, and seems to be all ok with the kernel driver.

The problem must be on the battery % patch (as said by FiDra), that is the only point of the program that I cant test on my Arc or emulator.

I will update the APK to add some alternate ways of changing the battery %, and to include detailed log messages on initialization. To test the next APK version, I will need that you start the "Charger Monitor" service, let it run for 1 minute, stop the service, and them generate the LogCat report.

adb logcat > output.txt

Sorry for this delayed solution. Its difficult to do exaustive tests without a faulty phone.
[Xperia Arc General] da_schau_her:
Hello and sorry for my bad English.

I have the same Problem with my NEO. It's 4 Month old. Can anyone tell me what i should do bevor i send it to repair?

Thank You!
[Xperia Arc General] :
HI there Bazoocaze, on your app when my phone is discharging at the -Software Status- it does show Calculated battery right it is going down when phone is used more (music, games, etc), But only thing is the real battery indicator does not go down.

BTW it does start on boot...

Thanks
[Xperia Arc General] Bazoocaze:
Thanks for the feedback. The idea is the service to calculate simulated battery status, and to transport this value to the hardware battery % reported by system.

The transport of calculated value is not working: I'm working on this. :D
[Xperia Arc General] kalarox:
thank you very much Bazoocaze...now my neo shows only 85%...but it's better than 0%..
[Xperia Arc General] lenathou972:
I'm sorry to disturb you one more time but...I don't knw if there is a link, since I put the apk, I can't view the pictures or any other images in my galery.
[Xperia Arc General] Bazoocaze:
Hi, :D

There is a new patched kernel version (v4) and APK (v1.1). Try this together.

See the first post for instructions and links.

@lenathou972:

I will test this on my Arc, but I can say in advance that are no relation between my APK and the Gallery.
[Xperia Arc General] DAVIDSIKH:
what is the differences between v3.1 and v4?