Code Monkey home page Code Monkey logo

Comments (16)

milux avatar milux commented on August 23, 2024 1

I think that this issue might be caused when your device performs changes to the file without altering its behavior in the expected way.
Please try the "always write" feature of version 1.0.4 and report back.

from batterychargelimit.

 avatar commented on August 23, 2024

Excact same problem here, as described in the thread -> https://forum.xda-developers.com/showpost.php?p=73588529&postcount=996

"and first problem ^^ till this morning everything worked fine. Charged until the defined limit as exspected and worked out before.
But tonight I wanted to charge again, battery symbol is showing power supply, but its not charging anymore. My limits are 70% upper and 65% for recharge. I got the message "waiting till 70%" but it was not charging. The battery was at 42% so this should not be the problem. After a reboot (without opening the app) its working fine again.
As said, I am on LineageOS 14.1 latest build for Nexus 6 with LineageOS root.zip and no further modifications.
I just realized, when opening the app and then close it again by swiping it out of the recent apps it says "battery charge limit deactivated" and if I open the app again "battery charge limit is activated". Any ideas what might go wrong? I use the generic method (selfselected but the app after install) and rest on default in the app, just unchecked "wiping battery stats automatically".
I am an "idiot" and restarted before taking a logcat, but next time I will take one... "

LineageOS 14.1 25th August build, Android 7.1.2.
Would be really interesting why it worked before (maybe I did reboots without noticing them cause I was setting up my device from scratch two days ago.)

from batterychargelimit.

 avatar commented on August 23, 2024

I played around a bit and after a
"echo "0" > /sys/class/power_supply/battery/charging_enabled"
in termux with root privileges its working properly again without a reboot and BatterChargerLimit directly pops-up again and says "Waiting till 70%".
So something is not properly switching back the state = 0 after a full charge.

I also recognized, after charging, and waiting till 3% dropped (to 67%) i can still charge again, even if my lower threshold is 60%. So somehow its starts charging again even if it shouldnt.

And most interesting. After
"echo "0" > /sys/class/power_supply/battery/charging_enabled"
if I do a
"cat /sys/class/power_supply/battery/charging_enabled"
its still at 1 and not back to zero, but now it can charge again without a reboot.

and after a reboot a
"cat /sys/class/power_supply/battery/charging_enabled"
gives also a 1

and if i use
"echo "0" > /sys/class/power_supply/battery/charging_enabled" -> not charging
and
"echo "1" > /sys/class/power_supply/battery/charging_enabled" -> charging
with BatteryChargerLimit disabled I can "manually" stop and start charging and toggle between it without any problem, so in general its working on the Nexus 6 when manually just flipping between o and 1.

And I found out, that BatterChargeLimit sucuessfully prevent my manual overwriting to not charging if its running.

So my guess is that something in Version 1.0.3 in general is not working properly as it should. Cause manually its perfectly working.
Hope this testing helps.

from batterychargelimit.

 avatar commented on August 23, 2024

And this morning (after a reboot yeseterday) it charges till 70% limit as it should.

a "cat /sys/class/power_supply/battery/charging_enabled" returns an 1 afterwards (which for me does not make sense because it stopped charging)
And if i plug in the power supply again (and beeing above the threshold) it still returns an 1 and is not charging.

I would exspect that BatterChargeLimit set it back to zero so that charging is disabled. Its set on 1 (so charging) but phone is still not charging.

from batterychargelimit.

ottomanmint avatar ottomanmint commented on August 23, 2024

from batterychargelimit.

ottomanmint avatar ottomanmint commented on August 23, 2024

from batterychargelimit.

 avatar commented on August 23, 2024

Sorry for the late reply. I was testing the behaviour in longterm. After reboot, or if not charing till the upper threshold everything works "fine". But charging till upper threshold will prevent further charging till reboot or a skript to enable charging again.

from batterychargelimit.

sriharshaarangi avatar sriharshaarangi commented on August 23, 2024

@ottomanmint @testman86
Can you observe any changes with the v1.1+ versions? Or is it behaving in the same way?

from batterychargelimit.

milux avatar milux commented on August 23, 2024

@testman86
In case it's not working still, could you please provide a link to the "script to enable charging again"?
This might be helpful for us to understand possible workarounds.

from batterychargelimit.

ottomanmint avatar ottomanmint commented on August 23, 2024

from batterychargelimit.

ottomanmint avatar ottomanmint commented on August 23, 2024

from batterychargelimit.

 avatar commented on August 23, 2024

@milux i use termux and the termux:widget for it. https://termux.com/add-on-widget.html
In the script I have a one line code snippet:

"
su -c 'echo "1" > /sys/class/power_supply/battery/charging_enabled'
"

this enables charging again. I charge till the upper limit, unplug the phone and use it as long as I want. Then plug it in again to the charger, run this line of code and the phone charges again and stopps after reaching the upper limit. Without running this code a reboot is needed before the phone will charge again.

from batterychargelimit.

digitalcircuit avatar digitalcircuit commented on August 23, 2024

In the latest release of Battery Charge Limit (v1.1.1), enabling the Always write CTRL file option appears to make this app correctly start and stop charging on my Nexus 6, even Qi wireless charging (to my surprise). LineageOS 15.1, Android 8.1, with Magisk, just in case that matters.

Without that option enabled, the same symptom arises that charging is disabled, but not re-enabled. I haven't tried watching the charging_enabled file to see if it somehow gets reset, misleading Battery Charge Limit.

from batterychargelimit.

ottomanmint avatar ottomanmint commented on August 23, 2024

from batterychargelimit.

milux avatar milux commented on August 23, 2024

Hi, I've confirmed it works on my N6 great thanks! I wish I knew how to tinker with apk's, however I barely find time for my self lately... However after install on my N10 puts the tablet into a boot-loop still!

Good to hear. Sounds like N10 does not like the commands of BCL. There's likely nothing we can do for this on our side. If you find something that we can do, please open another issue for this!

from batterychargelimit.

milux avatar milux commented on August 23, 2024

@milux i use termux and the termux:widget for it. https://termux.com/add-on-widget.html
In the script I have a one line code snippet:

"
su -c 'echo "1" > /sys/class/power_supply/battery/charging_enabled'
"

this enables charging again. I charge till the upper limit, unplug the phone and use it as long as I want. Then plug it in again to the charger, run this line of code and the phone charges again and stopps after reaching the upper limit. Without running this code a reboot is needed before the phone will charge again.

Have you tried the solution of @digitalcircuit ?

from batterychargelimit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.