[Nut-upsuser] Unitek UPS 1250xD - megatec_usb driver

Alexander I. Gordeev lasaine at lvk.cs.msu.su
Sun Feb 17 19:56:07 UTC 2008


On Sun, 17 Feb 2008 20:59:41 +0300, Arjen de Korte <nut+devel at de-korte.org> wrote:

> [...]
>
>> Asking for UPS status [Q1]...
>> get_data_krauler: index [03], prefix [(]
>> -> String: UPS No Ack (len = 10/128)
>> get_data_krauler: retry [UPS No Ack]
>> -> String: UPS No Ack (len = 10/128)
>> get_data_krauler: retry [UPS No Ack]
>> - Unable to fetch string 3
>> get_data_krauler: connection failure
>> Q1 => FAILED [timeout]
>
> The above is the source of the problems. The first two attempts fail
> internally in the UPS (since it reports 'UPS No Ack', which is an
> indication that the USB controller in the UPS can't read the status).
> Unfortunately, on the third attempt, the USB connection times out which
> seems to be handled rather ungracefully.
>
> The best solution would probably to ignore the first couple of failures in
> the 'megatec.c' driver, before declaring data stale. Generally speaking,
> one should be careful to declare data stale and only do so after a couple
> of attempts to read the status (typically three in a row) have failed.
>
> Best regards, Arjen

I like the idea of solving this in megatec.c. Both serial and usb
interfaces could easily fail.

-- 
   Alexander



More information about the Nut-upsuser mailing list