[Nut-upsuser] Trouble getting Roline/Powercom UPS recognized

Charles Lepple clepple at gmail.com
Tue Jul 16 14:33:41 BST 2019


On Jul 16, 2019, at 3:52 AM, Patrick M. Hausen wrote:

> The OS is FreeBSD:
> 
> FreeBSD freenas-pmh.local 11.2-STABLE FreeBSD 11.2-STABLE #0 r325575+6aad246318c(HEAD): Mon Jun 24 17:25:47 UTC 2019     root at nemesis:/freenas-releng/freenas/_BE/objs/freenas-releng/freenas/_BE/os/sys/FreeNAS.amd64  amd64
> 
> This is the device:
> 
> ugen0.6: <POWERCOM Co.,LTD HID UPS Battery> at usbus0
> uhid0 on uhub0
> uhid0: <POWERCOM Co.,LTD HID UPS Battery, class 0/0, rev 1.10/0.02, addr 5> on usbus0

There may be an issue with the uhid driver binding to the device. I can't remember which versions of FreeBSD this affects, though.

> This is the driver version:
> 
> root at freenas-pmh[~]#  /usr/local/libexec/nut/usbhid-ups -V
> Network UPS Tools - Generic HID driver 0.41 (2.7.4)
> USB communication driver 0.33
> 
> Came bundled with the FreeNAS installation.

This driver is using the libusb-0.1 API through FreeBSD's emulation layer (since they implement a different API that is closer to libusb-1.0).

We have another branch that uses the libusb-1.0 API: https://github.com/networkupstools/nut/issues/300

> ups.conf:
> 
> root at freenas-pmh[~]# cat /usr/local/etc/nut/ups.conf 
> [roline]
>    driver = usbhid-ups
>    port = /dev/uhid0
>    desc = “"

As mentioned here: https://networkupstools.org/docs/man/usbhid-ups.html#_implementation

"The driver ignores the "port" value in ups.conf."

The problem is that libusb does not provide a way to open a specific device by pathname, and if it did, it would need a generic USB device node (like the /dev/ugen* names shown at the end of the "Checking device" log messages) rather than a USB HID device node. Instead, if you have multiple UPSes, see the previous section in the man page.

We recommend putting something like "port = auto" in the configuration file.

> Debug output:
> 
> root at freenas-pmh[~]#  /usr/local/libexec/nut/usbhid-ups -DD -a roline
> Network UPS Tools - Generic HID driver 0.41 (2.7.4)
> USB communication driver 0.33
>   0.000000	debug level is '2'
>   0.000746	upsdrv_initups...
>   0.001256	Checking device (0D9F/0004) (/dev/usb//dev/ugen0.6)
>   0.193552	- VendorID: 0d9f
>   0.193573	- ProductID: 0004
>   0.193579	- Manufacturer: unknown
>   0.193582	- Product: unknown
>   0.193586	- Serial Number: unknown
>   0.193589	- Bus: /dev/usb
>   0.193592	- Device release number: 0002
>   0.193598	Trying to match device
>   0.193608	Device matches
>   0.261466	Unable to get HID descriptor (Unknown error)
>   0.261487	HID descriptor length 996
>   0.328756	Unable to get Report descriptor: Input/output error

This is the case where the libusb-1.0 API might provide better error messages. These might be related to permissions - check to see if the /dev/ugen0.6 node is writable by the NUT user/group. (There should be a devd.conf file installed under /usr/local to make this work.)

> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser




More information about the Nut-upsuser mailing list