When I use the sysfs driver, I can't get the power consumption to show on the bar. However, the upower driver does work.
Worth mentioning is that my laptop lacks a /sys/class/power_supply/BAT0/power_now file but it does have current_now and voltage_now.
@travankor Do you still experience this?
@ammgws Yes, and I don't see any commits that fixed it.
Basically, this function has to be translated to Rust. So instead of not using current here, use the calculate_rate() function.
Alternatively, you can just use P=IV to get a quick and dirty result.
I've been meaning to learn Rust enough to fix this but I didn't have the time yet :/
I assume that just taking current * voltage is probably closer to the way the power sysfs value would behave.
IMO, actually taking a linear regression over time would probably be neat and more accurate (even for the power case), but also quite a bit more complicated
For now I just implemented the P=IV method, but need someone to test it.
Also, I found this. @travankor does your system have this powercap device?
Also, I found this. @travankor does your system have this powercap device?
Yes, it does. Thanks for looking into this.
Can you check what values it outputs? Then we can compare it to the current * voltage method and see if maybe we want to prefer powercap before falling back to P=VI.
As mentioned in the Stackexchange post you linked and on my system as well, it only provides a microjoule counter, which is probably just as difficult to get a power draw from as doing it via the other charge values
Yeah it would need to be sampled over time. Was just wondering how its values correlate with the other method to see if it's worth looking into in the future.
Yeah maybe. I put some thought and research into calculations like this (averaging intervals and such) in #214 , might be worth a look