<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I wrote up an article regarding this.  </p>
    <p><a moz-do-not-send="true"
href="https://blog.raymond.burkholder.net/index.php?/archives/1360-NUT-USB-APC-BeagleBone.html">NUT
        USB APC BeagleBone</a></p>
    <p>For some reason, USB devices 'disconnect' and reconnect. When the
      device reconnects, a new DeviceID is assigned to the USB device.
      This breaks the usbhid-ups drivers supplied by NUT the packages.
      That is, usbhid-ups no longer sees the APC USB device.
    </p>
    <p>To resolve this, I used Debian's udev system to sense the device
      id change and to restart the NUT USB driver.</p>
    <blockquote>
      <p><font face="monospace"># cat 
          /etc/udev/rules.d/89-usb-ups-change.rules<br>
          SUBSYSTEM=="usb", MODE="0660", ACTION=="add",   
          ENV{ID_VENDOR_ID}=="051d", ENV{ID_MODEL_ID}=="0003",
          RUN+="/home/debian/usb_add.sh add '$env{DEVNAME}'
          '$env{ID_USB_SERIAL}'"<br>
          SUBSYSTEM=="usb", MODE="0660", ACTION=="remove",
          RUN+="/home/debian/usb_remove.sh remove $env{DEVNAME}"</font></p>
    </blockquote>
    <p>Sense a removal, which stops nut.target</p>
    <blockquote>
      <p><font face="monospace">$ cat usb_remove.sh<br>
          #!/usr/bin/env bash<br>
          <br>
          logger "USB state change detected: $1 $2"<br>
          echo "$(date) USB state change detected: $1 $2" >>
          /home/debian/usb-log.txt<br>
          #systemctl stop nut.target<br>
          exit 0</font></p>
    </blockquote>
    <p>Sense an addition, which restarts / starts</p>
    <blockquote>
      <p><font face="monospace">$ cat usb_add.sh<br>
          #!/usr/bin/env bash<br>
          <br>
          logger "USB state change detected: $1 $2 $3"<br>
          echo "$(date) USB state change detected: $1 $2 $3" >>
          /home/debian/usb-log.txt<br>
          systemctl restart nut.target<br>
          exit 0</font></p>
    </blockquote>
    <br>
    <p>The blog entry has more detail about parameters</p>
    <p>Raymond<br>
      <a class="moz-txt-link-freetext" href="https://blog.raymond.burkholder.net">https://blog.raymond.burkholder.net</a></p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2026-07-22 21:02, Robert Nichols via
      Nut-upsuser wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:8777d876-ae18-4fe4-b45c-211c59865d59@comcast.net">Is
      there a way to prevent the usbhid-ups driver from flooding the
      system log when a monitored UPS is disconnected from its UCB port.
      I see a steady stream of messages:
      <br>
      <br>
       usbhid-ups[3480520]: libusb1: Could not open any HID devices:
      insufficient permissions on everything
      <br>
      <br>
      that are posted every 2 seconds until I comment out that device
      from ups.conf and restart the nut service.
      <br>
      Version is nut-2.8.2-1.el8.x86_64 in Rocky Linux 8.
      <br>
      <br>
    </blockquote>
  </body>
</html>