I did a fair bit of searching and didn’t come up with a good alternative.
What kills laptop batteries fast is having it sit at 100% SoC (~4.2v per cell) for long periods of time, and is exacerbated by higher temperatures (typical inside a laptop). “Disconnecting” a battery will do nothing unless it’s at a lower SoC. I vote for a selectable charge threshold. If you set your SoC to 70-80% you can massively extend the life of the battery. I’ve run 80% on my current Lenovo X1 (6th) and the battery has only experienced a few percent degradation.
Hmm, I wrote a script myself.
#!/bin/bash
# /usr/local/bin/reboot-firmware
if [[ $EUID -ne 0 ]]; then
>&2 echo "This script must be run as root"
exit 1
fi
OS_INDICATION_SUPPORTED_FILE='/sys/firmware/efi/efivars/OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c'
OS_INDICATION_FILE='/sys/firmware/efi/efivars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c'
BUFFER_ATTR=7 # EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS
[ -f $OS_INDICATION_SUPPORTED_FILE ] && [ "$(( $(cat $OS_INDICATION_SUPPORTED_FILE | od -An -t u8 --read-bytes=8 --skip-bytes=4) & 1))" -eq 1 ] || {
>&2 echo "OsIndications is not supported"
exit 1
}
DATA="$([ -f $OS_INDICATION_FILE ] && cat $OS_INDICATION_FILE | od -An -t u8 --read-bytes=8 --skip-bytes=4 || echo '0')"
DATA=$(( $DATA | 1 )) # EFI_OS_INDICATIONS_BOOT_TO_FW_UI
BUFFER="$(printf '%08x' $BUFFER_ATTR | sed -r -e 's/(..)(..)(..)(..)/\\x\4\\x\3\\x\2\\x\1/')$(printf '%016x' $DATA | sed -r -e 's/(..)(..)(..)(..)(..)(..)(..)(..)/\\x\8\\x\7\\x\6\\x\5\\x\4\\x\3\\x\2\\x\1/')"
printf "$BUFFER" > $OS_INDICATION_FILE
reboot
RUnit does actually do its own job, to be an init system but not a exit system . It does follow the unix philosophy.
What kills laptop batteries fast is having it sit at 100% SoC (~4.2v per cell) for long periods of time, and is exacerbated by higher temperatures (typical inside a laptop). “Disconnecting” a battery will do nothing unless it’s at a lower SoC. I vote for a selectable charge threshold. If you set your SoC to 70-80% you can massively extend the life of the battery. I’ve run 80% on my current Lenovo X1 (6th) and the battery has only experienced a few percent degradation.
You can set thresholds using tlp which forwards the setting to EC of the laptop Battery Charge Thresholds — TLP 1.3.1 documentation (linrunner.de)
START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=80
@Animesh_Sahu Do you have those thresholds working on Framework? The docs seem to say they only work on certain Lenovos but maybe they are out of date?
@Animesh_Sahu Do you have those thresholds working on Framework? The docs seem to say they only work on certain Lenovos but maybe they are out of date?
I did not got hands on framework till now, its neither in my country nor my parents (I’m a student) can afford it until my current laptop goes out completely, but I’m sure my next laptop is going to be 100% framework…
We have this exposed in the EC, but need to work on exposing this to the bios/user applications to make it usable.
The officials have confirmed that the EC is exposed, and I’d guess it should work without any problem on framework.
Yep, open source firmware is well aligned to our mission of building products that are better for people and the planet. Our EC firmware is based on chromium-ec, and we will be releasing source. As @Kieran_Levin noted, we’re also exploring coreboot. We’re currently focused on getting the Framework Laptop out into the world in a lower-risk path that uses an off the shelf proprietary BIOS, but we’re looking forward to replacing that with an open alternative in the future.
As pointed out, it is based on chromium-ec which was probably used in old lenovo thinkpads as well (zephyr framework appeared in 2016), even if sources might be different it would be easy to integrate as can take inspiration from old tlp sources and adjust accordingly for framework.
Add a new forum page if it does not work, implementation should be quick, unfortunately can’t test it out from my side :^(
Do you have those thresholds working on Framework?
I tried to set battery thresholds and it does not work with the defaults settings anyway.
Yeah, if we could get documentation, we could easily patch TLP for the Framework EC.
@RandomUser I’m not sure it’s exposed to the software yet. The Framework team has already alluded to the fact that adding that configuration to the BIOS is on their roadmap, until then Windows can’t do anything about charging thresholds. There is freeware that’ll alarm you when certain thresholds are met, but those are hacky and require you to unplug and replug manually anyways.
I’m not sure what it will look like when the Framework team gets around to that, whether it’ll be setting charge percentages in BIOS like I’ve seen on a recent-generation Dell laptop, or whether they’ll give a utility to be able to control charge levels through a tool like Asus and Lenovo provide.
As a work-around for another notebook, I wrote a Python script to monitor the battery charge level and turn on or off a smart plug that the charger is plugged into. It works well, but the computer must be on.
Crediting John Lombardo’s post here since he posted another quite literally hacky solution, but one that seems much more functional than the normally available utilities.
According to framework, and assuming I didn’t misread, the EC is exposed! So it should be possible to use rweverything to set the charge limit, much like controlling a fan.
Have not heard of that utility, I’ll have to try it out soon. If someone doesn’t beat me to it I’ll post what my experience was
Re F2 to enter the BIOS and F12 to enter the one-time boot override, I’ve only gotten it to work if I also press the Fn key:
Fn-F2
Fn-F12
Which might be obvious since that’s how you get the function keys, but might be worth mentioning for those of us who don’t know
(Fn + Esc)? It’s a persistent function lock.
That’s good to know as well!
Re F2 to enter the BIOS and F12 to enter the one-time boot override, I’ve only gotten it to work if I also press the Fn key:
Fn-F2
Fn-F12Which might be obvious since that’s how you get the function keys, but might be worth mentioning for those of us who don’t know
This may be a good thing to point out in the guide for 1st time use if it isn’t already. Folks are giddy & excited to get it going and may not realize that Fn key is part of the equation.
3.03 Beta is now available: Public Beta Test: BIOS v3.03 + Driver Bundle 2021_08_31
3.03 Beta changelog (as of 2021-09-03): Framework Laptop BIOS and Driver Releases
New Features
- Added Chassis Intrusion Detection Setup on BIOS setup advanced settings page.
Fixes
- Solve issue where user cannot enter the BIOS menus after rebooting from Linux.
- Increase switching frequency of side LEDs and keyboard backlight to reduce flicker.
- Improve power button behavior to detect short press to power on.
Known Issues
- System will not power on without battery present.
- System cannot recognize Thunderbolt 3 devices after resuming from S4.
@ImaxinarDM the guide is a wiki so anyone can edit it, that said I’ve already added a note about the function lock.
Anybody know how to send feedback about this community system? This thread has numerous references to “EC” but I have no idea what that refers to. I tried to search using Ctrl-F to use the browser’s search facility but they have trapped that key combination and launch their own search which won’t let me search for “ec” – they say it is too short. They assume too much.
This thread has numerous references to “EC” but I have no idea what that refers to.
Maybe EC = Embedded controller - Wikipedia ?
Anybody know how to send feedback about this community system?
Do you want to send a feedback to the system (Discourse)? That is maybe https://meta.discourse.org/ at https://www.discourse.org/ . You can post with category: feature or bug.
This thread has numerous references to “EC”
It does in fact reference embedded controller
This thread is a wiki. Anyone who has the permission to edit the wiki can edit the first comment. Context This thread started with a topic to ask to open EC firmware and also to use open BIOS firmware, coreboot (Wikipedia). In January 2022, Framework open-sourced their EC firmware (blog). Then this thread became the main thread of the coreboot. Challenges and actions Here is a summary mainly from a coreboot issue ticket to port coreboot to Framework Laptop below. Notes to collaborate with…
See the above thread for some more context on this discussion
Beta BIOS v3.06 is now available:
Its time for another BIOS update. This BIOS has a number of fixes and a few new features and is required to use the new mainboard with the Tempo audio codec. The Driver bundle keeps the same set of driver versions as the previous driver bundle, but fixes some issues around detection of the audio codec, and allows migrating an existing OS from the Realtek codec to Tempo codec mainboards, This driver bundle is needed for Tempo codec mainboards. We are still working on building a process to suppo…