Help getting NUT working with CyberPower UPS

Started by FullyBorked, March 21, 2021, 07:19:44 PM

Previous topic - Next topic
March 22, 2021, 04:52:42 PM #15 Last Edit: March 22, 2021, 04:54:35 PM by FullyBorked
Quote from: genesysguy on March 22, 2021, 04:50:19 PM
Quote from: FullyBorked on March 22, 2021, 04:13:19 PM
Quote from: genesysguy on March 22, 2021, 04:02:16 PM
I did a fresh install yesterday and ran into the same issue with my Cyberpower UPS.

When I looked into the ups.conf file located at /usr/local/etc/nut, I noticed that opnsense was adding several (3) configs for the ups in the file.  I removed the configs that didn't pertain and was left with:

# Please don't modify this file as your changes might be overwritten with
# the next update.
#
[CP1500PFCLCD]
driver=usbhid-ups
port=auto


After saving and rebooting, it worked.  But since there isn't a widget for the UPS like in pfSense, I'm wondering why I wasted so much time mucking with it.

This might explain something too, my config file is pretty much blank.

# Please don't modify this file as your changes might be overwritten with
# the next update.
#
MODE=standalone
~
~


You are looking at nut.conf, not ups.conf

Correct, nut.conf

EDIT: I'm dumb I misread what you posted. 


root@OPNsense:/usr/local/etc/nut # vi nut.conf
# Please don't modify this file as your changes might be overwritten with
# the next update.
#
MODE=standalone

@genesysguy editing the ups.conf file fixed it.  It works now.  I had some extra lines too.

Now that it's added I assume OPNsense will now power down if the battery gets critical? Didn't see any config for that part so assume that's predefined somewhere else.

Quote from: FullyBorked on March 22, 2021, 05:01:48 PM
@genesysguy editing the ups.conf file fixed it.  It works now.  I had some extra lines too.

Now that it's added I assume OPNsense will now power down if the battery gets critical? Didn't see any config for that part so assume that's predefined somewhere else.

Glad it works for you now.  I assume it's an OPNsense bug that causing the extra config to be put in there.
Good question about the shutdown, I don't know. I just moved from pfSense to give this a try.
Once I saw there was no UPS widget, I kind of lost interest.

Quote from: FullyBorked on March 22, 2021, 05:01:48 PM
@genesysguy editing the ups.conf file fixed it.  It works now.  I had some extra lines too.

Now that it's added I assume OPNsense will now power down if the battery gets critical? Didn't see any config for that part so assume that's predefined somewhere else.

this is done by the upsmon.conf but no point modifying it as it will be overwritten in the next update

this is pretty much default and not sure at what % opnsense shuts down.

https://networkupstools.org/docs/man/upsmon.conf.html

AFAIK there is no way in opnsense gui to modify this.

I see that this isn't so much a bug in OPNsense as it is a misunderstanding in the GUI.  You can select each driver from the drop down and select enable/disable it.  I thought just choosing the driver once and ensuring it was selected was enough.  I had to go back through each one and ensure it was de-slected.

I'm new to opnsense from pfsense. this UPS worked fine with the plugin there.

I tried installing this plugin and I also tried all options mentioned here, but NUT just freezes my opnsense UI. Not sure where i look for the logs?

i had to reload all services to get my UI to start working again.

any ideas?

I have a cyberpower UPS connected via USB

As an alternative, my cyberpower UPS works fine in netclient mode.  I run NUT on a raspberry pi (usb connected) and then point to it from my NAS and OPNsense...and monitor via zabbix.
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT