[Nut-upsdev] [Nut-upsuser] Getting 'Data stale' error with bcmxcp_usb for a PowerWare 5115 on OSX

Arjen de Korte nut+devel at de-korte.org
Sat Mar 6 20:41:15 UTC 2010


Citeren Charles Lepple <clepple op gmail.com>:

> A while back, NUT opened the USB device, forked, and used that
> descriptor in the child process. That breaks in OS X because the USB
> connection is per-process.

In that case, we're toast. :-(

> Currently, if the debug level is zero, we
> go into the background before opening the USB device.

No, we don't (see 'drivers/main.c'). Backgrounding is one of the last  
things we do (line 618), before starting the main loop. The USB device  
has been opened long before that in upsdrv_initups (line 577).

> I admit I
> haven't done physical device testing with 2.4.3 on OS X yet (I spent
> too much time messing with FreeBSD for the last release), but I don't
> remember any other recent architectural changes which could cause
> problems like that.

I guess it all depends if the driver is able to detect it can no  
longer talk to the UPS and reconnects. Usually, I would expect that  
after a couple of failed attempts to read data, the UPS would assume  
the connection is lost and reconnect (at least, that is what most USB  
drivers do I'm familiar with). Apparently, this isn't working here.

Since running the driver in debug mode effectively works around the  
problem, we probably need to add some upslogx() lines strategically tp  
see in the syslog what is going on.

Best regards, Arjen
-- 
Please keep list traffic on the list




More information about the Nut-upsdev mailing list