geeekpi / upsplus

UPS Plus is a new generation of UPS power management module. It is an improved version of the original UPS prototype. It has been fixed the bug that UPS could not charge and automatically power off during work time. It can not only perform good battery power management, but also provide stable voltage output and RTC functions. At the same time,it support for FCP, AFC, SFCP fast charge protocol, support BC1.2 charging protocol, support battery terminal current/voltage monitoring and support two-way monitoring of charge and discharge. It can provide programmable PVD function. Power Voltage Detector (PVD) can be used to detect if batteries voltage is below or above configured voltage. Once this function has been enabled, it will monitoring your batteries voltage, and you can control whether or not shut down Raspberry Pi via simple bash script or python script. This function will protect your batteries from damage caused by excessive discharge. It can provide Adjustable data sampling Rate. This function allows you to adjust the data sampling rate so that you can get more detailed battery information and also it will consume some power. The data sampling information can communicate with the upper computer device through the I2C protocol. UPS Plus supports the OTA firmware upgrade function. Once there is a new firmware update, it is very convenient for you to upgrade firmware for UPS Plus. The firmware upgrade can be completed only by connecting to the Internet,and execute a python script. Support battery temperature monitoring and power-down memory function. UPS Plus can be set to automatically start the Raspberry Pi after the external power comes on. The programmable shutdown and forced restart function will provide you with a remote power-off restart management method. That means you don’t need to go Unplug the power cable or press the power button to cut off the power again. You can set the program to disconnect the power supply after a few seconds after the Raspberry Pi is shut down properly. And you can also reconnect the power supply after a forced power failure to achieve a remote power-off and restart operation. Once it was setting up, you don't need to press power button to boot up your device which is very suitable for smart home application scenarios.
https://wiki.52pi.com/index.php?title=UPS_Plus_SKU:_EP-0136
MIT License
73 stars 25 forks source link

Power Adapter Report Online and Offline via Online Diagnostics #124

Closed SpekOregonian closed 4 months ago

SpekOregonian commented 1 year ago

Running diagnostics on my ups (https://api.52pi.com/), following messages received;

Power adapter offline.

It seems that your battery is still not fully charged.

You are using a fast charger to charge through the USB-C port.

It is recommended to use a fast charging charger.

I am also experiencing stats freezing like battery percentage and uptime (all three counters). I have re-installed and reseated and experience same issues.

I am running firmware 14 per the registers

Hardware: Raspberry Pi 4b OS: Debian 11 (bullseye) Kernel: 5.15.84-v8+ Firmware: 14

SpekOregonian commented 1 year ago

Per the time counters, between 26 and 30 minutes from power up the counter stops incrementing.

SpekOregonian commented 1 year ago

Output from full featured script The diagnostic page is reporting just the following now;

You are using a fast charger to charge through the USB-C port.

However, Battery Percentage and all timers are frozen. They did increment for a period.

python upsplus/Full-featured-demo-code.py Raspberry Pi power supply voltage: 5.168 V Current current consumption of Raspberry Pi: 1245.416 mA Current power consumption of Raspberry Pi: 6442.389 mW Batteries Voltage: 4.204 V Battery current (charging), rate: 8.049 mA Current battery power supplement: 175.610 mW Current processor voltage: 3306 mV Current Raspberry Pi report voltage: 5218 mV Current battery port report voltage: 4206 mV Current charging interface report voltage (Type C): 8851 mV Current charging interface report voltage (Micro USB): 54 mV Currently charging through Type C. Current battery temperature (estimated): 43 degC Full battery voltage: 4274 mV Battery empty voltage: 3780 mV Battery protection voltage: 3500 mV Battery remaining capacity: 92 % Sampling period: 2 Min Current power state: normal No shutdown countdown! Automatically turn on when there is external power supply! No restart countdown! Accumulated running time: 1821 sec Accumulated charged time: 1829 sec This running time: 1821 sec Version number: 14

SpekOregonian commented 1 year ago

Reboot after disconnecting the USB-C power;

pi@spek-rsp003:~ $ python upsplus/Full-featured-demo-code.py Raspberry Pi power supply voltage: 5.068 V Current current consumption of Raspberry Pi: 1270.311 mA Current power consumption of Raspberry Pi: 6344.828 mW Batteries Voltage: 4.144 V Battery current (discharge), rate: -2060.000 mA Current battery power consumption: 10887.805 mW Current processor voltage: 3306 mV Current Raspberry Pi report voltage: 5218 mV Current battery port report voltage: 4206 mV Current charging interface report voltage (Type C): 8851 mV Current charging interface report voltage (Micro USB): 54 mV Currently charging through Type C. Current battery temperature (estimated): 43 degC Full battery voltage: 4274 mV Battery empty voltage: 3780 mV Battery protection voltage: 3700 mV Battery remaining capacity: 92 % Sampling period: 2 Min Current power state: normal Shutdown countdown: 240 sec Automatically turn on when there is external power supply! Restart countdown: 10 sec Accumulated running time: 1821 sec Accumulated charged time: 1829 sec This running time: 1821 sec Version number: 14

yoyojacky commented 7 months ago

Could you please try to reboot Raspberry Pi and execute this python script again? it seems like the I2C communication has been interrupted ...