Skip to content
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

Battery energy calculation remains at 100 #966

Closed
ofuangka opened this issue Jan 4, 2021 · 8 comments
Closed

Battery energy calculation remains at 100 #966

ofuangka opened this issue Jan 4, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@ofuangka
Copy link

ofuangka commented Jan 4, 2021

I'm using a Pinebook Pro with /sys/class/power_supply/cw2015-battery. It looks like commit a7056f7ccec0126f3b2a1c86b09a4d6dacef8cce modified the capacity calculation to use charge_now or energy_now, but neither of those exist for that battery:

[/sys/class/power_supply/cw2015-battery]$ ls
capacity	    device   subsystem		voltage_now
charge_counter	    hwmon5   technology		wakeup9
charge_full	    power    time_to_empty_now
charge_full_design  present  type
current_now	    status   uevent
$ cat uevent 
POWER_SUPPLY_NAME=cw2015-battery
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_CAPACITY=96
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_VOLTAGE_NOW=4151000
POWER_SUPPLY_TIME_TO_EMPTY_NOW=0
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CHARGE_COUNTER=1
POWER_SUPPLY_CHARGE_FULL=9800000
POWER_SUPPLY_CHARGE_FULL_DESIGN=9800000
POWER_SUPPLY_CURRENT_NOW=0

Removing that commit resolves the issue.

@MFAshby
Copy link

MFAshby commented Jan 24, 2021

I got the same issue, downgrading waybar fixed it temporarily.
I guess waybar could revert to using 'capacity' if charge_now and energy_now are both absent. Alternatively the driver for this battery could start to expose the charge now value here

@Alexays Alexays added the bug Something isn't working label Jan 24, 2021
@madalinignisca
Copy link

Oh man. Facing same issue...

@MFAshby
Copy link

MFAshby commented Feb 4, 2021

Reported the problem in Manjaro forums and submitted a patch but it'll likely take a few weeks as the maintainer of this driver is short on time at the moment.

If you're running pinebook pro with Manjaro or arch arm you can try this Linux build:

https://forum.manjaro.org/t/pinebook-pro-sway-battery-indicator-broken/50448/6

@madalinignisca
Copy link

I doubt people with Pinebook Pro's are in urgent need of problems being fixed. My self, it's my secondary laptop to use when going out in weekends or holidays. Really glad somebody spotted the better fix that ain't need this app to change.

@Artturin
Copy link
Contributor

Artturin commented Mar 2, 2021

same issue on the pinephone which uses axp20x-battery but it does not remain at 100% instead its at 14% usually

cat /sys/class/power_supply/axp20x-battery/uevent
POWER_SUPPLY_NAME=axp20x-battery
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_VOLTAGE_NOW=3928000
POWER_SUPPLY_CURRENT_NOW=1374000
POWER_SUPPLY_CONSTANT_CHARGE_CURRENT=1200000
POWER_SUPPLY_CONSTANT_CHARGE_CURRENT_MAX=1200000
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_VOLTAGE_OCV=3667400
POWER_SUPPLY_VOLTAGE_MAX_DESIGN=4200000
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=3000000
POWER_SUPPLY_CAPACITY=11

indicator should be at 11% but instead its at 14% even when much below that or much above that

@jezek
Copy link

jezek commented Mar 23, 2021

Same issue on pinebook 1080p, which uses axp20x-battery. The /sys/class/power_supply/axp20x-battery/uevent is correct, but indicator displays other percentage (usualy 100%).

@MFAshby
Copy link

MFAshby commented Mar 23, 2021

Looks like the same issue with that battery driver too, no implementation of CHARGE_NOW in here

I haven't checked what fraction of battery drivers support this property, but if most of them don't then it might be better to change waybar to not rely on it.

@Max1Truc
Copy link
Contributor

This should be fixed by #1101 on master.
I think this issue might now be closed.

@Alexays Alexays closed this as completed Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants