Danilo Godec
2011-Jun-03 12:21 UTC
[Nut-upsuser] Two identical UPS's on USB - how to diferentiate?
Hi, I have two identical UPS's on USB bus. The original machine I was going to use for UPS monitoring only had had USB bus, so these two UPS's were seen like that: Bus 001 Device 009: ID 14f0:00c9 Bus 001 Device 007: ID 14f0:00c9 There was no description on the right side either. If I used the 'verbose' flag, both UPS's had the exact same output... I since replaced the machine and used one with two USB buses, so my problem is fixed... But if I couldn't do that, is there any way to distinguish between the two in 'ups.conf'? Danilo PS: Since I have about an hour of battery running time and a generator, the plan is not to shutdown any machine, but to manually start the generator. That's why I have just one hosts monitoring both UPS's and alerting the responsible person via SMS / GSM.
Charles Lepple
2011-Jun-06 11:26 UTC
[Nut-upsuser] Two identical UPS's on USB - how to diferentiate?
On Jun 3, 2011, at 8:21 AM, Danilo Godec wrote:> Hi, > > I have two identical UPS's on USB bus. The original machine I was > going > to use for UPS monitoring only had had USB bus, so these two UPS's > were > seen like that: > > Bus 001 Device 009: ID 14f0:00c9 > Bus 001 Device 007: ID 14f0:00c9I don't know much about the blazer_usb driver (which seems to be the appropriate one for this hardware), but in general, I am pretty sure that using libusb to access USB devices does not let us distinguish between a device which has already been claimed by another NUT driver, versus a device which is claimed by a kernel driver (usually the USB HID driver). Even so, we don't know whether it has been claimed until we try to open it and get an error. The short version is that we need something unique to distinguish the two devices when opening them, even if it doesn't matter later on which one is claimed by which driver.> There was no description on the right side either. If I used the > 'verbose' flag, both UPS's had the exact same output...If you run 'lsusb' without any options, that description comes from the usb.ids file. Your distribution might have a script to pull down an updated version, but since the lookup keys are the Vendor ID (14f0) and Product ID (00c9), that description won't distinguish between the two devices either. This situation is a good argument for including a USB serial number on new devices (which would show up in the lsusb verbose output).