Hello, misc@

run into problem connecting my new ups. it seems like problems with
libusb on OpenBSD-current .

UPS model is: Njoy Aten Pro 1000 USB

it works fine when I attach it to linux. but on OpenBSD NUT fails to
read it.

the device attaches as:
# usbdevs -vvvv 
addr 02: 0665:5161 Mustek Systems, PowerMust 800
         low speed, power 100 mA, config 1, rev 0.03
         driver: ugen0

lsusb 
Bus 000 Device 002: ID 0665:5161 Cypress Semiconductor USB to Serial

# lsusb -v -d 0665:5161

Bus 000 Device 002: ID 0665:5161 Cypress Semiconductor USB to Serial
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0665 Cypress Semiconductor
  idProduct          0x5161 USB to Serial
  bcdDevice            0.03
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      27
          Report Descriptor: (length is 27)
            Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
                            (null)
            Item(Local ): Usage, data= [ 0x01 ] 1
                            (null)
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0x02 ] 2
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Input, data= [ 0x82 ] 130
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile
Bitfield Item(Local ): Usage, data= [ 0x02 ] 2
                            (null)
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Output, data= [ 0x82 ] 130
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile
Bitfield Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               8
Device Status:     0x0000
  (Bus Powered)

/etc/nut/ups.conf reads:
[nutdev1]
        driver = "nutdrv_qx"
        vendorid = "0665"
        productid = "5161"
        bus = "000"
        pollinterval = "10"
        port = "auto"

# nutdrv_qx -DDDDDDDDDDDDDDDDDDDDD -a nutdev1

also tried with all subdriver options available for nutdrv_qx.
the result is the same:

Network UPS Tools - Generic Q* USB/Serial driver 0.32 (2.8.0)
USB communication driver (libusb 1.0) 0.43
   0.000000     [D3] do_global_args: var='W' val='<null>'
   0.000068     [D3] do_global_args: var='maxretry' val='3'
   0.000160     [D3] main_arg: var='driver' val='nutdrv_qx'
   0.000175     [D3] main_arg: var='vendorid' val='0665'
   0.000204     [D5] send_to_all: SETINFO driver.parameter.vendorid
"0665" 0.000210 [D3] main_arg: var='productid' val='5161'
   0.000216     [D5] send_to_all: SETINFO driver.parameter.productid
"5161" 0.000220 [D3] main_arg: var='bus' val='000'
   0.000225     [D5] send_to_all: SETINFO driver.parameter.bus "000"
   0.000229     [D3] main_arg: var='pollinterval' val='10'
   0.000246     [D3] main_arg: var='port' val='auto'
   0.000250     [D5] send_to_all: SETINFO driver.parameter.port
"auto" 0.000269 [D1] debug level is '21'
   0.015216     [D5] send_to_all: SETINFO device.type "ups"
   0.015233     [D1] upsdrv_initups...
   0.015758     [D2] libusb1: No appropriate HID device found
   0.015775     libusb1: Could not open any HID devices: no USB
buses found 0.015784    No supported devices found. Please check
your device availability with 'lsusb' and make sure you have an
up-to-date version of NUT. If this does not help, try running the
driver with at least 'subdriver', 'vendorid' and 'productid' options
specified. Please refer to the man page for details about these options
(man 8 nutdrv_qx).



lbld12# ls -l /dev/ugen0*
crw-rw----  1 root  _ups   63,   0 Mar 19 11:50 /dev/ugen0.00
crw-rw----  1 root  _ups   63,   1 Mar 19 11:50 /dev/ugen0.01
crw-rw----  1 root  _ups   63,   2 Mar 19 11:50 /dev/ugen0.02
crw-rw----  1 root  _ups   63,   3 Mar 19 11:50 /dev/ugen0.03
crw-rw----  1 root  _ups   63,   4 Mar 19 11:50 /dev/ugen0.04
crw-rw----  1 root  _ups   63,   5 Mar 19 11:50 /dev/ugen0.05
crw-rw----  1 root  _ups   63,   6 Mar 19 11:50 /dev/ugen0.06
crw-rw----  1 root  _ups   63,   7 Mar 19 11:50 /dev/ugen0.07
crw-rw----  1 root  _ups   63,   8 Mar 19 11:50 /dev/ugen0.08
crw-rw----  1 root  _ups   63,   9 Mar 19 11:50 /dev/ugen0.09
crw-rw----  1 root  _ups   63,  10 Mar 19 11:50 /dev/ugen0.10
crw-rw----  1 root  _ups   63,  11 Mar 19 11:50 /dev/ugen0.11
crw-rw----  1 root  _ups   63,  12 Mar 19 11:50 /dev/ugen0.12
crw-rw----  1 root  _ups   63,  13 Mar 19 11:50 /dev/ugen0.13
crw-rw----  1 root  _ups   63,  14 Mar 19 11:50 /dev/ugen0.14
crw-rw----  1 root  _ups   63,  15 Mar 19 11:50 /dev/ugen0.15


