[Nut-upsuser] Incorrect 'low battery' detected with Back-UPS XS 1200 (usbhid-ups)

hanji hanji at uno-code.com
Sat Nov 17 21:03:46 UTC 2007


On Sat, 17 Nov 2007 21:24:27 +0100
Arjen de Korte <nut+users at de-korte.org> wrote:

> hanji wrote:
> 
> > Thanks for replying to my email. I updated to 2.2.0, and I'm running
> > into the same problem, but also encountered other issues. After
> > upgrading to 2.2.0 and using the usbhid-ups driver, I was not able to
> > get a clean restart of upsd.
> > 
> > /etc/init.d/upsd restart
> >  * Stopping upsd ...                                              [ ok ]
> >  * Starting upsd ...
> > Network UPS Tools upsd 2.2.0-
> > listening on 0.0.0.0 port 3493
> > Can't connect to UPS [apc1] (usbhid-ups-apc1): Connection refused [ ok ]
> > 
> > The only way to get this to work was by firing up the driver first,
> > then starting upsd...
> 
> You probably need to put a delay in the /etc/init.d/upsd script for
> restart. Stopping a driver is an asynchronous process, which means that
> the actual stopping of the driver will be sometime later. Assuming this
> script looks something like
> 
>   restart)
> 	$0 stop
> 	$0 start
> 	;;
> 
> you'd need to sleep for a second or two between stopping and starting like
> 
>   restart)
> 	$0 stop
> 	sleep 2
> 	$0 start
> 	;;
> 

Strange. Looks like my init script already does this:

start() {
        ebegin "Starting upsd"
        # clean up first
        pkill -u root -x upsd
        sleep 1s
        rm -f ${pidfile}
        # now start up
        start-stop-daemon --start --quiet --exec /usr/sbin/upsd
        eend $?
}

My system is Gentoo Linux (2.6.22-gentoo-r9 kernel).

> 
> From looking at the above, I have my doubts about your UPS'es. Basically
> all it is responding is 0 or 1. Nevertheless, post the first few seconds
> worth of output from the command
> 
> 	/lib/nut/usbhid-ups -DD -a apc1
> 
> and we'll see what we can do. This will hopefully provide enough
> information to tell what the heck is going on.

Here is my output:

upsdrv_updateinfo...
dstate_init: sock /var/lib/nut/usbhid-ups-apc1 open on fd 5
upsdrv_updateinfo...
Waiting for notifications...

=>Got 2 HID Objects...
battery.charge = 100
battery.runtime = 1387
upsdrv_updateinfo...
Waiting for notifications...

=>Got 3 HID Objects...
ups.status = !chrg
ups.status = !dischrg
ups.status = !off
upsdrv_updateinfo...
Waiting for notifications...

=>Got 2 HID Objects...
battery.charge = 100
battery.runtime = 1387
upsdrv_updateinfo...
Waiting for notifications...

=>Got 3 HID Objects...
ups.status = !chrg
ups.status = !dischrg
ups.status = !off
upsdrv_updateinfo...
Waiting for notifications...

=>Got 2 HID Objects...
battery.charge = 100
battery.runtime = 1417
upsdrv_updateinfo...
Waiting for notifications...

=>Got 3 HID Objects...
ups.status = !chrg
ups.status = !dischrg
ups.status = !off
upsdrv_updateinfo...
Waiting for notifications...

=>Got 2 HID Objects...
battery.charge = 100
battery.runtime = 1447
upsdrv_updateinfo...
Waiting for notifications...

=>Got 3 HID Objects...
ups.status = !chrg
ups.status = !dischrg
ups.status = !off
Signal 2: exiting
Closing device

Thanks!
hanji



More information about the Nut-upsuser mailing list