htop icon indicating copy to clipboard operation
htop copied to clipboard

Wrong battery status on Termux

Open Glucy-2 opened this issue 3 years ago • 4 comments

Battery reads 0.1% when charging and 0.0% when not charging. Charging: image image Not charging: image image Termux:API APP is installed and package termux-api is installed (pkg install termux-api) Phone model: OPPO Reno3, Android 10, rooted htop ver: 3.0.5 image

Glucy-2 avatar Jan 15 '22 08:01 Glucy-2

Can you have a look at the status information provided in the two places where htop looks for them? https://github.com/htop-dev/htop/blob/main/linux/Platform.c#L629-L868 The first one is in /proc/acpi/battery//proc/acpi/ac_adapter and the second one is in /sys/class/power_supply. A copy of those values for the two situations might be good for further diagnosing the issue.

BenBE avatar Jan 15 '22 14:01 BenBE

/sys/devices/platform/charger/power_supply/battery/capacity or /sys/class/power_supply/battery/capacity (is a link) image

Glucy-2 avatar Jan 15 '22 15:01 Glucy-2

Are these the only files in these directories?

BenBE avatar Jan 15 '22 17:01 BenBE

image All files in the directories (the second directory is linked to the first)

Glucy-2 avatar Jan 16 '22 04:01 Glucy-2