CrazyBoyFeng / AccSettings

Simple UI for Advanced Charging Controller
GNU General Public License v3.0
196 stars 3 forks source link

[FEATURE REQUEST] Also show charger information like voltage/current/power/charging protocol #9

Open KaMyKaSii opened 2 years ago

KaMyKaSii commented 2 years ago

Just as it is already done with the battery information. I currently use a personal script on Termux to see this. It needs bc installed and the logic only works if the charger has enough power to charge the battery and power the phone. Screenshot_20220606-112857818_1 charger.txt

CrazyBoyFeng commented 2 years ago

Currently acc only outputs the voltage, current, power, and status of the device.
Your requirement is to additionally display the voltage, current, power and protocol of the charger? I don't know much about it, but I think maybe not all device kernels support getting the status of the charger. This may require help from @VR-25, who is the developer of acc.

VR-25 commented 2 years ago

Indeed, not many devices provide this information. Still, I'm considering the idea. I like your script. I'd like to take a look at your /sys/class/power_supply/usb/uevent as well.

Off-topic: acc wiki is live (and empty!) Anyone is free to add/edit pages.

KaMyKaSii commented 2 years ago

I thought support was implemented equally as battery information. Using a good USB Tester (TC66C) I see that it reports 15% more power for a standard 5V USB charging and 30% more for a 9V QC3 charging than what is reported by the kernel. I don't know if this difference is due to low kernel precision, loss of energy in heat or both.

Indeed, not many devices provide this information. Still, I'm considering the idea. I like your script. I'd like to take a look at your /sys/class/power_supply/usb/uevent as well.

Here is the contents of the uevent file:

root@ASUS_Z01KD_3:/ # cat /sys/class/power_supply/usb/uevent
POWER_SUPPLY_NAME=usb
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_VOLTAGE_MAX=9000000
POWER_SUPPLY_VOLTAGE_NOW=8574218
POWER_SUPPLY_PD_CURRENT_MAX=-22
POWER_SUPPLY_CURRENT_MAX=1400000
POWER_SUPPLY_TYPE=USB_DCP
POWER_SUPPLY_TYPEC_MODE=Source attached (medium current)
POWER_SUPPLY_TYPEC_POWER_ROLE=sink
POWER_SUPPLY_TYPEC_CC_ORIENTATION=2
POWER_SUPPLY_PD_ALLOWED=1
POWER_SUPPLY_PD_ACTIVE=0
POWER_SUPPLY_INPUT_CURRENT_SETTLED=1400000
POWER_SUPPLY_INPUT_CURRENT_NOW=764345
POWER_SUPPLY_BOOST_CURRENT=0
POWER_SUPPLY_PE_START=1
POWER_SUPPLY_CTM_CURRENT_MAX=-22
POWER_SUPPLY_HW_CURRENT_MAX=3000000
POWER_SUPPLY_REAL_TYPE=USB_HVDCP_3
POWER_SUPPLY_PR_SWAP=0
POWER_SUPPLY_PD_VOLTAGE_MAX=5000000
POWER_SUPPLY_PD_VOLTAGE_MIN=5000000
POWER_SUPPLY_SDP_CURRENT_MAX=-22
VR-25 commented 2 years ago

@KaMyKaSii, try the latest pre-release.

KaMyKaSii commented 2 years ago

@KaMyKaSii, try the latest pre-release.

Sorry for the late reply. For me using the latest ACC release it is just printing the CHARGE_TYPE, no POWERSUPPLY* info