From nobody Fri Jul 19 04:53:07 2024 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WQHP42C2Zz5R7FQ for ; Fri, 19 Jul 2024 04:53:12 +0000 (UTC) (envelope-from graham@menhennitt.com.au) Received: from rusty.tulip.relay.mailchannels.net (rusty.tulip.relay.mailchannels.net [23.83.218.252]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WQHP33000z4nmh for ; Fri, 19 Jul 2024 04:53:11 +0000 (UTC) (envelope-from graham@menhennitt.com.au) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=menhennitt.com.au header.s=dreamhost header.b=PpbEMiq7; dmarc=none; spf=pass (mx1.freebsd.org: domain of graham@menhennitt.com.au designates 23.83.218.252 as permitted sender) smtp.mailfrom=graham@menhennitt.com.au; arc=pass ("mailchannels.net:s=arc-2022:i=1") X-Sender-Id: dreamhost|x-authsender|graham@menhennitt.com.au Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id AD7976C3F6D for ; Fri, 19 Jul 2024 04:53:09 +0000 (UTC) Received: from pdx1-sub0-mail-a301.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4866C6C485C for ; Fri, 19 Jul 2024 04:53:09 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1721364789; a=rsa-sha256; cv=none; b=2HDNstY5Mq2x32CHMwohXlh4kuKkDGJ92Aa+6o5KRw1G9i3qbOdhlozouqxiuK2J+7GfET mjFYIOeomBIjcVjauIBuRbT4PD7zEWcVGhoMfS+zzEYW565lFBOvr3zpWBU4hKsB9rDnvh jW7RhoX80M/XUt9FPiGXkgVJe7cMuVd3ZC1mAAl4rrZJKH7+HdNFk3ppCle1X67lyr9qJw KVFhc0RYDclDe0WsOTJgeqBPk+ma8Q84yzq8v0blS5tHj/Qtqthd4aHt0hReEJJMAjDOwf 7/GPky6wmLoQarOP+9Q+/INpCGM9CvzTDZ3g6sWCVgViZvWQKbMZoqK7evDz5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1721364789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FFzhTElQWc8PZXSQhWo8tukSXKjRshv41PXY/NvuTE8=; b=lgNuZF+P4xY5y8RA5zyBTMlDOCaBArDdybQajId7+efoydKqukFfBpz8fcGYFID2KQQqzO VY4Ln9b7HanXdWBz8yPoEPAhLsoUCLDdAu+/KCwUkqNyRYj9QDfKxWNb1hriT38CwRaw8t rEfJfdAiDRDvwcatSZIcU6FMRX46v4w37KWpJ/BwGTYIu1+mpCFc0yUWGjlcF1MWJUrWaN +Khg+DqjDiG45sDDtspL+SAh7+mW0r6OWfLwl/jaKPhje9Wf8DxWhVSabxixyviwJ9PDw0 ILVosOHYo4/rGzXmPvF47Ikfb8R1Z+O4sx5pF9T/lUcw7vizxJ+i5hkVJ+kGQQ== ARC-Authentication-Results: i=1; rspamd-585d4c99d7-925fm; auth=pass smtp.auth=dreamhost smtp.mailfrom=graham@menhennitt.com.au X-Sender-Id: dreamhost|x-authsender|graham@menhennitt.com.au X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|graham@menhennitt.com.au X-MailChannels-Auth-Id: dreamhost X-Spill-Thoughtful: 306836957ddc3dc3_1721364789515_2720566729 X-MC-Loop-Signature: 1721364789515:4247056725 X-MC-Ingress-Time: 1721364789515 Received: from pdx1-sub0-mail-a301.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.115.121.42 (trex/7.0.2); Fri, 19 Jul 2024 04:53:09 +0000 Received: from [203.3.73.118] (unknown [118.102.125.251]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: graham@menhennitt.com.au) by pdx1-sub0-mail-a301.dreamhost.com (Postfix) with ESMTPSA id 4WQHP05FBqz6H for ; Thu, 18 Jul 2024 21:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=menhennitt.com.au; s=dreamhost; t=1721364789; bh=FFzhTElQWc8PZXSQhWo8tukSXKjRshv41PXY/NvuTE8=; h=Content-Type:Date:Subject:From:To; b=PpbEMiq7nBbUBLWkhcr3v0CtFuox1RKDILq2ubaFffmwrtymbzglUpCN3ftyELOPk ITSu6akiSzTl6liRUbRSpVOVBUGfY5JHlh85t+yZUwymQnfrVTduf+qCT8508qm93l S3fX6fAONlEw/FecdTRU2w5RzSTJQI+INtzYVg7yNTKn99d5/8586yU0k4AeLobOxk WpTBK/ClvT/oTts+MBcx3y2rDhTDRTYbgkhVT8qfa4pqTe64g6nefwxLaQOvlX9W53 Dsf+Nua8yKjEhdvGJlmxDD5RWOnq2gUT7nrzXOAt/YB6dUk098TMD6y0DBjNMrW2mk axkTy0lbnI7QQ== Content-Type: multipart/alternative; boundary="------------nmVQDBxVKZXqZQGMqcj0Y50T" Message-ID: <019983a9-9429-4c12-bdb9-932a8f0f63d8@menhennitt.com.au> Date: Fri, 19 Jul 2024 14:53:07 +1000 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-ports@freebsd.org Sender: owner-freebsd-ports@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Nut can't open Mini-Box OPEN-UPS2 (SOLVED) From: Graham Menhennitt To: freebsd-ports@freebsd.org References: <12903a5d-c6c0-4476-bb20-4a60ec00b0e5@menhennitt.com.au> Content-Language: en-AU In-Reply-To: <12903a5d-c6c0-4476-bb20-4a60ec00b0e5@menhennitt.com.au> X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.67 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; ARC_ALLOW(-1.00)[mailchannels.net:s=arc-2022:i=1]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.980]; RWL_MAILSPIKE_VERYGOOD(-0.20)[23.83.218.252:from]; R_SPF_ALLOW(-0.20)[+ip4:23.83.208.0/20]; R_DKIM_ALLOW(-0.20)[menhennitt.com.au:s=dreamhost]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; XM_UA_NO_VERSION(0.01)[]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:63213, ipnet:23.83.216.0/22, country:CA]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[23.83.218.252:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DMARC_NA(0.00)[menhennitt.com.au]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-ports@freebsd.org]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[menhennitt.com.au:+] X-Rspamd-Queue-Id: 4WQHP33000z4nmh This is a multi-part message in MIME format. --------------nmVQDBxVKZXqZQGMqcj0Y50T Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thanks to Michael Gmelin for pointing me to https://forums.freebsd.org/threads/nut-2-8-0-generic-ups-blazer_usb-cant-claim-usb-device.90744/ and from there to https://forum.opnsense.org/index.php?topic=28695.0. As the first link says, the problem is that the device is claimed by the HID driver. Running the "detach" command fixes the problem (until the next reboot). As described in the second link, I added a line to /boot/loader.conf:     hw.usb.quirk.0="0x04D8 0xD005 0 0xffff UQ_HID_IGNORE" and it's fixed permanently. Thanks again, Michael. Graham On 1/06/2024 2:57 pm, Graham Menhennitt wrote: > Hi FreeBSDers, > > Trying to get nut to talk to my Mini-Box OPEN-UPS2 (FreeBSD 13.3 with > nut-2.8.2 built from ports). I've fixed devfs.rules correctly so that > the /dev entry is owned by user nut. > > When I start nut, I get a message "Can't claim USB device > [04d8:d005]@0/0/0: Other error". See below for details including > usbconfig output for the device. > > Does anybody have a clue, please. > > Thanks in advance for any hints, > >     Graham > > > root@larabee# ll -L /dev/ugen0.2 /dev/usb/0.2.0 > crw-rw----  1 nut  nut  0x59  1 Jun 14:12 /dev/ugen0.2 > crw-rw----  1 nut  nut  0x59  1 Jun 14:12 /dev/usb/0.2.0 > > > root@larabee# service nut restart > nut not running? (check /var/db/nut/upsd.pid). > Network UPS Tools - UPS driver controller 2.8.2 > Network UPS Tools - Generic HID driver 0.53 (2.8.2) > USB communication driver (libusb 1.0) 0.47 > Can't claim USB device [04d8:d005]@0/0/0: Other error > upsnotify: failed to notify about state 4: no notification tech > defined, will not spam more about it > Driver failed to start (exit status=1) > /usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut > > > root@larabee# usbconfig -v -d ugen0.2 > ugen0.2: at usbus0, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=ON (100mA) > ugen0.2.0: uhid0: addr 2> > >   bLength = 0x0012 >   bDescriptorType = 0x0001 >   bcdUSB = 0x0200 >   bDeviceClass = 0x0000  >   bDeviceSubClass = 0x0000 >   bDeviceProtocol = 0x0000 >   bMaxPacketSize0 = 0x0020 >   idVendor = 0x04d8 >   idProduct = 0xd005 >   bcdDevice = 0x0003 >   iManufacturer = 0x0001  >   iProduct = 0x0002  >   iSerialNumber = 0x0004  >   bNumConfigurations = 0x0001 > > >  Configuration index 0 > >     bLength = 0x0009 >     bDescriptorType = 0x0002 >     wTotalLength = 0x0029 >     bNumInterfaces = 0x0001 >     bConfigurationValue = 0x0001 >     iConfiguration = 0x0000  >     bmAttributes = 0x00c0 >     bMaxPower = 0x0032 > >     Interface 0 >       bLength = 0x0009 >       bDescriptorType = 0x0004 >       bInterfaceNumber = 0x0000 >       bAlternateSetting = 0x0000 >       bNumEndpoints = 0x0002 >       bInterfaceClass = 0x0003  >       bInterfaceSubClass = 0x0000 >       bInterfaceProtocol = 0x0000 >       iInterface = 0x0000  > >       Additional Descriptor > >       bLength = 0x09 >       bDescriptorType = 0x21 >       bDescriptorSubType = 0x11 >        RAW dump: >        0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0xf7, >        0x08 | 0x02 > >      Endpoint 0 >         bLength = 0x0007 >         bDescriptorType = 0x0005 >         bEndpointAddress = 0x0081  >         bmAttributes = 0x0003  >         wMaxPacketSize = 0x0020 >         bInterval = 0x000a >         bRefresh = 0x0000 >         bSynchAddress = 0x0000 > >      Endpoint 1 >         bLength = 0x0007 >         bDescriptorType = 0x0005 >         bEndpointAddress = 0x0001  >         bmAttributes = 0x0003  >         wMaxPacketSize = 0x0020 >         bInterval = 0x000a >         bRefresh = 0x0000 >         bSynchAddress = 0x0000 > > > > root@larabee# > > --------------nmVQDBxVKZXqZQGMqcj0Y50T Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Thanks to Michael Gmelin for pointing me to https://forums.freebsd.org/threads/nut-2-8-0-generic-ups-blazer_usb-cant-claim-usb-device.90744/ and from there to https://forum.opnsense.org/index.php?topic=28695.0.

As the first link says, the problem is that the device is claimed by the HID driver. Running the "detach" command fixes the problem (until the next reboot).

As described in the second link, I added a line to /boot/loader.conf:

    hw.usb.quirk.0="0x04D8 0xD005 0 0xffff UQ_HID_IGNORE"

and it's fixed permanently.

Thanks again, Michael.

Graham



On 1/06/2024 2:57 pm, Graham Menhennitt wrote:
Hi FreeBSDers,

Trying to get nut to talk to my Mini-Box OPEN-UPS2 (FreeBSD 13.3 with nut-2.8.2 built from ports). I've fixed devfs.rules correctly so that the /dev entry is owned by user nut.

When I start nut, I get a message "Can't claim USB device [04d8:d005]@0/0/0: Other error". See below for details including usbconfig output for the device.

Does anybody have a clue, please.

Thanks in advance for any hints,

    Graham


root@larabee# ll -L /dev/ugen0.2 /dev/usb/0.2.0
crw-rw----  1 nut  nut  0x59  1 Jun 14:12 /dev/ugen0.2
crw-rw----  1 nut  nut  0x59  1 Jun 14:12 /dev/usb/0.2.0


root@larabee# service nut restart
nut not running? (check /var/db/nut/upsd.pid).
Network UPS Tools - UPS driver controller 2.8.2
Network UPS Tools - Generic HID driver 0.53 (2.8.2)
USB communication driver (libusb 1.0) 0.47
Can't claim USB device [04d8:d005]@0/0/0: Other error
upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it
Driver failed to start (exit status=1)
/usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut


root@larabee# usbconfig -v -d ugen0.2
ugen0.2: <Mini-Box.Com OPEN-UPS2> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.2.0: uhid0: <Mini-Box.Com OPEN-UPS2, class 0/0, rev 2.00/0.03, addr 2>

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0020
  idVendor = 0x04d8
  idProduct = 0xd005
  bcdDevice = 0x0003
  iManufacturer = 0x0001  <Mini-Box.Com>
  iProduct = 0x0002  <OPEN-UPS2>
  iSerialNumber = 0x0004  <LI-ION>
  bNumConfigurations = 0x0001


 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0029
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00c0
    bMaxPower = 0x0032

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x0003  <HID device>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x11
       RAW dump:
       0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0xf7,
       0x08 | 0x02

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0020
        bInterval = 0x000a
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0001  <OUT>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0020
        bInterval = 0x000a
        bRefresh = 0x0000
        bSynchAddress = 0x0000



root@larabee#


--------------nmVQDBxVKZXqZQGMqcj0Y50T--