-
-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ThinkBook] FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/power_supply/BAT0/charge_start_threshold' #713
Comments
Auto CPU freq identifies laptops based on the currently running Kernel modules could you share the output of lsmod and your laptop model? |
Model: lsmod:
|
So it looks like you have the ideapad_laptop kernel module. That's why it thinks you have a ideapad I looked online but I haven't been able to find if that module is compatible with your laptop or a compatable module. I would suggest you try the same. And just wondering does the path /sys/class/power_supply/ exist? And whats in it? |
this is the ls(d) for that dir:
|
and the BAT0 directory:
|
The problem is that BAT0 is a symbolic link, I've tried a solution, you can wait for it to be validated or install manually with |
PR #716 is merged which should fix the issue, if problem persists, please feel free to re-open it |
@Angel-Karasu
I assume its related? |
got the same issue: ❯ sudo auto-cpufreq --config ~/.config/auto-cpufreq/auto-cpufreq.conf --debug Using settings defined in /home/offeex/.config/auto-cpufreq/auto-cpufreq.conf file
could not get value from conservation mode
-------------------------------- Battery Info ---------------------------------
battery count = 1
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/auto_cpufreq/battery_scripts/ideapad_laptop.py", line 92, in ideapad_laptop_print_thresholds
with open(f'/sys/class/power_supply/BAT{b}/charge_start_threshold', 'r') as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/power_supply/BAT0/charge_start_threshold'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/sbin/auto-cpufreq", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/auto_cpufreq/bin/auto_cpufreq.py", line 169, in main
battery_get_thresholds()
File "/usr/lib/python3.12/site-packages/auto_cpufreq/battery_scripts/battery.py", line 42, in battery_get_thresholds
ideapad_laptop_print_thresholds()
File "/usr/lib/python3.12/site-packages/auto_cpufreq/battery_scripts/ideapad_laptop.py", line 101, in ideapad_laptop_print_thresholds
print(f"ERROR: failed to read battery thresholds: {e}")
^
NameError: name 'e' is not defined |
Just encountered this issue on a Lenovo Ideapad. Can this issue be reopened, please? |
@PurpleWazard might know more about this ... |
Had a look at the code and I have some questions:
also small thing :) start_threshold is written twice instead of start followed by stop:
|
This problem has been patches with #716 |
Problem patches in #742 |
Thank you @Angel-Karasu! #742 merged with |
Not completely solved, because those files are not actually allowed to be created in that folder (sorry for my incorrect suggestion), but this is not really an issue. I might just fix it myself later.
|
I'm still encountering the same issue. I updated using yay and restarted the service, but it didn't resolve the issue. As @kralle333 mentioned, manually creating the files is also not possible due to permission restrictions. |
Unfortunately you need to have permissions to to create |
I'm not talking about the config file at |
@PurpleWazard should this be re-opened? |
i think thinkbook is more or less rebranded ideapad but not exactly ideapad. what you can do with thinkbook is most present in /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/, such as fn lock, conservation mode and always on usb, which can be toggled on Windows using Lenovo Vantage as well. |
Can this be reopened? I'm getting this issue on a lenovo legion. |
Issue re-opened, but as @PurpleWazard announced on auto-cpufreq Discord community. As original implementer of this functionality, since he doesn't have time to look into this problem, if you or anyone else wants to look into this problem and contribute to the project (create a PR with fix), you will be credited for your work as part of future releases. |
Having the same issue - lenovo legion |
Edit: i install auto-cpu-freq using AUR (auto-cpufreq-2.3.0.tar.gz) Processor: 11th Gen Intel(R) Core(TM) i7-11800H (16) @ 4.60 GHz Upower info # upower -i /org/freedesktop/UPower/devices/battery_BAT0
native-path: BAT0
vendor: SMP
model: L20M4PC1
serial: 1660
power supply: yes
updated: Sun 08 Sep 2024 02:30:02 PM WIB (7 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: pending-charge
warning-level: none
energy: 61.67 Wh
energy-empty: 0 Wh
energy-full: 72.55 Wh
energy-full-design: 80 Wh
energy-rate: 0 W
voltage: 16.524 V
charge-cycles: 467
percentage: 85%
capacity: 90.6875%
technology: lithium-polymer
icon-name: 'battery-full-charging-symbolic' auto-cpufreq --live # auto-cpufreq --live
Note: You can quit live mode by pressing "ctrl+c"
could not get value from conservation mode
-------------------------------- Battery Info ---------------------------------
battery count = 1
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/auto_cpufreq/battery_scripts/ideapad_laptop.py", line 92, in ideapad_laptop_print_thresholds
with open(f'/sys/class/power_supply/BAT{b}/charge_start_threshold', 'r') as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/power_supply/BAT0/charge_start_threshold'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/auto-cpufreq", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/auto_cpufreq/bin/auto_cpufreq.py", line 123, in main
battery_get_thresholds()
File "/usr/lib/python3.12/site-packages/auto_cpufreq/battery_scripts/battery.py", line 42, in battery_get_thresholds
ideapad_laptop_print_thresholds()
File "/usr/lib/python3.12/site-packages/auto_cpufreq/battery_scripts/ideapad_laptop.py", line 101, in ideapad_laptop_print_thresholds
print(f"ERROR: failed to read battery thresholds: {e}")
^
NameError: name 'e' is not defined |
from #741 (comment) I install auto-cpufreq using the latest v2.4.0 release from source code (git clone) method and can confirm it works! here are my zsh output:
➜ auto-cpufreq git:(master) sudo auto-cpufreq --live
Note: You can quit live mode by pressing "ctrl+c"
conservation mode is on
-------------------------------------------------------------------------------
Linux distro: Arch Linux
Linux kernel: 6.10.8-arch1-1
Processor: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Cores: 16
Architecture: x86_64
Driver: intel_pstate
------------------------------ Current CPU stats ------------------------------
CPU max frequency: 2300 MHz
CPU min frequency: 800 MHz
Core Usage Temperature Frequency
CPU0 0.0% 38 °C 800 MHz
CPU1 1.0% 39 °C 2152 MHz
CPU2 2.0% 37 °C 800 MHz
CPU3 3.9% 32 °C 800 MHz
CPU4 1.0% 36 °C 800 MHz
CPU5 1.0% 38 °C 1818 MHz
CPU6 1.0% 37 °C 800 MHz
CPU7 0.0% 38 °C 1696 MHz
CPU8 0.0% 38 °C 1685 MHz
CPU9 0.0% 39 °C 830 MHz
CPU10 0.0% 37 °C 800 MHz
CPU11 1.0% 32 °C 800 MHz
CPU12 0.0% 36 °C 800 MHz
CPU13 1.0% 38 °C 2261 MHz
CPU14 1.0% 37 °C 800 MHz
CPU15 0.0% 38 °C 800 MHz
CPU fan speed: 1761 RPM
---------------------------- CPU frequency scaling ----------------------------
Battery is: charging
Setting to use: "performance" governor
Setting to use: "performance" EPP
Total CPU usage: 1.0 %
Total system load: 0.59
Average temp. of all cores: 36.88 °C
Load optimal (load average: 0.59, 0.56, 0.56)
Optimal total CPU usage: 1.0%, high average core temp: 36.875°C
Setting turbo boost: off
-------------------------------------------------------------------------------
"auto-cpufreq" is about to refresh ...
Executed on: Sun Sep 8 03:14:08 PM WIB 2024
-------------------------------------------------------------------------------
Linux distro: Arch Linux
Linux kernel: 6.10.8-arch1-1
Processor: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Cores: 16
Architecture: x86_64
Driver: intel_pstate
------------------------------ Current CPU stats ------------------------------
CPU max frequency: 2300 MHz
CPU min frequency: 800 MHz
Core Usage Temperature Frequency
CPU0 2.0% 40 °C 1094 MHz
CPU1 0.0% 40 °C 880 MHz
CPU2 0.0% 38 °C 800 MHz
CPU3 0.0% 32 °C 800 MHz
CPU4 2.0% 36 °C 1049 MHz
CPU5 1.0% 37 °C 974 MHz
CPU6 0.0% 37 °C 800 MHz
CPU7 0.0% 37 °C 800 MHz
CPU8 1.0% 40 °C 800 MHz
CPU9 7.8% 40 °C 800 MHz
CPU10 1.0% 38 °C 1100 MHz
CPU11 1.0% 32 °C 862 MHz
CPU12 1.0% 36 °C 918 MHz
CPU13 3.0% 37 °C 1087 MHz
CPU14 2.0% 37 °C 861 MHz
CPU15 1.0% 37 °C 941 MHz
CPU fan speed: 1761 RPM
---------------------------- CPU frequency scaling ----------------------------
Battery is: discharging
Setting to use: "powersave" governor
Setting to use: "balance_power" EPP
Total CPU usage: 1.9 %
Total system load: 0.65
Average temp. of all cores: 37.12 °C
Load optimal (load average: 0.65, 0.58, 0.56)
Optimal total CPU usage: 1.9%, high average core temp: 37.125°C
Setting turbo boost: off
-------------------------------------------------------------------------------
"auto-cpufreq" is about to refresh .
➜ auto-cpufreq git:(master) sudo auto-cpufreq --install
--------------------- Deploying auto-cpufreq as a daemon ----------------------
* Turn off bluetooth on boot (can be turned on any time later on!)
* Deploy auto-cpufreq install script
* Deploy auto-cpufreq remove script
There was a problem, couldn't determine GNOME Power Profiles Daemon
─────────────────────────────────────────────────── Running auto-cpufreq daemon install script ───────────────────────────────────────────────────
Deploying auto-cpufreq systemd unit file
* Reloading systemd manager configuration
* Starting auto-cpufreq daemon (systemd) service
* Enabling auto-cpufreq daemon (systemd) at boot
Created symlink '/etc/systemd/system/multi-user.target.wants/auto-cpufreq.service' → '/etc/systemd/system/auto-cpufreq.service'.
----------------- auto-cpufreq daemon installed and running -----------------
To view live stats, run:
auto-cpufreq --stats
auto-cpufreq makes all decisions automatically, if you would like to
configure certain setting to your own liking, please refer to:
https://github.com/AdnanHodzic/auto-cpufreq#configuring-auto-cpufreq
To disable and remove auto-cpufreq daemon, run:
sudo auto-cpufreq --remove
-------------------------------------------------------------------------------
➜ auto-cpufreq git:(master) sudo systemctl status auto-cpufreq
● auto-cpufreq.service - auto-cpufreq - Automatic CPU speed & power optimizer for Linux
Loaded: loaded (/etc/systemd/system/auto-cpufreq.service; enabled; preset: disabled)
Active: active (running) since Sun 2024-09-08 15:15:36 WIB; 7min ago
Invocation: 5c8e17390c0b4035a85bd59b3e40a1cd
Main PID: 904602 (python)
Tasks: 2 (limit: 18900)
Memory: 19.7M (peak: 23.1M)
CPU: 14.838s
CGroup: /system.slice/auto-cpufreq.service
└─904602 /opt/auto-cpufreq/venv/bin/python /opt/auto-cpufreq/venv/bin/auto-cpufreq --daemon
Sep 08 15:15:36 archlegion systemd[1]: Started auto-cpufreq - Automatic CPU speed & power optimizer for Linux.
➜ auto-cpufreq git:(master) sudo auto-cpufreq --stats
Note: You can quit stats mode by pressing "ctrl+c"
conservation mode is on
Linux distro: Arch Linux
Linux kernel: 6.10.8-arch1-1
Processor: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Cores: 16
Architecture: x86_64
Driver: intel_pstate
------------------------------ Current CPU stats ------------------------------
CPU max frequency: 2300 MHz
CPU min frequency: 800 MHz
Core Usage Temperature Frequency
CPU0 2.0% 39 °C 2184 MHz
CPU1 2.0% 39 °C 2215 MHz
CPU2 2.1% 37 °C 801 MHz
CPU3 4.0% 32 °C 2278 MHz
CPU4 2.0% 37 °C 2064 MHz
CPU5 0.0% 38 °C 1089 MHz
CPU6 2.0% 39 °C 1127 MHz
CPU7 1.0% 38 °C 800 MHz
CPU8 3.0% 39 °C 1207 MHz
CPU9 3.0% 39 °C 2274 MHz
CPU10 1.0% 37 °C 1695 MHz
CPU11 1.0% 32 °C 1309 MHz
CPU12 0.0% 37 °C 1291 MHz
CPU13 2.0% 38 °C 1013 MHz
CPU14 1.0% 39 °C 1191 MHz
CPU15 2.9% 38 °C 800 MHz
CPU fan speed: 1767 RPM
---------------------------- CPU frequency scaling ----------------------------
Battery is: discharging
Setting to use: "powersave" governor
Setting to use: "balance_power" EPP
Total CPU usage: 5.2 %
Total system load: 0.71
Average temp. of all cores: 37.38 °C
Load optimal (load average: 0.71, 0.76, 0.65)
Optimal total CPU usage: 5.2%, high average core temp: 37.375°C
Setting turbo boost: off
-------------------------------------------------------------------------------
"auto-cpufreq" is about to refresh ...
Executed on: Sun Sep 8 03:23:08 PM WIB 2024 |
Can anyone else besides @glenkusuma confirm that v2.4.0 released fixed this issue for them? |
@AdnanHodzic I'm running
|
Yes, it's working properly on my ThinkBook laptop |
For me this file does not exists
my laptop's battery charging is limited at 60%. Mine is a asus ROG series laptop. |
Legion Y9000P IAH7H
|
Fill out information requested in this template, without doing so issue will be ignored & closed!
Have you tried?
Tried all relevant suggestions
Error output:
System information:
Add/paste output of:
(same error)
Also please be descriptive about the issue you're reporting, i.e: what you tried & what's the expected behaviour.
Looks like my device is incorrectly identified as an ideapad laptop. I am thinking maybe there just isnt support for my device, I believe it is a pretty new variant.
ThinkBook 14 Gen 7
Intel Core Ultra i7
Upower info
The text was updated successfully, but these errors were encountered: