Solved [SOLVED] UPS Monitoring with NUT driving me nuts

I do have a cheap whatever UPS for my server. It should work with the blazer_usb driver, which it does for a period of several minutes. Then I get the message
Code:
blazer_usb[90671]: Permissions problem: Input/output error
and the driver disappears, while the upsd still runs and starts sending
Code:
upsd[90673]: Can't connect to UPS [myups] (blazer_usb-myups): No such file or directory

Does anybody have similar trouble with NUT ( Version 2.6.5 )?

(Setup 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64)

During the startup, upsd has a problem to create the PID file, but I can do that manually.

Code:
Network UPS Tools - UPS driver controller 2.6.5
Network UPS Tools - Megatec/Q1 protocol USB driver 0.09 (2.6.5)
Supported UPS detected with mustek protocol
Vendor information unavailable
No values provided for battery high/low voltages in ups.conf

Using 'guestimation' (low: 10.400000, high: 13.000000)!
Battery runtime will not be calculated (runtimecal not set)
Starting nut.
Network UPS Tools upsd 2.6.5
fopen /var/run/upsd.pid: No such file or directory
/usr/local/etc/nut/upsd.conf is world readable
listening on 127.0.0.1 port 3493
Connected to UPS [myups]: blazer_usb-myups
/usr/local/etc/nut/upsd.users is world readable
A check with upsc is showing that it work a while:
Code:
upsc myups@localhost  
battery.charge: 100
battery.voltage: 13.50
battery.voltage.high: 13.00
battery.voltage.low: 10.40
battery.voltage.nominal: 12.0
device.type: ups
driver.name: blazer_usb
driver.parameter.pollinterval: 2
driver.parameter.port: AUTO
driver.version: 2.6.5
driver.version.internal: 0.09
input.current.nominal: 3.0
input.frequency: 50.1
input.frequency.nominal: 50
input.voltage: 237.1
input.voltage.fault: 237.1
input.voltage.nominal: 230
output.voltage: 237.1
ups.beeper.status: enabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.load: 9
ups.productid: 5161
ups.status: OL
ups.type: offline / line interactive
ups.vendorid: 0665

Maybe there is a special devd.conf setup needed? I have seen also right after the start the following message:
Code:
devd: Executing 'kldload -n uhid'
while the system was not touched from a USB point of view.
==> Update: this is not the problem as uhid is already loaded.

Interesting: I have had two blazer_usb processes running in parallel. After a while the first started process stops with permission problem, while the other was still running and continued to work.

Has anybody also used the blazer_usb driver and had similar trouble ?
 
Re: UPS Monitoring with NUT driving me nuts

§e Ok, I hacked the code in blazer_usb.c the easy way: In case of the permission problem, the driver just retries it again. Find below the code in case you have the same trouble

Code:
        case -EPERM:            /* Operation not permitted */
                /* fatal_with_errno(EXIT_FAILURE, "Permissions problem");*/
                upsdebugx(1, "Permission problem identified. Retry");
                break;

Overall the UPS SW is not great when you want to do some power savings : it calls the UPS status every 2 sec. To my mind you could do that a bit smarter: depending on the runtime of your battery without power, you poke in normal situation just every x% of capacity left. Mean, when you estimate that your server on battery will survive 15 min., that you poll the battery maybe only every 10 min. In case a of a power failure you could still get the status that power is off. And even better, if then the driver would be able to switch to a more frequent poll, so that you could use the full capacity of the battery before you need to shutdown the server.
Ok, that's off topic ==> will mail it to NUT developers.
 
Back
Top