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
  Battery problem with a Pinephone keyboard and Mobian elode 2 2,751 12-22-2022, 07:10 PM
Last Post: acid andy
  Possible solutions to the battery draining issue? 3x5co 5 3,325 11-28-2022, 10:58 AM
Last Post: 3x5co
  Will this battery-saving script cause problems? rp3 1 1,635 08-28-2022, 02:00 PM
Last Post: biketool
  Battery Management jsch 4 2,731 07-27-2022, 11:17 AM
Last Post: jsch
  Limiting battery charging to some percentage TRS-80 3 3,821 08-22-2021, 01:02 AM
Last Post: bcnaz
  Possible fix for lousy standby battery life? bitnick 5 5,935 02-04-2021, 04:05 PM
Last Post: dcinoz
Sad battery usage HLing 3 5,177 08-29-2020, 06:04 AM
Last Post: User 18618
  SMS after dead battery antiX-Dave 4 6,788 06-05-2020, 08:11 PM
Last Post: antiX-Dave

Forum Jump:


Users browsing this thread: 1 Guest(s)