[Nut-upsdev] Patch for the bestfortress driver 0.02
Arnaud Quette
aquette.dev at gmail.com
Wed Jul 18 10:46:04 UTC 2012
2012/7/12 Oliver Kluge <ok23 at kluge-digital.de>
> Hi,
>
> nice to read. Sorry, I've been busy for several weeks and just following
> up.
>
Hi Oliver,
I'm sorry to say that I'm not seeing any free time in a near future to work
on this driver.
the TODO list for 2.8.0 is already full, and 2.8.0 is already 1 year late...
however, there was a patch in 2.6.4 (the one that Stuart has validated
below), that you may want to test.
I'm interested in your feedback (and traces) on this...
I can however assist any development / investigation on this point, and
help the best I can.
All apologies for that, the situation is never has optimal as I'd like to
see.
cheers,
Arno
--
Linux / Unix / Opensource Engineering Expert - Eaton -
http://opensource.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.fr
Stuart D Gathman wrote:
>
>> Applied this to nut-2.6.3 on fedora, and bestfortress seems to still
>> work. The patch seems reasonable as well. As to why it isn't needed
>> for me, I suspect it has to do with serial IO buffering. Driver was
>> depending on upsflushin() to empty the input buffer before triggering
>> another status update. That doesn't always kill everything (I was
>> getting occasional misreads on a server), and the patch simply skips to
>> just after '\n' before and after reading a status line.
>>
>> Long ago, Nostradamus foresaw that on 05/25/2012 10:31 AM, Arnaud Quette
>> would write:
>>
>>> Hi Jørgen, Oliver and Stuart,
>>>
>>> I'm not forgetting you...
>>> while looking again at bestfortress, I realized I completely missed
>>> Jørgen's patch!
>>>
>>> 2010/4/19 J. Thomsen<list at jth.net>:
>>>
>>>> --- nut-2.4.3/drivers/**bestfortress.c 2010-02-11
>>>> 22:43:23.000000000 +0100
>>>> +++ nut-2.4.3j/drivers/**bestfortress.c 2010-04-19
>>>> 12:17:07.929852889 +0200
>>>> @@ -34,7 +34,7 @@
>>>> #endif
>>>>
>>>> #define DRIVER_NAME "Best Fortress UPS driver"
>>>> -#define DRIVER_VERSION "0.02"
>>>> +#define DRIVER_VERSION "0.03"
>>>>
>>>> /* driver description structure */
>>>> upsdrv_info_t upsdrv_info = {
>>>> @@ -203,20 +203,26 @@
>>>> int loadva;
>>>> int len;
>>>> int retry;
>>>> + char ch;
>>>>
>>>> int checksum_ok, is_online=1, is_off, low_batt, trimming,
>>>> boosting;
>>>>
>>>> for (retry = 0; retry< 5; ++retry) {
>>>> upsflushin (0, 0, "\r ");
>>>> upssend ("f\r");
>>>> + while (ser_get_char(upsfd,&ch, 0, UPSDELAY)> 0&& ch
>>>> != '\n'); // response starts with \r\n
>>>>
>>>> + temp[2] = 0;
>>>> do {
>>>> - if (upsrecv (temp+2, sizeof temp - 2, ENDCHAR,
>>>> IGNCHARS)<= 0) {
>>>> + if ((len = upsrecv (temp+2, sizeof temp - 2,
>>>> ENDCHAR, IGNCHARS))<= 0) {
>>>> upsflushin (0, 0, "\r ");
>>>> upssend ("f\r");
>>>> + while (ser_get_char(upsfd,&ch, 0,
>>>> UPSDELAY)> 0&& ch != '\n'); // response starts with \r\n
>>>>
>>>> }
>>>> } while (temp[2] == 0);
>>>>
>>>> - /*syslog (LOG_DAEMON | LOG_NOTICE,"ups: got '%s'\n",
>>>> p);*/
>>>> + /* syslog (LOG_DAEMON | LOG_NOTICE,"ups: got %d chars
>>>> '%s'\n", len, temp + 2); */
>>>> +
>>>> + upsdebugx(5, "data from UPS: len=%d '%s'",
>>>> len,&temp[2]);
>>>>
>>>> /* status example:
>>>> 000000000001000000000000012201**
>>>> 210000001200014500000280600000**990025000000000301BE
>>>> 000000000001000000000000012401**
>>>> 230000001200014800000280600000**990025000000000301B7
>>>>
>>>
>>>
>>
>> ______________________________**_________________
>> Nut-upsdev mailing list
>> Nut-upsdev at lists.alioth.**debian.org <Nut-upsdev at lists.alioth.debian.org>
>> http://lists.alioth.debian.**org/cgi-bin/mailman/listinfo/**nut-upsdev<http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev>
>>
>
>
>
> ______________________________**_________________
> Nut-upsdev mailing list
> Nut-upsdev at lists.alioth.**debian.org <Nut-upsdev at lists.alioth.debian.org>
> http://lists.alioth.debian.**org/cgi-bin/mailman/listinfo/**nut-upsdev<http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev>
--
Linux / Unix / Opensource Engineering Expert - Eaton -
http://opensource.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20120718/7c5f87d0/attachment.html>
More information about the Nut-upsdev
mailing list