msoon / PyMonsoon

Monsoon Power Monitor Python Library
MIT License
55 stars 23 forks source link

LVPM.Monsoon.setVout is interrupting the power source. #15

Open luiscruz opened 7 years ago

luiscruz commented 7 years ago

Whenever I set the voltage of the power monitor my phone dies 👎 This is unfortunate because I have to manually turn the phone on each time I run my scripts.

I will use a temporary solution in which I only call LVPM.Monsoon.setVout if the voltage is different from the actual value in the power monitor.

Which leads me to another question about LVPM.Monsoon.setVout:

Mbrinker commented 7 years ago

I'm having difficulty replicating the primary bug. We have a few phones here we use for testing, and they're able to stay powered on between voltage changes with setVout(). Does it occur with any call to setVout at all? For example, if the current setpoint is 3.70V, and you call to set it to 3.70V again, does your phone die?

For FLOAT_TO_INT, the microprocessor inside the Power Monitor doesn't support floating point numbers, so we map the floating point number given by the user to an integer with the level of precision needed to accurately interpret the voltage setpoint.

luiscruz commented 7 years ago

Hi Mike,

I'm having difficulty replicating the primary bug. We have a few phones here we use for testing, and they're able to stay powered on between voltage changes with setVout().

I'm using Nexus 5X without any battery at all. I’m directly connecting it to the LVPM power source. Does it occur with any call to setVout at all? For example, if the current setpoint is 3.70V, and you call to set it to 3.70V again, does your phone die?

Yes, it happens even when I set it with the same value. For FLOAT_TO_INT, the microprocessor inside the Power Monitor doesn't support floating point numbers, so we map the floating point number given by the user to an integer with the level of precision needed to accurately interpret the voltage setpoint.

Oh that’s cool! :)