该设备在 Windows 上运行良好,而在 Ubuntu 16.04 上,我只能在连接的设备列表中看到它,但没有实例化 /dev/tty* 端口,因此无法访问它。
关于该设备的输出lsusb -v
如下:
Bus 003 Device 005: ID 0483:5750 STMicroelectronics
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0483 STMicroelectronics
idProduct 0x5750
bcdDevice 2.01
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 300mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 33
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 2
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 2
有什么办法可以将其关联到 USB 端口吗?
编辑:提到的设备是可编程伺服控制器。我应该通过串行通信向它发送命令,这就是为什么我想将它映射到类似 /dev/tty* 的端口上。
编辑 #2:我已在 udev 中添加了规则,但仍然无法正确访问设备。这里我提供了来自 /var/log/syslog 的相关输出:
Jan 30 13:10:02 cr055 kernel: [ 615.391231] usb 3-1: new full-speed USB device number 10 using xhci_hcd
Jan 30 13:10:03 cr055 kernel: [ 615.540602] usb 3-1: New USB device found, idVendor=0483, idProduct=5750
Jan 30 13:10:03 cr055 kernel: [ 615.540605] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 30 13:10:03 cr055 kernel: [ 615.540607] usb 3-1: Product: LOBOT
Jan 30 13:10:03 cr055 kernel: [ 615.540609] usb 3-1: Manufacturer: MyUSB_HID
Jan 30 13:10:03 cr055 kernel: [ 615.540610] usb 3-1: SerialNumber: 498F248E3033
Jan 30 13:10:03 cr055 kernel: [ 615.541725] hid-generic 0003:0483:5750.0003: hiddev0,hidraw0: USB HID v1.10 Device [MyUSB_HID LOBOT] on usb-0000:00:14.0-1/input0
Jan 30 13:10:03 cr055 mtp-probe: checking bus 3, device 10: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-1"
Jan 30 13:10:03 cr055 mtp-probe: bus: 3, device: 10 was not an MTP device
答案1
你可以修改 UDEV 信息,以便在设备插入时为其分配一个 tty。类似下面的内容可能比较合适
SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="483", ATTRS{serial}=="00492F60", SYMLINK+="ttyS99"
您可以将其添加到 /etc/udev/rules.d 中的一个文件(以数字开头,以 .rules 结尾)中 - 例如 /etc/cudev/rules.d/20-microontroller.rules
然后您需要重新启动 udev。
顺便说一句,当您插入设备时,提供在 /var/log/messages 或 /var/log/syslog 中生成的日志输出通常是一个好主意。