[Nut-upsdev] USB comms dropout not detected

Daniel O'Connor doconnor at gsoft.com.au
Mon Jun 1 02:15:30 UTC 2009


Hi,
I have an MGE Ellipse 1000 connected to a FreeBSD 7.1 system and it 
works well except that if I yank the cable it doesn't detect a 
problem.. It seems to quite merrily read the old data (upsc reports the 
same values).

There is nothing logged by NUT to indicate comms is lost (usbhid-ups is 
still running).

In the attached log I yanked the able at the 28 second mark and plugged 
it back in at the 48 second mark.

It seems that usbhid-ups should know the UPS is no longer present but 
upsd doesn't seem to DTRT and mark the data stale (or perhaps 
usbhid-ups is re-sending the old data structure to upsd?).

Also, I think that usbhid-ups should either try reconnecting to the UPS 
(ie search for a suitable device like it does when starting) or exit 
after several failed attempts.

I found when I was using libusb I could not detect if a device went away 
directly, in the end I settled for trying to read a string descriptor - 
since this is a mandatory operation a device always supports if it 
fails it indicates a catastrophic problem. (The lack of decent error 
codes in libusb [or maybe the FreeBSD version] is rather irritating).

I guess really if usbhid-ups exits on error then it should really just 
be started by some system specific daemon on UPS connection (eg devd in 
FreeBSD).

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usbhid-ups.log.gz
Type: application/x-gzip
Size: 6964 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20090601/9837d7dc/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20090601/9837d7dc/attachment.pgp>


More information about the Nut-upsdev mailing list