You are not logged in.

#1 2018-01-12 13:54:50

brainwasher
Member
From: Lucca (Italy)
Registered: 2007-01-04
Posts: 81
Website

[SOLVED] Wrong value inside /sys/.../BAT0/capacity pseudo file

After digging into this issue https://github.com/gpakosz/.tmux/issues/137 I have found that the capacity file contains a wrong value.
At this time my battery is full and 100% charged.

The capacity value is 135, but the linux doc. https://www.kernel.org/doc/Documentatio … _class.txt says that

~ CAPACITY attribute represents capacity in *percents*, from 0 to 100.
$ cat /sys/class/power_supply/BAT0/capacity
135

$ uname -a
Linux manuel-xps 4.14.12-1-ARCH #1 SMP PREEMPT Fri Jan 5 18:19:34 UTC 2018 x86_64 GNU/Linux
$ lsb_release -a
LSB Version:    1.4
Distributor ID: Arch
Description:    Arch Linux
Release:        rolling
Codename:       n/a
Dell XPS 13-9350

Is this a firmware issue? or Kernel related?

Last edited by brainwasher (2018-01-13 18:07:21)

Offline

#2 2018-01-12 14:47:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,543
Website

Re: [SOLVED] Wrong value inside /sys/.../BAT0/capacity pseudo file

How about `acpi` output, and the other relevant content of the directory - this should do:

grep . /sys/class/power_supply/BAT0/*

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-01-12 14:56:35

brainwasher
Member
From: Lucca (Italy)
Registered: 2007-01-04
Posts: 81
Website

Re: [SOLVED] Wrong value inside /sys/.../BAT0/capacity pseudo file

Trilby wrote:

How about `acpi` output, and the other relevant content of the directory - this should do:

grep . /sys/class/power_supply/BAT0/*
$ acpi
Battery 0: Full, 100%

$ grep . /sys/class/power_supply/BAT0/*
alarm:0
capacity:135
capacity_level:Full
charge_full:5582000
charge_full_design:7570000
charge_now:7570000
current_now:1000
cycle_count:0
manufacturer:SMP
model_name:DELL JHXPY53
present:1
serial_number:69
status:Full
technology:Li-poly
type:Battery
voltage_min_design:7600000
voltage_now:8690000

charge_full never reached charge_full_design while charge_now does.

Last edited by brainwasher (2018-01-12 15:00:08)

Offline

#4 2018-01-12 15:17:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,543
Website

Re: [SOLVED] Wrong value inside /sys/.../BAT0/capacity pseudo file

Hmm, so it looks like the problem is in the "charge_full" value.  I'm not that well versed on such issues (perhaps someone like ewaller could chime in) but I've frequently had related issues that are often remedied by ensuring the battery goes through a full discharge-charge cycle: as if it needs to hit the top and bottom values in order to know accurately what they are.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2018-01-13 18:06:39

brainwasher
Member
From: Lucca (Italy)
Registered: 2007-01-04
Posts: 81
Website

Re: [SOLVED] Wrong value inside /sys/.../BAT0/capacity pseudo file

Trilby wrote:

but I've frequently had related issues that are often remedied by ensuring the battery goes through a full discharge-charge cycle

It worked, thank you.

Offline

Board footer

Powered by FluxBB