Fedora 40 kde battery percentage not updating/always in charge

Hello, i’m using an Asus TUF A15 FA506NC with a ryzen 5 7535HS and a rtx 3050 laptop. I’m having an issue where the laptop seems always in charge and the battery percentage doesn’t change. Only when rebooting sometimes the battery percentage changes but it’s not consistent. The laptop is new, and this is a fresh installation.
Also, when running the command:
“upower -i /org/freedesktop/UPower/devices/battery_BAT0”

The output is this one:
native-path: (null) power supply: no updated: gio 1 gen 1970, 01:00:00 (1727375594 seconds ago) has history: no has statistics: no unknown warning-level: unknown battery-level: unknown percentage: 0% (should be ignored) icon-name: '(null)'
How can i fix? Thank you so much.

What is the value of cat /sys/class/power_supply/BAT0?
It should be the percent of battery.

You can also look at the other files in /sys/class/power_supply to see more info on your battery.

What is the output of grep . /sys/class/power_supply/* ?

It could be that your laptop is not supported by the kernel.

thank you for your reply. I tried running your commands, bat0 is non existent, there is BAT1 e ACAD, i checked the information inside those folders and they’re all wrong. now the pc is charging and the file inside BAT0 “status” show discharcing. In case the laptop is not supported by the kernel, the only thing i can do is wait?

You would need to track down someone who maintained this part of the kernel. I don’t know who that would be. Then ask them to add support.

ok so i either have to stick to windows or i need to replace my laptop. Because i think it’s practically impossible to get the battery to work on this laptop. How should i track down a kernel dev lol

The battery, I thought, would be controlled by the UEFI BIOS.
Odd that it does not charge.

Also you could web search for your laptop name and linux to see what other people have reported.

Maybe someone else may know how to find a kernel dev that could help?

nono the battery actually charges, is just that the os is not updating the battery status.

Ok so the laptop is functional but becuase you have no feedback on battery level you might lose power without warning.

exactly. because i have to bring this laptop to the university i need the battery to be somewhat functional. if i’m studying or taking notes on the lessons i can’t risk my laptop to shutdown

I did some web searches to see if I could find info for your model.
Did not find anything useful. But did find there is a new command to try.

sudo dnf install acpi
sudo acpi -V

What does acpi -V report for you?

This is the report:

Battery 0: Discharging, 100%, 01:44:18 remaining
Battery 0: design capacity 4110 mAh, last full capacity 4334 mAh = 100%
Adapter 0: on-line
Thermal 0: ok, 50.0 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 107.0 degrees C
Thermal 0: trip point 1 switches to mode hot at temperature 110.0 degrees C
Thermal 0: trip point 2 switches to mode passive at temperature 110.0 degrees C
Thermal 0: trip point 3 switches to mode active at temperature 60.0 degrees C
Cooling 0: Processor 0 of 3
Cooling 1: Processor 0 of 3
Cooling 2: Processor 0 of 3
Cooling 3: Processor 0 of 3
Cooling 4: Processor 0 of 3
Cooling 5: Fan 0 of 1
Cooling 6: Processor 0 of 3
Cooling 7: Processor 0 of 3
Cooling 8: Processor 0 of 3
Cooling 9: Processor 0 of 3
Cooling 10: Processor 0 of 3
Cooling 11: Processor 0 of 3
Cooling 12: Processor 0 of 3

But the pc is connected to the AC :frowning: and it shows as discharging,

I think that acpi report is from the BIOS and is buggy.
I wonder if it is a BIOS firmware issue.

Are you running up to date uefi bios firmware for the laptop?

i bought the laptop yesterday so i haven’t tought about that. Now i’m gonna check if there are any bios updates available and apply them. Hoping for the best. thank you for you all your help

i updated the bios, no difference sadly

new info: just tried using tails live usb and the battery percentage was working perfectly fine, also it noticed when the ac cable was connected. So i don’t think it’s a kernel problem beacause tails is based on debian, and debian has a way older kernel then the fedora one

I did see here https://bugs.archlinux.org/task/75653 that it was working for a different asus model then stopped on newer kernels.

It says version 5.19 - what kernel is tails using?

tails is using 6.1.0

It may be that what matters is the kernel config options that where used to build the tails kernel vs. the fedora kernel.

Try raising a bugzilla against the kernel for fedora saying that the tail kernel works.

Have you tried a different OSI report? Maybe faking Windows OSI would cause the BIOS to do something differently with ACPI and battery reporting. Something like this (kernel boot option/parameter) does Windows 10:

acpi_osi='Windows 2017'

Some BIOS also do different thing explicitly for Linux (my Dell Latitude 5591 does), but Linux disables reporting itself to OSI by-default:

acpi_osi=Linux

dmesg shows the OSI reporting with something like this (with Linux OSI default-disabled):

[    0.132751] raid6: using avx2x2 recovery algorithm
[    0.132756] ACPI: Added _OSI(Module Device)
[    0.132757] ACPI: Added _OSI(Processor Device)
[    0.132758] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.132759] ACPI: Added _OSI(Processor Aggregator Device)
[    0.179148] ACPI: 10 ACPI AML tables successfully acquired and loaded
[    0.184802] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    0.190906] ACPI: Dynamic OEM Table Load:

This reports what your BIOS supports for Windows OSIs:

sudo strings '/sys/firmware/acpi/tables/DSDT' | grep -i 'windows ' | sort

And for my laptop I have to have both of these for Windows OSI (! cancels out something?):

acpi_osi='!' acpi_osi='Windows 2017'
2 Likes