PiSugar / pisugar-power-manager-rs

PiSugar Power Manger in rust language
https://www.pisugar.com/
GNU General Public License v3.0
130 stars 15 forks source link

PiSugar3 on Pi0-2W: "On Power Restore" loops while "battery_power_plugged: true" #73

Open Arthur-Philip-Dent opened 2 years ago

Arthur-Philip-Dent commented 2 years ago

Hi *!

/etc/debian_version
10.11

cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
(...)

cat /proc/cpuinfo
(...)
Hardware        : BCM2835
Revision        : 902120
Serial          : 000000004e3758e2
Model           : Raspberry Pi Zero 2 Rev 1.0

I wanted to ask, if someone can fix this:

Condition:

Behavior: When power restorred on USB-C, still the battery has the level of <=30% (or below due to temperature drop...) and after booting up the "Safe Shutdown on 30% (or below)" cuts in resulting in a looping of permant rebooting.

Please add some kind of conditional check for this situation, so it does not shut down, when power is plugged.

is_battery_power_plugged = true on adequate points in code to circumvent this "looping".

Please execute safe shutdown in case of

if is_battery_power_plugged = false or ( is_battery_power_plugged = true AND USB-port is not delivering enough power (<200mA)
to charge the battery AND power the Pi0 same time to prevent deep discharge of the battery.

Thank you!
Best Regards!

mitpre commented 2 years ago

I have the same issue and would be very happy if it would be resolved.