UNSOLVED

BeeOnRope

updated

2 years ago

B

BeeOnRope

1 Rookie

14 Posts

4

57083

July 4th, 2017 15:00

Setting the battery charge level within Linux

In Windows you can use the "Dell Power Manager" app or whatever it's called to set specific charging behavior. For example, I set it to only charge up to 80%, since I'm usually using the thing plugged in and I'll get a lot more life, long term, out of my battery if it's not sitting at 100% all the time.


There is a similar functionality in the BIOS.

Now these settings "work" when I'm booted into Ubuntu 16.04, in that the limits are respected but I would also like to change them from within Linux. The main use case is that *sometimes* I know I'm about the take the machine on the road so I'd like to charge up to 100%. Having to shut down everything and boot into the BIOS to do this is a pretty big pain so in practice I just live with my 80%.

  • n03i

    5 Posts

    42109

    0

    Posted October 17th, 2018 06:00

    Hello,

    yes, you are right. Probably this option is not possible with my model of XPS. It is not possible to set it in the BIOS.

    I have seen in my research, that there was even a bug fix about the battery live. But it was only for newer models and my CPU was not affected.

    Thanks for your advice.

    Okay, so it seems, that there is no easy solution to save life of the battery of my Dell XPS and Ubuntu operating system.

  • ShedG

    33 Posts

    6840

    0

    Posted October 17th, 2018 11:00

    The hard way still remains. I have a 3 1/2 year old Lenovo Y50 which controls an external switch to maintain the battery between 30% and 60%. I checked earlier today and the battery is at 65% capacity which seems decent for a laptop that has been plugged in for most of the 3 1/2 years. I can provide additional details if that would be helpful.

  • mattadori

    1 Message

    6370

    0

    Posted February 17th, 2019 03:00

    Hello everyone,
    thanks for all the information you shared.

    The command I use returns the following output on my XPS 13 9333 with Ubuntu 18.04 and BIOS version A03 release date 01/28/2014:

     

    sudo /opt/dell/dcc/cctk --primarybatterycfg=custom:50-85
    primarybatterycfg=custom:50-55

    Checking the BIOS in fact returns that the custom levels are locked to be 50 to 55 and can't be changed.

    Do you think upgrading to BIOS A08 (the last available for the XPS 13 9333) could unlock the custom levels ?

    Cheers

     

  • ratkiley

    1 Message

    4372

    0

    Posted May 15th, 2020 19:00

    I spent a few hours today, exploring all the options including Dell Command Configure and updating my BIOS, changing the BIOS settings, etc. I have definitively concluded that my Dell Laptop (E6410) does not and will never have this BIOS setting, therefore the Dell Command Configure utility cannot set this setting (because it is a BIOS setting command line utility).  Even though the documentation for the Dell Command Configure lists all possible settings, not all settings are available for every Laptop.

    Dell Command Configure is available in the Ubuntu repositories (and therefore I installed it with synaptic package manager in Linux Mint).  Running it from path:

    /opt/dell/dcc

    Like so, lists all available settings for your BIOS on your laptop:

    sudo ./cctk

    It is a generic Dell BIOS command line utility that only lets you set the settings that are actually in your BIOS on your laptop.  If you upgrade your BIOS and new settings are added in that BIOS version, the same settings will be available to set through Linux / windows from Dell Command Configure. 

    I now believe that the charge controller is built into your laptop hardware (motherboard) and if the BIOS setting is not available to configure the max charge and min charge values, then there is no way for (Linux OS / Software / BIOS) to control these settings. The max charge / min charge settings must be a feature of newer chargers / motherboards and their corresponding BIOS ROMs.  The only way to get the ability to control the charge is to upgrade the motherboard with one that has this feature built into it (and the BIOS).

    The easiest way to change this setting if you have it in your BIOS is to go into the BIOS and change it there. If the Command Configure can't change the values then, maybe your BIOS is password protected?  The read-only values are listed with an asterisk (*) when you run it with no parameters.

  • marcmerlin

    1 Message

    0

    0

    Posted January 3rd, 2024 13:51

    Is there any way to tell the battery not to charge?

    When powering from an external USB battery pack, I want to power the laptop only, not to charge its batteries. That's easy to do on thinkpad, but with dell, all I have is
    /opt/dell/dcc/cctk --PrimaryBattChargeCfg=Custom:50-55
    but this only works if the battery is still over 55%.
    Is there anything better, or that's the best there is?

  • Manjaro22211

    1 Message

    0

    1

    Posted January 25th, 2024 08:51

    After installing dell-command-configure on Latitude E5540 running  Manjaro it seems to accept :

    sudo cctk --PrimaryBattChargeCfg=Custom,50,80

    But the system won't "respect" these changes sadly

  • KPT1

    1 Rookie

    2 Posts

    0

    0

    Posted February 29th, 2024 11:11

    @Manjaro22211​ That actually works on the latest Manjaro here

  • KPT1

    1 Rookie

    2 Posts

    0

    0

    Posted February 29th, 2024 11:12

    Installing dell-command-configure and running :

    sudo cctk --PrimaryBattChargeCfg=Custom,50,80

    Does work now here.

  • Mister Curious

    1 Rookie

    1 Message

    0

    0

    Posted April 28th, 2024 13:27

    Hello there,

    i see so many people struggling with this issue, and decided to post my feedback.

    I actually run debian on dell Latitude 7290, and i try to limit the charge of my battery (say from 50 to 85%)

    > Lauching cctk binary seems to work, but the tool tells me i cannot set custom charging  mode :

    ~# cctk --help PrimaryBattChargeCfg
    
    
    PrimaryBattChargeCfg:  Configures the primary battery charging. ....
    Arguments: Standard+ | Express+ | PrimAcUse | Adaptive | Custom Note : + Indicates the arguments supported in the current machine.

    ~# cctk --PrimaryBattChargeCfg=Custom:50-85

    Error in Setting the Value.


    > So i ended up using package "smbios-utils"

    ~# smbios-battery-ctl --set-charging-mode=custom
    ~# smbios-battery-ctl --set-custom-charge-interval=50 85

    --------

    System: Debian 12 stable

    Machine : Dell Latitude 7290 2nd hand (i doubt the battery is a genuine DELL one, maybe there is some battery-firmware-sorcery in place)

  • AK17

    1 Rookie

    1 Message

    2 Points

    0

    0

    Posted January 19th, 2025 13:37

    I have a Dell Latitude 7480 and the BIOS trick worked for me.

    I'm using a freshly installed Zorin OS 17.2 Core version.

    (edited)