SOLVED How to configure the ups service for APC's BE700Y-IND

Status
Not open for further replies.

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
This is essentially just a transcript of the terminal log from someone who managed to turn on the UPS service for his UPS using NUT's usbhid-ups driver. The "Auxiliary Parameters" that make FreeNAS work with BE700Y-IND are mentioned below and if you are in a hurry, just try putting them in the GUI. Otherwise, this might be slightly useful for configuring the UPS service for other UPS models also.

This write-up targets home users with a single UPS. What is suggested here might not be optimal for organizations with multiple UPS.

Warning: This document should not encourage you to type ups commands willy-nilly as sudo on your primary storage! A wrong command can cause an abrupt shutdown and you could lose your data. Be very careful with UPS commands, especially with sudo or as root.

About the UPS
BE700Y-IND is a replacement for APC BACK-UPS ES 700VA 230V, probably just for India. The previous version didn't have any interface ports. My decision to buy it was based on APC's literature that claimed it is plug-and-play with Macs, so I assumed the protocol was not (entirely) proprietary.

There is also a BE800Y with higher wattage, but no interface ports. For my purpose, the wattage provided by BE700Y-IND was just fine.

Getting Started

Once I plugged it in, I noticed this in /var/log/messages
Oct 2 10:59:04 freenas-primary kernel: ugen0.3: <American Power Conversion> at usbus0

If you are trying to find the usb port you need to specify in the GUI for UPS settings, grep for 'American Power Conversion' or a suitable substring if you have an APC UPS. That "ugen0.3" thing is the usb port number you have to enter the Port field of "UPS Settings".

You could also try "usbconfig" as root or with sudo. Mine gave me this:

ugen0.1: <EHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <product 0x07db vendor 0x8087> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.3: <Back-UPS ES 700Y-IND FW895.p1.I USB FWp1 American Power Conversion> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (2mA)
ugen0.4: <Virtual Hub American Megatrends Inc.> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA)
ugen0.5: <Virtual Keyboard and Mouse American Megatrends Inc.> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (0mA)

My first approach was to try all the APC drivers, starting with the one that matched most closely with my model. None of them worked. I kept getting this in /var/log/messages:
Oct 1 17:36:51 freenas-primary notifier: nut not running? (check /var/db/nut/upsd.pid).
Oct 1 17:44:27 freenas-primary notifier: nut not running? (check /var/db/nut/upsd.pid).
Oct 1 17:44:27 freenas-primary notifier: nut_upsmon not running? (check /var/db/nut/upsmon.pid).
Oct 1 17:44:28 freenas-primary notifier: nut_upslog not running? (check /var/db/nut/upslog.pid).
Oct 1 17:44:28 freenas-primary notifier: Will not 'restart' nut because nut_enable is NO.
Oct 1 17:44:28 freenas-primary notifier: Will not 'restart' nut_upsmon because nut_upsmon_enable is NO.
Oct 1 17:44:28 freenas-primary notifier: Will not 'restart' nut_upslog because nut_upslog_enable is NO.
Oct 1 17:44:38 freenas-primary notifier: nut not running? (check /var/db/nut/upsd.pid).
Oct 1 17:44:38 freenas-primary notifier: nut_upsmon not running? (check /var/db/nut/upsmon.pid).
Oct 1 17:44:38 freenas-primary notifier: nut_upslog not running? (check /var/db/nut/upslog.pid).
Oct 1 17:44:38 freenas-primary notifier: nut not running? (check /var/db/nut/upsd.pid).
Oct 1 17:44:38 freenas-primary root: Unknown USB device: vendor 0x051d product 0x0002 bus uhub1
Oct 1 17:44:39 freenas-primary notifier: Using subdriver: APC HID 0.95
Oct 1 17:44:39 freenas-primary notifier: Network UPS Tools - Generic HID driver 0.38 (2.7.1)
Oct 1 17:44:39 freenas-primary notifier: USB communication driver 0.32
Oct 1 17:44:39 freenas-primary notifier: libusb_get_report: Unknown error
Oct 1 17:44:39 freenas-primary notifier: Can't initialize data from HID UPS
Oct 1 17:44:39 freenas-primary notifier: Driver failed to start (exit status=1)
Oct 1 17:44:39 freenas-primary notifier: Network UPS Tools - UPS driver controller 2.7.1
Oct 1 17:44:39 freenas-primary root: /usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut
Oct 1 17:44:39 freenas-primary notifier: /usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut
Oct 1 17:44:39 freenas-primary notifier: nut_upsmon not running? (check /var/db/nut/upsmon.pid).
Oct 1 17:44:39 freenas-primary notifier: Starting nut_upsmon.
Oct 1 17:44:39 freenas-primary notifier: kill: No such process
Oct 1 17:44:39 freenas-primary notifier: UPS: BE700Y-IND (master) (power value 1)
Oct 1 17:44:39 freenas-primary upsmon[25950]: UPS [BE700Y-IND]: connect failed: Connection failure: Connection refused
Oct 1 17:44:39 freenas-primary upsmon[25950]: Communications with UPS BE700Y-IND lost
Oct 1 17:44:39 freenas-primary notifier: nut_upslog not running? (check /var/db/nut/upslog.pid).
Oct 1 17:44:39 freenas-primary notifier: Starting nut_upslog.
Oct 1 17:44:39 freenas-primary notifier: Warning: initial connect failed: Connection failure: Connection refused
Oct 1 17:44:40 freenas-primary notifier: Stopping nut_upslog.
Oct 1 17:44:40 freenas-primary notifier: Waiting for PIDS: 25978.
Oct 1 17:44:41 freenas-primary notifier: Stopping nut_upsmon.
Oct 1 17:45:04 freenas-primary upsmon[25949]: upsmon parent: read
Oct 1 17:45:05 freenas-primary notifier: Waiting for PIDS: 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950, 25950.

After some googling, I came across this post that advised liberalising the permissions for /dev/ugenX.Y, because the driver needs to read/write to it. I'm not sure what it runs as, so I changed it to 777 but it didn't help me. I also created a upsmon user, gave it a password, changed ownership of the port to it, but still, nothing.

Digging Deeper

After enough Googling I realised that the GUI translates to /etc/local/nut/ups.conf. Mine looked like this:

index.php


And the ups.conf was

[BE700Y-IND]
driver = usbhid-ups
port = /dev/ugen0.3
desc = ""

Note that there is no mention of exactly which driver was selected in the GUI. The selection of UPS model in the GUI only helps narrow down the choice of driver to usb, generic (serial) or network.

The documentation for usbhid-ups, upsdrvctl & ups.conf mention some ways of debugging/printing what happens when the UPS driver tries to communicate with your UPS, but its not obvious how to do that from the GUI. This page mentions how to run the usb driver "by hand", which is also what is attempted when you try to turn on the UPS service from FreeNAS GUI. Basically, it runs
Code:
/usr/local/libexec/nut/upsdrvctl start
.
This takes the UPS settings from /etc/local/nut/ups.conf and runs the actual driver (usbhid-ups, in my case) with those parameters in the command line. I tried that:
Code:
sudo /usr/local/libexec/nut/upsdrvctl -DD start

which gave me this:
Network UPS Tools - UPS driver controller 2.7.1
0.000000

If you're not a NUT core developer, chances are that you're told to enable debugging to see why a driver isn't working for you. We're sorry for the confusion, but this is the 'upsdrvctl' wrapper, not the driver you're interested in.

Below you'll find one or more lines starting with 'exec:' followed by an absolute path to the driver binary and some command line option. This is what the driver starts and you need to copy and paste that line and append the debug flags to that line (less the 'exec:' prefix).

0.000146 Starting UPS: BE700Y-IND
0.000178 exec: /usr/local/libexec/nut/usbhid-ups -a BE700Y-IND
Network UPS Tools - Generic HID driver 0.38 (2.7.1)
USB communication driver 0.32
No matching HID UPS found
0.079297 Driver failed to start (exit status=1)

Ok, so I need to run this
Code:
/usr/local/libexec/nut/usbhid-ups -a BE700Y-IND


Here's what I got:
[saurav@freenas-primary /usr/local/etc/nut]$ sudo /usr/local/libexec/nut/usbhid-ups -DD -a BE700Y-IND

