PINE64
Battery Management - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Mobian on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=139)
+---- Thread: Battery Management (/showthread.php?tid=17059)



Battery Management - jsch - 07-26-2022

Is there something like a battery management for the PinePhone?
If you plug in the usb charger, the battery level will raise up to 100% (as expected).
Would it increase the lifespan of the battery if battery level would be kept in a reasonable range (e.g. between 60% and 70%)?
Would it increase the lifespan of the battery if charging is not with full power (1.5A) if not needed?


RE: Battery Management - wibble - 07-27-2022

More people complain if it won't charge to 100% than complain that it should stop at a lower level to preserve battery lifespan, so the default in most distros is to charge to 100%. IIRC you can change this via sysfs, but I don't remember how exactly. I don't think anyone has bothered doing a GUI for it.
I think the details of the charging profile are down to the firmware on the PMIC. I think megous has looked into this more than anyone else.
https://xnux.eu/devices/feature/anx7688.html


RE: Battery Management - shulamy - 07-27-2022

on manjaro phosh  in  tweaks > power

ezik


RE: Battery Management - vusra - 07-27-2022

pmos-tweaks offers feature https://wiki.mobian-project.org/doku.php?id=tweaks#pmos-tweaks yet does not work. Gladdened if you would file the bug report.


Any mate care to share the sysfs technique?


RE: Battery Management - jsch - 07-27-2022

Using a python script to create a poc.
I could not find a setting to disable charging. Since pp draws more than 0.1A it's sufficient to set the current limit to 0.1A.

Code:
    'battery_current': {
        'filename': '/sys/class/power_supply/axp20x-battery/hwmon4/curr1_input',  # noqa E501
        'description': 'battery current in mA'},
    # 'battery_voltage': {
    #    'filename': '/sys/class/power_supply/axp20x-battery/hwmon4/in0_input',
    #    'description': 'battery voltage in mV'},
    'usb_current_limit': {
        'filename': '/sys/class/power_supply/axp20x-usb/input_current_limit',
        'description': 'usb current limit in µA'},
    'usb_charger_current_limit': {
        'filename': '/sys/class/power_supply/axp20x-usb/usb_dcp_input_current_limit',  # noqa E501
        'description': 'usb charger current limit in µA'},
    'battery_capacity': {
        'filename': '/sys/class/power_supply/axp20x-battery/capacity',
        'description': 'battery capacity in %'},
    'usb_charger_online': {
        'filename': '/sys/class/power_supply/axp20x-usb/online',
        'description': 'charger is online'},