[Nut-upsuser] Advice Partner PRPC650 - no serial device

Arjen de Korte nut+users at de-korte.org
Sat Jan 3 11:37:22 UTC 2009


Citeren Hai Zaar <haizaar at gmail.com>:

> The current progress is like this:
> With help from linux-hotplug guys
> (http://thread.gmane.org/gmane.linux.hotplug.devel/13551) I've managed
> to /dev/ttyUSB0 to be registered, but:
> # /sbin/upsdrvctl start
> Network UPS Tools - UPS driver controller 2.2.2
> Network UPS Tools - PowerCom and similars protocol UPS driver $
> Revision: 0.5 $ (2.2.2)
>
> writing error

Question is, what is the syslog showing? The 'writing error' message  
is awkward, but in the case of the powercom driver doesn't indicate  
that the UPS wasn't detected or the driver didn't load properly. I  
would like you to run the driver with debugging enabled to see what is  
really happening:

     powercom -DDDDD -a PRPC650 2>&1

This will run until you kill it with ctrl-C. Post the first 30 seconds  
worth of output after starting the driver and I'll take a look at it.  
Note that I'm not the driver author however, so if this requires  
digging deeper into the protocol, I'll step back.

> # cat /etc/nut/ups.conf
> [PRPC650]
>   driver = powercom
>   port = /dev/ttyUSB0
>   desc = "Test"
>
> Trying with strace shows the following:
> 12369 open("/dev/ttyUSB0", O_RDWR|O_EXCL|O_NOCTTY|O_NONBLOCK) = 4
> 12369 flock(4, LOCK_EX|LOCK_NB)         = 0
> 12369 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B1200 -opost -isig
> -icanon -echo ...}) = 0
> 12369 ioctl(4, TCFLSH, 0)               = 0
> 12369 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B1200 -opost -isig
> -icanon -echo ...}) = 0
> 12369 ioctl(4, SNDCTL_TMR_START or TCSETS, {B1200 -opost -isig -icanon
> -echo ...}) = 0
> 12369 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B1200 -opost -isig
> -icanon -echo ...}) = 0
> 12369 ioctl(4, TIOCMBIC, [TIOCM_DTR])   = 0
> 12369 ioctl(4, TIOCMBIS, [TIOCM_RTS])   = 0
> 12369 write(4, "\1"..., 1)              = -1 EAGAIN (Resource
> temporarily unavailable)
> 12369 write(2, "writing error\n"..., 14) = 14
>
> Any hint please?

It's too soon to run the driver through 'strace'. Unless you're trying  
to diagnose communication problems, this is much too verbose to be  
useful at this stage. The driver shouldn't mention the 'writing error'  
message without debugging enabled and silently retry a couple of times  
before complaining about this.

Best regards, Arjen

PS  I'm adding Bill Blessing to the list of CC's, since he seems to  
have a similar unit.
-- 
Please keep list traffic on the list




More information about the Nut-upsuser mailing list