imagebuilder icon indicating copy to clipboard operation
imagebuilder copied to clipboard

misc: Battery always at 100 percent

Open cdd100 opened this issue 3 years ago • 18 comments

On my lenovo chromebook c330 the battery is always at 100 percent. Not a huge issue but the only way I can judge the battery is by looking at the light next to the charging port, which is not precise. What would be causing this?

cdd100 avatar Nov 23 '22 23:11 cdd100

battery percentage should just work - at least it does for my test oak systems (just my old response from the other issue for completeness)

hexdump0815 avatar Nov 24 '22 19:11 hexdump0815

Huh... I wonder what is causing it? In gnome, it sits at estimating and xfce says it has 10,000 hours remaining. Must have to do with the actual battery.

cdd100 avatar Nov 24 '22 19:11 cdd100

i have no real idea actually - maybe looking into /sys/class/power_supply and the kernel log via dmesg gives some hints ...

hexdump0815 avatar Nov 26 '22 10:11 hexdump0815

16694721605774301877861987997271

This error about sbs-battery 6-00b shows multiple times. Seems like it is using a fallback.

cdd100 avatar Nov 26 '22 14:11 cdd100

This error too: 16694724390544848168463917142566

cdd100 avatar Nov 26 '22 14:11 cdd100

some of such errors seem to be normal - what does find /sys/class/power_supply/sbs-*/ -mindepth 1 -maxdepth 1 -type f -exec cat {} \; result in? maybe some errors in it?

hexdump0815 avatar Nov 26 '22 17:11 hexdump0815

All I can get is "find: missing argument to `-exec'"

cdd100 avatar Nov 27 '22 00:11 cdd100

It can at least tell when being plugged in.

cdd100 avatar Nov 27 '22 00:11 cdd100

sorry, i should have quoted it properly and as a result the backslash got lost - i fixed it now above

hexdump0815 avatar Nov 27 '22 09:11 hexdump0815

Here is the output: 3932100 65535000 ffff cat: /sys/class/power_supply/sbs-6-000b/technology: Invalid argument -1000 65535000 1 65535000 cat: /sys/class/power_supply/sbs-6-000b/manufacturer: Invalid argument 65535000 655350000 Battery 65535000 2107 100 31 Calibration required 3932100 65535 65535000 Discharging cat: /sys/class/power_supply/sbs-6-000b/model_name: Invalid argument -1000 65535000 62804 65535000 0 Full 655350000 3932100 15 655350000

cdd100 avatar Nov 27 '22 15:11 cdd100

i do not have my oak systems at hand right now - will check on them during the next days ... just an idea: maybe let the battery run down completely once and afterwards charge it completely to recalibrate the battery logic - maybe that makes things better - inspired by the "Calibration required" ...

hexdump0815 avatar Nov 27 '22 18:11 hexdump0815

Running into the exact same issue on both postmarketos latest (kernel 6.something) and this debian project. Running an older kernel 5.10.50 since the latest produced a boot disk oops. Boots fine but the battery readings are garbage and exactly as described in this issue. Also having the kernel error messages as per above screenshot.

I'd like to debug this, just not a clue where to start 😂

harmw avatar Jul 26 '23 19:07 harmw

sadly i have no real idea what to do about this - for me it works fine on oak ... as far as i understand it there is a small controller in the battery which is taking care of everything around charging and status and which is asked about the battery percentage for instance, so i guess either this controller does not work well anymore or the communication with it is not fully ok anymore ... one possible test would be to check it from chromeos side, if you see the same problem there as well or not

update: i think on chromebooks there is the embedded controller (ec) inbetween the battery and linux, i.e. linux speaks to ec and that to the battery controller i think

hexdump0815 avatar Jul 26 '23 20:07 hexdump0815

just did a clean recovery to chromeos (kernel 4.19.281 / aarch64), and battery is fine there. From the power_supply_info cmd I can now see fields like voltage, energy, current and charge showing proper values (instead of bogus values that seem to indicate some int maxing out at 65.535)

This time, I also see the technology (Li-ion), vendor (LGC) and model name (L15L3PB1) fields - those were all unavailable in regular linux.

Path is /sys/class/power_supply/sbs-6-000b, which I suspect is the exact same on ordinary Linux (probably because it's from a kernel interface?).

When I execute power_supply_info (without sudo) It returns the regular stuff from sysfs, but it also prints a little error:

[cros_ec_prefs_source.cc(23)] Failed to open /dev/cros_ec: Permission denied (13)

No idea if this is relevant though 😅

harmw avatar Jul 27 '23 10:07 harmw

thanks a lot for checking - so this way a hardware problem is ruled out, so most probably somehow your battery is not properly supported by mainline - is it a default battery or maybe a replaced one?

hexdump0815 avatar Jul 29 '23 18:07 hexdump0815

Battery is still original but the touchpad was replaced due to a malfunction.

harmw avatar Jul 30 '23 10:07 harmw

sadly i have no real idea how to deal with that - i'm currently working on testing the v6.4 kernel, so maybe it might be worth a try to test that once i have it tested working ...

hexdump0815 avatar Jul 31 '23 19:07 hexdump0815

@hexdump0815 just adding that I have the exact same problem with my C330. Since it's EOL in June 2025, I figured I'd look for alternatives, and I stumbled upon your project. I have tried your latest image (Sept 2023), Postmarket OS, and Arch Linux ARM. The latter kept looping and displaying the same errors over 2 minutes until I killed the boot process (same error that user @cdd100 posted earlier).

Also, wanted to say thanks for all the hard work you are doing with this project.

tuccimon avatar Apr 27 '25 18:04 tuccimon