Can't save change to UPS Driver selection in FreeNAS GUI (Services > UPS)

Net Pilgrim

Cadet
Joined
May 29, 2016
Messages
1
Please help!
I'm having trouble getting my UPS service to run correctly, running under FreeNAS 11.3-U4.1 with a CyberPower (CST135XLU) UPS connected via USB. Basically, after configuring the UPS service in the GUI (using MASTER mode and the correct port: /dev/ugen0.4), saving configuration and starting the UPS service, going to the CLI (via SSH or Shell) I get the following errors when trying to determine the status of the UPS:

Code:
/etc/local/nut # upsc ups
Error: Connection failure: Connection refused


After reading through other threads and doing a bunch of detective work it seems to be an incorrect driver being used, I have determined that no matter what Driver option I try to set in the GUI and then save the change, it seems to always revert back to powerpanel (specifically: powerpanel$CPS1500AVR). I'm certain that the correct Driver should be usbhid-ups. I've attached a couple of screen shots of what I'm trying to select, vs. what the GUI always sets it back to.

The only way I've been able to get the UPS service to run is to disable it in the FreeNAS GUI, then manually edit the conf files in /etc/local/nut/ , with the most important change being the driver selection in ups.conf (changed from powerpanel to usbhid-ups), like so:

Code:
/etc/local/nut # cat ups.conf
[ups]
    driver = usbhid-ups
    port = /dev/ugen0.4
    desc =

I'm then able to manually start the nut_upsmon service:
Code:
/etc/local/nut # service nut_upsmon onestart
Starting nut_upsmon.
Network UPS Tools upsmon 2.7.4
kill: No such process
UPS: ups@localhost:3493 (master) (power value 1)
Using power down flag file /etc/nokillpower

then the nut service:
Code:
/etc/local/nut # service nut onestart
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
Using subdriver: CyberPower HID 0.4
libusb_get_interrupt: Unknown error
Starting nut.
Network UPS Tools upsd 2.7.4
fopen /var/db/nut/upsd.pid: No such file or directory
listening on ::1 port 3493
listening on 127.0.0.1 port 3493
Connected to UPS [ups]: usbhid-ups-ups
/usr/local/etc/nut/cmdvartab not found - disabling descriptions

Note: I have to use the 'onestart' directive instead of 'start', since I get an error stating that the service must be enabled in the /etc/rc.conf file. Of course, I tried this, but it gets overwritten on reboot of the server. So ... for now, I have just been using 'onestart' in order to debug my situation.

Now checking my UPS status:
Code:
/etc/local/nut # upsc ups
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 3930
battery.runtime.low: 300
battery.type: PbAcid
battery.voltage: 24.0
battery.voltage.nominal: 24
device.mfr: CPS
device.model: CST135XLU
device.serial: CR7EZxxxxxxx
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen0.4
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.data: CyberPower HID 0.4
driver.version.internal: 0.41
input.voltage: 125.0
input.voltage.nominal: 120
output.voltage: 141.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 12
ups.mfr: CPS
ups.model: CST135XLU
ups.productid: 0501
ups.realpower.nominal: 810
ups.serial: CR7EZxxxxxxx
ups.status: OL
ups.test.result: No test initiated
ups.timer.shutdown: -60
ups.timer.start: -60
ups.vendorid: 0764

So, it now seems to be working correctly. Until I reboot the server or restart the service from the GUI again ... all of conf files get overwritten, like so:
Code:
~ # upsc ups
Error: Connection failure: Connection refused
root@freenas1:~ # cat /etc/local/nut/ups.conf
[ups]
    driver = powerpanel
    port = /dev/ugen0.4
    desc = 

I understand that this is probably the expected behavior (GUI config overwrites any manual changes I made), however I am kind of stuck. I can't figure out how make my driver change actually stick, or force it to use usbhid-ups. The only thing I can guess is that it is somehow detecting the device name (CPS CST135XLU) from what is connecting to the USB Port ugen0.4 and trying to be smarter than me by changing it to what it thinks is the closest equivalent from CyberPower. From what I can tell (from NUT Website), all CyberPower UPS devices with USB connections (they don't have my exact model) use the usbhid-ups driver, whereas other models (like the CPS1500AVR it keeps thinking I have) use powerpanel.
/etc/local/nut # dmesg | grep ugen
ugen1.1: <Intel EHCI root HUB> at usbus1
ugen2.1: <Intel EHCI root HUB> at usbus2
ugen0.1: <0x8086 XHCI root HUB> at usbus0
ugen0.2: <vendor 0x05e3 USB2.0 Hub> at usbus0
ugen1.2: <vendor 0x8087 product 0x8008> at usbus1
ugen2.2: <vendor 0x8087 product 0x8000> at usbus2
ugen0.3: <Dell Dell USB Keyboard> at usbus0
ugen0.4: <CPS CST135XLU> at usbus0
ugen0.5: <vendor 0x0557 product 0x7000> at usbus0
ugen0.6: <vendor 0x0557 product 0x2419> at usbus0
By way of further debugging, I've tried making other changes to the FreeNAS GUI UPS Service options (like the Shutdown Timer period, MASTER -> SLAVE mode, etc.) and all of those settings do seem to get properly reflected and survive a settings save and reboot (I think). Therefore, I don't think something got messed up with my system configuratino db. However, once again - whenever I change back to MASTER mode and try to select anything other than the powerpanel driver it has shown by default, it doesn't last even when I try to save again.

I appreciate any help in correcting my issue. Thank you for any tips or solution to my problem! Cheers.
 

Attachments

  • GUI_always_defaults_back_here.png
    GUI_always_defaults_back_here.png
    52 KB · Views: 288
  • What_I_try_to_set.png
    What_I_try_to_set.png
    57.6 KB · Views: 296

AleQQ

Dabbler
Joined
Jan 22, 2014
Messages
38
Did you ever have any luck getting this to work? I had been eyeing a few APC models before I found the CST135XLU from Costco for less than half the price of a comparable APC. I'm planning on getting this thing set up sometime next week, but I wanted to check in in case you found a solution to this issue or if I will need to redo it every time I reboot?

Thanks!
 

marked23

Cadet
Joined
Dec 12, 2020
Messages
4
(rookie, here.)

I'm using TrueNAS-12.0-U1

This seems somewhat improved from how you described. I connected my CST135XLU tonight, and configured it in the GUI. I selected the CP1350AVRLCD, and I used usbconfig to figure out that my ups is plugged into /dev/ugen1.3.

In ssh, I ran upsc ups and it showed my ups status right away.
However the log was saying things like this:

Poll UPS [ups@localhost:3493] failed - Server disconnected
nut plugin: nut_read: upscli_list_start (ups) failed: Write error: Broken pipe
nut plugin: nut_connect: upscli_connect (localhost, 3493) failed: Connection failure: Connection refused


So I stopped nut_upsmon and nut, and then onestarted both. Then I saw:
Communications with UPS ups@localhost:3493 established

I haven't rebooted yet (and can't right now). I never had to repair my .conf files. So I'm hopeful that my config will stick.
But will it start on reboot? I'll find out later.
 
Top