Charles Lepple
2015-Jan-02 01:57 UTC
[Nut-upsuser] Problem with ups-dummy driver (repeater mode)
On Jan 1, 2015, at 8:23 PM, Charles Lepple <clepple at gmail.com> wrote:> On Jan 1, 2015, at 4:57 PM, Jonathan Gammell <jon.gammell at utoronto.ca> wrote: > >> [ups] >> driver = dummy-ups >> port = eaton1 >> desc = "Dummy UPS" > > There is a typo in the specification of "port =" in the dummy-ups man page, but your configuration file is effectively looking for a simulation file named 'eaton1'. The presence of an "@" character enables repeater mode. If you change this to 'port = eaton1 at localhost', things should work as you described.I should also mention a pair of options that were introduced in 2.7.2: maxretry and retrydelay. http://www.networkupstools.org/docs/man/ups.conf.html#_global_directives I haven't used dummy-ups in production (I just use the other mode to simulate an UPS) but I suspect there might be a race condition if upsdrvctl starts dummy-ups before both usbhid-ups instances connect to upsd. Not sure if there is a backport of NUT 2.7.2 to 12.04, but it might be worth looking into. Or you could manually add something to rc.local that restarts dummy-ups if it is not running, but usbhid-ups is. -- Charles Lepple clepple at gmail
Jonathan Gammell
2015-Jan-03 01:15 UTC
[Nut-upsuser] Problem with ups-dummy driver (repeater mode)
On 15-01-01 08:57 PM, Charles Lepple wrote:> On Jan 1, 2015, at 8:23 PM, Charles Lepple <clepple at gmail.com> wrote: > >> On Jan 1, 2015, at 4:57 PM, Jonathan Gammell <jon.gammell at utoronto.ca> wrote: >> >>> [ups] >>> driver = dummy-ups >>> port = eaton1 >>> desc = "Dummy UPS" >> >> There is a typo in the specification of "port =" in the dummy-ups man page, but your configuration file is effectively looking for a simulation file named 'eaton1'. The presence of an "@" character enables repeater mode. If you change this to 'port = eaton1 at localhost', things should work as you described. > > I should also mention a pair of options that were introduced in 2.7.2: maxretry and retrydelay. > > http://www.networkupstools.org/docs/man/ups.conf.html#_global_directives > > I haven't used dummy-ups in production (I just use the other mode to simulate an UPS) but I suspect there might be a race condition if upsdrvctl starts dummy-ups before both usbhid-ups instances connect to upsd. > > Not sure if there is a backport of NUT 2.7.2 to 12.04, but it might be worth looking into. Or you could manually add something to rc.local that restarts dummy-ups if it is not running, but usbhid-ups is. >Thanks Charles, You're right that it should be "eaton1 at localhost". That was actually just a one-off mistake in making a simple example to post. The errors are the same even with the correct "@localhost". I will look into whether there's a backport to 12.04, as a race condition seems logical. I'm glad to hear that my use case should be supported though, as I was a little unsure. Thanks, Jon
Charles Lepple
2015-Jan-03 01:47 UTC
[Nut-upsuser] Problem with ups-dummy driver (repeater mode)
On Jan 2, 2015, at 8:15 PM, Jonathan Gammell <jon.gammell at utoronto.ca> wrote:> > Thanks Charles, > > You're right that it should be "eaton1 at localhost". That was actually just a one-off mistake in making a simple example to post. The errors are the same even with the correct "@localhost". I will look into whether there's a backport to 12.04, as a race condition seems logical. I'm glad to hear that my use case should be supported though, as I was a little unsure.So if you manually start the dummy-ups driver after the other two have connected to upsd, are there any other errors? It is a reasonable use case, but as you can see, support is still evolving. We're open to feedback on ways to make this work better. Some thoughts for the third-generation dummy-ups driver are here, although you would most likely be interested in nutdrv-repeater: https://github.com/networkupstools/nut/issues/94 Unfortunately, I don't see any PPAs with backports to 12.04 (precise) listed here: https://launchpad.net/ubuntu/+source/nut Depending on how you feel about compiling your own binaries or packages, it is possible to mix-and-match certain components from different NUT versions. In particular, the latest upsdrvctl can easily launch drivers from the original Ubuntu package (the "maxretry" functionality is entirely contained within upsdrvctl), and you could divert the package's upsdrvctl binary so that the changes are not overwritten. Let us know if you would like to try that. -- Charles Lepple clepple at gmail