9

I am trying to use my old notebook to monitor some things, and I really don't need it to run past its lowest frequency, since it will only gather data every few minutes or so and relay it. But the problem is, I don't want it to sleep either.

I am using pm-powersave true but after installing it, suddenly the PC sleeps very often and the ping only replied a few seconds after I press the button at the notebook. I've tried with cable and wifi.

The OS is Ubuntu Server 23.04, running on an old Compaq Presario with Core Duo processor.

Is there a way to prevent this?

What is the correct way to keep it at minimum frequency but stays awake?

Z0OM
  • 3,149
Magician
  • 193
  • 4

1 Answers1

8

If you don't want the laptop went to sleep or if you closed the lid, you can try the following:

  1. Edit and uncomment this lines in /etc/systemd/logind.conf

    HandleLidSwitch=ignore
    HandleLidSwitchExternalPower=ignore
    HandleLidSwitchDocked=ignore
    
  2. Install and run cpufrequtils

    apt install cpufrequtils

    Set the CPU governor to powersave

    cpufreq-set -r -g powersave

  3. Disable suspend with systemctl

  4. Use cpupower from the linux-tools-generic

    apt install linux-tools-generic
    cpupower frequency-set -g powersave
    cpupower frequency-set -d <min_frequency>
    

Do a reboot after you change it.

More Sources:

Bergi
  • 115
Z0OM
  • 3,149
  • Are these 4 separate alternatives for solving the problem or you need to do all of them? Could you please clarify? Thanks. – arielf Jul 24 '23 at 21:03
  • 1
    @arielf they are to perform different task I guess. I had added settings to logind.conf before asking, and that let me close the lid and keep the notebook running, tucked neatly at the gap between the machines. The second one, cpufrequtils is to set the power management to stay low power. The third one is keeping my notebook from being suspended, that was modified when I installed pm-powersave I think. And the fourth one is to keep it low, kind like my pm-powersave true, but without extra bells and whistles. So I removed pm-powersave. Anyway, now it is running cool, and stays online. – Magician Jul 25 '23 at 04:43
  • 1
    It sounds like these are independent ways to achieve the goal which are not exactly equivalent or identical. In addition it sounds like you don't necessarily need all the 4 suggested actions to achieve the OP goal. To make this clearer in the answer, I would change "the following" into "one or more of the following independent alternatives". Cheers. – arielf Jul 26 '23 at 05:14