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

GF66 (MSI Katana) and possibly other models have different battery threshold address #1

Open
levnikmyskin opened this issue Jun 30, 2022 · 5 comments
Labels
bug Something isn't working investigating Working on a solution

Comments

@levnikmyskin
Copy link

Hey everyone! So it looks like the Katana model has a different battery threshold address. I don't know about the other addresses (since this was the only one I was interested about). I can tell you that cooler boost, for instance, works out of the box. Other things might work as well, who knows.

That said, for the battery address, change the isw.conf file (bottom of the file, MSI_ADDRESS_DEFAULT), like:

...
[MSI_ADDRESS_DEFAULT]
address_profile = MSI_ADDRESS_DEFAULT
fan_mode_address = 0xf4
cooler_boost_address = 0x98
usb_backlight_address = 0xf7
battery_charging_threshold_address = 0xd7  <---- this is what you need to change (default now is 0xef)
...

Once you've done this and saved the file, you can simply do isw -t 80 to set the battery threshold at 80% (laptop needs to be below 80% when you plug it in for this to work, from my experience).
Now, I didn't look into the isw python code too much, but I feel like all the addresses are taken from the MSI_ADDRESS_DEFAULT or am I wrong?
If addresses are taken by the model specific section, then we should be good to go simply changing the address in a specific section for this (and possibly many more) model.
Also, see this issue on the original isw repo

@FaridZelli
Copy link
Owner

Hi, thanks for sharing this info!

If addresses are taken by the model specific section, then we should be good to go simply changing the address in a specific section for this (and possibly many more) model.

Indeed, the address is located from the address_profile value of each section under isw.conf, as where the default addresses themselves are defined bellow.

Laptop needs to be below 80% when you plug it in for this to work, from my experience.

You are correct, and it's certainly best to keep the battery level above 20%, and under 80% at all times. But I have some concerns regarding the implementation used by ISW, and believe that it may be harmful to your charging circuit in the future (similar to how Magisk battery limiter modules on Android harm the PMIC of many devices). Therefore I personally wouldn't recommend using that feature at all. I'm not a developer, nor do I know Python, so I cannot confirm this by any means. Though keep in mind that the My laptop exploded! entry in the FAQ is not a joke.

I'm currently more focused on restoring ISW's core functionality back onto as many distros as possible (during my limited time however), but I added a potential plan for hardware addresses in the to-do list, as it'll be a way better use case for the configuration file in general. 👍

@levnikmyskin
Copy link
Author

Hey!

Indeed, the address is located from the address_profile value of each section under isw.conf, as where the default addresses themselves are defined bellow.

Yes that's what I thought. Looks good to me :)

You are correct, and it's certainly best to keep the battery level above 20%, and under 80% at all times. But I have some concerns regarding the implementation used by ISW, and believe that it may be harmful to your charging circuit in the future (similar to how Magisk battery limiter modules on Android harm the PMIC of many devices). Therefore I personally wouldn't recommend using that feature at all. I'm not a developer, nor do I know Python, so I cannot confirm this by any means. Though keep in mind that the My laptop exploded! entry in the FAQ is not a joke.

I understand your concerns, but honestly as long as we don't have "proof" of what you say I don't see why this would be the case. The way I reverse engineered the address was simply by switching to windows, setting the battery threshold and then back to linux, to check where windows wrote the setting. I don't think this should be dangerous, since it's basically doing the same thing windows is doing. I'd be more concerned, at the moment, to use any other feature in ISW, since addresses are most likely completely different (except for cooler boost apparently) and you don't really know where you're writing.

That said, I totally understand your concerns, but I think we'd need more info to either assert one or the other thing.

@FaridZelli
Copy link
Owner

Could you send an EC dump? I'm adding a new address profile for the GF66 =]
Also, can you please confirm which features are currently working? There's a new issue at #2 reporting that fan controls aren't functional either.

@FaridZelli FaridZelli added bug Something isn't working investigating Working on a solution labels Jul 3, 2022
@levnikmyskin
Copy link
Author

Haven't tested much yet, but we're discussing it here

@levnikmyskin
Copy link
Author

Updating this just to warn again: if you are using ANY model which is not listed in the isw.conf file I would absolutely recommend NOT to use isw. Keep following the discussion I posted in my previous comment, it is safe to assume most addresses have basically changed (the good news is, these new addresses shouldn't apply to Katana only, but to many other recent models).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigating Working on a solution
Projects
None yet
Development

No branches or pull requests

2 participants