[Nut-upsdev] Driver bestfcom - Timing problem with Fortress LI1420

Heiko Kegel h.kegel at cityweb.de
Fri Dec 7 12:41:52 UTC 2007


> [...]
>
> Could you try if fixing this (instead of adding these 1 second sleeps) by
> changing the above calls in the driver to
>
> 173	ser_get_line(upsfd, buf, sizeof(buf), '\012', "", 0, 20000);
> 189	ser_get_line_alert(upsfd, buf, sizeof(buf), '\012', "",
> 190		POLL_ALERT, alert_handler, 0, 20000);
> 195	for (ch = '\0'; ch != '\012'; ser_get_char(upsfd, &ch, 0, 10000));
>
> fixes this problem?
>

It's working with your changes.

Inserted the fix and removed delays.
Your fix is definitly better than the 'delay workaround'.
Thanks for the fast response.

BTW; when applying the timing fix could you also fix the vaout calculation ?
  
The vaout reading from Fortress is an integer, no fraction, so division by 10 
is wrong.

280			/* Volt-amps out.  int	*/
281			vaout = ((double)bcd2i(&fstring[40], 6) / 10);

Best regards, Heiko




More information about the Nut-upsdev mailing list