I would like to be sure that power management is set correctly in order to do not have problem with battery longevity.
I read this https://support.system76.com/articles/battery and setup threshold as it said but when I look at power statistics I see no data in charge or discharge.
But at each reboot threshold value are reset to his original values 0 and 100.
This is the bash function that I use for setting this values
adjust_charging_thresholds(){
# Adjust charging thresholds for best longevity of lithium batteries.
#
# See:
# - https://support.system76.com/articles/battery
#
charge_control_start_threshold=40
charge_control_end_threshold=80
cstart=$charge_control_start_threshold
cend=$charge_control_end_threshold
fstart=/sys/class/power_supply/BAT0/charge_control_start_threshold
fend=/sys/class/power_supply/BAT0/charge_control_end_threshold
cstart0=$(cat $fstart)
cend0=$(cat $fend)
if [ $cstart != $cstart0 ];then
echo "Modify start threshold from $cstart0 to $cstart"
export fstart && export cstart # in order to pass this to root
sudo -E su -p -c 'echo $cstart > $fstart'
fi
if [ $cend != $cend0 ];then
echo "Modify end threshold from $cend0 to $cend"
export fend && export cend # in order to pass this to root
sudo -E su -p -c 'echo $cend > $fend'
fi
}
Steps to reproduce (if you know):
I run the function/or edit the files manually and reboot.
Distribution (run
cat /etc/os-release
):NAME="Pop!_OS" VERSION="20.04 LTS" ID=pop ID_LIKE="ubuntu debian" PRETTY_NAME="Pop!_OS 20.04 LTS" VERSION_ID="20.04" HOME_URL="https://pop.system76.com" SUPPORT_URL="https://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal LOGO=distributor-logo-pop-os
Issue/Bug Description:
I would like to be sure that power management is set correctly in order to do not have problem with battery longevity. I read this https://support.system76.com/articles/battery and setup threshold as it said but when I look at power statistics I see no data in charge or discharge. But at each reboot threshold value are reset to his original values 0 and 100. This is the bash function that I use for setting this values
Steps to reproduce (if you know):
I run the function/or edit the files manually and reboot.