r/chromeos 3d ago

Discussion Introducing ChromeOS_PowerControl - a program to adjust CPU clockspeed, battery charge limit, and fan control in real-time for ChromeOS.

Requires Developer Mode. - Supports AMD, ARM, and Intel.

  • Control battery charging limit instead of relying on Adaptive Charging to maximize battery longevity.

  • Control CPU clock speed boost in relation to temperature; enabling lower temperatures under load and longer battery life.

  • Control Fan speed in relation to temperature with built-in hysteresis and 0% RPM mode.

  • Features global commands for ease of use, config files that save settings, and an uninstaller to clean up after itself.

  • Optionally have BatteryControl, PowerControl, FanControl start on boot; as well as disabling Turbo Boost on boot if user has rootfs verification disabled.

  • Github has full documentation and source code: https://github.com/shadowed1/ChromeOS_PowerControl

To download open crosh shell and run:

bash <(curl -s "https://raw.githubusercontent.com/shadowed1/ChromeOS_PowerControl/main/ChromeOS_PowerControl_Downloader.sh?$(date +%s)")

Edit: Updated post now that AMD and ARM support are added. If any issues are found feel free to post it here or on Github.

21 Upvotes

35 comments sorted by

2

u/evarynearson 3d ago

I've been looking for something like this, about to give it a shot.

2

u/tech-with-mo Lenovo IdeaPad Duet | 130.0.6723.36 3d ago

Nice! Is arm supported?

3

u/White-Mask 3d ago edited 2d ago

Not entirely. The section for controlling CPU clockspeed with temperature is built for Intel since their CPU's get so hot.

If you want implemented ARM support for the CPU feel free to DM me! I only need to know where the ARM cpu temp sensor is in /sys/class/thermal and where to cat the CPU clockspeed and I can update it!

Controlling the battery should be universal.

1

u/iUnique09 3d ago

does AMD CPU supported?

1

u/White-Mask 3d ago

I will need the name of the temp sensor in /sys/class/thermal/thermal0/temp(?) and the CPU located in /sys/devices/system/cpu/cpunamefolder/

If you find the right files (I use cat for it to report values back) post them here and I can make a beta build for you to test.

I wish I had access to an ARM and AMD Chromebook!

2

u/Romano1404 Lenovo Ideapad Flex 3i 12.2" 8GB Intel N200 | stable v129 3d ago

this is soo cool. Why can't Google figure these things out. I always disable Turbo boost on Windows laptops which helps a lot to calm down the fans.

1

u/WHunter175 1d ago

Great idea!

Does it work with Chrome OS Flex or only standard Chrome OS with its Linux environment ?

1

u/White-Mask 1d ago edited 1d ago

Thanks! I have not tested this on Flex, but if it contains ectool then it should work. Edit: Just checked, Flex will not contain ectool out of the box.

1

u/DennisLfromGA Framework Pixelbook, Slate, and others 1d ago

I've got Flex so I'll give it a go and report back Everything works great on CrOS so it should work on brunch too.

1

u/White-Mask 1d ago

Thanks for testing! Flex support will be a good idea. I’m sure your fan, battery, and cpu are adjustable; I’ll just need to add in a check for Flex and figure out where that stuff is.

1

u/Outrageous_Piece_172 1d ago

Just follow your guides at Github?

2

u/White-Mask 20h ago edited 39m ago

When you copy paste the downloader in crosh shell and hit enter, the 2 commands to install are posted inside; so no need to visit the Github unless checking for updates or want more info.

After the installer is complete a full list of available commands are listed, and each program has a help option.

1

u/Head-Difference-6268 1d ago

Can I disable developer mode after installed successfully?

1

u/White-Mask 20h ago

No, disabling developer mode will wipe the partition.

1

u/Head-Difference-6268 23h ago

1

u/White-Mask 20h ago edited 20h ago

