我有两台笔记本电脑(和两台 Raspberry pi)连接到 4 路 USB 交换机,一个键盘和鼠标作为所有四台设备的输入设备。当我挂起笔记本电脑(一台是 ubuntu,另一台是 xubuntu)时,我无法使用键盘或鼠标唤醒它们。我尝试按照grep . /sys/bus/usb/devices/*/power/wakeup
此处的说明启用所有设备的唤醒功能@Pavlos Theodorou 的问题并发现这将适用于最近暂停的设备,但如果我按下切换器上的按钮将其更改为其他设备,则暂停的设备将被唤醒。有人有使用 USB 切换器的经验吗?
编辑以显示输出
grep . /sys/bus/usb/devices/*/power/wakeup
lsusb
grep . /sys/bus/usb/devices/*/power/wakeup | cut -d: -f1 | cut -d/ -f1-6 | xargs -I{} sh -c 'echo {}:; cat {}/product 2>/dev/null'
matt@zakk-jr:~$ grep . /sys/bus/usb/devices/*/power/wakeup
/sys/bus/usb/devices/1-1.1/power/wakeup:disabled
/sys/bus/usb/devices/1-1/power/wakeup:disabled
/sys/bus/usb/devices/2-1/power/wakeup:disabled
/sys/bus/usb/devices/3-2.2/power/wakeup:disabled
/sys/bus/usb/devices/3-2.3.2/power/wakeup:enabled
/sys/bus/usb/devices/3-2.3/power/wakeup:disabled
/sys/bus/usb/devices/3-2/power/wakeup:disabled
/sys/bus/usb/devices/usb1/power/wakeup:disabled
/sys/bus/usb/devices/usb2/power/wakeup:disabled
/sys/bus/usb/devices/usb3/power/wakeup:enabled
/sys/bus/usb/devices/usb4/power/wakeup:disabled
matt@zakk-jr:~$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 04f2:b307 Chicony Electronics Co., Ltd TOSHIBA Web Camera - HD
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 003: ID 0bda:0138 Realtek Semiconductor Corp. RTS5138 Card Reader Controller
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 152d:0562 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 050: ID 195d:2030 Itron Technology iONE Func KB-460 Gaming Keyboard
Bus 003 Device 049: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 003 Device 048: ID 1c4f:0054 SiGma Micro Usb Mouse
Bus 003 Device 047: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
matt@zakk-jr:~$ grep . /sys/bus/usb/devices/*/power/wakeup | cut -d: -f1 | cut -d/ -f1-6 | xargs -I{} sh -c 'echo {}:; cat {}/product 2>/dev/null'
/sys/bus/usb/devices/1-1.1:
USB2.0-CRW
/sys/bus/usb/devices/1-1:
/sys/bus/usb/devices/2-1:
/sys/bus/usb/devices/3-2.2:
Usb Mouse
/sys/bus/usb/devices/3-2.3.2:
RUSH Mechanical Keyboard
/sys/bus/usb/devices/3-2.3:
USB2.0 Hub
/sys/bus/usb/devices/3-2:
USB2.1 Hub
/sys/bus/usb/devices/usb1:
EHCI Host Controller
/sys/bus/usb/devices/usb2:
EHCI Host Controller
/sys/bus/usb/devices/usb3:
xHCI Host Controller
/sys/bus/usb/devices/usb4:
xHCI Host Controller
matt@zakk-jr:~$
答案1
我遇到了类似的问题。您应该能够直接启用键盘,而无需启用 KVM。您还必须启用它所连接的 USB 端口。例如 /etc/udev/rules.d
# Enable usb port 3 wakeup
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="1d6b", ATTRS{idProduct}=="0001", ATTRS{busnum}=="3", ATTR{power/wakeup}="enabled"
# Disable KVM wakeup
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="0557", ATTRS{idProduct}=="7000", ATTR{power/wakeup}="disabled"
# Disable mouse wakeup
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="1ea7", ATTRS{idProduct}=="0064", ATTR{power/wakeup}="disabled"
# Enable keyboard wakeup
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="1c4f", ATTRS{idProduct}=="0047", ATTR{power/wakeup}="enabled"
按此顺序执行的原因是因为第一条规则会自动启用附加到它的所有内容。