<br><div class="gmail_quote">2012/7/12 Oliver Kluge <span dir="ltr"><<a href="mailto:ok23@kluge-digital.de" target="_blank">ok23@kluge-digital.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
nice to read. Sorry, I've been busy for several weeks and just following up.<br></blockquote><div> <br>Hi Oliver,<br>
<br>
I'm sorry to say that I'm not seeing any free time in a near future to work on this driver.<br>
the TODO list for 2.8.0 is already full, and 2.8.0 is already 1 year late...<br>
however, there was a patch in 2.6.4 (the one that Stuart has validated below), that you may want to test.<br>I'm interested in your feedback (and traces) on this...<br><br>
I can however assist any development / investigation on this point, and help the best I can.<br>
All apologies for that, the situation is never has optimal as I'd like to see.<br>
<br>
cheers,<br>
Arno<br>-- <br>Linux / Unix / Opensource Engineering Expert - Eaton - <a href="http://opensource.eaton.com" target="_blank">http://opensource.eaton.com</a><br>Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org" target="_blank">http://www.networkupstools.org</a><br>
Debian Developer - <a href="http://www.debian.org" target="_blank">http://www.debian.org</a><br>Free Software Developer - <a href="http://arnaud.quette.fr" target="_blank">http://arnaud.quette.fr</a><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


Stuart D Gathman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Applied this to nut-2.6.3 on fedora, and bestfortress seems to still<br>
work.  The patch seems reasonable as well.  As to why it isn't needed<br>
for me, I suspect it has to do with serial IO buffering.  Driver was<br>
depending on upsflushin() to empty the input buffer before triggering<br>
another status update.  That doesn't always kill everything (I was<br>
getting occasional misreads on a server), and the patch simply skips to<br>
just after '\n' before and after reading a status line.<br>
<br>
Long ago, Nostradamus foresaw that on 05/25/2012 10:31 AM, Arnaud Quette<br>
would write:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi Jørgen, Oliver and Stuart,<br>
<br>
I'm not forgetting you...<br>
while looking again at bestfortress, I realized I completely missed<br>
Jørgen's patch!<br>
<br>
2010/4/19 J. Thomsen<<a href="mailto:list@jth.net" target="_blank">list@jth.net</a>>:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
--- nut-2.4.3/drivers/<u></u>bestfortress.c    2010-02-11 22:43:23.000000000 +0100<br>
+++ nut-2.4.3j/drivers/<u></u>bestfortress.c   2010-04-19 12:17:07.929852889 +0200<br>
@@ -34,7 +34,7 @@<br>
  #endif<br>
<br>
  #define DRIVER_NAME             "Best Fortress UPS driver"<br>
-#define DRIVER_VERSION  "0.02"<br>
+#define DRIVER_VERSION  "0.03"<br>
<br>
  /* driver description structure */<br>
  upsdrv_info_t   upsdrv_info = {<br>
@@ -203,20 +203,26 @@<br>
        int loadva;<br>
        int len;<br>
        int retry;<br>
+       char ch;<br>
<br>
        int checksum_ok, is_online=1, is_off, low_batt, trimming, boosting;<br>
<br>
        for (retry = 0; retry<  5; ++retry) {<br>
                upsflushin (0, 0, "\r ");<br>
                upssend ("f\r");<br></div></div>
+               while (ser_get_char(upsfd,&ch, 0, UPSDELAY)>  0&&  ch != '\n'); // response starts with \r\n<div class="im"><br>
+               temp[2] = 0;<br>
                do {<br>
-                       if (upsrecv (temp+2, sizeof temp - 2, ENDCHAR, IGNCHARS)<= 0) {<br>
+                       if ((len = upsrecv (temp+2, sizeof temp - 2, ENDCHAR, IGNCHARS))<= 0) {<br>
                                upsflushin (0, 0, "\r ");<br>
                                upssend ("f\r");<br></div>
+                               while (ser_get_char(upsfd,&ch, 0, UPSDELAY)>  0&&  ch != '\n'); // response starts with \r\n<div class="im"><br>
                        }<br>
                } while (temp[2] == 0);<br>
<br>
-               /*syslog (LOG_DAEMON | LOG_NOTICE,"ups: got '%s'\n", p);*/<br>
+               /* syslog (LOG_DAEMON | LOG_NOTICE,"ups: got %d chars '%s'\n", len, temp + 2); */<br>
+<br></div>
+               upsdebugx(5, "data from UPS: len=%d '%s'", len,&temp[2]);<div class="im"><br>
                /* status example:<br>
                   000000000001000000000000012201<u></u>210000001200014500000280600000<u></u>990025000000000301BE<br>
                   000000000001000000000000012401<u></u>230000001200014800000280600000<u></u>990025000000000301B7<br>
</div></blockquote>
<br>
</blockquote>
<br>
<br><div class="im">
______________________________<u></u>_________________<br>
Nut-upsdev mailing list<br>
<a href="mailto:Nut-upsdev@lists.alioth.debian.org" target="_blank">Nut-upsdev@lists.alioth.<u></u>debian.org</a><br>
</div><a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev" target="_blank">http://lists.alioth.debian.<u></u>org/cgi-bin/mailman/listinfo/<u></u>nut-upsdev</a><br>
</blockquote><div class="im">
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Nut-upsdev mailing list<br>
<a href="mailto:Nut-upsdev@lists.alioth.debian.org" target="_blank">Nut-upsdev@lists.alioth.<u></u>debian.org</a><br>
</div><a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev" target="_blank">http://lists.alioth.debian.<u></u>org/cgi-bin/mailman/listinfo/<u></u>nut-upsdev</a></blockquote></div><br><br clear="all">
<br>-- <br>Linux / Unix / Opensource Engineering Expert - Eaton - <a href="http://opensource.eaton.com" target="_blank">http://opensource.eaton.com</a><br>Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org" target="_blank">http://www.networkupstools.org</a><br>
Debian Developer - <a href="http://www.debian.org" target="_blank">http://www.debian.org</a><br>Free Software Developer - <a href="http://arnaud.quette.fr" target="_blank">http://arnaud.quette.fr</a><br><br>