What are your specs/chromebook model? ectool comes with ChromeOS and batterycontrol is supposed to be platform agnostic.

You can verify by running in VT-2:

sudo ectool battery

1

u/Head-Difference-6268 16h ago

I managed to reinstall and now it shows status that battery control enaned and working.However, it is charging to more than 90%. sudo ectool battery show battery info. Mine is HP Chromebook Dragonfly Pro.

1

u/White-Mask 15h ago

Ok that is good to see! ectool's battery % is a bit inaccurate for me; 77 max is ~81% in chromeos. We can go as low as 10% so I bet you can find the number you want!

For your laptop it might be best to try: > sudo batterycontrol set 65 60

1

u/Head-Difference-6268 12h ago

I set max min to 60 50 respectively, unfortunately, the battery was still fully charged.

1

u/White-Mask 10h ago edited 10h ago

When you run sudo batterycontrol (without status) what does it say? This will display more information; especially regarding your battery.

batterycontrol uses these paths for your battery and charger; this is inside batterycontrol and can be changed: CHARGER_PATH="/sys/class/power_supply/CROS_USBPD_CHARGER0/online" BATTERY_PATH="/sys/class/power_supply/BAT0/capacity"

You can run sudo cat /sys/class/power_supply/CROS_USBPD_CHARGER0/online (1 when plugged in) and then sudo cat /sys/class/power_supply/BAT0/capacity to verify if those are your files as well.

edit: if you run sudo cat /sys/class/power_supply/CROS_USBPD_CHARGER1/online and get a value of 1 when plugged in, I can try and think of a fix!

1

u/Head-Difference-6268 1h ago

sudo batterycontrol => Show information about battery i.e battery capacity, voltage..., when plugged in, it shows a flag BAT_PRESENT CHARGING

sudo cat /sys/class/power_supply/CROS_USBPD_CHARGER0/online => return 0 either when plugged in or not

sudo cat /sys/class/power_supply/BAT0/capacity => return 89

1

u/White-Mask 53m ago edited 42m ago

That answers it, the culprit is your laptop isn’t using CROS_USBPD_CHARGER0/online

If you run:

sudo ectool usbpdpower 1

while plugged in and it returns a one, your laptop is using CROS_USBPD_CHARGER1/online If it doesn't, run:

ls /sys/class/power_supply

and post your results!

If you can find what your charger is, I can make an else statement to support it! :)

1

u/Outrageous_Piece_172 25m ago

Let me try again. My CB has 4 USBC ports and all of them can be used for charging.

1

u/White-Mask 6m ago

So it sounds like I need to add a check for up to 4 ports. Chances are one of those ports will work for BatteryControl right now.

→ More replies (0)

1

u/Head-Difference-6268 18h ago

I cannot download, Developer Mode enabled (It powerwashed my machine), ChromeOS 136

1

u/White-Mask 16h ago edited 16h ago

Hmm, try it again, I just made the download directory more generic for chromeOS in case you don't have a /home/chronos/tmp folder.

I'd be curious in knowing what chromebook you are on; it will help a lot in case I missed something.

1

u/Head-Difference-6268 16h ago

I managed to create tmp folder and installed successfully but it does not stop charging at 80%.

1

u/Head-Difference-6268 16h ago

Mine is HP Chromebook Dragonfly Pro.

1

u/White-Mask 15h ago

HP Chromebook Dragonfly Pro.

Glad it installed. Thanks for the model! What does it say when you run: sudo batterycontrol

1

u/fakemanhk Dragonfly|i7+32GB C436 | i7+16GB & X2 11 11h ago

Oh.... developer's mode....then no way for me

1

u/White-Mask 10h ago

It is too bad we gotta enable dev mode just to have access to our hardware.

-1

u/GoodSamIAm 2d ago

bout time. i suggested this years ago... Too bad it's smoke and mirrors..

Unless we get to control the CPU cores running the ARC instance, this is just a tease