Ritter, Nicholas
2014-Feb-07 20:44 UTC
[Nut-upsuser] BestPower Ferrups driver glitch with f commands
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. 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? 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 Network UPS Tools - Best Ferrups/Fortress driver 0.12 (2.7.1) Warning: This is an experimental driver. Some features may not function correctly. Unknown model id ? FERRUPS Uninterruptible Power System By Powerware Corporation 8609 Six Forks Road Raleigh, NC 27615 USA Sales: (800) 356-5794 Service: (800) 356-5737 FAX : (608) 565-2221 Copyright (C) 2001 Powerware Corporation Model: FE2.1KVA Unit ID: FE2.1K27433 Serial #: FE2.1K27433 Version: 9.28 = in upsdrv_init_nofc() . 20.428359 Driver failed to start (exit status=1) ---------------------------------------------------------------
Charles Lepple
2014-Feb-08 02:21 UTC
[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 rootAs 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
Ritter, Nicholas
2014-Feb-10 17:40 UTC
[Nut-upsuser] BestPower Ferrups driver glitch with f commands
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 [clepple at gmail.com] Sent: Friday, February 07, 2014 8:21 PM To: Ritter, Nicholas Cc: nut-upsuser at lists.alioth.debian.org 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 rootAs 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 AMTV Spam Admin: Clickhttps://www.mailcontrol.com/sr/nApD3Do4eoPGX2PQPOmvUqW!RI4xIDLrB+QJRwHJqbUvO65YYfmXJsNFE+0nuLp3kIs893ZinNHp5oVq8TaMKA== to report this email as spam.