yashsingh1/xdaforums huggingface dataset:
[Magisk] hackel:
I just tried the new release 1.1.3 and am still getting "ERROR: Internal error occured, please report." Also, mcc is not present in my path and I always have to type the full path to run it.

I'm on a Pixel running Android 9 with Magisk 17.1. Is there a known working previous version I should try?
[Magisk] Deus.:
I have the same problem on my Xiaomi with AICP ROM.
[Magisk] Jaymin.0.1910:
Please try the newer reworked version 'Battery Life Extender (blex)' from Magisk Manager or the third post.
[Magisk] pinoholo:
I'm trying this for the first time

When configure blex for first time I got 'failed to configure blex'

OnePlus 3 running OOS 5.0.5 with Latest Magisk 17.1

Log:

https://drive.google.com/open?id=1uuod6gOiR0EFHzOAatkuA3sHMzaFJ8FA
[Magisk] cesar_9046:
Same for me!
[Magisk] dajumper:
What are the commands for terminal? I.can not find them in read me

---------- Post added at 01:42 PM ---------- Previous post was at 01:23 PM ----------

Nice try but this doesn't work at all
[Magisk] Jaymin.0.1910:
Duplicate post, see the one below.
[Magisk] Jaymin.0.1910:
Thanks to [MENTION=6975315]pinoholo[/MENTION]'s logs, I have a test build for the fix, please try that.
[Magisk] cesar_9046:
It work's! Thanks
[Magisk] cesar_9046:
How can i configure to 90% stop charging and 80% charging?

Sorry for my bad English
[Magisk] Jaymin.0.1910:
You can do that by running

blex --enforce --update switch 90 80

Note that [--enforce] flag is required to set 90 as a threshold.
[Magisk] cesar_9046:
And what are the Settings recommended of you?
[Magisk] Jaymin.0.1910:
I have already put my personal settings as defaults, and as a minor (a real minor) compromise, I will decrease the power threshold to 10 :)

Best regards.
[Magisk] pinoholo:
Tried the zip you gave, still give same error

I notice when configuring blex the charging led went off for a second

FYI: I'm OP3 running OOS 5.0.5 with RenderZenith Kernel

Logs: https://drive.google.com/file/d/1IrIcfO8IsiPtjTO3TaBmWalhvZGKueNM/view?usp=sharing
[Magisk] Jaymin.0.1910:
Can you send me /sys/devices/soc/qpnp-smbcharger-17/power_supply/battery/uevent file ??

Best regards.
[Magisk] pinoholo:
I hope this will help you solve the issue

https://drive.google.com/file/d/1YCDBsgv4X08lvcKTzq307jt5Ceqp3a05/view?usp=sharing
[Magisk] pkmoazzam:
Hi, Jaymin.

what is inside your personal settings as default?
[Magisk] DMagister:
OnePlus3:/ $ su

OnePlus3:/ # blex --info

************************************

Battery Life Extender (blex) CLI

************************************

Battery Information

- Level : 42

- Health: Good

- State : Not charging

Current Settings

- Auto Switch thresholds: 80, 70

- Auto Power threshold : 20

- Auto Switch state : ON

- Auto Power state : ON

Daemon State: Not running

OnePlus3:/ #

This is defaults I think.
[Magisk] thinkwise98:
S7 edge exynos g935f !

To be clear if I installed it correctly and shows 90 80 it will charge until 90 and stops until 80?( it is the default )

and is it gonna work if I dont see mcc module in magisk.

After I tried blex --enforce --update 90 70

it says revert . how to fix and it says charging (unplugged from charger)

is it okay if the daemon is off
[Magisk] Jimbus369:
I have the same issue on my oneplus 5t with Render Zenith Kernel. I'm so sorry but at the moment i can't provide any log. But yesterday when i have tried your module, i have noticed that while the configuration try to do something before fail, the charging stops and start. If you can provide a really lite version of the script with only manual start and stop functions we can launch the command from the terminal automatically with some apps like Droid Automation.

Let me know if it is possible. Thanks in advance.

Bad english, I know :crying:
[Magisk] sharpsan:
Don't apologize for your English... The mod description is far worse.
[Magisk] Pipodi93:
I've installed the zip from some posts before, but no luck. OnePlus 5, PixelExperience latest build, RedFlare kernel.
[Magisk] thecube13:
When connect the charger with quick charge support, the phone constantly turns on and off the charge with a period of one second.
[Magisk] Jaymin.0.1910:
You need to run

