以前,我可以通过设备文件 /dev/ttyUSB0 与设备通信,我可以通过终端仿真器连接到该文件。我不知道为什么,但最近在检测到设备时,/dev/ttyUSB0 停止创建,尽管枚举仍在记录消息以及被检测到的设备系统盘。 我如何再次创建 /dev/ttyUSB0?
有问题的设备是飞思卡尔设备,如下所示USB-1-3,在 lsusb 输出(总线 001 设备 028)下,完全相同的设备被称为“Google Inc. Nexus 7”。名称不同是因为硬件运行的是 Android 端口,该端口显示为“Nexus 7”。它是通过微型 USB 连接的 NXP i.MX 6 SoM。
$ dmesg
[ 1074.879020] usb 1-3: new high-speed USB device number 24 using xhci_hcd
[ 1075.083989] usb 1-3: no configurations
[ 1075.083998] usb 1-3: can't read configurations, error -22
[ 1075.195166] usb 1-3: new high-speed USB device number 25 using xhci_hcd
[ 1075.387420] usb 1-3: no configurations
[ 1075.387428] usb 1-3: can't read configurations, error -22
[ 1075.499143] usb 1-3: new high-speed USB device number 26 using xhci_hcd
[ 1075.521617] usb 1-3: no configurations
[ 1075.521625] usb 1-3: can't read configurations, error -22
[ 1075.687121] usb 1-3: new high-speed USB device number 27 using xhci_hcd
[ 1075.704437] usb 1-3: no configurations
[ 1075.704446] usb 1-3: can't read configurations, error -22
[ 1075.704482] usb usb1-port3: unable to enumerate USB device
[ 1076.275060] usb 1-3: new high-speed USB device number 28 using xhci_hcd
[ 1076.413277] usb 1-3: New USB device found, idVendor=18d1, idProduct=4e42
[ 1076.413285] usb 1-3: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 1076.413289] usb 1-3: Product: SABRESD-MX6DQ
[ 1076.413293] usb 1-3: Manufacturer: Freescale
[ 1076.413296] usb 1-3: SerialNumber: 0123456789ABCDEF
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0bda:0153 Realtek Semiconductor Corp. Mass Storage Device
Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 028: ID 18d1:4e42 Google Inc. Nexus 7 (debug)
Bus 001 Device 005: ID 8087:0a2a Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ ls /dev/ttyUSB*
ls: cannot access /dev/ttyUSB*: No such file or directory
我尝试了不同的 USB 电缆和不同的端口,并在使用集线器和不使用集线器两种不同模式下重置了设备。
为了找到我的 USB 设备正在使用哪个设备文件,我尝试了以下命令https://unix.stackexchange.com/questions/144029/command-to-determine-ports-of-a-device-like-dev-ttyusb0?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
不幸的是,这并没有提供我所寻找的信息。
结果是:
/dev/input/event4 - Logitech_USB_Receiver
/dev/input/mouse0 - Logitech_USB_Receiver
/dev/hidraw1 - Logitech_USB_Receiver
/dev/input/event5 - Logitech_USB_Receiver
/dev/hidraw2 - Logitech_USB_Receiver
/dev/hidraw0 - Logitech_USB_Receiver
/dev/usb/hiddev0 - Logitech_USB_Receiver
/dev/bsg/4:0:0:0 - Generic-_SD_MMC_MS_PRO_20120926571200000-0:0
/dev/sdc - Generic-_SD_MMC_MS_PRO_20120926571200000-0:0
/dev/sg2 - Generic-_SD_MMC_MS_PRO_20120926571200000-0:0
有一次我有一个脚本,它使用 将 echo 输出传送到 /dev/ttyUSB0 echo 'mytext' > /dev/ttyUSB0
。有一天我意识到 /dev/ttyUSB0 实际上并不存在,所以脚本只是创建了一个文本文件。我删除了那个文本文件,因为我担心它会干扰创建同名的设备文件。我不知道这是否相关。
我在使用 Ubuntu 14.04。
提前致谢!