Correct battery life reading, help editing file.

Discussion in 'Android Hacks and Help' started by terrets, Mar 12, 2011.

  1. terrets
    Offline

    terrets New Member

    Joined:
    Dec 5, 2010
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    0
    Not sure if this is a good place for this, if not, please move.

    Anyways, I got an extended battery and I am currently trying to edit sys/devices/platform/cpcap_battery/power_supply/battery/charge_full_design so that the phone will read the battery life correctly. Well Ive tried changing the permissions and using vi to edit but vi refuses to save. When I try writing, it just doesnt do anything. Ive tried using ghost commander as root and it says the file is uneditable even with permission set to rw for everyone. If someone could help me out, that would be great. Or if you have a different way to fix the battery life reading, thatd be great. Thanks for the help. :)

    Sent from my DROID2 GLOBAL using DroidForums App
  2. prime
    Offline

    prime Kernel Developer Premium Member Developer

    Joined:
    Apr 26, 2010
    Messages:
    1,831
    Likes Received:
    19
    Trophy Points:
    38
    Location:
    Florida
    In a terminal do this (replace mA with correct number):

    Code:
    su
    echo mA > /sys/devices/platform/cpcap_battery/power_supply/battery/charge_full_design
    
  3. terrets
    Offline

    terrets New Member

    Joined:
    Dec 5, 2010
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    0
    Tried it with vi.. Also tried from the pc, and copying a file to replace that one. Yes i had permissions correct. Its totally locked out. I think it has to be flashed with an update.zip but im not entirely surebhow to do that.

    Sent from my DROID2 GLOBAL using DroidForums App
  4. prime
    Offline

    prime Kernel Developer Premium Member Developer

    Joined:
    Apr 26, 2010
    Messages:
    1,831
    Likes Received:
    19
    Trophy Points:
    38
    Location:
    Florida
    You have to install the terminal application on your phone and enter the commands I gave.
  5. terrets
    Offline

    terrets New Member

    Joined:
    Dec 5, 2010
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    0
    Dude. I have a terminal emulator, how do you think I tried changing it with vi? I changed permissions and tried using echo. Does not work. I think these files are locked out some how.

    I also tried sed in terminal.

    I even tried using a .zip file and installing via clockwork. My lines in the script was:

    set_perm(0,0,0755,"/sys/devices/platform/cpcap_battery/power_supply/battery");
    set_perm(0,0,0755,"/sys/devices/platform/cpcap_battery/power_supply/battery/charge_full_design");
    run_program("/sbin/busybox", "sh", "sed -i 's/1390/3500/g' /sys/devices/platform/cpcap_battery/power_supply/battery/charge_full_design");
    run_program("/sbin/busybox", "sh", "cat /sys/devices/platform/cpcap_battery/power_supply/battery/charge_full_design");
  6. prime
    Offline

    prime Kernel Developer Premium Member Developer

    Joined:
    Apr 26, 2010
    Messages:
    1,831
    Likes Received:
    19
    Trophy Points:
    38
    Location:
    Florida
    ADB, SSH...I don't know your skillset buddy ;-)

    You will likely have to use the init.rc
  7. terrets
    Offline

    terrets New Member

    Joined:
    Dec 5, 2010
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    0
    :). Thanks for trying to help but Ill have to put this on hold for a week :/. Maybe someone else will figure it out in that time frame.

    Sent from my DROID2 GLOBAL using DroidForums App
  8. grimloktt
    Offline

    grimloktt New Member

    Joined:
    Apr 3, 2010
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    0
    Anyone else?! I know there's an entire crew of Gorilla Gadget 3500 mAh batteries that would like there phone to read/act properly...
  9. sonicfreak360
    Offline

    sonicfreak360 New Member

    Joined:
    Aug 19, 2010
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    0
    Out of pure curiosity, can you wipe battery stats and have it learn to your new battery? Because I am thinking about getting the same battery as you, and i don't want to run into problems like misreading!
  10. grimloktt
    Offline

    grimloktt New Member

    Joined:
    Apr 3, 2010
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    0
    I don't think that'd make a difference. There's the folder the poster mentioned above that specifically states the size of the battery. I think we really need someone smarter than me to figure out how to change it and keep the system from changing it back.

    I tried using root explorer, changing rights to read/write, and saving/exiting. No luck...system changes it back.
  11. prime
    Offline

    prime Kernel Developer Premium Member Developer

    Joined:
    Apr 26, 2010
    Messages:
    1,831
    Likes Received:
    19
    Trophy Points:
    38
    Location:
    Florida
    I told you how, it has to be in the hardcored /init.rc or be running a ROM that supports a userinit (such as cyanogen mod) and I'm not certain the userinit would work.
    Last edited: Mar 26, 2011
  12. grimloktt
    Offline

    grimloktt New Member

    Joined:
    Apr 3, 2010
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    0
    I appreciate your input, but I just don't know enough to fully understand what you're saying. Are you saying that it can't be modified by the user, even if they have a rooted phone (I'm running Fussion)? That to get it to operate properly, the user may need to use Cyanogen Mod ROM (I didn't know they had a ROM for the D2G...I'll have to check it out.)? Thank you for dumbing it down... :smile:
  13. boristhebladexx
    Offline

    boristhebladexx New Member

    Joined:
    Nov 26, 2009
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Connecticut
    i got a directory not found error when i tried the terminal emulator commands.

    its not really that much of a problem for me though, my system almost correctly reads the battery life. with my 3500mah battery, when my system reads 5% it means i only have 2-3 hours left, which is around 5% of my battery life anyways
  14. grimloktt
    Offline

    grimloktt New Member

    Joined:
    Apr 3, 2010
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    0
    I see u take donations for ur work. I'm willing to donate for this cause...
  15. prime
    Offline

    prime Kernel Developer Premium Member Developer

    Joined:
    Apr 26, 2010
    Messages:
    1,831
    Likes Received:
    19
    Trophy Points:
    38
    Location:
    Florida
    I don't have the device, I have a Droid 1.

    Could you post a link to the ROM your currently running.
  16. grimloktt
    Offline

    grimloktt New Member

    Joined:
    Apr 3, 2010
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    0
    I'll have to find a link. I'm using fission on d2g.
  17. prime
    Offline

    prime Kernel Developer Premium Member Developer

    Joined:
    Apr 26, 2010
    Messages:
    1,831
    Likes Received:
    19
    Trophy Points:
    38
    Location:
    Florida
    I looked, I have yet to find a link...
  18. grimloktt
    Offline

    grimloktt New Member

    Joined:
    Apr 3, 2010
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    0
  19. mattchenzo
    Offline

    mattchenzo New Member

    Joined:
    Mar 3, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    i have a D1 with a seido extended battery... from the full charge the system tells me i have low battery (<15%) after two hours or so, then the bar stays red for the rest of the day... the only way I have found to accurately judge the charge left is to use an app called battery left, it had a widget that shows your charge in mV, and when its full, that is around 4200, then it discharges fairly quickly to 3700-3800, and stays there for hours, discharging much more slowly. I have just had to learn from experience that once it gets under 3700 i dont have long, perhaps an hour or two, depending on usage... frustrating, I have been looking for a good fix for about a year, and dont have any better option so far...

    :eek:(
  20. grimloktt
    Offline

    grimloktt New Member

    Joined:
    Apr 3, 2010
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    0
    Thnx for the input. I've been using Batter Left, too. I have it setup so it tells me how many hours:minutes I have remaining. Maybe you could try that setting?
Search tags for this page
android not reading battery correctly
,
battery stats editor android
,
bp7x battery conditioning
,
cameron sino battery monitor widget
,
can i edit my androids device sys file
,

charge full design

,
cp cap battery android
,
cpcap battery android
,
edit android batterystats
,
extended battery not reading correctly
,
get androids battery stats in terminal editor
,
how to fix a misreading battery life on a droidx2
,
phone reading battery power correctly
,
sure power 132001