06-08-2021, 10:41 AM
(05-30-2021, 12:55 PM)SocialNetworkingWasAMistake Wrote: In https://wiki.pine64.org/wiki/PinePhone_FAQ#Battery it says I can use this to allow my phone to charge more:
When I do that however I get a write error, what's going on?Code:echo 4350000 > /sys/class/power_supply/axp20x-battery/voltage_max_design
I want to install this battery but it's not going to be able to use the full capacity if I can't set the max voltage, right?
https://www.ebay.co.uk/itm/333992044176
Your initial error is most likely because either you're not executing the command as root, or because the /sys node in question is read-only. I think battery voltage needs to be set very early on, AFAIR it's done in the pinephone version of u-boot. You may need to compile a custom boot loader to actually change that value.
I have no idea why people are suggesting that you use tee, and I wouldn't expect it to work like that. Without any other arguments, tee will (AFAIR) attempt delete the existing node and then create a regular file to output to. I would expect this to fail, as you generally aren't aren't allowed to delete nodes or create regular files in sysfs.
You might be able to get tee to work with tee in append mode, but a far simpler solution is just to execute your original command as root, e.g. with
Code:
sudo echo 4350000 > /sys/class/power_supply/axp20x-battery/voltage_max_design