SOLVED OpenUPS2 success

Status
Not open for further replies.

skis4hire

Cadet
Joined
May 28, 2014
Messages
3
I'm running FreeNAS 9.3-RELEASE and have an OpenUPS2 as here:
http://www.mini-box.com/OpenUPS2

FreeNAS runs a program called NUT (network ups tools) for the UPS service.
NUT officially only supports the OpenUPS but not the OpenUPS2 (actually recently fixed but hasn't made it to FreeNAS yet)

The solution is very simple.
Place the text "productid=d005" in the "auxiliary parameters" field
of the UPS Service settings page in FreeNAS.

I've confirmed that I get notifications (console and email) when the power is unplugged, and when it plugs back in. With the "UPS On Battery" option for shutdown and 30s timer I verified that the UPS service will shut down the system in an orderly fashion after power loss. I occasionally get a COMMBAD alert by email but it seems to be an intermittent polling issue with the driver and has no effect on operation.

If you're having any issue getting it to work, first check is that the USB connection is recognized. If you look in the console there is a boot message like below indicating the UPS is identified by the operating system.

Code:
freenas kernel: ugen0.3: <Mini-Box.Com> at usbus0
freenas kernel: uhid0: <Mini-Box.Com OPEN-UPS2, class 0/0, rev 2.00/0.03, addr 3> on usbus0


In this case it also means you should select select ugen0.3 in the UPS config page.

If you want to test or debug anything you can open the shell and do the following:

(this assumes you've already tried to start the UPS using the GUI and specified "ups1" as the identifier in the UPS config page, which will setup the config files especially ups.conf)

verify /usr/local/etc/nut/ups.conf exists and has an entry under "ups1".

run upsd to start the UPS service (See the MAN page for details)
run "upsc ups1" to list details about the UPS.

Code:
[root@freenas] ~# upsc ups1
battery.capacity: 100
battery.charge: 100
battery.charge.low: 5
battery.charge.warning: 20
battery.current: 0.000
battery.mfr.date:
battery.runtime: 3932100
battery.temperature: 28.09
battery.type:
battery.voltage: 10.14
device.mfr: Mini-Box.Com
device.model: OPEN-UPS2
device.serial: LI-ION
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen0.3
driver.parameter.productid: d005
driver.version: 2.7.2
driver.version.data: openUPS HID 0.1
driver.version.internal: 0.38
input.current: 0.000
input.voltage: 432.42
output.current: 0.000
output.voltage: 313.20
ups.mfr: Mini-Box.Com
ups.model: OPEN-UPS2
ups.productid: d005
ups.serial: LI-ION
ups.status: OL
ups.vendorid: 04d8
[root@freenas] ~#


Note some of the values like voltage are whacky, from what I can tell this may be fixed in a future version of NUT but does not affect operation in the mean time.

You may also need to manually start the driver. The driver for OpenUPS2 is "usbhid-ups"
You can run it with the following:

Code:
/usr/local/libexec/nut/usbhid-ups -u root -x productid=d005 -a ups1


note the productid=d005 is the added config info needed for the OpenUPS2 from the FreeNAS GUI mentioned above.

You may get a bunch of errors when you run this. For me it output a bunch of info about the UPS and then eventually gave a "libusb_get_report: Unknown error". However this does not seem to impact the functioning of the UPS. upsd responds when the power is pulled and plugged back in, will shutdown the system in an orderly fashion, and sends emails just fine.

Anyway, hopefully this is way too much info as all you really need to do is enter the 1 line in the auxiliary parameters box.
 
Status
Not open for further replies.
Top