我想在linux命令行中读取串行输入(举个例子),但我无法找到附加设备(Arduino)路径。
我能辨认出这个装置:
# lsusb
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 003: ID 2341:0043 Arduino SA Uno R3 (CDC ACM) <- this one
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub但是dmesg只显示与此相关的消息。
# dmesg | grep usb
[15026545.556311] usb 4-1: new full-speed USB device number 3 using xhci-hcd
[15026545.697929] usb 4-1: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes同样让我困惑的是,lspci并没有展示这个装置:
# lspci
00:01.0 PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 04)
00:02.0 PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 04)
00:03.0 PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 04)
01:00.0 Network controller: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) (rev 01)
02:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter查看/dev目录:
# ls /dev/
autofs kmsg network_latency ram4 ttyS12
btrfs-control log network_throughput ram5 ttyS13
bus mapper null ram6 ttyS14
console mem port ram7 ttyS15
cpu_dma_latency memory_bandwidth ppp ram8 ttyS2
full mmcblk0 ptmx ram9 ttyS3
fuse mmcblk0boot0 pts random ttyS4
hwrng mmcblk0boot1 ram0 root ttyS5
i2c-0 mmcblk0p1 ram1 rtc0 ttyS6
i2c-1 mmcblk0rpmb ram10 shm ttyS7
i2c-2 mtd0 ram11 snd ttyS8
i2c-3 mtd0ro ram12 spidev0.2 ttyS9
i2c-4 mtd1 ram13 tty ubi_ctrl
i2c-5 mtd1ro ram14 ttyS0 urandom
i2c-6 mtdblock0 ram15 ttyS1 watchdog
i2c-7 mtdblock1 ram2 ttyS10 watchdog0
i2c-8 net ram3 ttyS11 zero我能找到这些东西:
还有一个输出,使我更加困惑(表示2(错误)的iProduct行):
# lsusb -v -s 004:003
Bus 004 Device 003: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x2341 Arduino SA
idProduct 0x0043 Uno R3 (CDC ACM)
bcdDevice 0.01
iManufacturer 1 Arduino (www.arduino.cc)
iProduct 2 (error)
iSerial 220 8553130343135121F1A0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 62
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 1 AT-commands (v.25ter)
iInterface 0
CDC Header:
bcdCDC 10.01
CDC ACM:
bmCapabilities 0x06
sends break
line coding and serial state
CDC Union:
bMasterInterface 0
bSlaveInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 255
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Device Status: 0x0000
(Bus Powered)这是设备在这个环境中出现故障的迹象吗?你能帮我找出这个设备的附加地址吗?
背景信息:我在这里运行的系统是TurrisOS (基于OpenWrt)。测试也是Debian/Mint/Ubuntu/Manjaro,所有这些都是没有任何问题的USB连接(设备本身没有损坏)。
编辑:这是安装usbserial驱动程序时与dmesg相关的输出:
[15707335.904584] usbserial: USB Serial support registered for carelink
[15707335.904622] usbserial: USB Serial support registered for zio
[15707335.904657] usbserial: USB Serial support registered for funsoft
[15707335.904686] usbserial: USB Serial support registered for flashloader
[15707335.904714] usbserial: USB Serial support registered for google
[15707335.904743] usbserial: USB Serial support registered for libtransistor
[15707335.904771] usbserial: USB Serial support registered for vivopay
[15707335.904802] usbserial: USB Serial support registered for moto_modem
[15707335.904832] usbserial: USB Serial support registered for motorola_tetra
[15707335.904863] usbserial: USB Serial support registered for novatel_gps
[15707335.904891] usbserial: USB Serial support registered for hp4x
[15707335.904917] usbserial: USB Serial support registered for suunto
[15707335.904944] usbserial: USB Serial support registered for siemens_mpi
[15707336.867539] usbcore: registered new interface driver ti_usb_3410_5052
[15707336.867582] usbserial: USB Serial support registered for TI USB 3410 1 port adapter
[15707336.867611] usbserial: USB Serial support registered for TI USB 5052 2 port adapter
[15721145.188760] usb 4-1: new full-speed USB device number 4 using xhci-hcd
[15721145.330360] usb 4-1: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes编辑2:当我在谷歌上搜索时,我发现这个脚本很明显地宣称,我需要:
opkg install kmod-usb-acm为了连接这些设备。
发布于 2021-05-25 14:02:45
您需要内核模块来识别Arduino并自动创建串口设备。
根据OpenWrt的文档:将Arduino连接到OpenWrt:
请安装以下软件包(如果您在终端或LuCi软件页面上)kmod-usb串行- are 3116 kmod-usb系列-belkin kmod-usb串行-ch341 kmod-usb串行-cp210x kmod-usb串行-ftdi kmod-usb串行-mct kmod串行-mos7720 kmod-usb串行-6858 kmod-usb串行-pl2303 kmod-usb串行-usb串行-ti-usb实际上您可能只需要其中之一。在您的arduino (或克隆)中使用的usb到串行芯片是什么?他们不需要太多的空间无论如何,所以如果你不确定或懒惰,你可以安装所有。
正如注释中所述,在该列表中还可能需要添加kmod-usb-acm。
https://unix.stackexchange.com/questions/651293
复制相似问题