[Nut-upsdev] Problem with bestfcom and old Ferrups

Chris Adams cmadams at hiwaay.net
Thu Feb 7 01:59:25 UTC 2008

Once upon a time, Charles Lepple <clepple at gmail.com> said:
> On Feb 6, 2008 2:44 PM, Chris Adams <cmadams at hiwaay.net> wrote:
> > Once upon a time, Chris Adams <cmadams at hiwaay.net> said:
> > > I have an old (1997) Best Ferrups (model FE18KVA) that I am trying to
> > > monitor for the first time, but all the Best drivers fail to communicate
> > > with it.
> >
> > Okay, I think I have bestfcom working with my old UPS.  Here's a patch
> > verses 2.2.1 that fixes three issues I saw with my UPS:
> >
> > - the "time" command sends a prompt, so always send an empty command
> >   after "time" (on versions that prompt, hitting return doesn't change
> >   the time, and on UPSes that don't, this just sends an empty command)
> >
> > - the spacing in the "id" command is different, so match a second string
> >   for Ferrups
> >
> > - the sscanf calls have various combinations of space and tab before the
> >   matched valud, which is unneeded; scanf will skip any amount of white
> >   space in the input when the format has a space
> >
> > With this, bestfcom starts and reports valid values.  I have not tried
> > cutting the power yet (just to be safe I will need to do that outside
> > normal business hours).
> Sounds good. This applies cleanly to the trunk (with "patch -l" to
> ignore spaces), so if there are no objections from the other
> developers, I can go ahead and commit that.

I think if you use "patch -l", the whitespace changes in the sscanf
calls will not be applied.  Some of the calls have a space before the %f
or %d, some have a tab, some have both, but changing all of them to a
single space makes it work to me (and should be just fine in all cases
according to the sscanf man page).

> >         if (strlen(rstring) < 80 ) {
> > +               ser_get_line(upsfd, rstring, sizeof(rstring), '>', "\012", 3, 0);
> >                 upsdrv_init_nofc();
> I assume this is safe for owners of the newer Ferrups units? (I am not
> familiar with this protocol in particular.)

Well, someone with a newer model should definately try it.  I need this
because my UPS doesn't support the "fc" command and has an error that
isn't read from the serial port before continuing.  The newest models I
think have the "fc" command and won't hit this; the models without "fc"
should at worst hit this as a one-time timeout.

Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.

More information about the Nut-upsdev mailing list