-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turning off USB charging of the target from the energy meter #118
Comments
As far as it's been tested, it currently only works on Google Pixel. However if another device has a different method for disabling charging then it should be possible to override the mechanism. |
Thanks @bjackman for pointing that out. |
Maybe we can do that, but that means adding API surface so it musn't be a hack to solve a problem for a specific platform. How to dis/enable charging is really procedural information rather than data so I'd want to be conservative about designing a JSON interface for it (Even if we assume it's always a case of writing a sysfs file, we need to store the values to write. Do we assume that it's always the same file to enable and disable? Should we read the file back to check it was updated or is it write-only? What if there are multiple power sources to be dis/enabled?). Also, that configuration isn't technically necessary, the problem could be solved in devlib by making the
Yeah that sounds sensible, probably libs/utils/energy.py is the place to do that - patches welcome 😁 |
Turns out charging disable from target side is unreliable on devices. It seems to confuse the host-side, and if the host drops the USB connection, then there isn't any way to re-enable charging because that requires the USB connection to begin with. I think some USB host controllers do monitor VBUS current. Considering the nature of doing this which platform-specific and the fact that its unreliable, I think we should just use something like USB passthrough where USB automatically disconnected externally by the emeter. I started a discussion here: #121 |
Can we instruct the target to turn off USB charging from the energy meter as a hint?
Currently this has to be done manually either from target.execute or from adb. Can we automate this by providing some per-device abstraction?
CC @bjackman @derkling
The text was updated successfully, but these errors were encountered: