[Nut-upsuser] NUT upgrade to 2.6.0 in Gentoo with Liebert UPS

Francesco Talamona francesco.talamona at know.eu
Tue Apr 5 05:14:09 UTC 2011


I have a 64 bit Gentoo, with a Liebert UPS. The last NUT working version 
was sys-power/nut-2.4.1-r1 (I also tried sys-power/nut-2.4.3-r2 but 
downgraded, don't remember the reason).

Anyway with the upgrade to sys-power/nut-2.6.0 I started to see this 
error message when I try to start upsdrv:
[root at aemaeth:/etc/nut]$ /etc/init.d/upsdrv start
* Starting UPS drivers ...
Network UPS Tools - UPS driver controller 2.6.0
Network UPS Tools - Liebert MultiLink UPS driver 1.02 (2.6.0)
Warning: This is an experimental driver.
Some features may not function correctly.
tcgetattr(/dev/liebert-ups): Inappropriate ioctl for device
Driver failed to start (exit status=1)
* Failed to start UPS drivers! [ !! ]
* ERROR: upsdrv failed to start

Upgrade instruction don't say anything relevant.
The link /dev/liebert-ups -> usb/hiddev0 is managed by udev, and the 
permissons should be ok, this problem is present also if I set user=root 
in /etc/nut/ups.conf (see further below my tests)

So I did a little testing:
[root at aemaeth:/lib/nut]$ ll /dev/usb/hiddev0
crw-rw---- 1 nut nut 180, 96 26 mar 08.44 /dev/usb/hiddev0

[root at aemaeth:/lib/nut]$ cat /etc/nut/ups.conf | egrep -v '\#|^$'
user = nut
[liebert]
port = /dev/liebert-ups
driver = usbhid-ups

[root at aemaeth:/lib/nut]$ ./usbhid-ups -a liebert -DDDDD
Network UPS Tools - Generic HID driver 0.35 (2.6.0)
USB communication driver 0.31
0.000000	debug level is '5'
0.000507	upsdrv_initups...
0.000893	Checking device (05AB/0060) (001/006)
0.000929	- VendorID: 05ab
0.000936	- ProductID: 0060
0.000942	- Manufacturer: unknown
0.000947	- Product: unknown
0.000953	- Serial Number: unknown
0.000958	- Bus: 001
0.000963	Trying to match device
0.000982	Device does not match - skipping
0.000991	Checking device (0BC2/2300) (001/002)
0.001005	- VendorID: 0bc2
0.001011	- ProductID: 2300
0.001017	- Manufacturer: unknown
0.001022	- Product: unknown
0.001028	- Serial Number: unknown
0.001033	- Bus: 001
0.001038	Trying to match device
0.001044	Device does not match - skipping
0.001051	Checking device (1D6B/0002) (001/001)
0.001065	- VendorID: 1d6b
0.001071	- ProductID: 0002
0.001076	- Manufacturer: unknown
0.001082	- Product: unknown
0.001087	- Serial Number: unknown
0.001093	- Bus: 001
0.001098	Trying to match device
0.001104	Device does not match - skipping
0.001111	Checking device (10AF/0004) (002/007)
0.001126	- VendorID: 10af
0.001132	- ProductID: 0004
0.001137	- Manufacturer: unknown
0.001143	- Product: unknown
0.001148	- Serial Number: unknown
0.001154	- Bus: 002
0.001159	Trying to match device
0.001168	This Liebert device (10af:0004) is not (or perhaps not 
yet) supported
by usbhid-ups. Please make sure you have an up-to-date version of NUT. 
If
this does not fix the problem, try running the driver with the
'-x productid=0004' option. Please report your results to the NUT user's
mailing list <nut-upsuser at lists.alioth.debian.org>.
0.001181	Device does not match - skipping
0.001188	Checking device (046D/C517) (002/005)
0.001203	- VendorID: 046d
0.001209	- ProductID: c517
0.001214	- Manufacturer: unknown
0.001219	- Product: unknown
0.001225	- Serial Number: unknown
0.001230	- Bus: 002
0.001236	Trying to match device
0.001242	Device does not match - skipping
0.001249	Checking device (10D5/000D) (002/006)
0.001263	- VendorID: 10d5
0.001270	- ProductID: 000d
0.001275	- Manufacturer: unknown
0.001281	- Product: unknown
0.001286	- Serial Number: unknown
0.001291	- Bus: 002
0.001297	Trying to match device
0.001303	Device does not match - skipping
0.001310	Checking device (058F/9254) (002/002)
0.001323	- VendorID: 058f
0.001329	- ProductID: 9254
0.001335	- Manufacturer: unknown
0.001340	- Product: unknown
0.001346	- Serial Number: unknown
0.001352	- Bus: 002
0.001357	Trying to match device
0.001363	Device does not match - skipping
0.001370	Checking device (0A12/0001) (002/004)
0.001382	- VendorID: 0a12
0.001388	- ProductID: 0001
0.001393	- Manufacturer: unknown
0.001399	- Product: unknown
0.001404	- Serial Number: unknown
0.001410	- Bus: 002
0.001415	Trying to match device
0.001421	Device does not match - skipping
0.001428	Checking device (1D6B/0001) (002/001)
0.001442	- VendorID: 1d6b
0.001448	- ProductID: 0001
0.001453	- Manufacturer: unknown
0.001459	- Product: unknown
0.001464	- Serial Number: unknown
0.001470	- Bus: 002
0.001475	Trying to match device
0.001481	Device does not match - skipping
0.001488	No appropriate HID device found
0.001496	No matching HID UPS found

So far so good
[root at aemaeth:/lib/nut]$ lsusb -d 10af:0004
Bus 002 Device 007: ID 10af:0004 Liebert Corp. PowerSure PSI UPS
This command indeed goes a little further and tries belkin driver (not 
really operational tho):

[root at aemaeth:/lib/nut]$ ./usbhid-ups -a liebert -x productid=0004 -u 
root -DD
Network UPS Tools - Generic HID driver 0.35 (2.6.0)
USB communication driver 0.31
0.000000	debug level is '2'
0.000469	upsdrv_initups...
0.000808	Checking device (05AB/0060) (001/006)
0.040630	- VendorID: 05ab
0.040653	- ProductID: 0060
0.040658	- Manufacturer: In-System Design
0.040664	- Product: USB Storage Adapter
0.040669	- Serial Number: 2BFF0118031FA7BB
0.040674	- Bus: 001
0.040679	Trying to match device
0.040706	Device does not match - skipping
0.040723	Checking device (0BC2/2300) (001/002)
0.041855	- VendorID: 0bc2
0.041871	- ProductID: 2300
0.041877	- Manufacturer: Seagate
0.041882	- Product: Portable
0.041887	- Serial Number: 2GH23G2A
0.041893	- Bus: 001
0.041898	Trying to match device
0.041907	Device does not match - skipping
0.041917	Checking device (1D6B/0002) (001/001)
0.041944	- VendorID: 1d6b
0.041950	- ProductID: 0002
0.041955	- Manufacturer: Linux 2.6.38-gentoo ehci_hcd
0.041962	- Product: EHCI Host Controller
0.041968	- Serial Number: 0000:00:02.1
0.041973	- Bus: 001
0.041978	Trying to match device
0.041984	Device does not match - skipping
0.041991	Checking device (10AF/0004) (002/007)
0.062231	- VendorID: 10af
0.062255	- ProductID: 0004
0.062261	- Manufacturer: Liebert
0.062266	- Product: Liebert PSI 1000 FW:06
0.062272	- Serial Number: 0523700073AD059
0.062277	- Bus: 002
0.062283	Trying to match device
0.062330	Device matches
0.062354	failed to claim USB device: could not claim interface 0: 
Device or resource busy
0.062375	detached kernel driver from USB device...
0.071243	HID descriptor length 653
0.098232	Report Descriptor size = 653
0.098450	Using subdriver: Belkin HID 0.12
0.101243	refresh_report_buffer: expected 2 bytes, but got 8 
instead
0.101289	Path: UPS.BELKINConfig.BELKINConfigVoltage, Type: Feature, 
ReportID: 0x01, Offset: 0, Size: 8, Value: 230
0.104233	refresh_report_buffer: expected 2 bytes, but got 8 
instead
0.104268	Path: UPS.BELKINConfig.BELKINConfigFrequency, Type: 
Feature, ReportID: 0x02, Offset: 0, Size: 8, Value: 50

so far the best result is:
[root at aemaeth:/lib/nut]$ cat /etc/nut/ups.conf | egrep -v '\#|^$'
user = root
[liebert]
port = /dev/liebert-ups
driver = usbhid-ups

[root at aemaeth:/lib/nut]$ /etc/init.d/upsdrv start
* Starting UPS drivers ...
Network UPS Tools - UPS driver controller 2.6.0
Network UPS Tools - Generic HID driver 0.35 (2.6.0)
USB communication driver 0.31
Using subdriver: Belkin HID 0.12
that gives in /var/log/messages:
Apr 4 22:59:26 aemaeth kernel: usb 2-5: usbfs: process 31854 (usbhid-
ups) did not claim interface 0 before use
Apr 4 22:59:26 aemaeth kernel: usb 2-5: usbfs: process 31854 (usbhid-
ups) did not claim interface 0 before use
Apr 4 22:59:26 aemaeth usbhid-ups[31854]: libusb_get_interrupt: error 
submitting URB: Device or resource busy
Apr 4 22:59:26 aemaeth usbhid-ups[31854]: libusb_get_report: error 
sending control message: Device or resource busy
Apr 4 22:59:26 aemaeth usbhid-ups[31854]: Got disconnected by another 
driver: Device or resource busy

Debugging wih the original setup (that worked for years) isn't of much 
help:
[root at aemaeth:/lib/nut]$ ./liebert -a liebert -DDDDD
Network UPS Tools - Liebert MultiLink UPS driver 1.02 (2.6.0)
Warning: This is an experimental driver.
Some features may not function correctly.
0.000000	debug level is '5'
0.000492	tcgetattr(/dev/liebert-ups): Inappropriate ioctl for 
device

I don't know what else I can try, I simply don't understand what's going 
on. Donwgrade isn't a good option because nut-2.4.1-r1 is no more in the 
portage tree: it isn't impossible to install, but I prefer to make the 
new one work.

Thanks in advance
	Francesco

-- 
Linux Version 2.6.38-gentoo-r1, Compiled #1 SMP PREEMPT Fri Apr 1 
20:26:45 CEST 2011
Two 1GHz AMD Athlon 64 Processors, 4GB RAM, 4020.54 Bogomips Total
aemaeth



More information about the Nut-upsuser mailing list