Plugging CyberPower USB cable:
# udevadm monitor --subsystem-match=usb
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
# lsusb | grep Cyber
Bus 004 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Unplugging/re-plugging the CyberPower:
# udevadm monitor --subsystem-match=usb
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
What's weird in the above is that udev reports it's adding 4-2 but the device is apparently at 4-3:
# lsusb | grep Cyber
Bus 004 Device 003: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
I did unplug/plug back in the exact same physical slot. Here's dmesg just in case:
# dmesg -T | grep 0501
[Tue Aug 29 16:17:32 2017] usb 4-2: New USB device found, idVendor=0764, idProduct=0501
[Tue Aug 29 16:17:32 2017] hid-generic 0003:0764:0501.0002: hiddev0,hidraw1: USB HID v1.10 Device [CPS CP685AVR-G] on usb-0000:00:1a.1-2/input0
[Tue Aug 29 16:23:08 2017] usb 4-2: New USB device found, idVendor=0764, idProduct=0501
[Tue Aug 29 16:23:08 2017] hid-generic 0003:0764:0501.0003: hiddev0,hidraw1: USB HID v1.10 Device [CPS CP685AVR-G] on usb-0000:00:1a.1-2/input0
Fresh install of Trusty 14.04.0 with *old* udev:
# apt-cache policy udev 5ubuntu20. 24 0 us.archive. ubuntu. com/ubuntu/ trusty-updates/main amd64 Packages us.archive. ubuntu. com/ubuntu/ trusty/main amd64 Packages dpkg/status
udev:
Installed: 204-5ubuntu20
Candidate: 204-5ubuntu20.24
Version table:
204-
500 http://
*** 204-5ubuntu20 0
500 http://
100 /var/lib/
Plugging CyberPower USB cable: match=usb
# udevadm monitor --subsystem-
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[212.661306] add /devices/ pci0000: 00/0000: 00:1a.1/ usb4/4- 2 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2/4-2:1. 0 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2/4-2:1. 0 (usb)
KERNEL[212.663416] add /devices/
UDEV [212.861460] add /devices/
UDEV [212.863063] add /devices/
Wrong perms: usb/004/ 002 usb/004/ 001
# find /dev/bus/usb/ -ls
7329 0 drwxr-xr-x 10 root root 200 Aug 29 16:14 /dev/bus/usb/
...
7336 0 drwxr-xr-x 2 root root 80 Aug 29 16:17 /dev/bus/usb/004
11406 0 crw-rw-r-- 1 root root Aug 29 16:17 /dev/bus/
7337 0 crw-rw-r-- 1 root root Aug 29 16:14 /dev/bus/
...
Install nut-server
# apt-get install -y nut-server # pulling 2.7.1-1ubuntu1
# lsusb | grep Cyber
Bus 004 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Unplugging/ re-plugging the CyberPower: match=usb
# udevadm monitor --subsystem-
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[544.264436] remove /devices/ pci0000: 00/0000: 00:1a.1/ usb4/4- 2/4-2:1. 0 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2/4-2:1. 0 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2/4-2:1. 0 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2 (usb) pci0000: 00/0000: 00:1a.1/ usb4/4- 2/4-2:1. 0 (usb)
KERNEL[544.264626] remove /devices/
UDEV [544.271603] remove /devices/
UDEV [544.271648] remove /devices/
KERNEL[548.024486] add /devices/
KERNEL[548.027386] add /devices/
UDEV [548.186083] add /devices/
UDEV [548.187851] add /devices/
Notice that nut-server's 52-nut-usbups.rules worked: usb/004/ 003 usb/004/ 001
# find /dev/bus/usb/ -ls
7329 0 drwxr-xr-x 10 root root 200 Aug 29 16:14 /dev/bus/usb/
...
7336 0 drwxr-xr-x 2 root root 80 Aug 29 16:23 /dev/bus/usb/004
12329 0 crw-rw-r-- 1 root nut Aug 29 16:23 /dev/bus/
7337 0 crw-rw-r-- 1 root root Aug 29 16:14 /dev/bus/
...
What's weird in the above is that udev reports it's adding 4-2 but the device is apparently at 4-3:
# lsusb | grep Cyber
Bus 004 Device 003: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
I did unplug/plug back in the exact same physical slot. Here's dmesg just in case: 0501.0002: hiddev0,hidraw1: USB HID v1.10 Device [CPS CP685AVR-G] on usb-0000: 00:1a.1- 2/input0 0501.0003: hiddev0,hidraw1: USB HID v1.10 Device [CPS CP685AVR-G] on usb-0000: 00:1a.1- 2/input0
# dmesg -T | grep 0501
[Tue Aug 29 16:17:32 2017] usb 4-2: New USB device found, idVendor=0764, idProduct=0501
[Tue Aug 29 16:17:32 2017] hid-generic 0003:0764:
[Tue Aug 29 16:23:08 2017] usb 4-2: New USB device found, idVendor=0764, idProduct=0501
[Tue Aug 29 16:23:08 2017] hid-generic 0003:0764: