[Nut-upsuser] freenas USB connection error

Charles Lepple clepple at gmail.com
Sun Feb 15 03:13:27 UTC 2015

On Feb 14, 2015, at 2:43 PM, J Neethling <jneethling at webmail.co.za> wrote:

> 67611 blazer_usb CALL  write(0x2,0x7fffffffd2a0,0xc)
> 67611 blazer_usb GIO   fd 2 wrote 12 bytes
>       "   0.280697     "
> 67611 blazer_usb RET   write 12/0xc
> 67611 blazer_usb CALL  write(0x2,0x7fffffffd2a0,0x35)
> 67611 blazer_usb GIO   fd 2 wrote 53 bytes
>       "read: (229.6 219.5 220.0 021 49.7 2.25 18.5 00000001
>       "

Here's the strange part: the driver successfully queried the UPS once, and got a valid string back.

> 67611 blazer_usb CALL  ioctl(0x4,USB_DO_REQUEST,0x7fffffffe030)
> 67611 blazer_usb RET   ioctl -1 errno 5 Input/output error

However, this part indicates that there is a disconnect between the NUT driver (which printed "Permissions problem" due to an EPERM return code somewhere), and the kernel driver, which returned EIO.

Sadly, all nonzero error codes get mapped to EIO here:


If we look further into the kernel driver, it appears that there are some debugging messages:


It is unclear as to whether this can be enabled with a sysctl (hw.usb.debug), or if additional #defines are needed. For this, you might want to check with the FreeNAS folks, or try the FreeBSD USB list.

This is a bit of wishful thinking, but NUT 2.7.2 also has a newer driver for Megatec equipment: nutdrv_qx. While I don't recall any FreeBSD-specific tweaks to it, trying it would probably be faster than recompiling the kernel, and there is little to lose.

Charles Lepple
clepple at gmail

More information about the Nut-upsuser mailing list