- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有 2 个相同的蓝牙接收器连接到 Raspberry Pi,我需要监控房间不同部分的蓝牙信号。不幸的是,这两个设备具有相同的 idVendor 和 idProduct 所以我已诉诸使用 ATTR{serial} 希望 udev 可以区分两者。
问题是,在我创建 udev 规则(使用新的符号链接(symbolic link))后,只有 1 个蓝牙接收器显示正确名称的 DEVLINK我在规则中提供了。另一个蓝牙接收器 DEVLINK 名称是从未显示过。我尝试了很多方法:重新启动、重新加载 udev规则,重新启动 udevadm。控制台提供以下错误在 dm 测试中时(下面提供了完整的输出 - 我认为有可能是此输出后半部分的权限问题?):
udev_event_execute_rules: no node name set, will use kernel supplied
name 'bus/usb/001/006'
udev_node_add: creating device node '/dev/bus/usb/001/006',
devnum=189:5, mode=01664, uid=0, gid=0
udev_node_mknod: preserve file '/dev/bus/usb/001/006', because it has
correct dev_t
udev_node_mknod: preserve permissions /dev/bus/usb/001/006, 021664, uid=0, gid=0
node_symlink: preserve already existing symlink '/dev/char/189:5' to
'../bus/usb/001/006'
udev_device_update_db: unable to create temporary db file
'/run/udev/data/c189:5.tmp': Permission denied
ACTION=add
BUSNUM=001
DEVNAME=/dev/bus/usb/001/006
如果有帮助的话,这就是我为了创建规则所做的事情执行测试:
首先,我运行 udevadm info 来识别2 个接收器。1 台设备上的 idVendor、serial 和 idProduct 如下:
ATTR{idVendor}=="0a5c"
ATTR{serial}=="0002723FAE6C"
ATTR{idProduct}=="21e8"
在另一台设备上...
ATTR{idVendor}=="0a5c"
ATTR{serial}=="5CF37067320A"
ATTR{idProduct}=="21e8"
我创建了一个名为“00-my-usb-device.rules”的新规则文件,它看起来像下面这样:
SUBSYSTEM=="usb", ATTR{idVendor}=="0a5c",
ATTRS{serial}=="5CF37067320A", SYMLINK+="driverBT"
然后我创建了一个名为“01-my-usb-device.rules”的单独规则文件(最初我在 1 个文件中有两条规则,但想尝试所有的可能性。该文件如下所示:
SUBSYSTEM=="USB", ATTR{serial}=="0002723FAE6C",
ATTR{idVendor}=="0a5c", SYMLINK+="rearBT"
在第一个端口上运行 devadm,序列号为“5CF37067320A”(也是我设定的第一条规则): udevadm 测试/devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5.2 run_command:调用:测试 adm_测试:版本 175 该程序仅用于调试,它不运行任何程序, 由RUN键指定。它可能会显示不正确的结果,因为 有些值可能不同,或者在模拟运行时不可用。
parse_file: reading '/etc/udev/rules.d/00-my-usb-device.rules' as rules file
parse_file: reading '/etc/udev/rules.d/01-my-usb-device.rules' as rules file
parse_file: reading '/lib/udev/rules.d/10-local-rpi.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-scratch.rules' as rules file
parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file
parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file
parse_file: reading '/lib/udev/rules.d/55-dm.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-fuse.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-gnupg.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-gpsd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-i2c-tools.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-ifplugd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-libgphoto2-2.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-alsa.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-serial.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage-dm.rules'
as rules file
parse_file: reading
'/lib/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage.rules' as
rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-python-pifacecommon.rules'
as rules file
parse_file: reading '/lib/udev/rules.d/60-python3-pifacecommon.rules'
as rules file
parse_file: reading '/lib/udev/rules.d/60-triggerhappy.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-accelerometer.rules' as rules file
parse_file: reading '/run/udev/rules.d/61-dev-root-link.rules' as rules file
parse_file: reading '/lib/udev/rules.d/64-xorg-xkb.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-uaccess.rules' as rules file
add_rule: IMPORT found builtin 'usb_id', replacing
/lib/udev/rules.d/70-uaccess.rules:13
parse_file: reading '/lib/udev/rules.d/70-udev-acl.rules' as rules file
parse_file: reading '/lib/udev/rules.d/71-seat.rules' as rules file
add_rule: IMPORT found builtin 'path_id', replacing
/lib/udev/rules.d/71-seat.rules:23
parse_file: reading '/lib/udev/rules.d/73-seat-late.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules'
as rules file
parse_file: reading '/lib/udev/rules.d/75-net-description.rules' as rules file
parse_file: reading
'/lib/udev/rules.d/75-persistent-net-generator.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-probe_mtd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-tty-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/78-sound-card.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-networking.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-udisks.rules' as rules file
parse_file: reading '/lib/udev/rules.d/85-hwclock.rules' as rules file
parse_file: reading '/lib/udev/rules.d/85-usbmuxd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/90-alsa-restore.rules' as rules file
parse_file: reading '/lib/udev/rules.d/91-permissions.rules' as rules file
parse_file: reading
'/lib/udev/rules.d/95-keyboard-force-release.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-hid2hci.rules' as rules file
parse_file: reading '/etc/udev/rules.d/99-input.rules' as rules file
parse_file: reading '/lib/udev/rules.d/99-systemd.rules' as rules file
udev_rules_new: rules use 145392 bytes tokens (12116 * 12 bytes),
24358 bytes buffer
udev_rules_new: temporary index used 39920 bytes (1996 * 20 bytes)
udev_device_new_from_syspath: device 0x18b5748 has devpath
'/devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5.2'
udev_device_new_from_syspath: device 0x18b2258 has devpath
'/devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5.2'
udev_device_read_db: device 0x18b2258 filled with db file data
udev_rules_apply_to_event: LINK 'driverBT'
/etc/udev/rules.d/00-my-usb-device.rules:1
udev_device_new_from_syspath: device 0x18b3188 has devpath
'/devices/platform/bcm2708_usb/usb1/1-1/1-1.5'
udev_device_new_from_syspath: device 0x18b3640 has devpath
'/devices/platform/bcm2708_usb/usb1/1-1'
udev_device_new_from_syspath: device 0x18b3ae8 has devpath
'/devices/platform/bcm2708_usb/usb1'
udev_device_new_from_syspath: device 0x18b3f88 has devpath
'/devices/platform/bcm2708_usb'
udev_device_new_from_syspath: device 0x18b42d8 has devpath '/devices/platform'
udev_rules_apply_to_event: IMPORT builtin 'usb_id'
/lib/udev/rules.d/60-libgphoto2-2.rules:11
udev_builtin_add_property: ID_VENDOR=Broadcom_Corp
udev_builtin_add_property: ID_VENDOR_ENC=Broadcom\x20Corp
udev_builtin_add_property: ID_VENDOR_ID=0a5c
udev_builtin_add_property: ID_MODEL=BCM20702A0
udev_builtin_add_property: ID_MODEL_ENC=BCM20702A0
udev_builtin_add_property: ID_MODEL_ID=21e8
udev_builtin_add_property: ID_REVISION=0112
udev_builtin_add_property: ID_SERIAL=Broadcom_Corp_BCM20702A0_5CF37067320A
udev_builtin_add_property: ID_SERIAL_SHORT=5CF37067320A
udev_builtin_add_property: ID_BUS=usb
udev_builtin_add_property: ID_USB_INTERFACES=:ff0101:ffffff:fe0101:
udev_rules_apply_to_event: MODE 0664 /lib/udev/rules.d/91-permissions.rules:36
udev_event_execute_rules: no node name set, will use kernel supplied
name 'bus/usb/001/009'
udev_node_add: creating device node '/dev/bus/usb/001/009',
devnum=189:8, mode=01664, uid=0, gid=0
udev_node_mknod: preserve file '/dev/bus/usb/001/009', because it has
correct dev_t
udev_node_mknod: preserve permissions /dev/bus/usb/001/009, 021664, uid=0, gid=0
node_symlink: preserve already existing symlink '/dev/char/189:8' to
'../bus/usb/001/009'
link_find_prioritized: found 'c189:8' claiming '/run/udev/links/driverBT'
link_update: creating link '/dev/driverBT' to '/dev/bus/usb/001/009'
node_symlink: preserve already existing symlink '/dev/driverBT' to
'bus/usb/001/009'
udev_device_update_db: unable to create temporary db file
'/run/udev/data/c189:8.tmp': Permission denied
ACTION=add
BUSNUM=001
DEVLINKS=/dev/driverBT
DEVNAME=/dev/bus/usb/001/009
DEVNUM=009
DEVPATH=/devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5.2
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_MODEL=BCM20702A0
ID_MODEL_ENC=BCM20702A0
ID_MODEL_ID=21e8
ID_REVISION=0112
ID_SERIAL=Broadcom_Corp_BCM20702A0_5CF37067320A
ID_SERIAL_SHORT=5CF37067320A
ID_USB_INTERFACES=:ff0101:ffffff:fe0101:
ID_VENDOR=Broadcom_Corp
ID_VENDOR_ENC=Broadcom\x20Corp
ID_VENDOR_ID=0a5c
MAJOR=189
MINOR=8
PRODUCT=a5c/21e8/112
SUBSYSTEM=usb
TYPE=255/1/1
UDEV_LOG=6
USEC_INITIALIZED=465479898
在第二个端口上运行 udevadm 测试(此处不存在 DEVLINK,因为与其他设备相比):
udevadm 测试/devices/platform/bcm2708_usb/usb1/1-1/1-1.5 run_command:调用:测试 adm_测试:版本 175 该程序仅用于调试,它不运行任何程序, 由RUN键指定。它可能会显示不正确的结果,因为 有些值可能不同,或者在模拟运行时不可用。
parse_file: reading '/etc/udev/rules.d/00-my-usb-device.rules' as rules file
parse_file: reading '/etc/udev/rules.d/01-my-usb-device.rules' as rules file
parse_file: reading '/lib/udev/rules.d/10-local-rpi.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-scratch.rules' as rules file
parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file
parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file
parse_file: reading '/lib/udev/rules.d/55-dm.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-fuse.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-gnupg.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-gpsd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-i2c-tools.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-ifplugd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-libgphoto2-2.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-alsa.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-serial.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage-dm.rules'
as rules file
parse_file: reading
'/lib/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage.rules' as
rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-python-pifacecommon.rules'
as rules file
parse_file: reading '/lib/udev/rules.d/60-python3-pifacecommon.rules'
as rules file
parse_file: reading '/lib/udev/rules.d/60-triggerhappy.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-accelerometer.rules' as rules file
parse_file: reading '/run/udev/rules.d/61-dev-root-link.rules' as rules file
parse_file: reading '/lib/udev/rules.d/64-xorg-xkb.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-uaccess.rules' as rules file
add_rule: IMPORT found builtin 'usb_id', replacing
/lib/udev/rules.d/70-uaccess.rules:13
parse_file: reading '/lib/udev/rules.d/70-udev-acl.rules' as rules file
parse_file: reading '/lib/udev/rules.d/71-seat.rules' as rules file
add_rule: IMPORT found builtin 'path_id', replacing
/lib/udev/rules.d/71-seat.rules:23
parse_file: reading '/lib/udev/rules.d/73-seat-late.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules'
as rules file
parse_file: reading '/lib/udev/rules.d/75-net-description.rules' as rules file
parse_file: reading
'/lib/udev/rules.d/75-persistent-net-generator.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-probe_mtd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-tty-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/78-sound-card.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-networking.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-udisks.rules' as rules file
parse_file: reading '/lib/udev/rules.d/85-hwclock.rules' as rules file
parse_file: reading '/lib/udev/rules.d/85-usbmuxd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/90-alsa-restore.rules' as rules file
parse_file: reading '/lib/udev/rules.d/91-permissions.rules' as rules file
parse_file: reading
'/lib/udev/rules.d/95-keyboard-force-release.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-hid2hci.rules' as rules file
parse_file: reading '/etc/udev/rules.d/99-input.rules' as rules file
parse_file: reading '/lib/udev/rules.d/99-systemd.rules' as rules file
udev_rules_new: rules use 145392 bytes tokens (12116 * 12 bytes),
24358 bytes buffer
udev_rules_new: temporary index used 39920 bytes (1996 * 20 bytes)
udev_device_new_from_syspath: device 0x17a748 has devpath
'/devices/platform/bcm2708_usb/usb1/1-1/1-1.5'
udev_device_new_from_syspath: device 0x177258 has devpath
'/devices/platform/bcm2708_usb/usb1/1-1/1-1.5'
udev_device_read_db: device 0x177258 filled with db file data
udev_device_new_from_syspath: device 0x177db8 has devpath
'/devices/platform/bcm2708_usb/usb1/1-1'
udev_device_new_from_syspath: device 0x178260 has devpath
'/devices/platform/bcm2708_usb/usb1'
udev_device_new_from_syspath: device 0x1786d8 has devpath
'/devices/platform/bcm2708_usb'
udev_device_new_from_syspath: device 0x178a28 has devpath '/devices/platform'
udev_rules_apply_to_event: IMPORT builtin 'usb_id'
/lib/udev/rules.d/60-libgphoto2-2.rules:11
udev_builtin_add_property: ID_VENDOR=050d
udev_builtin_add_property: ID_VENDOR_ENC=050d
udev_builtin_add_property: ID_VENDOR_ID=050d
udev_builtin_add_property: ID_MODEL=0234
udev_builtin_add_property: ID_MODEL_ENC=0234
udev_builtin_add_property: ID_MODEL_ID=0234
udev_builtin_add_property: ID_REVISION=3298
udev_builtin_add_property: ID_SERIAL=050d_0234
udev_builtin_add_property: ID_BUS=usb
udev_builtin_add_property: ID_USB_INTERFACES=:090001:090002:
udev_rules_apply_to_event: MODE 0664 /lib/udev/rules.d/91- permissions.rules:36
udev_event_execute_rules: no node name set, will use kernel supplied
name 'bus/usb/001/006'
udev_node_add: creating device node '/dev/bus/usb/001/006',
devnum=189:5, mode=01664, uid=0, gid=0
udev_node_mknod: preserve file '/dev/bus/usb/001/006', because it has
correct dev_t
udev_node_mknod: preserve permissions /dev/bus/usb/001/006, 021664, uid=0, gid=0
node_symlink: preserve already existing symlink '/dev/char/189:5' to
'../bus/usb/001/006'
udev_device_update_db: unable to create temporary db file
'/run/udev/data/c189:5.tmp': Permission denied
ACTION=add
BUSNUM=001
DEVNAME=/dev/bus/usb/001/006
DEVNUM=006
DEVPATH=/devices/platform/bcm2708_usb/usb1/1-1/1-1.5
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_MODEL=0234
ID_MODEL_ENC=0234
ID_MODEL_ID=0234
ID_REVISION=3298
ID_SERIAL=050d_0234
ID_USB_INTERFACES=:090001:090002:
ID_VENDOR=050d
ID_VENDOR_ENC=050d
ID_VENDOR_ID=050d
MAJOR=189
MINOR=5
PRODUCT=50d/234/3298
SUBSYSTEM=usb
TYPE=9/0/2
UDEV_LOG=6
USEC_INITIALIZED=200440100
最佳答案
需要内核。 2 个 BT 适配器连接到 4 端口集线器。一旦我在 2 条规则中指定了内核,一切就正常了。
产品和序列号也用于区分这两个设备(产品可能不是必需的,因为它与其他 BT 设备匹配,但序列号绝对是必需的)。
关于linux - udevadm/持久 USB 名称不起作用(权限错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31627853/
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
Android 权限(您在 list 中请求并在安装时显示的权限)是否与 root 用户在 root 手机上获得的 linux 权限相同? 更确切地说:如果我的手机上有 root 权限并且我有一个可以
我经常读到 VIEW 的一个目的是安全性:允许一些用户访问基础表,而其他用户只允许访问派生 View 。考虑到这一点,我设计了几个向外部用户提供受限数据集的 View 。 一切都很好,但在实践中这是行
在 Facebook API v2.3 中,“user_posts”听起来像是“user_status”的超集。是这样吗?如果我已经有“user_posts”,为什么还需要“user_status”?
在为 BLUETOOTH_CONNECT 请求运行时权限后,android 12 崩溃了,我在 Samsung Android 12 设备中遇到了这个问题。在其他低于 Android 12 的设备上运
请理解这个问题可能有点头晕,因为这是我第一次提问。另外,请理解语法可能很奇怪,因为我不擅长英语并使用翻译。 我是一个在 Android 工作室中使用 java 制作应用程序的人。 尝试使用蓝牙时出现连
我刚刚将我的 Magento 商店从 cPanel 移动到 DirectAdmin (Centos)。 我的问题现在是权限。以前在 cPanel 上,所有文件夹都设置为 755 和文件 644。这很好
我希望在我的 Django 项目中获得更细粒度的权限,但无法决定使用哪个应用程序。 我所拥有的是这样的: class Item(models.Model): name = models.Cha
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 6年前关闭。 Improve thi
我们已经设置了一个 Github 应用程序,以便它使用 Github API 自动为另一个个人 Github 用户创建一个存储库。现在我们遇到了一个问题,不是每个人都想让我们完全读取他们所有的私有(p
假设我有一个网站想要访问 Facebook 的用户帐户信息。通常,用户会获得网站要求的所有权限,并且可以整体上允许或拒绝这些权限。 是否可以让用户选择(例如,通过授权屏幕上每个权限的复选框)他想授予网
平台下载地址:https://gitee.com/alwaysinsist/edp 权限介绍 权限实际上就是谁有权使用或是访问什么,这里的“谁”可以视作"授权对象",&qu
playstore 给我发这个消息 We've detected that your app contains the requestLegacyExternalStorage flag in the
我可以在没有 sudo 的情况下运行 docker,但有时它会再次请求权限,我无法在 VS 代码中附加容器 Got permission denied while trying to connect
我正在尝试在 Ubuntu 中的可执行文件上运行 gdb。但是,当我尝试在 gdb 中运行 run 时,出现以下错误。 /vagrant/unit_test: cannot execute: Perm
我的应用程序工作了一年,然后对 instagram 的 API 调用停止返回任何数据。 我使用以下 instagram 端点: https://api.instagram.com/v1/media/s
我使用 TFS 2012 并希望为 TFS 用户组设置以下权限。 允许创建新问题项。 拒绝创建新的任务项。 拒绝更改他的任务项,只能更改提醒时间、描述和状态。并且不能更改分配的用户、优先级和迭代。 我
我有一个谷歌计算引擎实例,我使用与我的 glcoud 帐户关联的 SSH key 通过 SFTP 连接到该实例。但是,我无法将任何文件上传到/var/www 目录,尽管我可以读取目录列表。/var/w
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为
我不确定如何正确处理以下情况: 我的程序通过安装程序安装 我在应用程序文件夹中创建SQLite数据库(程序启动时) 在某些配置中,我收到“ Attemt写入只读数据库”错误。这是权限问题,现在我通过将
我是一名优秀的程序员,十分优秀!