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

UPS not charging batteries correctly #34

Closed hellresistor closed 3 years ago

hellresistor commented 3 years ago

Hello friends. Yesterday have arrived to home and see my rpi off (with no time to check), today i have checked... the UPS are not charge the batteries correctly. Actually batteries have ~2.1V each. I am using a 3Amp quality charger.

Maybe this issue have about the Fw7 ? or hw issue? Or give me a recommendation of batteries brand/model ? i have 4x new brand.. doing the same on both pairs.. I think this it is because I never get the 4 fix led on. always got the 4th blinking.

ArjenR49 commented 3 years ago

You could run my upsPlus.py and redirect its output to a file. Then you'll have some kind of a trail. You can also run my UPS_report.py in cron and redirect its output to a file. It will supply more information. I run upsPlus with output to a file all the time. Maybe I will not do that any longer when I leave it to run for months at a time eventually, but for now. It would be easy to add more output to either script as they both read the whole of the UPS memory into the buffer called aReceiveBuf.

On my UPS the fourth blue led stops blinking when the Pi is off for some time. I noted this when the automatic restart after running PowerCycle started taking 10 minutes on f/w v.7 instead of 15 seconds on f/w v.5. That was enough for the unloaded batteries to get fully charged (being without load). During normal operation charging seems to be stopped during every sampling event when the blue leds go out altogether. That is when the INA219 module reports the batteries supplying power instead of getting charged, and I think it is the reason the fourth blue led is mostly found blinking.

nickfox-taterli commented 3 years ago

If you would like us to assist you with your troubleshooting, you will need to provide your UID to the [after-sales service], please do not provide it here.

ArjenR49 commented 3 years ago

I need to find that service first, then. I assumed this place is it. BTW, I have no problem with batteries not being charged properly. That was the other person who started this issue.

hellresistor commented 3 years ago

If you would like us to assist you with your troubleshooting, you will need to provide your UID to the [after-sales service], please do not provide it here.

ok. i will do reference on this post.

I need to find that service first, then. I assumed this place is it. BTW, I have no problem with batteries not being charged properly. That was the other person who started this issue.

what is website you have purchased the ups?

ArjenR49 commented 3 years ago

I bought my UPS plus board from the 52Pi Official Store on AliExpress.

I have not had problems with the charging as such.

I have had to solve problems with TimeoutError exceptions and failing writes (to 0x18 & 0x1A, the countdown registers). That was really bad, actually. Cost me a lot of time and effort.

The voltage to the Pi is slightly below 5V, but no problems because of that. (headless, no monitor).

It can very well be that the current readings for the battery are off, as somebody wrote in another issue, but otherwise it all seems to wrks logically. When the bluelights go out, the battery is discharging and the UPS collects data about it. The discharging lasts only a short time (less than 15 sec) and the batteries get charged during the rest of the time. Whenever the Pi is off, the batteries get fully charged after a short while and all 4 blue leds stay on.

I am now using Frtz13's scripts. It doesn't have all the same features as what I had built into my scripts, but I was only mimicking another UPS (Olmatic) and these extra features aren't essential to me. After I removed the charger, my Pi ran another hour with the default setting of 3,7V. (This I don't understand; it is waaay higher than what the lithium cells can discharge to safely.)

I think I'll stick to Frtz13's scripts. I can change my own UPS_report.py to fit better with that. It has rounding to significant digits and V, A and W instead of mV, mA and mW. I suppose I could even use my own PowerCycle.py script if I want. So I only replace the GeeekPi's control program (or my own version of it) with fanShutDownUps.py. I don't have the hardware for the Ice Tower fan control now, but that's easy (unless the LEDs can't handle the PWM). The MQTT stuff is totally new to me, but interesting since I have a cottage where I have little servers etc. Frtz's is a complete package and running in the background. Really Nice!