Increasing max voltage to use a bigger battery
#1
In https://wiki.pine64.org/wiki/PinePhone_FAQ#Battery it says I can use this to allow my phone to charge more:
Code:
echo 4350000 > /sys/class/power_supply/axp20x-battery/voltage_max_design
When I do that however I get a write error, what's going on?
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
  Reply
#2
You have to enter it like this:
Code:
echo 4350000 | sudo tee /sys/class/power_supply/axp20x-battery/voltage_max_design
  Reply
#3
(05-30-2021, 01:34 PM)Merc Wrote: You have to enter it like this:
Code:
echo 4350000 | sudo tee /sys/class/power_supply/axp20x-battery/voltage_max_design

Same issue
Code:
tee: /sys/class/power_supply/axp20x-battery/voltage_max_design: Invalid argument
  Reply
#4
(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:
Code:
echo 4350000 > /sys/class/power_supply/axp20x-battery/voltage_max_design
When I do that however I get a write error, what's going on?
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
If sudo works, but the write attempt fails, it probably implies that the node isn't writable at all.
  Reply
#5
The privs granted by sudo stop at the redirect, so you can't redirect into files your user doesn't have write access to. Piping into sudo tee is a common workaround for this limitation, and often used with things in sysfs.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Limiting battery charging to some percentage TRS-80 1 173 07-18-2021, 09:56 PM
Last Post: Merc
  Possible fix for lousy standby battery life? bitnick 5 1,441 02-04-2021, 04:05 PM
Last Post: dcinoz
Sad battery usage HLing 3 1,665 08-29-2020, 06:04 AM
Last Post: jed
  SMS after dead battery antiX-Dave 4 2,191 06-05-2020, 08:11 PM
Last Post: antiX-Dave

Forum Jump:


Users browsing this thread: 1 Guest(s)