[Nut-upsuser] freenas USB connection error

J Neethling jneethling at webmail.co.za
Sun Feb 15 07:35:28 UTC 2015


On Sat, 14 Feb 2015 22:13:27 -0500 Charles Lepple <clepple at gmail.com> wrote

> 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:
> 
>   
>
http://fxr.watson.org/fxr/source/dev/usb/usb_generic.c?v=FREEBSD92;im=10#L911
> 
> If we look further into the kernel driver, it appears that there are some
> debugging messages: 
>
>   
>
http://fxr.watson.org/fxr/source/dev/usb/usb_request.c?v=FREEBSD92;im=10#L393
> 
> 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. 

I'll look into this and see if I can provide more information.

>
> 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. 

Shortcut activated - no luck :( In case there is different output that may be
useful:
# /usr/local/libexec/nut/nutdrv_qx -DD -q -a ups            Network UPS Tools
- Generic Q* USB/Serial driver 0.06 (2.7.2)
USB communication driver 0.32
   0.000000	debug level is '2'
   0.000753	upsdrv_initups...
   0.001484	Checking device (06DA/0201) (/dev/usb//dev/ugen0.2)
   0.033000	- VendorID: 06da
   0.033028	- ProductID: 0201
   0.033035	- Manufacturer: PPC
   0.033043	- Product: USB Card
   0.033050	- Serial Number: unknown
   0.033056	- Bus: /dev/usb
   0.033063	Trying to match device
   0.033074	Device matches
   0.095010	qx_process_answer: short reply (input.voltage)
   1.175481	Permissions problem: Input/output error


ktrace output (snippet)
  4938 nutdrv_qx RET   write 12/0xc
  4938 nutdrv_qx CALL  write(0x2,0x7fffffffc010,0x17)
  4938 nutdrv_qx GIO   fd 2 wrote 23 bytes
       "Trying to match device
       "
  4938 nutdrv_qx RET   write 23/0x17
  4938 nutdrv_qx CALL  gettimeofday(0x7fffffffcaa0,0)
  4938 nutdrv_qx RET   gettimeofday 0
  4938 nutdrv_qx CALL  write(0x2,0x7fffffffc010,0xc)
  4938 nutdrv_qx GIO   fd 2 wrote 12 bytes
       "   0.034004	"
  4938 nutdrv_qx RET   write 12/0xc
  4938 nutdrv_qx CALL  write(0x2,0x7fffffffc010,0xf)
  4938 nutdrv_qx GIO   fd 2 wrote 15 bytes
       "Device matches
       "
  4938 nutdrv_qx RET   write 15/0xf
  4938 nutdrv_qx CALL  ioctl(0x5,USB_FS_UNINIT,0x7fffffffcb77)
  4938 nutdrv_qx RET   ioctl 0
  4938 nutdrv_qx CALL  ioctl(0x4,USB_SET_ALTINTERFACE,0x7fffffffcb80)
  4938 nutdrv_qx RET   ioctl 0
  4938 nutdrv_qx CALL  ioctl(0x5,USB_FS_INIT,0x7fffffffcb50)
  4938 nutdrv_qx RET   ioctl 0
  4938 nutdrv_qx CALL  ioctl(0x4,USB_DO_REQUEST,0x7fffffffe080)
  4938 nutdrv_qx RET   ioctl 0
  4938 nutdrv_qx CALL  ioctl(0x5,USB_FS_OPEN,0x7fffffffdff0)
  4938 nutdrv_qx RET   ioctl 0
  4938 nutdrv_qx CALL  ioctl(0x5,USB_FS_START,0x7fffffffe087)
  4938 nutdrv_qx RET   ioctl 0
  4938 nutdrv_qx CALL  ioctl(0x5,USB_FS_COMPLETE,0x7fffffffe087)
  4938 nutdrv_qx RET   ioctl -1 errno 16 Device busy
  4938 nutdrv_qx CALL  poll(0x7fffffffe080,0x1,0xffffffff)
  4938 nutdrv_qx RET   poll 1
  4938 nutdrv_qx CALL  ioctl(0x5,USB_FS_COMPLETE,0x7fffffffe087)
  4938 nutdrv_qx RET   ioctl 0
  4938 nutdrv_qx CALL  ioctl(0x5,USB_FS_COMPLETE,0x7fffffffe087)
  4938 nutdrv_qx RET   ioctl -1 errno 16 Device busy
  4938 nutdrv_qx CALL  gettimeofday(0x7fffffffe1f0,0)
  4938 nutdrv_qx RET   gettimeofday 0
  4938 nutdrv_qx CALL  write(0x2,0x7fffffffd760,0xc)
  4938 nutdrv_qx GIO   fd 2 wrote 12 bytes
       "   0.172803	"
  4938 nutdrv_qx RET   write 12/0xc
  4938 nutdrv_qx CALL  write(0x2,0x7fffffffd760,0x2f)
  4938 nutdrv_qx GIO   fd 2 wrote 47 bytes
       "qx_process_answer: short reply (input.voltage)
       "
  4938 nutdrv_qx RET   write 47/0x2f
  4938 nutdrv_qx CALL  ioctl(0x4,USB_DO_REQUEST,0x7fffffffe080)
  4938 nutdrv_qx RET   ioctl -1 errno 5 Input/output error
  4938 nutdrv_qx CALL  stat(0x7fffffffd8d0,0x7fffffffdcd0)
  4938 nutdrv_qx NAMI  "/usr/share/nls/C/libc.cat"
  4938 nutdrv_qx RET   stat -1 errno 2 No such file or directory
  4938 nutdrv_qx CALL  stat(0x7fffffffd8d0,0x7fffffffdcd0)
  4938 nutdrv_qx NAMI  "/usr/share/nls/libc/C"
  4938 nutdrv_qx RET   stat -1 errno 2 No such file or directory
  4938 nutdrv_qx CALL  stat(0x7fffffffd8d0,0x7fffffffdcd0)
  4938 nutdrv_qx NAMI  "/usr/local/share/nls/C/libc.cat"
  4938 nutdrv_qx RET   stat -1 errno 2 No such file or directory
  4938 nutdrv_qx CALL  stat(0x7fffffffd8d0,0x7fffffffdcd0)
  4938 nutdrv_qx NAMI  "/usr/local/share/nls/libc/C"
  4938 nutdrv_qx RET   stat -1 errno 2 No such file or directory
  4938 nutdrv_qx CALL  gettimeofday(0x7fffffffe200,0)
  4938 nutdrv_qx RET   gettimeofday 0
  4938 nutdrv_qx CALL  write(0x2,0x7fffffffd770,0xc)
  4938 nutdrv_qx GIO   fd 2 wrote 12 bytes
       "   1.254156	"
  4938 nutdrv_qx RET   write 12/0xc
  4938 nutdrv_qx CALL  write(0x2,0x7fffffffd770,0x28)
  4938 nutdrv_qx GIO   fd 2 wrote 40 bytes
       "Permissions problem: Input/output error
       "
  4938 nutdrv_qx RET   write 40/0x28
  4938 nutdrv_qx CALL  sigprocmask(SIG_BLOCK,0x800836720,0x7fffffffe0a0)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_SETMASK,0x800836730,0)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_BLOCK,0x800836720,0x7fffffffe050)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_SETMASK,0x800836730,0)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_BLOCK,0x800836720,0x7fffffffe050)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_SETMASK,0x800836730,0)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_BLOCK,0x800836720,0x7fffffffe050)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_SETMASK,0x800836730,0)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_BLOCK,0x800836720,0x7fffffffe050)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_SETMASK,0x800836730,0)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_BLOCK,0x800836720,0x7fffffffe050)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_SETMASK,0x800836730,0)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_BLOCK,0x800836720,0x7fffffffe050)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  sigprocmask(SIG_SETMASK,0x800836730,0)
  4938 nutdrv_qx RET   sigprocmask 0
  4938 nutdrv_qx CALL  exit(0x1)


Seems like we get further this time actually querying the ups parameters?

Thanks for the assistance :)




____________________________________________________________
South Africas premier free email service - www.webmail.co.za





More information about the Nut-upsuser mailing list