I did the testing you suggested, and it was indeed the whitespace. I added another if clause test to the function and everything seems to work. I have working driver that I will email a patch for this list. My coworker says the model ID is configurable though, so we will try that first, which would negate the need to patch the driver.
________________________________________ From: Charles Lepple [[email protected]] Sent: Friday, February 07, 2014 8:21 PM To: Ritter, Nicholas Cc: [email protected] Subject: Re: [Nut-upsuser] BestPower Ferrups driver glitch with f commands 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@gmail AMTV Spam Admin: Clickhttps://www.mailcontrol.com/sr/nApD3Do4eoPGX2PQPOmvUqW!RI4xIDLrB+QJRwHJqbUvO65YYfmXJsNFE+0nuLp3kIs893ZinNHp5oVq8TaMKA== to report this email as spam. _______________________________________________ Nut-upsuser mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