Network UPS Tools - Generic HID driver 0.38 (2.7.1)
USB communication driver 0.32
0.000000 debug level is '2'
0.000940 upsdrv_initups...
0.001611 Checking device (046B/FF10) (/dev/usb//dev/ugen0.5)
0.003047 - VendorID: 046b
0.003067 - ProductID: ff10
0.003079 - Manufacturer: American Megatrends Inc.
0.003088 - Product: Virtual Keyboard and Mouse
0.003097 - Serial Number: unknown
0.003106 - Bus: /dev/usb
0.003114 Trying to match device
0.003130 Device does not match - skipping
0.003183 Checking device (046B/FF01) (/dev/usb//dev/ugen0.4)
0.004796 - VendorID: 046b
0.004817 - ProductID: ff01
0.004829 - Manufacturer: American Megatrends Inc.
0.004838 - Product: Virtual Hub
0.004847 - Serial Number: serial
0.004856 - Bus: /dev/usb
0.004864 Trying to match device
0.004876 Device does not match - skipping
0.004922 Checking device (051D/0002) (/dev/usb//dev/ugen0.3)
0.077308 - VendorID: 051d
0.077340 - ProductID: 0002
0.077351 - Manufacturer: American Power Conversion
0.077361 - Product: Back-UPS ES 700Y-IND FW:895.p1.I USB FW:p1
0.077371 - Serial Number: E21423018588
0.077379 - Bus: /dev/usb
0.077388 Trying to match device
0.077419 Device does not match - skipping
0.077489 Checking device (8087/07DB) (/dev/usb//dev/ugen0.2)
0.077618 - VendorID: 8087
0.077636 - ProductID: 07db
0.077647 - Manufacturer: unknown
0.077656 - Product: unknown
0.077665 - Serial Number: unknown
0.077673 - Bus: /dev/usb
0.077682 Trying to match device
0.077694 Device does not match - skipping
0.077739 Checking device (0000/0000) (/dev/usb//dev/ugen0.1)
0.077855 - VendorID: 0000
0.077873 - ProductID: 0000
0.077885 - Manufacturer: Intel
0.077894 - Product: EHCI root HUB
0.077903 - Serial Number: unknown
0.077912 - Bus: /dev/usb
0.077920 Trying to match device
0.077931 Device does not match - skipping
0.077975 No appropriate HID device found
0.077992 No matching HID UPS found
So, the driver can "see" my ups at ugen0.3 just fine, only that it doesn't realize its an UPS that it can talk to. So may be I need to be more specific about exactly what to look for?

The manpage for usbhid-ups lists all the parameters that can be passed to the driver, so I tried to make it as specific as possible:
[BE700Y-IND]
driver = usbhid-ups
port = /dev/ugen0.3
desc = ""
vendorid=051d
serial=XXXXXXXXXXXX
productid=0002
vendor=American.Power.Conversion
product=Back-UPS.ES.700Y-IND.*
bus=/dev/usb
Still, no dice. And it was getting painful switching back & forth between the terminal and the GUI. I needed some way to pass these parameters from the command-line itself. And, sure enough, the man page for usbhid-ups and "/usr/local/libexec/nut/usbhid-ups -h" would both tell you how to: just use the "-x" flag. So I tried this
Code:
sudo /usr/local/libexec/nut/usbhid-ups -DD -x vendorid=051d -x productid=0002

But then you'd get
Network UPS Tools - Generic HID driver 0.38 (2.7.1)
USB communication driver 0.32
0.000000 Error: specifying '-a id' is now mandatory. Try -h for help.
So, you must have a section created in /etc/local/nut/ups.conf with minimal information, while the rest can be passed the rest from command line.

Also, last time, I was probably too specific. May be I passed "too much information" to the driver? This time, I'd only be as specific as I need to be. So the ups.conf looks like
[BE700Y-IND]
driver = usbhid-ups
port = /dev/ugen0.3
desc = ""
while I ran
Code:
sudo /usr/local/libexec/nut/usbhid-ups -DD -x vendorid=051d -x productid=0002 -a BE700Y-IND

And voila! something was happening!

....
0.004813 Checking device (051D/0002) (/dev/usb//dev/ugen0.3)
0.076839 - VendorID: 051d
0.076869 - ProductID: 0002
0.076880 - Manufacturer: American Power Conversion
0.076889 - Product: Back-UPS ES 700Y-IND FW:895.p1.I USB FW:p1
0.076898 - Serial Number: E21423018588
0.076907 - Bus: /dev/usb
0.076915 Trying to match device
0.076955 Device matches
0.570971 HID descriptor length 1149
0.813829 Report Descriptor size = 1149
0.814761 Using subdriver: APC HID 0.95
0.817460 Path: UPS.PowerSummary.iProduct, Type: Feature, ReportID: 0x01, Offset: 0, Size: 8, Value: 1
0.821204 Path: UPS.PowerSummary.iSerialNumber, Type: Feature, ReportID: 0x02, Offset: 0, Size: 8, Value: 2
0.823829 Path: UPS.PowerSummary.iManufacturer, Type: Feature, ReportID: 0x03, Offset: 0, Size: 8, Value: 3
0.827452 Path: UPS.PowerSummary.iOEMInformation, Type: Feature, ReportID: 0x04, Offset: 0, Size: 8, Value: 3
0.831330 Path: UPS.PowerSummary.iDeviceChemistry, Type: Feature, ReportID: 0x05, Offset: 0, Size: 8, Value: 4
0.833954 Path: UPS.PowerSummary.Rechargeable, Type: Feature, ReportID: 0x06, Offset: 0, Size: 8, Value: 1
0.833982 Path: UPS.PowerSummary.CapacityMode, Type: Feature, ReportID: 0x06, Offset: 8, Size: 8, Value: 2
0.837580 Path: UPS.PowerSummary.DesignCapacity, Type: Feature, ReportID: 0x0e, Offset: 0, Size: 8, Value: 100
0.837609 Path: UPS.PowerSummary.FullChargeCapacity, Type: Feature, ReportID: 0x0e, Offset: 8, Size: 8, Value: 100
0.839201 libusb_get_report: Unknown error
0.839302 Can't retrieve Report 0c: Input/output error
0.839325 Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID: 0x0c, Offset: 0, Size: 8
0.841443 libusb_get_report: Unknown error
0.841465 Can't retrieve Report 0c: Input/output error
0.841482 Path: UPS.PowerSummary.RemainingCapacity, Type: Feature, ReportID: 0x0c, Offset: 0, Size: 8
0.843954 Path: UPS.PowerSummary.CapacityGranularity1, Type: Feature, ReportID: 0x10, Offset: 0, Size: 8, Value: 1
0.843983 Path: UPS.PowerSummary.CapacityGranularity2, Type: Feature, ReportID: 0x10, Offset: 8, Size: 8, Value: 1
0.847579 Path: UPS.PowerSummary.WarningCapacityLimit, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 8, Value: 50
0.851455 Path: UPS.PowerSummary.RemainingCapacityLimit, Type: Feature, ReportID: 0x11, Offset: 0, Size: 8, Value: 10
0.854081 Path: UPS.PowerSummary.ManufacturerDate, Type: Feature, ReportID: 0x09, Offset: 0, Size: 16, Value: 17605
0.857830 Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x0d, Offset: 0, Size: 16, Value: 4927
0.857858 Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, ReportID: 0x0d, Offset: 0, Size: 16, Value: 4927
0.861457 Path: UPS.PowerSummary.DelayBeforeShutdown, Type: Feature, ReportID: 0x12, Offset: 0, Size: 16, Value: -1
0.863954 Path: UPS.PowerSummary.DelayBeforeReboot, Type: Feature, ReportID: 0x13, Offset: 0, Size: 24, Value: 0
0.867864 Path: UPS.PowerSummary.RemainingTimeLimit, Type: Feature, ReportID: 0x08, Offset: 0, Size: 16, Value: 120
0.871583 Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x0a, Offset: 0, Size: 16, Value: 12
0.874204 Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x0b, Offset: 0, Size: 16, Value: 13.67
0.877829 Path: UPS.PowerSummary.AudibleAlarmControl, Type: Feature, ReportID: 0x14, Offset: 0, Size: 8, Value: 2
0.881580 Path: UPS.PowerSummary.PresentStatus.Charging, Type: Input, ReportID: 0x07, Offset: 0, Size: 1, Value: 0
0.881609 Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x07, Offset: 0, Size: 1, Value: 0
0.881630 Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Input, ReportID: 0x07, Offset: 1, Size: 1, Value: 0
0.881650 Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x07, Offset: 1, Size: 1, Value: 0
0.881672 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x07, Offset: 2, Size: 1, Value: 1
0.881694 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x07, Offset: 2, Size: 1, Value: 1
0.881715 Path: UPS.PowerSummary.PresentStatus.BatteryPresent, Type: Input, ReportID: 0x07, Offset: 3, Size: 1, Value: 1
0.881736 Path: UPS.PowerSummary.PresentStatus.BatteryPresent, Type: Feature, ReportID: 0x07, Offset: 3, Size: 1, Value: 1
0.881757 Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Input, ReportID: 0x07, Offset: 4, Size: 1, Value: 0
0.881779 Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x07, Offset: 4, Size: 1, Value: 0
0.881799 Path: UPS.PowerSummary.PresentStatus.ShutdownRequested, Type: Input, ReportID: 0x07, Offset: 5, Size: 1, Value: 0
0.881819 Path: UPS.PowerSummary.PresentStatus.ShutdownRequested, Type: Feature, ReportID: 0x07, Offset: 5, Size: 1, Value: 0
0.881839 Path: UPS.PowerSummary.PresentStatus.ShutdownImminent, Type: Input, ReportID: 0x07, Offset: 6, Size: 1, Value: 0
0.881859 Path: UPS.PowerSummary.PresentStatus.ShutdownImminent, Type: Feature, ReportID: 0x07, Offset: 6, Size: 1, Value: 0
0.881879 Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Input, ReportID: 0x07, Offset: 7, Size: 1, Value: 0
0.881899 Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Feature, ReportID: 0x07, Offset: 7, Size: 1, Value: 0
0.881928 Path: UPS.PowerSummary.PresentStatus.CommunicationLost, Type: Input, ReportID: 0x07, Offset: 8, Size: 1, Value: 0
0.881947 Path: UPS.PowerSummary.PresentStatus.CommunicationLost, Type: Feature, ReportID: 0x07, Offset: 8, Size: 1, Value: 0
0.881961 Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Input, ReportID: 0x07, Offset: 9, Size: 1, Value: 0
0.881973 Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Feature, ReportID: 0x07, Offset: 9, Size: 1, Value: 0
0.881989 Path: UPS.PowerSummary.PresentStatus.Overload, Type: Input, ReportID: 0x07, Offset: 10, Size: 1, Value: 0
0.882003 Path: UPS.PowerSummary.PresentStatus.Overload, Type: Feature, ReportID: 0x07, Offset: 10, Size: 1, Value: 0
0.882017 Path: UPS.PowerSummary.PresentStatus.VoltageNotRegulated, Type: Input, ReportID: 0x07, Offset: 11, Size: 1, Value: 0
0.882030 Path: UPS.PowerSummary.PresentStatus.VoltageNotRegulated, Type: Feature, ReportID: 0x07, Offset: 11, Size: 1, Value: 0
0.882043 Path: UPS.PowerSummary.PresentStatus.ff860080, Type: Input, ReportID: 0x07, Offset: 12, Size: 1, Value: 0
0.882057 Path: UPS.PowerSummary.PresentStatus.ff860080, Type: Feature, ReportID: 0x07, Offset: 12, Size: 1, Value: 0
0.884204 Path: UPS.Battery.Test, Type: Input, ReportID: 0x16, Offset: 0, Size: 8, Value: 6
0.884231 Path: UPS.Battery.Test, Type: Feature, ReportID: 0x16, Offset: 0, Size: 8, Value: 6
0.887831 Path: UPS.Battery.APCBattReplaceDate, Type: Feature, ReportID: 0x45, Offset: 0, Size: 24, Value: 394516
0.891830 Path: UPS.Battery.ManufacturerDate, Type: Feature, ReportID: 0x15, Offset: 0, Size: 16, Value: 17605
0.894330 Path: UPS.Battery.RemainingCapacity, Type: Feature, ReportID: 0x18, Offset: 0, Size: 16, Value: 100
0.897953 Path: UPS.Battery.RemainingTimeLimit, Type: Feature, ReportID: 0x1a, Offset: 0, Size: 16, Value: 120
0.901830 Path: UPS.Battery.RunTimeToEmpty, Type: Feature, ReportID: 0x19, Offset: 0, Size: 16, Value: 4927
0.904204 Path: UPS.Battery.ConfigVoltage, Type: Feature, ReportID: 0x1f, Offset: 0, Size: 16, Value: 12
0.907954 Path: UPS.Battery.Voltage, Type: Feature, ReportID: 0x1d, Offset: 0, Size: 16, Value: 13.67
0.911829 Path: UPS.Battery.ff860024, Type: Feature, ReportID: 0x47, Offset: 0, Size: 8, Value: 243
0.914329 Path: UPS.Battery.ff860018, Type: Feature, ReportID: 0x48, Offset: 0, Size: 32, Value: 0
0.917943 refresh_report_buffer: expected 5 bytes, but got 3 instead

The elation didn't last very long, once I actually looked at what was scrolling past. There were error messages. Look at the last line, for example:
0.917943 refresh_report_buffer: expected 5 bytes, but got 3 instead

Fortunately, the manpage for usbhid-ups had this:
maxreport

With this option, the driver activates a tweak to workaround buggy firmware returning invalid HID report length. Some APC Back-UPS units are known to have this bug.​

Next attempt was this:
Code:
sudo /usr/local/libexec/nut/usbhid-ups -DD -x vendorid=051d -x productid=0002 -a BE700Y-IND -x maxreport


This still had that particular error message, but the subsequent logs looked much better:
1.037635 upsdrv_initinfo...
1.037651 upsdrv_updateinfo...
1.084048 Got 1 HID objects...
1.084095 Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x0d, Offset: 0, Size: 16, Value: 4283
1.084113 Quick update...
1.084132 Path: UPS.PowerSummary.DelayBeforeShutdown, Type: Feature, ReportID: 0x12, Offset: 0, Size: 16, Value: -1
1.084155 Path: UPS.PowerSummary.DelayBeforeReboot, Type: Feature, ReportID: 0x13, Offset: 0, Size: 24, Value: 0
1.084176 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x07, Offset: 2, Size: 1, Value: 1
1.084195 Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x07, Offset: 1, Size: 1, Value: 0
1.084225 Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x07, Offset: 0, Size: 1, Value: 0
1.084244 Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x07, Offset: 4, Size: 1, Value: 0
1.084522 dstate_init: sock /var/db/nut/usbhid-ups-BE700Y-IND open on fd 6
1.084567 upsdrv_updateinfo...
1.147977 Got 1 HID objects...
1.148011 Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x0d, Offset: 0, Size: 16, Value: 4927
1.148027 Quick update...
1.148046 Path: UPS.PowerSummary.DelayBeforeShutdown, Type: Feature, ReportID: 0x12, Offset: 0, Size: 16, Value: -1

I guess it was time to try to turn the UPS service on, with these parameters. Also, I had nothing left to try to debug, anyway. Only that, these additional parameters need to be specified in the GUI, so FreeNAS would write them into its sqlite db and therefore would survive a reboot. This is what the final UPS settings screen looked like
index.php


I actually created a upsmon user with a valid password. I don't know if that's really necessary.

With these, the UPS service turned on without any fuss.

This morning, I had to restart my server to reset its network. The usb permissions I had set up were gone, but the UPS service was still on. It probably works too, since I got an email this morning when the power went down for a minute, and also when it came back up. I have yet to test actual shutdown/restart.

Testing the service

run this to find the commands supported by your UPS
upscmd -l YOUR-UPS-SECTION@localhost

This will tell you various dynamic properties your ups can be queried for
upsc YOUR-UPS-SECTION@localhost
 

Attachments

  • ups-settings-final.png
    ups-settings-final.png
    48.1 KB · Views: 1,042
  • ups-settings.png
    ups-settings.png
    44 KB · Views: 1,057
Last edited:
Status
Not open for further replies.
Top