finally, here's what I read on linux:
   0.306500     Checking device (1D6B/0003) (002/001)
   0.334166     - VendorID: 1d6b
   0.334212     - ProductID: 0003
   0.334221     - Manufacturer: unknown
   0.334228     - Product: unknown
   0.334235     - Serial Number: unknown
   0.334243     - Bus: 002
   0.334251     - Device release number: 0519
   0.334261     Trying to match device
   0.334278     Device does not match - skipping
   0.334568     Checking device (0665/5161) (001/008)
   0.334640     - VendorID: 0665
   0.334657     - ProductID: 5161
   0.334669     - Manufacturer: unknown
   0.334677     - Product: unknown
   0.334688     - Serial Number: unknown
   0.334700     - Bus: 001
   0.334711     - Device release number: 0003
   0.334726     Trying to match device
   0.334852     Device matches
   0.334911     nut_usb_set_altinterface: skipped
usb_set_altinterface(udev, 0) 0.334938  send_to_all: SETINFO
ups.vendorid "0665" 0.334962    send_to_all: SETINFO ups.productid
"5161" 0.334986 send_to_all: SETINFO device.type "ups"
   0.335000     send_to_all: SETINFO driver.version "2.7.4"
   0.335014     send_to_all: SETINFO driver.version.internal "0.12"
   0.335027     send_to_all: SETINFO driver.name "blazer_usb"
   0.335037     Trying megatec protocol...
   0.335608     send: Q1
   0.626309     read: (229.7 229.8 229.8 000 50.0 2.27 26.7 00000001
   0.626382     send_to_all: SETINFO input.voltage "229.7"
   0.626399     send_to_all: SETINFO input.voltage.fault "229.8"
   0.626427     send_to_all: SETINFO output.voltage "229.8"
   0.626477     send_to_all: SETINFO ups.load "0"
   0.626527     send_to_all: SETINFO input.frequency "50.0"
   0.626549     send_to_all: SETINFO battery.voltage "2.27"
   0.626573     send_to_all: SETINFO ups.temperature "26.7"
   0.626592     send_to_all: SETINFO ups.beeper.status "enabled"
   0.626612     send_to_all: SETINFO ups.type "online"
   0.626633     send_to_all: SETINFO ups.status "OL"
   0.626648     Status read in 1 tries
   0.626662     Supported UPS detected with megatec protocol
   0.627257     send: F
   0.786131     read: #230.0 004 024.0 50.0
   0.786186     send_to_all: SETINFO input.voltage.nominal "230"
   0.786191     send_to_all: SETINFO input.current.nominal "4.0"
   0.786195     send_to_all: SETINFO battery.voltage.nominal "24.0"
   0.786201     send_to_all: SETINFO input.frequency.nominal "50"
   0.786204     Ratings read in 1 tries
   0.786714     send: I
   1.026302     read: #                WPHVT1K0   01060.08  
   1.026374     send_to_all: SETINFO ups.mfr ""
   1.026391     send_to_all: SETINFO ups.model "WPHVT1K0"
   1.026411     send_to_all: SETINFO ups.firmware "01060.08"
   1.026447     Vendor information read in 1 tries
   1.026467     No values provided for battery high/low voltages in
ups.conf

   1.026492     send_to_all: SETINFO battery.voltage.low "20.80"
   1.026522     send_to_all: SETINFO battery.voltage.high "26.00"
   1.026541     Using 'guestimation' (low: 20.800000, high:
   26.000000)! 1.026555 Battery runtime will not be calculated
   (runtimecal not set) 1.026572        send_to_all: SETINFO
   ups.delay.start "180" 1.026587       send_to_all: SETINFO
   ups.delay.shutdown "30" 1.026603     send_to_all: ADDCMD
   beeper.toggle 1.026617       send_to_all: ADDCMD load.off
   1.026632     send_to_all: ADDCMD load.on
   1.026642     send_to_all: ADDCMD shutdown.return
   1.026655     send_to_all: ADDCMD shutdown.stayoff
   1.026666     send_to_all: ADDCMD shutdown.stop
   1.026683     send_to_all: ADDCMD test.battery.start
   1.026700     send_to_all: ADDCMD test.battery.start.deep
   1.026714     send_to_all: ADDCMD test.battery.start.quick
   1.026728     send_to_all: ADDCMD test.battery.stop
   1.027431     send: Q1
   1.346318     read: (230.1 229.9 229.9 000 50.0 2.27 26.7 00000001
   1.346387     send_to_all: SETINFO input.voltage "230.1"
   1.346404     send_to_all: SETINFO input.voltage.fault "229.9"
   1.346422     send_to_all: SETINFO output.voltage "229.9"
   1.346462     send_to_all: SETINFO battery.charge "100"
   1.346479     send_to_all: SETINFO battery.voltage "27.24"
   1.346503     send_to_all: DATAOK
   1.346678     dstate_init: sock /run/nut/blazer_usb-njoy open on
   fd 5 1.346708        send_to_all: SETINFO
   driver.parameter.pollinterval "2" 1.346723   send_to_all:
   SETINFO driver.parameter.synchronous "no" 1.346741
   send_to_all: SETINFO device.mfr "" 1.346760  send_to_all:
   SETINFO device.model "WPHVT1K0" 1.347425     send: Q1
   1.626236     read: (229.7 229.8 229.7 000 50.0 2.27 26.7 00000001
   1.626308     send_to_all: SETINFO input.voltage "229.7"
   1.626325     send_to_all: SETINFO input.voltage.fault "229.8"
   1.626343     send_to_all: SETINFO output.voltage "229.7"

Reply via email to