[Nut-upsuser] BestPower Ferrups driver glitch with f commands

Charles Lepple clepple at gmail.com
Sat Feb 8 02:21:34 UTC 2014


On Feb 7, 2014, at 3:44 PM, Ritter, Nicholas wrote:

> Greetings to you all,
> 
> We are attempting to use NUT to interface with a BestPower FerrUPS FE2.1KVA. We are using the bestfcom driver because the driver listed our UPS as supported. The driver fails, however, because "fc" commands do not exist on the unit.

There is a upsdrv_init_nofc() function, but it seems to be brittle in its string matching.

> We are running NUT v2.7.1 on CentOS 6.5 with the bestfcom driver. We setup a serial tap and see the UPS error out on the fc command issued for the model, which than causes the driver to not identify the model correctly.
> 
> Does anyone have any suggestions?

See below.

> Nicholas
> 
> 
> Here are some details:
> 
> From "upsdrvctl -DDDDD start":
> 
> ------------------------------------------------------------------
> Network UPS Tools - UPS driver controller 2.7.1
>   0.000000
> If you're not a NUT core developer, chances are that you're told to enable debugging
> to see why a driver isn't working for you. We're sorry for the confusion, but this is
> the 'upsdrvctl' wrapper, not the driver you're interested in.
> 
> Below you'll find one or more lines starting with 'exec:' followed by an absolute
> path to the driver binary and some command line option. This is what the driver
> starts and you need to copy and paste that line and append the debug flags to that
> line (less the 'exec:' prefix).
> 
>   0.000181    Starting UPS: ATVUPS
>   0.000194    exec:  /usr/local/ups/bin/bestfcom -a ATVUPS -u root

As the message suggests, for debugging the driver, you should bypass the upsdrvctl command (which really only helps when starting multiple drivers at once) and pass the -D flags directly to the driver:

/usr/local/ups/bin/bestfcom -a ATVUPS -u root -DDD

But I suspect that this line is not matching the spaces after the "Model:" string properly:

https://github.com/networkupstools/nut/blob/master/drivers/bestfcom.c#L579

Does it work if you match the exact string your model returns? If so, we can patch it to skip however much white space is present before the "FE".

-- 
Charles Lepple
clepple at gmail






More information about the Nut-upsuser mailing list