Bug 1733424 - Does not handle /sys battery status provided by pinebook
Summary: Does not handle /sys battery status provided by pinebook
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: lxpanel
Version: 30
Hardware: aarch64
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Christoph Wickert
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-26 04:33 UTC by Stuart D Gathman
Modified: 2019-08-12 23:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)
patch to make battery monitor work on pinebook (1.17 KB, text/plain)
2019-07-26 04:33 UTC, Stuart D Gathman
no flags Details

Description Stuart D Gathman 2019-07-26 04:33:22 UTC
Created attachment 1593555 [details]
patch to make battery monitor work on pinebook

Description of problem:
Battery percentage and time remaining are computed as 0 on pinebook

Version-Release number of selected component (if applicable):
lxpanel-0.10.0-2.D20190301gitb9ad6f2a.fc30.aarch64
kernel-5.1.18-300.fc30.aarch64

How reproducible:
Always on pinebook

Steps to Reproduce:
1. Add Battery Monitor plugin to lxpanel
2.
3.

Actual results:
Battery percentage and time remaining are computed as 0 on pinebook

Expected results:
Show correct percentage and estimated time remaining

Additional info:
Patch attached has been tested on pinebook.  It only kicks in when percentage cannot be computed and falls back to 0 - so it *shouldn't* break any working cases.  

An obvious improvement is to make the charge_full configurable, as later models may have a different battery, and the full charge reduces with age.  While tracking history so as to auto-adjust an estimated full charge may be too heavy weight for LXDE, it isn't too hard to occasionally make a manual estimate - if only someone adds the config field.

This only affect users of this ARM device, but when it affects you it is somewhat serious.  The work around without this patch is to 

$ cat /sys/class/power_supply/axp20x-battery/capacity

in a terminal to track battery level.

Comment 1 Stuart D Gathman 2019-07-30 17:59:28 UTC
With I as the reported current in mA, P as reported percentage of total energy, t as elapsed time, stepwise integration of I dt / dP comes out to 10000 mAh within 2 significant digits.  The remaining time calculation is thus as accurate as the percentage it is based on.

Comment 2 Mamoru TASAKA 2019-08-11 14:48:30 UTC
Would you try posting your patches on the upstream? Thank you in advance.

Comment 3 Stuart D Gathman 2019-08-12 23:39:34 UTC
I added a pull request to the github mirror.  I am not sure that they monitor that.  Do you know a better place?


Note You need to log in before you can comment on or make changes to this bug.