我正在连接 Legrand Keor SPUPS通过 USB 设备连接到我的 Debian linux。问题是/dev/ttyUSB0
未创建,因此我无法与设备通信。
连接后我可以看到它添加到lsusb
:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 005: ID 1cb0:0032 <<— THIS ONE
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
我可以看到相关dmesg
消息:
[Jul19 12:03] usb 3-1: new low-speed USB device number 5 using uhci_hcd
[ +0.201170] usb 3-1: New USB device found, idVendor=1cb0, idProduct=0032, bcdDevice= 0.02
[ +0.000002] usb 3-1: New USB device strings: Mfr=3, Product=1, SerialNumber=5
[ +0.000001] usb 3-1: Product: Legrand UPS
[ +0.000000] usb 3-1: Manufacturer: Legrand
[ +0.183988] hid-generic 0003:1CB0:0032.0005: hiddev0,hidraw1: USB HID v1.11 Device [Legrand Legrand UPS ] on usb-0000:00:1d.0-1/input0
我可以看到相关udev
消息:
UDEV [1188.303843] add /devices/pci0000:00/0000:00:1d.0/usb3/3-1 (usb)
UDEV [1188.304636] add /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)
UDEV [1188.305475] add /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005 (hid)
UDEV [1188.306728] add /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005/hidraw/hidraw1 (hidraw)
UDEV [1188.307283] add /class/usbmisc (class)
UDEV [1188.307957] bind /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005 (hid)
UDEV [1188.308732] add /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/usbmisc/hiddev0 (usbmisc)
UDEV [1188.309241] bind /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)
UDEV [1188.310003] bind /devices/pci0000:00/0000:00:1d.0/usb3/3-1 (usb)
UDEV [1191.140181] remove /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/usbmisc/hiddev0 (usbmisc)
UDEV [1191.140554] remove /usbmisc (class)
UDEV [1191.141072] remove /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005/hidraw/hidraw1 (hidraw)
UDEV [1191.141419] unbind /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005 (hid)
UDEV [1191.141618] remove /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0005 (hid)
UDEV [1191.142072] unbind /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)
我还尝试了这个技巧来查看设备是否映射到另一个/dev
节点,但事实并非如此,不幸的是 /dev 中没有出现任何内容:如何允许软件访问任何 USB 设备?
需要注意的是,我的 Debian 是在 Proxmox VE 内运行,尽管我认为这无关紧要。 USB 端口完全与 Debian VM 共享,因此我认为应该没问题:
lsusb
该设备在Proxmox 虚拟化主机中的显示完全相同:
Bus 004 Device 002: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 1058:25a2 Western Digital Technologies, Inc. Elements 25A2
Bus 002 Device 005: ID 1058:1140 Western Digital Technologies, Inc. My Book Essential (WDBACW)
Bus 002 Device 003: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 8087:0a2b Intel Corp.
Bus 001 Device 003: ID 05c8:0815 Cheng Uei Precision Industry Co., Ltd (Foxlink)
Bus 001 Device 011: ID 1cb0:0032 <<— THIS ONE
Bus 001 Device 004: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
2020 年 7 月 20 日更新:
更新udevadm monitor -u
消息以消除有关设备删除的混乱。每次我都会打印以下内容插入将 UPS 插入 USB 端口:
UDEV [316.998469] remove /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0002/hidraw/hidraw1 (hidraw)
UDEV [316.998941] remove /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/usbmisc/hiddev0 (usbmisc)
UDEV [316.999325] remove /usbmisc (class)
UDEV [317.000298] unbind /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0002 (hid)
UDEV [317.000534] remove /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0/0003:1CB0:0032.0002 (hid)
UDEV [317.001022] unbind /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)
UDEV [317.001219] remove /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1:1.0 (usb)
UDEV [317.001737] unbind /devices/pci0000:00/0000:00:1d.0/usb3/3-1 (usb)
UDEV [317.001902] remove /devices/pci0000:00/0000:00:1d.0/usb3/3-1 (usb)
2020 年 7 月 22 日更新:dmesg
将设备连接到主机时的新转储:
https://pastebin.com/raw/uFUUHGz6
2020 年 7 月 30 日更新:添加的新转储lsusb -v
:
答案1
罗格朗不使用ttyUSB
,在upssrv
设置中选择“USB”。
我使用 UPS Communicator 1.32,但是 Linux 版本有一个错误,无法正确初始化与 UPS 的连接。
解决方案:
- 在 Debian 上停止 upssrv
- 使用 Windows 启动 VM
- 将 USB 端口转发到 VM
- 安装 Windows 版 UPS Communicator,运行它并连接到 UPS
现在您可以停止虚拟机并upssrv
在 Debian 上启动 - 一切都会正常工作,直到您拔掉 USB 电缆或硬重置电脑。