Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery #41

Open
ssergio-ll opened this issue Nov 18, 2019 · 21 comments
Open

Battery #41

ssergio-ll opened this issue Nov 18, 2019 · 21 comments

Comments

@ssergio-ll
Copy link

This that i go to comment is not related to this project, but I suggest if it were possible if you want and can.

MSI have a tool called "MSI Dragon". This utility have a option for battery care that set limit charging to battery. For example: loading between 40% and 60%.

Can you do a script that can limit values min and max of ours batteries for increase its useful life.

TLP can do but i have seen that it only run with thinkpad notebook.

I have been thinking that if you can do all or some of utilities that MSI Dragon have, i could do a GUI (QT) for yours scripts and so we can have a "MSI Dragon" amateur for Linux.

@YoyPa
Copy link
Owner

YoyPa commented Nov 18, 2019

I had to remove the battery of my laptop (swollen). Can't help on this one 😇.

@ssergio-ll
Copy link
Author

I had to remove the battery of my laptop (swollen). Can't help on this one innocent.

Hello YoyPa. What is your model Laptop? Maybe i could buy you a battery for that you can do this feature.

Thanks.

@ssergio-ll
Copy link
Author

I had to remove the battery of my laptop (swollen). Can't help on this one innocent.

Hello YoyPa. Are you interested in my proposal? I can buy to you a battery for that you can add this feature.

Thanks.

@YoyPa
Copy link
Owner

YoyPa commented Dec 4, 2019

Hello,
That's really kind, but I installed multiple version of Dragon center and i don't see anything related to battery in it. I've also seen this statement (relevant?) "Battery Master is only for RTX and GTX16 series". My laptop is GTX970m (GS40_6QE), maybe too old for the feature.

@ssergio-ll
Copy link
Author

Hello,
That's really kind, but I installed multiple version of Dragon center and i don't see anything related to battery in it. I've also seen this statement (relevant?) "Battery Master is only for RTX and GTX16 series". My laptop is GTX970m (GS40_6QE), maybe too old for the feature.

Hello Yoypa.
Then If you wish, i can give you access remote to my computer for that you can add this feature. In exchange of you work, i can buy a battery for you or I can make you an economic contribution. How about?

Thanks!

@YoyPa
Copy link
Owner

YoyPa commented Dec 4, 2019

i can give you access remote to my computer

Might make it possible, but it will be a pain (reboot between linux/windows to test + charge discharge battery) and I could fail :trollface:.

@ssergio-ll
Copy link
Author

i can give you access remote to my computer

Might make it possible, but it will be a pain (reboot between linux/windows to test + charge discharge battery) and I could fail :trollface:.

I will be with you for give access with teamviewer. About what could fail, do you mean damage the battery?

Do we speak privately when you can and particularize?

Thanks!

@YoyPa
Copy link
Owner

YoyPa commented Dec 4, 2019

About what could fail, do you mean damage the battery?

I mean not finding anything but there is always a risk, even if I never broke anything until now. I don't think EC is able to damage the battery (battery contain it's own circuitry).

Do we speak privately when you can and particularize?

You can find my @mail here -> https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=isw

@ssergio-ll
Copy link
Author

About what could fail, do you mean damage the battery?

I mean not finding anything but there is always a risk, even if I never broke anything until now. I don't think EC is able to damage the battery (battery contain it's own circuitry).

Do we speak privately when you can and particularize?

You can find my @mail here -> https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=isw

Sorry. I don't see your email nowhere.

@garis
Copy link

garis commented Dec 27, 2019

This that i go to comment is not related to this project, but I suggest if it were possible if you want and can.

MSI have a tool called "MSI Dragon". This utility have a option for battery care that set limit charging to battery. For example: loading between 40% and 60%.

Can you do a script that can limit values min and max of ours batteries for increase its useful life.

TLP can do but i have seen that it only run with thinkpad notebook.

I have been thinking that if you can do all or some of utilities that MSI Dragon have, i could do a GUI (QT) for yours scripts and so we can have a "MSI Dragon" amateur for Linux.

Maybe I can help.
I was looking to get a little bit of control of the battery in Linux exactly like TLP on my Lenovo (that was awesome), long story short I have a MSI Prestige 15 and maybe I found something but I didn't test these results yet.
The options in Dragon Center for the battery are:

  1. Best for mobility: charge the battery to 100% all the time.
  2. Balanced: charge the battery when under 70% stop at 80%
  3. Best form battery: charge the battery when under 50% stop at 60%.

These options are directly writing in the EC at address EF with the following values:

  1. E4
  2. D0
  3. BC

These are 3 screenshots of the 3 modes.
bb
bl
bm

I was trying to explore the code of the application to look for an explanation of the values but I can't understand the logic behind the code I found (if someone is interested I can share what I found).

