Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    NUT package (2.8.0 and below)

    Scheduled Pinned Locked Moved UPS Tools
    1.2k Posts 128 Posters 4.0m Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kevindd992002 @dennypage
      last edited by

      @dennypage

      That's what I thought.

      So if I set both overrides, the master will send a shutdown order whichever between the two thresholds it hits first, correct? And I believe you also have to set the "warning" override to be higher than the "low" override?

      Yes, that's what I thought but it's just that in our place, whenever a blackout occurs, it's a long one. So keeping it in battery mode until depleted is not achieving anything. When a blackout occurs, no one will ever stream off of the NAS anyway because all streaming devices are forcefully turned off by the blackout :) So might as well conserve battery charge (hence savings a bit of its life more), if you know what I mean. So yeah, I guess it really just depends on the use case.

      dennypageD 1 Reply Last reply Reply Quote 0
      • dennypageD
        dennypage @kevindd992002
        last edited by

        @kevindd992002 said in NUT package:

        @dennypage
        So if I set both overrides, the master will send a shutdown order whichever between the two thresholds it hits first, correct? And I believe you also have to set the "warning" override to be higher than the "low" override?

        Whichever comes first is correct. Warning is essentially just a syslog entry.

        K 1 Reply Last reply Reply Quote 0
        • K
          kevindd992002 @dennypage
          last edited by

          @dennypage

          Gotcha. Is the battery.runtime.low threshold the time left in the battery's charge or the total time the UPS is running without connection to the mains?

          dennypageD 1 Reply Last reply Reply Quote 0
          • dennypageD
            dennypage @kevindd992002
            last edited by

            @kevindd992002

            They are both "low" conditions. The NUT documentation describes this.

            K 1 Reply Last reply Reply Quote 0
            • K
              kevindd992002 @dennypage
              last edited by

              @dennypage

              Ok. I'm testing NUT now with only pfsense running as the master and no slaves. I'm noticing a very strange behavior that totally doesn't make sense to me. So here's what I did (in chronological order):

              1. Set override.battery.charge.warning to 55 and override.battery.charge.low to 50.
              2. I started with a full charge battery and unplugged the UPS from the mains.
              3. The UPS status in the pfsense picked up the change and says Online, discharging.
              4. As soon as the battery charge hits 50, the state changed to FSD which is what is expected. So far so good.
              5. Since no slaves are present, the pfsense box turned off itself pretty quick.
              6. The UPS waited for a few more seconds before it finally cut off the load power to the rest of its ports. All good.
              7. Now I plug the mains back into the UPS. As soon as I do this, the UPS turns on BUT stays at battery mode (so discharging).
              8. It supplies power back to all ports and pfsense and the other devices started booting.
              9. Then the UPS itself detects that the battery charge is still below 50% (of course, because it needs time to charge and it is even at a discharging state now) and then a few seconds later the unit turns off again. It seems that the killpower command given to it by the pfsense is still being enforced even though the mains is already connected and providing power.
              10. Then it turns on by itself again. And this vicious cycle continues over and over until I disconnected the USB serial connection in the back of the UPS.

              What have I done wrong here? Why doesn't the UPS detect that the mains power is already back when the USB serial connection is plugged in. It seems to me that the command given by the pfsense NUT package is messing the behavior of the UPS.

              dennypageD 1 Reply Last reply Reply Quote 0
              • dennypageD
                dennypage @kevindd992002
                last edited by

                @kevindd992002

                The pfSense NUT package doesn't send commands to the UPS. The package generates the NUT configuration, the result of which you can find in /usr/local/etc/nut. All communication with the UPS is handled by NUT.

                If the UPS is staying on battery after the mains are restored, either the UPS is defective or it needs a startup delay configured. The NUT documentation has information on startup delays.

                K 1 Reply Last reply Reply Quote 0
                • K
                  kevindd992002 @dennypage
                  last edited by

                  @dennypage

                  I don't think the UPS is defective because when I directly connect the USB cable to a Windows machine with PowerChute installed, everything works just fine when I do the same test.

                  Why would it need a startup delay?

                  dennypageD 1 Reply Last reply Reply Quote 0
                  • Q
                    q54e3w
                    last edited by

                    Because it configures the amount to recharge the UPS to before turning back on. You can simulate by leave load off whilst the batteries charge back to 90% and when you power up you’ll see it operate correctly.
                    Read up on the startup delay Denny mentioned. It’s probably your answer.

                    K 1 Reply Last reply Reply Quote 0
                    • dennypageD
                      dennypage @kevindd992002
                      last edited by

                      @kevindd992002

                      You said “... I plug the mains back into the UPS. As soon as I do this, the UPS turns on BUT stays at battery mode (so discharging). It supplies power back to all ports ...”

                      If the UPS stays on battery even though mains have been restored, then that is a defect. It may be “by design” but it is still a defect. The UPS should return to main power before reenergizing the ports.

                      Sometimes you can work around defect by design issues like this by setting delay parameters in the UPS, which is why I suggested that you read up on the various delay values. Ups.delay.start in particular.

                      K 1 Reply Last reply Reply Quote 0
                      • K
                        kevindd992002 @dennypage
                        last edited by

                        @dennypage

                        Exactly. But like I said, this only happens when the USB cable is plugged unto NUT. So there's somrthing going on with the UPS when NUT issues a killpower order. I would've noticed this issue long ago (when I wasn't still using NUT) if it also occured when using PowerChute, or if it happens when the USB serial cable is unplugged. Does that make sense?

                        Yes, I will read up on that delay parameter later.

                        1 Reply Last reply Reply Quote 0
                        • K
                          kevindd992002 @q54e3w
                          last edited by

                          @q54e3w said in NUT package:

                          Because it configures the amount to recharge the UPS to before turning back on. You can simulate by leave load off whilst the batteries charge back to 90% and when you power up you’ll see it operate correctly.
                          Read up on the startup delay Denny mentioned. It’s probably your answer.

                          In the NUT user manual (variables section), it says this:

                          ups.delay.start - Interval to wait before restarting the load (seconds)

                          This is in seconds. How does that description relate to what you said (it configures the amount to recharge the UPS to before turning back on)? Sorry, I'm confused and I can't find any start delay variable description that is close to what you're describing.

                          1 Reply Last reply Reply Quote 0
                          • dennypageD
                            dennypage
                            last edited by

                            Run your 10 count test again. After step 6, unplug the serial cable. How long does it take after step 7 does it take for the ups to come off battery and return to the mains? That is The startup delay you are trying to achieve.

                            K 1 Reply Last reply Reply Quote 0
                            • Q
                              q54e3w
                              last edited by

                              If it only happens when the USB cable is connected then its possible your master is detecting the low battery condition still exists and instigating the shutdown again, this is potentially a poor driver or faulty hardware. Which brand & model is this?
                              The UPS should be should report its on mains power which should prevent this. With my APC and Eaton units (both with network cards) I rcall shutdown only triggered when (on battery AND battery charge < X%).

                              1 Reply Last reply Reply Quote 0
                              • K
                                kevindd992002 @dennypage
                                last edited by

                                @dennypage said in NUT package:

                                Run your 10 count test again. After step 6, unplug the serial cable. How long does it take after step 7 does it take for the ups to come off battery and return to the mains? That is The startup delay you are trying to achieve.

                                @q54e3w said in NUT package:

                                If it only happens when the USB cable is connected then its possible your master is detecting the low battery condition still exists and instigating the shutdown again, this is potentially a poor driver or faulty hardware. Which brand & model is this?
                                The UPS should be should report its on mains power which should prevent this. With my APC and Eaton units (both with network cards) I rcall shutdown only triggered when (on battery AND battery charge < X%).

                                I think I know what I did wrong. In step 7, I plugged the mains too early causing a power race condition as described by point #51 here . I thought that when APC BR1500GI's display went black (even with the fans still running) it is already in a shutdown state. This was not the case, it waited for a few more seconds until it totally went silent. At that time, I plugged the mains back and everything was working as expected :)

                                A question regarding the workaround implementation on point #51 of that FAQ article though. Where, in the pfsense NUT package, do I implement that if statement?

                                dennypageD 1 Reply Last reply Reply Quote 0
                                • dennypageD
                                  dennypage @kevindd992002
                                  last edited by

                                  @kevindd992002

                                  Unless you have a “stupid” ups, no. You may want to read up on offdelay and ondelay. But likely there is nothing else you need do. Just be happy.

                                  K 1 Reply Last reply Reply Quote 0
                                  • K
                                    kevindd992002 @dennypage
                                    last edited by

                                    @dennypage

                                    What do you mean no?

                                    Well, there's still a chance (though slim) that a power race condition will happen. So might as well implement thst if statement as a workaround, no?

                                    dennypageD 1 Reply Last reply Reply Quote 0
                                    • dennypageD
                                      dennypage @kevindd992002
                                      last edited by

                                      @kevindd992002 said in NUT package:

                                      @dennypage

                                      What do you mean no?

                                      No as in no you don’t need to.

                                      K 1 Reply Last reply Reply Quote 0
                                      • K
                                        kevindd992002 @dennypage
                                        last edited by kevindd992002

                                        @dennypage

                                        I'm confused. I was able to recreate the power race problem. Are you saying that this happens with a very low probability that makes it not worth applying the workaround? Sorry, I know I'm persistent but I'm just into the nitty-gritty details.

                                        EDIT:

                                        Also, do you have any ideas about this? https://forum.netgate.com/topic/109510/upsmon-parent-process-died-shutdown-impossible/5 . I'm encountering the same issue every now and then.

                                        K 1 Reply Last reply Reply Quote 0
                                        • K
                                          kevindd992002 @kevindd992002
                                          last edited by

                                          @dennypage

                                          Would you be able to continue helping me? Thanks.

                                          dennypageD 1 Reply Last reply Reply Quote 0
                                          • dennypageD
                                            dennypage @kevindd992002
                                            last edited by

                                            @kevindd992002

                                            I’m traveling, so it’s a bit hard atm. Not sure what additional help you need. Not sure what you tested was the issue referred to in the link. Regardless, offdelay and ondelay are likely what you need to look at.

                                            K 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.