blex --enforce --update switch 90 70

for this.

No, it's not OK if the daemon is off. The daemon is core part which handles everything from the bottom.

The defaults are currenty, 80 and 70 for Auto Switch and 20 for Auto Power, both features are enabled by default.

It's actually a minor issue with the kernel taking little more time when updating battery state. Can you test the attached zip ??

Please try out the attached zip :o

It should happen only until blex recognizes a positive input current, and after that it will stabilize. It was implemented to make sure we have the battery charging and just not mimicking the state :)
[Magisk] ChARCOOL:
My daemon is not running can someone help?

I am on Samsung A5 2017 Stock, Oreo, Default Kernel, Magisk 17.1 Latest Stable, Busybox Latest, Init.d Support
[Magisk] pinoholo:
[MENTION=8570610]JayminSuthar[/MENTION]

OP3 running OOS 5.0.5 with RenderZenith Kernel works
[Magisk] Jaymin.0.1910:
Kindly provide logs from /sbin/.core/img/blex/log folder.

Thank you a lot for the help :highfive:
[Magisk] ChARCOOL:
boot.log

+ sleep 5
+ /sbin/.core/img/blex/bin/busybox --install /sbin/.core/img/blex/bin/
+ sleep 120
+ PATH=/sbin:/system/bin:/system/xbin:/vendor/bin blex --detach --skip-logs --run-daemon

main.log

+ test --mkdaemon '==' --enforce
+ echo
+ echo '************************************'
+ echo ' Battery Life Extender (blex) CLI '
+ echo '************************************'
+ stop '==' stop
+ is_runningd
+ get_proc -q --run-daemon
+ ps
+ grep -v grep
+ grep {blex}
+ grep -q --run-daemon
grep: unrecognized option `--run-daemon'
BusyBox v1.29.2-topjohnwu (2018-08-12 18:39:31 DST) multi-call binary.

Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file
+ abort 'blex daemon is not running'
+ print --error 'blex daemon is not running'
+ echo 'ERROR: blex daemon is not running'
+ exit 1

---------- Post added at 01:32 PM ---------- Previous post was at 01:28 PM ----------

I have those modules installed:

App Systemizer

Battery Life Extender

Busybox by YashdSaraf

Debloater

Google Framework

GPU Turbo Boost

Init.d Injector

liboemcrypto disabler

Magisk Google DNS

MagiskHide Props Config

SQLite for ARM aarch64 devices

Sysconfig Patcher
[Magisk] Jaymin.0.1910:
Thanks to the logs, I tracked down another small bug :o
[Magisk] ChARCOOL:
I thought that init.d injector was not working, so I uninstalled that and installed it again but randomly my "Battery Life Extender" module turned to only "blex" with description (no info provided), (no info provided) in magisk manages, so I uninstalled it. I hope there is no leftover

It would be nice if you make uninstaller. And I hope you fix the problems soon so I can use it because it looks cool. !
[Magisk] thecube13:
Indeed, after connecting the AC charger after a while charging is equalized. But if I use powerbank (Xiaomi PowerBamk2 with QC) blinking does not go away.
[Magisk] Jaymin.0.1910:
Well, as you had a Magisk install, you can delete the /sbin/.core/img/blex folder while booted to make sure leftovers are gone. And yes, I will soon make an uninstaller, too! Thanks for the suggestion :good:

Then this means that the powerbank is not providing enough current to the circuit, there is nothing that can be done to that :( I will recommend stopping the blex daemon for the period by running

blex --mkdaemon stop

Best regards.
[Magisk] Jimbus369:
On Oneplus 5t works, at the moment. Anyway, could you add some examples to the description?

blex --update switch 80 75

blex --enforce --update switch 90 70

blex --toggle power off

blex --toggle switch off
[Magisk] Jaymin.0.1910:
I will rewrite the READMe to be more user-friendly and also add examples for each supported action. Thanks for the suggestion.
[Magisk] ChARCOOL:
not working again after the update

boot.log

https://xdaforums.com/attachment.php?attachmentid=4593043&stc=1&d=1536605913

main.log

https://xdaforums.com/attachment.php?attachmentid=4593042&stc=1&d=1536605913
[Magisk] Erecik:
Yep, can't start daemon, no matter what I do.

Version 0.1.1, Magisk 17.1, Android Pie

Here are logs:

boot.log

main.log
[Magisk] Pipodi93:
Now it works, but daemon cannot be started with any command provided.
[Magisk] Pipodi93:
Here's my logs.
[Magisk] Pipodi93:
UPDATE: This morning I woke up and I saw that blex was working anyway, even without the deamon. Is this supposed to be happening?
[Magisk] davidhozic:
Oh wait is this like a capacity preserver?
[Magisk] Jaymin.0.1910:
I figured the daemon was actually running, but the CLI was unable to recognize that. I have found the cause and a fix will be uploaded soon, not more than 2 or 3 hours.

Thanks to those who provided logs and relevant details.

Best regards.

It is a tool to control charging, so that to prolong the batteries life.
[Magisk] pinoholo:
[MENTION=8570610]JayminSuthar[/MENTION] after updated to latest blex 0.1.2 it's not working again, it let phone charge over 80%

Log:

https://drive.google.com/file/d/1NRfkt5uGSQ5RhTCh5z7zWpfjzjbYfgLO/view?usp=sharing
[Magisk] Jaymin.0.1910:
I didn't change any of the daemon/switch code between these versions, can you try again after a reboot ??
[Magisk] Jamess27:
Working fine on OP6, thank you! Battery limiter app was not working for me.

Adding some examples for the configuration could be very helpful to use all the potential of this module
[Magisk] Hellsingoff:
blex --mkdaemon

says "Done", but

blex --info

says Daemon not running

Module is not working, phone overcharged
[Magisk] pinoholo:
Tried reboot twice still the same, I'm even tried deleting module from Magisk Manager and reinstall, but still

Went back to 0.1.1
[Magisk] cesar_9046:
Have you a Link?
[Magisk] Jaymin.0.1910:
See a few posts back, it will be done shortly after sorting out the daemon not running issue :)

Can you post the output of

/sbin/.core/img/blex/bin/busybox ps

Can you post the output of the ps command as above and also, can you run

PATH=/sbin:/system/bin:/system/xbin:/vendor/bin blex --detach --run-daemon

and the provide the terminal output and logs inside the blex/log folder ??

Official 0.1.1 zip is attached, please use that until I fix the issue.

Thanks for the logs. I will soon fix the issue :o
[Magisk] kirito05:
can someone tell me how to use this ?

Total noob here
[Magisk] Tekken Lord:
Please search the thread. This is the firs step to un-noob yourself. That's what I did when I had your same question. Thanks for your consideration.
[Magisk] Jaymin.0.1910:
This is a tool to enable/disable charging on your device programmatically, details about this have been written into README (which is quite not user-friendly, but I'm gonna rewrite that).

You will need a terminal to use this, please wait until I rewrite the README (or read that fully yourself) because the CLI provides many options which I wouldn't be able to describe in a single post.
[Magisk] pinoholo:
[MENTION=8570610]JayminSuthar[/MENTION]

Sorry for the delay

Here's the output, hope I'm doing it right
[Magisk] Jaymin.0.1910:
Thanks for providing necessary logs! So finally, I figured out where the bug happens, I will soon push a fix for this :highfive:

Best regards.
[Magisk] Roll3r:
I can't seem to get the daemon running. I don't get any errors when running blex --mkdaemon start, but when I check blex --info I get "Daemon state: not running". Verified that the phone still charges past 80%.

I've got the latest version from the Magisk repo installed, running on Pixel XL stock Pie with latest ElementalX kernel. Tried uninstalling, reinstalling, using defaults, etc.

Logs are attached.
[Magisk] Jaymin.0.1910:
First of all, thanks for providing logs.

This issue has been fixed in my local clone of blex (thanks to [MENTION=6975315]pinoholo[/MENTION] for testing), but I'm also testing some other changes, so I will push the fix a couple of days later. Until then, check my previous posts, I have attached the last working build in one of my posts.

Best regards.
[Magisk] Roll3r:
Thanks! I'd thought the builds you posted were older than what's on the repo, so I'll give it a shot!

Update: installed v. 0.11, same thing except now I get the "failed to start daemon" error.

I'll just wait for the next release, or I'd be happy to help test it [MENTION=8570610]JayminSuthar[/MENTION]
[Magisk] pinoholo:
One thing I notice since last 0.12 update, when I install/update the other Magisk module after Blex installed the module failed to install and not found in Magisk Manager.

But when I updated/installed other module before Blex, the issue doesn't occure

Please let me know how to take proper log about the issue
[Magisk] Jaymin.0.1910:
OK, then I'd suggest wait for the release :)

:confused:, that shouldn't happen, can you send me /dev/blex_install.log after installing blex and other modules' install logs for both the cases. I will try to fix the bug.

Best greetings.
[Magisk] Denver3D:
Hello I got a question, I've runed CLI and grant it root permission after that I used the command blex --configure & I pluged the charger then I hit enter after few secondes the setup finished it means I can now reboot my phone or do anything it's working by default even if CLI isnt running or I should use another command for it ?

Log:

INFO : Press Enter when device is charging:

INFO : Reboot detected and workarrounded

- Configuring Blex' Kernel Interface

- Done

After that I did Blex --info

Battery Information

Level: 33

Health: Good

State: charging

Current settings by default (lazy to write it)

Deamon State: Not running

then I've used the command blex --mkdaemon but still even if it said done without any error I got Deamon State: Not running on blex info

Edit: After reading some couple of post I've understand now that my version is bugged and I can't use the one attached cause I'm using magisk, going to wait for the push update and in the meantime thank you a lot for this wonderful script, and I got a last small question, if I put auto shutdown at 10% and cut the charge phone at 95%, won't that affect the battery life ? and thank you again
[Magisk] Jaymin.0.1910:
blex has got a daemon that's always running in the background to handle every kind of power ON/OFF and switch ON/OFF requests, even manual methods are handled by that. The Commandline User Interface is to update what the daemon should be doing and how and with what parameters and to configure how the kernel interface is exposed (via sysfs).

Your terminal output is looking all good but, you seem to have an odd device which doesn't have standard and rebooted when configuring for the first time, if that's not true , there is a problem and you should quote me back on that, otherwise they're all good.

As for the bug, I will push a fix just in an hour or more versioned 0.1.2.1 to fix the issue and the refactored and redocumented build will be delayed by some days because I'm currently testing ShellHide - a shell script based alternative to MagiskHide. I have actually ported all hiding capabilities of Magisk and MagiskHide into a shell script without losing reliability.

And finally, for the settings, I will recommend that you cut the charge at a level that's below 85, or 90 at most. Going above 90 will likely put the device into a low current and high voltage state which is a part when it's tricky to protect the batteries' life. You should avoid that.

Best regards.
[Magisk] Denver3D:
Thank you soo much for all of thoses information and again I'm sorry but I didn't understand what did you meant by I got an Odd device ?

Cause what I got is a samsung S7 Edge SM-G935FD with a custom oreo room (Superman rom from xda) & MagiskRoot

Edit: After updating with magisk blex, I did blex --configure and then checked for the daemon it's still not running after that I tried blex --mkdaemon I got an error saying Failed to start daemon

What should I do to generate a debug logs ?
[Magisk] Jaymin.0.1910:
By odd device, I meant that your device might have spontaneously rebooted the first time you tried to configure blex, that's a known issue with some devices and blex has a workaround for that which, seemed enabled in your terminal output. So, if your device actually rebooted the first time, that's OK, otherwise there's something we will need to figure out.

Did you update to 0.1.2.1 0 from the Repo ?? Can you provide logs for me to analyze ??

Best regards.
[Magisk] Denver3D:
Here is my logs and yes I updated 0.1.2.1 0 from magisk update

And about Odd nop my device didn't reboot either during the installation or during the update or even after deleting & reinstalling Battery life extender from magisk
[Magisk] Jaymin.0.1910:
Thanks for providing logs, I figured out a silly quoting mistake.

I will push a bug-fix release soon.

Best regards.
[Magisk] Denver3D:
Thank you soo much, hope we will get an updater sooner cause even with the 1.1.10 that you've posted few page back doesn't work with blex --mkdaemon got the same error :(
[Magisk] Roll3r:
Upgraded to 0.1.2.1 and it's *somewhat* working now.

I still get an error when running --mkdaemon start, and --info says the daemon isn't running, but it does stop charging at the correct value (I set 41 35 for testing).

However, the battery level never drops when connected to power - it stays at 41%.

Logs are attached.
[Magisk] kindlyoldbear:
I can't seem to get the syntax right. To change the thresholds to 20% to 90%, I tried

Blex --update 20 90 enable

It is apparent that this not have the desired effect. Please help.
[Magisk] Roll3r:
blex --enforce --update switch 90 20
[Magisk] cesar_9046:
With version 0.1.3!
[Magisk] Jaymin.0.1910:
Please send me blex.cfg from the blex folder.

It's updated to 0.1.3 and 0.1.3.1 will be released in a few hours to address the issue reported by [MENTION=5323714]cesar_9046[/MENTION].

Please read the Usage and CUI sections in the README.

I will soon release a fix for that.
[Magisk] Denver3D:
Hi thanks again for the update 1.3.0 I just updated it and I still got configuring blex' Kernel interface, and got the same error as cesar_9046 when I wanted to start mkdaemon, and did someone noticed on the version 1.2.1 at 80% battery while charging it start to charge and stop like if the phone was plugged in and took it off several time is that normal ? won't it affect battery charge ?
[Magisk] Jaymin.0.1910:
Hello [MENTION=5834859]Denver3D[/MENTION],

I know about that but, that was implemented intentionally because some devices don't react to blex' requests and rather they halt the battery level at a constant level instead of re-enabling charging. I have already had enough reports about that being bad, and I Will either try to remove or stablilize that part of blex.

Best regards.
[Magisk] Erecik:
Version 0.1.3.1 working fine!

Thanks for your hard work
[Magisk] Jamess27:
latest version is not working, in terminal i have this answer *Unrecognised option" each time I type blex alone or with an option.

No log file is present
[Magisk] saoudien07:
Hi, your module seems interesting, unfortunately I m sad to say that it is a bit confusing to use it...:(

Are you planning to make it as an app in future, with some interface, instead of commands in Terminal

I think a lot of us would love that, of course if possible.

Thx of your work :good:
[Magisk] hackel:
Just tried 0.1.3.1 and am sorry to report that it's not working for me, either. The daemon never shows running. If I run `blex --detach --skip-logs --run-daemon` manually, it says that it's already running, but if I run `blex --mkdaemon stop`, it says it's *not* running. I never see blex in the ps list.

Manually setting /sys/devices/soc/qpnp-smbcharger-16/power_supply/battery/charger_control to 0 seems to have worked fine to disable charging even while plugged in, so it seems there's something else going on with the daemon.
[Magisk] neekless:
delete
[Magisk] Jaymin.0.1910:
You're always welcome.

Can you run

blex --help

?? It's supposed to print the HELP page. If that doesn't happen, please send me logs if they're present or else quote me back and I'll assist you to find out what's wrong.

I also would like to have that but, my college work is killing my free time and I haven't also studied much about GUIs, etc. BTW, I'm currently working on porting this to native "C" language.

Can you send me logs after running

blex --detach --skip-logs --run-daemon

??

Best regards.
[Magisk] snakx:
Daemon state : not running

With last version

************************************

Battery Life Extender (blex) CLI

************************************

Battery Information

- Level : 56

- Health: Good

- State : Charging

Current Settings

- Auto Switch thresholds: 80, 70

- Auto Power threshold : 5

- Auto Switch state : ON

- Auto Power state : ON

Daemon State: Not running

lex --detach --skip-logs --run-daemon <

lux_uds:/data/data/com.termux/files/home #

************************************

Battery Life Extender (blex) CLI

************************************

ERROR: blex daemon is already running

su

sh: su: not found

127|lux_uds:/data/data/com.termux/files/home # blex --info

************************************

Battery Life Extender (blex) CLI

************************************

Battery Information

- Level : 56

- Health: Good

- State : Charging

Current Settings

- Auto Switch thresholds: 80, 70

- Auto Power threshold : 5

- Auto Switch state : ON

- Auto Power state : ON

Daemon State: Not running
[Magisk] Dead-neM:
The su command is a one shot (in this case)

Just type su press enter on your keyboard and you are good to go
[Magisk] Jamess27:
THANK YOU, it was so simple.

Actually now is not working, I set the values to 75 65 but it charges to 100
[Magisk] saoudien07:
Thx, hope to see an app for the module in future not imminent, at least in some future...

Courage and keep the great work you do ;)
[Magisk] Roll3r:
Attached. Logs and the cfg. These are from 0.1.3.1
[Magisk] snakx:
it's normal : plug charger (first charge)-> 100% -> charge stop -> battery discharge -> 70% -> charge restart -> 80% -> charge stop

(if I understood how the module works)
[Magisk] Jamess27:
I know. This version is not working, I came back to 0.1.1 which is working well for me
[Magisk] snakx:
Can tout share the 0.1.1 version please.

I can't find it
[Magisk] walwan:
Daemon Status : not running

I encountered a problem of starting the daemon. Every time I use "blex --mkdaemon start" , it replies Done. But when I check the status, it gives me not running.

Logs attached.

Version 0.1.3.1