Like I was saying I didn't tests these results in Linux, hopefully in the next few days I will be able to do so.

@YoyPa
Copy link
Owner

YoyPa commented Dec 27, 2019

Nice :), here are the corresponding isw commands:

0xE4@0xEF (Mobility(100-100)) = sudo isw -s 0xef 228 
0xD0@0xEF (Balanced(70-80)) = sudo isw -s 0xef 208 
0xBC@0xEF (Battery(50-60)) = sudo isw -s 0xef 188

Sorry. I don't see your email nowhere.

Just look at the first line: # Maintainer: yoann dot p dot public at gmail dot com

@garis
Copy link

garis commented Dec 27, 2019

They seems to work well in Linux.
The value in 0xEF is probably the threshold that the system uses to stop charging the battery. It makes sense if the value is considered as signed (228-128=100, 208-128=80 and 188-128=60).
Probably all the value from 128 to 228 are possible (corresponding to 0% - 100% charge)
I didn't found anything regarding the lower threshold so I supposed that the charge always start at minus 10% of the threshold (and 100% is a special case).

@ssergio-ll
Copy link
Author

ssergio-ll commented Jan 3, 2020

H

Nice :), here are the corresponding isw commands:

0xE4@0xEF (Mobility(100-100)) = sudo isw -s 0xef 228 
0xD0@0xEF (Balanced(70-80)) = sudo isw -s 0xef 208 
0xBC@0xEF (Battery(50-60)) = sudo isw -s 0xef 188

Sorry. I don't see your email nowhere.

Just look at the first line: # Maintainer: yoann dot p dot public at gmail dot com

Hello YoyPa.

I have tested this on my notebook MSI GS75 and it works perfectly. (Comment that for it to work you have to restart the computer once the command has been executed)

Now if you could add alias command for this commands it would be perfect.

I go to begin to work in a graphics tools for KDE based on your work.

Also I appreciate your work and i wish do a contribution economic for you. If you wish could set a link for donations via paypal for example.

I also thank Garis for his contribution and help.

Very thanks!

@YoyPa
Copy link
Owner

YoyPa commented Jan 5, 2020

(Comment that for it to work you have to restart the computer once the command has been executed)

Weird, EC should be reset after reboot 👺

@YoyPa
Copy link
Owner

YoyPa commented Jan 5, 2020

Hmmm, how should it be added ?

  • A) a new option, isw -t 80 = treshold at 80%
    need to make a new systemd unit for auto apply at startup.

  • B) add a line in every profile for battery treshold, default at 100%
    set via option -w and no new systemd unit to make/enable

I vote for B personally 😇

@garis
Copy link

garis commented Jan 5, 2020

Regarding the reboot, in my case I was setting the battery threshold in windows via dual boot and then use Linux, the option was persistent after multiple reboots.

Regarding the implementation, I really like both implemented at the same time since it was I am currently using (sort of).
I would use the default at 80% or 60% at home with normal use and then I would use the -t 100 to charge the battery before leaving so the battery is full when I am not sure that a a power source would be near me.

@ssergio-ll
Copy link
Author

For me (MSI GS75) this options are permanent after of execute commanns and reboot so i think that is not necessary add a new systemd unit for auto apply at startup.

0xE4@0xEF (Mobility(100-100)) = sudo isw -s 0xef 228
0xD0@0xEF (Balanced(70-80)) = sudo isw -s 0xef 208
0xBC@0xEF (Battery(50-60)) = sudo isw -s 0xef 188

@YoyPa
Copy link
Owner

YoyPa commented Jan 7, 2020

Added with 047ca4f
As @garis suggested I added both:

  • battery_charging_threshold in isw.conf is applied via option -w or via systemd unit @startup
  • option -t is available to set it manually without touching isw.conf

ISW will check if the threshold is between 20% and 100% (arbitrary)
And I just noticed I wrote treshold instead of threshold everywhere ... 😭

@andreiboyanov
Copy link

@YoyPa, Do you plan to update the AUR package to include this precious feature ? :)

@Alphamineron
Copy link

@ssergio-ll Hello, I just stumbled upon this amazing project by @YoyPa... I'll have to check if this works with my MSI notebook as it doesn't seem that this has been extensively tested, however, I wanted to ask if there's any progress on the GUI concept of a linux-dragon-center...?

Looking a the help output of isw, it seems that it's implementing many things from the Dragon Center including Battery and Fan control... adding support for CPU Power Management and profiles would essentially cover most of the Dragon Center requirements.

@stef204
Copy link

stef204 commented Feb 5, 2022

@andreiboyanov

@YoyPa, Do you plan to update the AUR package to include this precious feature ? :)

https://aur.archlinux.org/packages/isw-git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants