PINE64
i3status issues reading battery status - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111)
+--- Forum: Linux on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=114)
+--- Thread: i3status issues reading battery status (/showthread.php?tid=8859)



i3status issues reading battery status - dummy - 01-20-2020

So, finally had the time to sit down and try to whip this thing into shape since getting it, so far solid hardware and no more issues than I would have expected with a product like this. But after getting i3 set up, I cannot get the status display to read the battery charge status. At first assumed it was just the normal issue with non-standard battery names, but after manually putting the path in the i3status.conf I'm now getting an error: 

no '%d' in battery path


Has anyone else had this issue/have a resolution? I've seen a lot of people playing with i3 setups on here, so hoping someone else's past struggles found the solution.


RE: i3status issues reading battery status - ospfeigrp - 01-21-2020

to check if the charger is plugged in: cat /sys/class/power_supply/dc-charger/device/power_supply/dc-charger/online


RE: i3status issues reading battery status - cbk - 01-25-2020

(01-20-2020, 04:08 PM)dummy Wrote: So, finally had the time to sit down and try to whip this thing into shape since getting it, so far solid hardware and no more issues than I would have expected with a product like this. But after getting i3 set up, I cannot get the status display to read the battery charge status. At first assumed it was just the normal issue with non-standard battery names, but after manually putting the path in the i3status.conf I'm now getting an error: 

no '%d' in battery path


Has anyone else had this issue/have a resolution? I've seen a lot of people playing with i3 setups on here, so hoping someone else's past struggles found the solution.

I have the same issue.  I can not get the battery to display in the i3bar. I have tried using both battery 0 and battery 1 as the labels in my i3status config file. (below) but nothing seams to work.  Not sure if this is a issue with i3 or with the pinebook pro....?

i3status config:

battery 0 {
  format = " %status %percentage %remaining "
  format_down = " no battery "  
  last_full_capacity = false
  integer_battery_capacity = true  
  hide_seconds = true    
  status_chr = "⚡"
  status_bat = "☉"
  status_full = "☻"
  low_threshold = 10
  threshold_type = percentage
  path = "/sys/class/power_supply/rk-bat/uevent"
}


RE: i3status issues reading battery status - Antoine - 01-25-2020

(01-25-2020, 02:09 AM)cbk Wrote: i3status config:

battery 0 {
  format = " %status %percentage %remaining "
  format_down = " no battery "  
  last_full_capacity = false
  integer_battery_capacity = true  
  hide_seconds = true    
  status_chr = "⚡"
  status_bat = "☉"
  status_full = "☻"
  low_threshold = 10
  threshold_type = percentage
  path = "/sys/class/power_supply/rk-bat/uevent"
}

Try by changing the path to:
Code:
path = "/sys/class/power_supply/cw2015-battery/uevent"


Remaining time does not work for me but at least you will have the percentage.


RE: i3status issues reading battery status - cbk - 01-25-2020

(01-25-2020, 04:22 AM)Antoine Wrote:
(01-25-2020, 02:09 AM)cbk Wrote: i3status config:

battery 0 {
  format = " %status %percentage %remaining "
  format_down = " no battery "  
  last_full_capacity = false
  integer_battery_capacity = true  
  hide_seconds = true    
  status_chr = "⚡"
  status_bat = "☉"
  status_full = "☻"
  low_threshold = 10
  threshold_type = percentage
  path = "/sys/class/power_supply/rk-bat/uevent"
}

Try by changing the path to:
Code:
path = "/sys/class/power_supply/cw2015-battery/uevent"


Remaining time does not work for me but at least you will have the percentage.

Listing  out the above file returns No such file or directory on my system.
The pinebook pro does not have the same battery as you describe above.  It has swhat I had posted: /sys/class/power_supply/rk-bat/ueven



RE: i3status issues reading battery status - aversglay - 01-27-2020

(01-20-2020, 04:08 PM)I had trouble with this at first too. The usual things I tried did not work. But in the end, since I installed i3 over the default debian, I just added "exec_always mate-power-manager" to my config. If you didn\t install over debian, you can still download the mate-power-manager, will show up in your tray.dummy Wrote: So, finally had the time to sit down and try to whip this thing into shape since getting it, so far solid hardware and no more issues than I would have expected with a product like this. But after getting i3 set up, I cannot get the status display to read the battery charge status. At first assumed it was just the normal issue with non-standard battery names, but after manually putting the path in the i3status.conf I'm now getting an error: 

no '%d' in battery path


Has anyone else had this issue/have a resolution? I've seen a lot of people playing with i3 setups on here, so hoping someone else's past struggles found the solution.



RE: i3status issues reading battery status - C_Elegans - 01-27-2020

Quote:Remaining time does not work for me but at least you will have the percentage.

I've got a patch that enables that here: https://github.com/C-Elegans/i3status.

Essentially the issue is i3status is looking for a field called POWER_SUPPLY_CHARGE_NOW with the current state of charge in Wh or mAh that it can use to calculate the battery run time. The pinebook battery doesn't provide this, however it does expose a field called POWER_SUPPLY_TIME_TO_EMPTY_NOW which has the number of minutes until the battery is empty. My patch just has i3status look at that if it's present instead of trying to calculate the runtime from the other fields.

Hope this helps!


RE: i3status issues reading battery status - Antoine - 01-27-2020

(01-27-2020, 02:43 AM)aversglay Wrote: I'm now getting an error: 
[quote pid='57529' dateline='1579558118']

no '%d' in battery path


Has anyone else had this issue/have a resolution? I've seen a lot of people playing with i3 setups on here, so hoping someone else's past struggles found the solution.

[/quote]

Do not forget the "0" in the config definition:


Code:
battery 0 {
        format = [...]
        path = [...]
}



RE: i3status issues reading battery status - mbooth - 01-31-2020

(01-27-2020, 02:04 PM)C_Elegans Wrote:
Quote:Remaining time does not work for me but at least you will have the percentage.

I've got a patch that enables that here: https://github.com/C-Elegans/i3status.

Essentially the issue is i3status is looking for a field called POWER_SUPPLY_CHARGE_NOW with the current state of charge in Wh or mAh that it can use to calculate the battery run time. The pinebook battery doesn't provide this, however it does expose a field called POWER_SUPPLY_TIME_TO_EMPTY_NOW which has the number of minutes until the battery is empty. My patch just has i3status look at that if it's present instead of trying to calculate the runtime from the other fields.

Hope this helps!

Nice work! This patch works great for me. Will you submit a PR upstream to the i3status project?


RE: i3status issues reading battery status - C_Elegans - 01-31-2020

(01-31-2020, 06:13 AM)mbooth Wrote: Nice work! This patch works great for me. Will you submit a PR upstream to the i3status project?

Yup, already did: https://github.com/i3/i3status/pull/378