godly-devotion / charge-limiter

macOS app to set battery charge limit for Intel MacBooks
GNU General Public License v3.0
644 stars 26 forks source link

keyNotFound(code: "BCLM")% #34

Open AdinAck opened 2 years ago

AdinAck commented 2 years ago

When running the app, is says the current charge is "keyNotFound(code: "BCLM")%".

Even though it says success, the battery charge is not being limited.

I also get this message when running the command sudo /Applications/Charge\ Limiter.app/Contents/Resources/bclm write 80

I'm on an M1 MacBook Air running macOS Monterey 12.0.1

isaacnorwich commented 2 years ago

I am also having this error. M1 Macbook Pro with Apple M1 Pro chip on macOS Monterey. Same things happens to me when i type the same command sudo /Applications/Charge\ Limiter.app/Contents/Resources/bclm write 80 in the terminal.

AdinAck commented 2 years ago

I have learned that the M1 does not have an SMC, and thus there is no key to write to. Unfortunately there is no option for us :(

I did have an idea to overwrite the ML model that determines when to hold at 80% with one that always outputs True, and I have created the file, but cannot figure out how to overwrite system files.

isaacnorwich commented 2 years ago

How does AlDente (https://github.com/davidwernhart/AlDente) work then with M1 Macs? Thanks for the info though!

AdinAck commented 2 years ago

It just disconnects the charger until the desired battery level is reached. The unfortunate thing about this is that clamshell doesn't work with it as clamshell is only enabled when connected to power, that is why I resorted to forcing the ML model to handle the SOC decrease.

Danby108 commented 2 years ago

I have learned that the M1 does not have an SMC, and thus there is no key to write to. Unfortunately there is no option for us :(

All the functions the SMC handled are now embedded in the M1 processor. That must include recharging the battery. So the lack of an SMC does NOT mean there's no way to limit the battery charging level.

It does explain why the two utilities I've tried, which reference BCLM, don't do what they were intended to do on my M1 Mac.

Clearly a new version of charge-limiter is needed, which will: First determine if it's running on an older mac with an SMC, or a newer M1 Mac. If it's running on an older mac, then it should apply the existing code. If it's running on a newer M1 Mac, then it should apply a new approach, which ought to be possible.

If godly-devotion is willing to attempt this new version, I'd be willing to sponsor him/her/them with a $20 contribution.

Danby108 commented 2 years ago

Update: Limiting the battery charge is DEFINITELY possible on the M1 machines, since the AlDente app is successfully doing it. However, the charging indicator light is incorrectly showing that it's charging when it's not.