Citeren Michal Soltys <[email protected]>:

@@ -417,10 +414,12 @@
        if (flags & SER_CC) {
                iset = IGN_CCCHARS;
                aset = "";
+               sec = 6; usec = 0;
        }
        if (flags & SER_CS) {
                iset = IGN_CSCHARS;
                aset = "";
+               sec = 6; usec = 0;
        }

        memset(buf, '\0', buflen);

Please see the following comment on upsdrv_updateinfo from the new-drivers documentation:

  "Don't spent more than a couple of seconds in this function. Typically
   five (5) seconds is the maximum time allowed before you risk that the
   server declares the driver stale. If your UPS hardware requires a
   timeout period of several seconds before it answers, consider returning
   from this function after sending a command immediately and read the
   answer the next time it is called."

It looks like you're setting a timeout of 6 seconds here, which puts your driver being declared stale by the server. Drivers are single threaded (like all of NUT at present) so hanging around this long, will mean that it won't respond to polls from the server in time.

If these commands really take this long to process, you really should split this up in multiple invocations of upsdrv_updateinfo (so send the command, return and process the reply the next time you enter).

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)



_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev

Reply via email to