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

    Nut - MEC0003 protocol - instant shut down as soon as nut starts?

    Scheduled Pinned Locked Moved pfSense Packages
    11 Posts 4 Posters 6.4k 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.
    • A Offline
      Andrew453
      last edited by

      Hi.  I've just installed the new nut package which has just reappeared in pfSense 2.3 (thank you).

      I'm using it with an unbranded UPS that reports it's using the MEC0003 protocol over USB.

      I'm using it with the Blazer USB driver which others have reported success on with the MEC0002 protocol (presumably an earlier version).

      However, whenever I enable nut pfSense just instantly shuts down.

      After some debugging, the output from nut when it starts with debug enabled is as below (I disabled the shutdown command so I could see what was going on):

      [2.3-RELEASE][admin@pfsense.home]/root: /usr/local/etc/rc.d/nut.sh start
      starting blazer_usb
      Network UPS Tools - UPS driver controller 2.7.3
      Network UPS Tools - Megatec/Q1 protocol USB driver 0.11 (2.7.3)
      Supported UPS detected with megatec protocol
      Rating information unavailable
      Vendor information unavailable
      Battery runtime will not be calculated (runtimecal not set)
      starting upsd
      Network UPS Tools upsd 2.7.3
      Network UPS Tools upsmon 2.7.3
      kill: No such process
         0.000000     UPS: pfSense@localhost (master) (power value 1)
         0.000210     Using power down flag file /etc/killpower
      Warning: no shutdown command defined!
         0.005554     debug level is '4'
         0.012014     Trying to connect to UPS [pfSense@localhost]
         0.013663     Can not connect to localhost in SSL, continue uncrypted
         0.015678     Logged into UPS pfSense@localhost
         0.016441     pollups: pfSense@localhost
         0.016528     get_var: pfSense@localhost / status
         0.017302     parse_status: [FSD WAIT]
         0.017398     parsing: [FSD]
         0.017445     ups_fsd: pfSense@localhost (first time)
         0.017483     do_notify: ntype 0x0003 (FSD)
         0.017522     UPS pfSense@localhost: forced shutdown in progress
         0.018283     parsing: [WAIT]
         0.018391     Critical UPS: pfSense@localhost
         0.018433     Current power value: 0
         0.018468     Minimum power value: 1
         0.018501     Shutting down any UPSes in MASTER mode...
         0.018534     Setting FSD on UPS pfSense@localhost
         0.019495     This system is a master... waiting for slave logout...
         0.019630     get_var: pfSense@localhost / numlogins
         0.020456     Executing automatic power-fail shutdown
      
      Broadcast Message from admin@pfsense.home
              (/dev/pts/0) at 17:32 BST...
      
      UPS pfSense@localhost: forced shutdown in progress
      
      Broadcast Message from admin@pfsense.home
              (/dev/pts/0) at 17:32 BST...
      
      Executing automatic power-fail shutdown
      
         0.034649     do_notify: ntype 0x0006 (SHUTDOWN)
         0.034720     Auto logout and shutdown proceeding
      
      Broadcast Message from admin@pfsense.home
              (/dev/pts/0) at 17:32 BST...
      
      Auto logout and shutdown proceeding
      
         5.093830     parent: Unable to call shutdown command: (null)
      
      Broadcast Message from root@pfsense.home
              (no tty) at 17:45 BST...
      
      Communications with UPS pfSense@localhost lost
      
      Broadcast Message from root@pfsense.home
              (no tty) at 17:45 BST...
      
      UPS pfSense@localhost is unavailable
      
      

      You can see the status being returned from polling the UPS is "FSD WAIT", and it's the FSD that's prompting the shut down.

      Has anyone seen this before?  Should be I trying a different driver or configuration?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • S Offline
        Sander88
        last edited by

        The UPS reports an empty battery. So probably a driver issue in this case. I would just try different drivers and see which one is working. At least that's how I got mine working.

        1 Reply Last reply Reply Quote 0
        • A Offline
          Andrew453
          last edited by

          OK. Thanks.  I'll keep trying.

          Do you know what these options are for please?

          Local UPS Generic Type
          Local UPS Cable Type

          The options don't seem to be specific to the selected UPS type?

          1 Reply Last reply Reply Quote 0
          • A Offline
            Andrew453
            last edited by

            … it looks like those extra options are needed for some of the drivers.

            I do wonder if some of the drivers are missing from the port though. Selecting a number of the drivers from the pull down menu in pfSense gives a "file not found" for the corresponding driver that should be in /usr/local/libexec/nut/ but isn't.

            e.g. Selecting the Mustek UPSs give the following error:
            [2.3-RELEASE][admin@pfsense.home]/root: /usr/local/etc/rc.d/nut.sh start
            starting megatec
            Network UPS Tools - UPS driver controller 2.7.3
            Can't start /usr/local/libexec/nut/megatec: No such file or directory
            megatec failed to start

            Similarly, selecting the Cyber Power UPSs give the following error:

            [2.3-RELEASE][admin@pfsense.home]/root: /usr/local/etc/rc.d/nut.sh start
            starting cyberpower
            Network UPS Tools - UPS driver controller 2.7.3
            Can't start /usr/local/libexec/nut/cyberpower: No such file or directory
            cyberpower failed to start

            1 Reply Last reply Reply Quote 0
            • T Offline
              tha_toadman
              last edited by

              Andrew,

              I had similar troubles when I first started using NUT. I was told that if your battery is USB, to always use:

              APC Back-UPS USB

              I have a CyberPower battery and this has always worked for me, even though that drop down menu is present and all. From my experience with it, that menu is useless.

              I hope this helps!

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

                It seems that the NUT package was originally written against a pretty old version of NUT.

                Looking at the NUT hardware compatibility list

                http://networkupstools.org/stable-hcl.html

                neither "megatec" not "cyberpower" are valid drivers in the current release.

                Looking at NUT release notes, it appears that megatec driver was merged into into the blazer_ser and blazer_usb drivers, which are subsequently being replaced by the nutdrv_qx driver. Old CyberPower UPSs are now handled by the powerpanel driver.

                Although the drivers are installed in the filesystem, there is no way to select the blazer_ser, nutdrv_qa or powerpanel drivers in the current version of the package. I believe the guys that did the port were kicking around the idea of updating the package config to be based on NUT drivers rather than UPS models, which would address the issue.

                1 Reply Last reply Reply Quote 0
                • A Offline
                  Andrew453
                  last edited by

                  Ok,  thanks.  That sounds like a sensible approach, not least because it would make it much clearer what drivers to try if you don't know which is compatible with your UPS.  If you work through the list at the moment, you try the same driver loads of times and/or pick some that are not installed at all,  which makes a trial and error approach to setting it up more challenging.

                  I might try configuring the driver manually in the conf files to see if I can get it to work.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    Andrew453
                    last edited by

                    I've tried every single driver combination - none of them work.  The UPS isn't recognised at all on the other drivers.  The Blazer USB driver is the only one that recognises the UPS, but using any subdriver gives the same result - instant power down of the firewall.

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

                      My recommendation would be to disable the NUT package in the UI and then work directly with NUT commands and configuration files (/usr/local/etc/nut) to see if there is a NUT configuration that works with your UPS. This will give you better information and allow you to avoid a shutdown with drivers that don't work. There appear to be several sub drivers for the blazer usb driver. This might be a place to start.

                      The best place for direct help with NUT would be their support page:

                      http://networkupstools.org/support.html

                      1 Reply Last reply Reply Quote 0
                      • A Offline
                        Andrew453
                        last edited by

                        Yes,  I was working from the command line and was referencing each driver in the driver directory rather than working through the UI. No luck unfortunately.

                        I also tried another UPS with the MEC0002 protocol - same result.

                        Is the FSD command generated by the UPS,  or at the driver level by comparing voltages to thresholds etc?  If the latter could it be something to do with the voltage configuration?

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

                          FWIW, looking at the NUT user support list, there are several references to the MEC0003 protocol. These are probably worth a read. There are references to both the blazer_usb and nutusb_qx drivers, and both of these drivers have a ton of configuration items that appear to be required.

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