首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >,为什么没有/dev条目?

,为什么没有/dev条目?
EN

Ask Ubuntu用户
提问于 2014-01-21 09:40:23
回答 1查看 20.8K关注 0票数 3

我最初是在SU上问这个问题的,但是它对Ubuntu是如此的特殊,所以我把它移到了这里。

我在我的Ubuntu系统上安装了433收发器 (3.8.0-35)。它是一种USB到串行的设备,不知怎么地被认可:

dmesg输出:

代码语言:javascript
运行
复制
[  324.051498] usb 3-1: new full-speed USB device number 2 using xhci_hcd
[  324.088070] usb 3-1: New USB device found, idVendor=10c4, idProduct=8668
[  324.088081] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  324.088087] usb 3-1: Product: NETUSB1100 NEWMSG 
[  324.088093] usb 3-1: Manufacturer: HZWB
[  324.102259] hid-generic 0003:10C4:8668.0002: hiddev0,hidraw1: USB HID v1.01 Device [HZWB NETUSB1100 NEWMSG ] on usb-0000:0e:00.0-1/input0

lsusb输出:

代码语言:javascript
运行
复制
Bus 003 Device 002: ID 10c4:8668 Cygnal Integrated Products, Inc.

我想访问它(例如通过rfxcmd ),但是我无法获得相关的/dev路径。当我插入/dev的内容时,它的内容不会改变,所以肯定缺少了一些东西。

要创建/dev/...设备路径(然后可以在脚本中使用),还必须执行哪些其他步骤?

编辑后,莱肯斯廷's回答:输出的tree /sys/bus/usb/drivers/跟随modprobe cp210x (与非相关部分删除)。请注意,在重新启动后,上面的3-1变成了3-2。我在测试中考虑到了这一点。

代码语言:javascript
运行
复制
/sys/bus/usb/drivers/
├── cp210x
│   ├── bind
│   ├── module -> ../../../../module/usbserial
│   ├── uevent
│   └── unbind
├── hub
│   ├── 1-0:1.0 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-0:1.0
│   ├── 1-1:1.0 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1:1.0
│   ├── 2-0:1.0 -> ../../../../devices/pci0000:00/0000:00:1d.0/usb2/2-0:1.0
│   ├── 2-1:1.0 -> ../../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0
│   ├── 3-0:1.0 -> ../../../../devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3/3-0:1.0
│   ├── 4-0:1.0 -> ../../../../devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb4/4-0:1.0
│   ├── bind
│   ├── module -> ../../../../module/usbcore
│   ├── new_id
│   ├── remove_id
│   ├── uevent
│   └── unbind
├── usb
│   ├── 1-1 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1
│   ├── 1-1.2 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2
│   ├── 1-1.3 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3
│   ├── 1-1.4 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4
│   ├── 1-1.6 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6
│   ├── 2-1 -> ../../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1
│   ├── 3-2 -> ../../../../devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3/3-2
│   ├── bind
│   ├── uevent
│   ├── unbind
│   ├── usb1 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1
│   ├── usb2 -> ../../../../devices/pci0000:00/0000:00:1d.0/usb2
│   ├── usb3 -> ../../../../devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3
│   └── usb4 -> ../../../../devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb4
├── usbhid
│   ├── 1-1.2:1.0 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0
│   ├── 3-2:1.0 -> ../../../../devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3/3-2/3-2:1.0
│   ├── bind
│   ├── module -> ../../../../module/usbhid
│   ├── new_id
│   ├── remove_id
│   ├── uevent
│   └── unbind
├── usbserial
│   ├── bind
│   ├── module -> ../../../../module/usbserial
│   ├── uevent
│   └── unbind
├── usbserial_generic
│   ├── bind
│   ├── module -> ../../../../module/usbserial
│   ├── uevent
│   └── unbind

编辑:在dmesg重新编译和重新引导之后添加了cp210x.ko (使用新的cp210x.ko)

代码语言:javascript
运行
复制
[    1.352918] usb 3-2: new full-speed USB device number 2 using xhci_hcd
[    1.389854] usb 3-2: New USB device found, idVendor=10c4, idProduct=8668
[    1.389865] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.389871] usb 3-2: Product: NETUSB1100 NEWMSG 
[    1.389877] usb 3-2: Manufacturer: HZWB
[    1.399869] usbcore: registered new interface driver usbhid
[    1.399872] usbhid: USB HID core driver
[    1.406870] hid-generic 0003:10C4:8668.0001: hiddev0,hidraw0: USB HID v1.01 Device [HZWB NETUSB1100 NEWMSG ] on usb-0000:0e:00.0-2/input0

在手动modprobe cp210x之后,dmesg中的额外行。

代码语言:javascript
运行
复制
[ 1313.312593] usbcore: registered new interface driver usbserial
[ 1313.312642] usbcore: registered new interface driver usbserial_generic
[ 1313.312674] usbserial: USB Serial support registered for generic
[ 1313.329536] usbcore: registered new interface driver cp210x
[ 1313.329575] usbserial: USB Serial support registered for cp210x
(end of file)
EN

回答 1

Ask Ubuntu用户

发布于 2016-03-31 06:10:01

我使用shell脚本管理标识设备节点,并使用自定义cp210x驱动程序。还提供了适当的udev规则和脚本,以便在CP210X设备热插拔时动态执行脚本。

github.com/RishiGupta12/serial-communication-manager/tree/master/drivers/cp210x-silicon-labs

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/408627

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档