Raspberry UPSPack experience

  • Hi,


    I am relatively new to omv, so thought I would share an aspect of my build which was fuelled by an electrician cutting the power to my mad scientist lab by accident and then switching it back on again, along with killing my boot drive in the progress.


    I quickly decided that the electrician had done me a favour, by causing a minor disaster while my NAS build was quite young, rather than waiting for a more natural power failure or power cut and looked for options.


    I initially searched google, youtube, and this forum, and came across one of these on amazon for sub £20



    A RPi UPSPack Standard V3P which seems to be made by Raspberry Pi Club in China and comes with a 4000 to 10000mAh battery.


    Power is fed in via a normal RPi4 charger, which it uses to charge the battery, and once it has recovered the battery to about 50% or more, it then powers the Pi as well.


    This version (and some others) has a header which can be connected to the GPIO pins of the Pi, to supply power, a shutdown output to the pi, and communications to report to the pi on the battery health and level.


    This particular version also has a header for a switch and a power led for external mounting onto a case, and 4 holes for standoffs which line up with the RPi4 so it can be stacked with the Pi.


    The output is 5v (5.1v when I measure it) and at 3 amps, so more than enough to keep the Pi happy.


    Both my main file server NAS and my backup NAS (both OMV) are in Argon cases with built in heat sink, intelligent fan and M.2 SSD, as well as external 3.5 inch magnetic HDD (which is a technical problem yet to sort out).


    But my long term plan is to put both these RPi, another running a 3cx phone server, and a final one running open canary, with the Argon40 fan hats, M.2 USB adapters, the hard drives and these one of these UPS for each RPiinto a 1U 19 inch rack enclosure with internal power supplys.


    For me, the main purpose is to stop unexpected power outages to cause problems for the 4 RPi have running at the moment, so I was not too worried about the size of the battery, as long as it would bridge the effects of short term power loss, and when that power loss is extended that it would then shut the machines down safely. So I opted for the 4000mAh battery version.


    The units come with absolutely no manual or instructions, other than header pins on the board having silk screen markings.


    Fortunately, a bit of a google session found a GitHub page where someone called RCDrones


    Click here for RCDrones Github


    Where he has the latest firmware, manuals and Python scripts for this board (well the V3 - No mention of the V3P there yet)


    I have tried sending RCDrones a message thanking him, but had no reply.


    I also found that RCDrones seems to be a shop on AliExpress that sells this and other UPSPack versions under a store name of RPiClub, so I suspect he is either involved with the development or just sells a lot of them.


    I did not have high hopes for this, I expected it to be a cheap Chinese ill conceived product, but it is really rather awesome!


    Being into my 3D Printer modifications, I had JST connectors (to connect nicely into the UPSPack and some dual row 10 pin Dupont headers for the RPI GPIO end of things, to make up my own loom, but to be honest, all you need is 5 female Dupont style jumper wires which will plug onto the UPSPack header and the RPi header.


    On the header you have...


    +5v which connects to pin 4 of the RPi GPIO

    0v - Which connect to pin 6 of the RPI GPIO

    and three UART coms pins, one of which connect the RPI GPIO pins 8, 10 and 12


    Once the Python script is installed, it seems it sets up an interrupt so that when one of the UART pins is triggered by the UPS pack (when the power to the UPS is disconnected AND the battery has depleted bellow a set level) that the PRI then will issue a shutdown command.


    You can also use the UART pins to communicate with the UPS and get information about battery health and other events, which once I get to grips with Python coding I hope to get a bit fancy with, by using an Arduino (or simpler solution) to keep an eye on the power supply to the board, or the RPi polling a python script on a regular interval and asking the UPS about its status of power supply. and then have one of the RPi to send an email to me saying "Power interupted, now running on battery" and the same for when the power supply comes back in... Along with adding to the UPSPack standard python script with email support to send another email saying "Mayday Mayday, the battery is low, I am going down!"


    This is all part of a bigger plan, to put my two RPi builds with omv, my other one with 3CX and a last one with OpenCanary into a 1U 19" rack enclosure in my rack cab, with one power supply (probably a 12 to 14v) with buck converters supply each UPSPack on each RPi, and also housing another bit of kit/project to solve the remaining problem I have... (which also explains the power supply to the 1U enclosure potentially being more than 5.x volts.


    Obviously the UPSPack supplies power to the RPi, and any USB devices, such as the M.2 drive. However... Both of the RPi OMV builds have a big multi terrabyte traditional 3.5 inch hard drive on them, which currently are via a USB interface with it's own 12v power supply.


    In the event of power loss, the RPi machines will still have battery backed up power, but the hard drives will still have powered up logic in the USB to SATA converters, but the drives themselves will suffer a 12v failure... Which could see data in the cache, or even worse being written at the time of shutdown.


    Ideas I have about solving this include...


    * Using a boost converter connected to the small battery in the UPSpack directly (on the wires between the battery and the UPSPack) to provide 12v to the hard drives... But I am not sure if this would cause the battery problems (overheating etc).... But it would mean that the drives are definitely powered beyond the point of the RPi shutting down, at the pre-set battery low level, however it would also see the drives continuing to be powered until the battery is flat... Which is probably less sensible, unless a put in a small relay powered by an power output of the UPSPack, so whenever the Pi is powered, so is the hard drive.


    * Using a separate DIY UPS (as seen on youtube for powering 12v routers) using a charging controller and some control to charge a separate battery, which then powers the hard disks... Then using the power supply from the UPSPack to close a relay whenever the UPSPack is powering the RPis, so the hard drive will power down whenever the RPi is shutdown...


    The second option is why I was thinking of having a bigger power supply in the rack mount, with buck converters feeding the UPSPacks, and buck converters powering the UPS for the hard drive UPS... But thinking about it, I need to research more about if it is better to power a hard drive from a 12v battery pack with charge controller, or use a lower voltage power supply to supply the UPSPack and lower voltage battery packs, and a boost converter to power the hard drives.


    I mainly wanted to put this information up here, so other members can see how they can inexpensively put a UPS on their OMV RPi builds... But also I am very interested to hear what other people think about supplying power to the traditional hard drives until the RPi shuts down.

  • ryecoaaron

    Hat das Thema freigeschaltet.
  • If I may ask - wouldn't it be far simpler to go with a "real" UPS (APC or Cyberpower) and plug everything into it? You'd have complete protection for all devices including the hard disks, and one of your RPis could communicate with the UPS via USB (and keep the other one in the loop as well).

  • If I may ask - wouldn't it be far simpler to go with a "real" UPS (APC or Cyberpower) and plug everything into it? You'd have complete protection for all devices including the hard disks, and one of your RPis could communicate with the UPS via USB (and keep the other one in the loop as well).

    Of course it would.


    But if we wanted easy, we would just buy an off the peg brand name NAS from Amazon, rather than tinkering about with OMV :)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!