Hi, I've got two MGE Ellipse 1500 UPS connected via usb to an ubuntu jaunty system with nut and libupsclient1 2.4.1-2ubuntu4. As soon as I start the driver for the second one, they start fighting each other and I get no data. I found an older post to this list that said: If you want to monitor multiple UPSes through usbhid-ups, you *must* make sure that each one can be uniquely identified through the "vendor", "product", "serial", "vendorid", "productid" and "bus" regular expressions (see 'man 8 usbhid-ups' for an explanation how to use these). So I ran lsusb -v and got two different values for iSerial (1HCG4700J and 000000000) and iManufacturer ('1 MGE UPS SYSTEMS' and '1 EATON'). Strangely, vendor is '0x0463 MGE UPS Systems' for both. They're also on the same bus ('Bus 003 Device 063' and 'Bus 003 Device 064') Since there is no flag for manufacturer, I had to go with serial. This is my new ups.conf: [ups1] driver = usbhid-ups port = /dev/usb/hiddev0 serial=000000000 [ups2] driver = usbhid-ups port = /dev/usb/hiddev1 serial=1HCG4700J When I run upsdrvctl start ups1, it starts /lib/nut/usbhid-ups -a ups1 but no -x flag. Starting usbhid-ups manually with the -x serial=000000000 and -DD flag shows: Checking device (0463/FFFF) (003/064) - VendorID: 0463 - ProductID: ffff - Manufacturer: MGE UPS SYSTEMS - Product: ELLIPSE - Serial Number: 1HCG4700J - Bus: 003 Trying to match device Device does not match - skipping Checking device (0463/FFFF) (003/063) - VendorID: 0463 - ProductID: ffff - Manufacturer: EATON - Product: ELLIPSE - Serial Number: 000000000 - Bus: 003 Trying to match device Device matches so it seems to be working. But how can I get upsdrvctl to add the -x flag automatically? Cheers, Tom
Citeren Thomas Gutzler <thomas.gutzler op gmail.com>: [...]> Strangely, vendor is '0x0463 MGE UPS Systems' for both.Eaton is now the owner of what was formerly known as MGE Office Protection Systems, which in turn is part of what used to be known as MGE.> They're also on the same bus ('Bus 003 Device 063' and 'Bus 003 Device 064') > Since there is no flag for manufacturer,There is. See 'man 8 usbhid-ups' for all regular expressions that you can use to identify units.> I had to go with serial. This > is my new ups.conf: > [ups1] > driver = usbhid-ups > port = /dev/usb/hiddev0 > serial=000000000 > [ups2] > driver = usbhid-ups > port = /dev/usb/hiddev1 > serial=1HCG4700JThe value of port isn't used, so we recommend setting it to port = auto to prevent people from thinking that it attaches to the location specified (this value needs to be present, but isn't actually used).> When I run upsdrvctl start ups1, it starts /lib/nut/usbhid-ups -a ups1 > but no -x flag.The driver reads most parameters directly from ups.conf, so this isn't added by upsdrvctl.> Starting usbhid-ups manually with the -x serial=000000000 and -DD flag shows: > Checking device (0463/FFFF) (003/064) > - VendorID: 0463 > - ProductID: ffff > - Manufacturer: MGE UPS SYSTEMS > - Product: ELLIPSE > - Serial Number: 1HCG4700J > - Bus: 003 > Trying to match device > Device does not match - skipping > Checking device (0463/FFFF) (003/063) > - VendorID: 0463 > - ProductID: ffff > - Manufacturer: EATON > - Product: ELLIPSE > - Serial Number: 000000000 > - Bus: 003 > Trying to match device > Device matches > > so it seems to be working. But how can I get upsdrvctl to add the -x > flag automatically?This isn't needed. Running /lib/nut/usbhid-ups -DD -a ups1 and /lib/nut/usbhid-ups -DD -a ups2 in another window should result in both instances running fine. Likewise, running it from upsdrvctl (with the above ups.conf file) should also work. Please confirm that there are no instances of usbhid-ups left running in the background before trying this out. This is a common mistake. One thing you may want to check as well, is that there are no trailing spaces in ups.conf. We have unconfirmed reports that this could confuse the configuration parser (but were never able to reproduce the problem). Best regards, Arjen -- Please keep list traffic on the list
On Nov 15, 2009, at 8:18 AM, Thomas Gutzler wrote:> So I ran lsusb -v and got two different values for iSerial (1HCG4700J > and 000000000) and iManufacturer ('1 MGE UPS SYSTEMS' and '1 EATON').Note that when interpreting values from lsusb, the members starting with "i" are indices (in this case, indexing the string descriptors). The index for iManufacturer seems to be "1", and the value that you specify in the configuration file is the portion *after* that index ("MGE UPS SYSTEMS" or "EATON", depending on how new the unit is).
Citeren Thomas Gutzler <thomas.gutzler op gmail.com>:> My setup is this: I have 6 computers on 2 UPSs (3 each). Boths UPSs have > equal power ratings but the load on the slave is less. They are both > connected to and monitored by the same computer (I call it monitor); one > UPS is configured as master (the one with the monitor on it) and the > other is configured as slave. The computers connected to slave should > shut down first because they're nfs mounting from one of the computers > on the master UPS. > > Assuming that the master runs out of battery first, my understanding is > that I could catch the master's LOWBATT notice and use it to shut down > the computers on the slave (via ssh <host> poweroff) and then catch the > master's FSD to shut down the computers on the master excluding the > monitor because that one is brought down last (to runlevel 0) by upsmon > executing SHUTDOWNCMD. Is there a smarter way doing it - perhaps setting > sdorder?There is. You can do this much better entirely in the upsmon.conf files on the various systems, without having to write your own shutdown scripts. The trick is that there should be one decision moment when it is time to commence shutting down of *all* systems. Otherwise you risk that if the power returns before all systems go critical, some of them won't shutdown and others that have already started shutting down, won't be restarted. You don't want that if this happens at 3am... The most convenient location to do this, is on the system that is attached to the UPS'es. System controlling the UPS'es (monitor): MONITOR ups1 op localhost 1 monmaster blah master MONITOR ups2 op localhost 1 monmaster blah master MINSUPPLIES 2 FINALDELAY 5 System running the NFS: MONITOR ups1 op monitor.example.com 1 monslave blah slave MINSUPPLIES 1 FINALDELAY 120 All other systems: MONITOR ups1 op monitor.example.com 1 monslave blah slave or MONITOR ups1 op monitor.example.com 1 monslave blah slave MINSUPPLIES 1 FINALDELAY 5 The above will initiate the shutdown sequence when either of the two UPS devices goes critical (On Battery and Low Battery at the same time). The NFS system will wait 120 seconds before the SHUTDOWNCMD is sent, all others will do so after 5 seconds (which means that they have almost two minutes before the NFS will shutdown). Note that you need a fairly long 'offdelay' for at least 'ups1', since the monitor system will start the shutdown sequence long before the NFS will. The minimum time needed, is the time it takes to shutdown the NFS + 120 seconds in this example. You can prevent the risk of 'ups1' shutting down before the NFS is ready to lose power, by running the monitoring from the NFS system. Generally, the system that needs to be powered longest should run the master upsmon(s). In that case, an offdelay of a couple of seconds is sufficient. You'll want to guarantee that there is ample of power left when the systems start shutting down (because there is a substantial delay between that and the actual shutdown), so set the 'battery.charge.low' not lower than something like 50% and also the restart level to the same (although not all UPS devices support the latter).> To make sure both UPSs shut down, I write a shutdown script for runlevel > 0 which checks for the existence of POWERDOWNFLAG, runs upsdrvctl > shutdown for all UPSs and possibly a shutdown -P now. Fortunately, > ubuntu comes with such a script (K50nut) but it has to be executed with > the parameter 'poweroff', not 'stop'. So, am I supposed to write a > shutdown script /etc/rc0.d/K99upspoweroff that calls '/etc/rc0.d/K50nut > poweroff'?Not if you use the above upsmon configuration, assuming that the people of Ubuntu created a proper shutdown script.> What's left but not necessary is to make sure that 'Interval to wait > after shutdown with delay command (seconds)' on my master UPS is long > enough for the monitor to power off properly after being halted.By the time 'upsdrvctl shutdown' runs, all systems should be ready for loss of power. Most already will have powered off already, but you'll want to make sure that the controlling systems doesn't shutdown before the NFS system. In order to be able to restart if the power returns in the mean time, 'ondelay' must be higher than 'offdelay'. Best regards, Arjen -- Please keep list traffic on the list