Menu

#925 Battery charge percentage not properly displayed

behavior
open
nobody
None
5
2022-09-15
2022-07-10
Denis Prost
No

Hi everyone,
On my Toshiba Tecra A10-11T laptop with MX 21 (Debian 11), the taskbar displays "-6%C" instead of 100% when battery is full. I use the same .icewm/preferences file on another laptop where the battery charge is properly displayed, so maybe this problem is related to the specific Tecra hardware ?
Thanks in advance
Denis

1 Attachments

Discussion

  • Denis Prost

    Denis Prost - 2022-07-12

    Fixed ! After letting battery get discharged to less that 10%, the displayed percentage became correct. Seems like the battery monitor had to do some scaling.

     
  • Denis Prost

    Denis Prost - 2022-07-12

    Sorry, I spoke too quickly. After a charging cycle, the problem is back again. "-6%CC" displayed in the battery charge field.

     

    Last edit: Denis Prost 2022-07-12
  • Denis Prost

    Denis Prost - 2022-08-24

    Additional information :
    1) this is with icewm-2.1.2
    2) I noticed that, while the displayed battery percentage was wrong, setting TaskBarShowAPMGraph=1 in preferences file produced right value in battery graph.
    So I checked aapm.cc source file to see what was the difference betwen values used to compute the battery percentage, and the ones used for the graph, and noticed that the latter used the variables energyNow and energyFull which was not the case of the former.
    So I replaced in aapm.cc, lines 437 and 660 :

    (100 *  BATcapacity_remain) / BATcapacity_full);
    

    with

    (100 * energyNow) / energyFull);
    

    And it seems the problem is fixed !
    I'm not sure this patch does not produce unexpected side effects, but at least on my computer, everything seems to work fine now.

     
  • Denis Prost

    Denis Prost - 2022-09-15

    Closing this bug because I saw it is fixed with icewm 2.9.9 (in fact, the problem came from an overflow in battery percentage computing which needed "long int" specification to succeed)

    Can anyone close it for me, I don't see any way to do it.
    Thanks !

     

    Last edit: Denis Prost 2022-09-15

Log in to post a comment.