12-31-2024, 02:20 AM
I'm new to PPP and am very interested in understanding the power usage of the device in order to optimize it. A simple way to log power usage is to run this in the console:
This will show the current going in/out the battery in microamps (negative for discharging, positive for charging) and the battery millivolts. You can put that into a "while" loop with a "sleep" to periodically log this to a file. However, bear in mind that during logging, the CPU is awake and working, so you won't get a true representation of whats the idle power draw is.
I'm busy porting FreeBSD to the PPP (see https://codeberg.org/Honeyguide/freebsd-pinephonepro ) and wrote the driver for the battery charger, and was trying to figure out how the Linux driver works out the state-of-charge, because the rk818 chip doesn't seem to provide it.
My preliminary testing shows that perhaps the state-of-charge calculation in the Linux driver is not accurate, and it might be leaving usable battery capacity on the table (e.g. when it says 5% remaining, there may actually be quite a lot more actual capacity left). I'll spend some time checking if the the millivolts/microamps figures match actual battery measurements on my device, and whether the state-of-charge is indeed inaccurate. If it is, this might explain part of the battery woes that seem to afflict this device.
Code:
cat /sys/class/power_supply/rk818-battery/*_now
This will show the current going in/out the battery in microamps (negative for discharging, positive for charging) and the battery millivolts. You can put that into a "while" loop with a "sleep" to periodically log this to a file. However, bear in mind that during logging, the CPU is awake and working, so you won't get a true representation of whats the idle power draw is.
I'm busy porting FreeBSD to the PPP (see https://codeberg.org/Honeyguide/freebsd-pinephonepro ) and wrote the driver for the battery charger, and was trying to figure out how the Linux driver works out the state-of-charge, because the rk818 chip doesn't seem to provide it.
My preliminary testing shows that perhaps the state-of-charge calculation in the Linux driver is not accurate, and it might be leaving usable battery capacity on the table (e.g. when it says 5% remaining, there may actually be quite a lot more actual capacity left). I'll spend some time checking if the the millivolts/microamps figures match actual battery measurements on my device, and whether the state-of-charge is indeed inaccurate. If it is, this might explain part of the battery woes that seem to afflict this device.