发现位置:usb之python(pyusb)
pypi:pyusb 1.0.2
Libraries.io教程 :pyusb Release 1.0.2
github教程:Programming with PyUSB 1.0
我的安装流程:参考tensorflow-yolov3 调试Intel Realsense D435摄像头所遇到的问题(USB自动检测并重置机制)

查看idVendor和idProduct

根据作者提供的github教程:
测试打印usb接口信息
随机挑选一个Intel Realsense摄像头,根据它的idVendor和idProduct打印它的信息:
发现深度摄像头都是一样的:
在这里插入图片描述
RGB摄像头都是一样的:
在这里插入图片描述

运行代码

# -*- coding: utf-8 -*-
"""
@File    : test_191128_测试pyusb.py
@Time    : 2019/11/28 11:24
@Author  : Dontla
@Email   : sxana@qq.com
@Software: PyCharm
"""
import usb.core
import usb.util

# find our device
dev = usb.core.find(idVendor=0x8086, idProduct=0x0B07)

print(dev)

结果:

D:\20191031_tensorflow_yolov3\python\python.exe D:/20191031_tensorflow_yolov3/needed/test/test_Intel_realsense/test_191128_测试pyusb.py
DEVICE ID 8086:0b07 on Bus 001 Address 014 =================
 bLength                :   0x12 (18 bytes)
 bDescriptorType        :    0x1 Device
 bcdUSB                 :  0x320 USB 3.2
 bDeviceClass           :   0xef Miscellaneous
 bDeviceSubClass        :    0x2
 bDeviceProtocol        :    0x1
 bMaxPacketSize0        :    0x9 (9 bytes)
 idVendor               : 0x8086
 idProduct              : 0x0b07
 bcdDevice              : 0x50b6 Device 80.116
 iManufacturer          :    0x1 Error Accessing String
 iProduct               :    0x2 Error Accessing String
 iSerialNumber          :    0x3 Error Accessing String
 bNumConfigurations     :    0x1
  CONFIGURATION 1: 110 mA ==================================
   bLength              :    0x9 (9 bytes)
   bDescriptorType      :    0x2 Configuration
   wTotalLength         :  0xb77 (2935 bytes)
   bNumInterfaces       :    0x5
   bConfigurationValue  :    0x1
   iConfiguration       :    0x0 
   bmAttributes         :   0xc0 Self Powered
   bMaxPower            :   0x37 (110 mA)
    INTERFACE 0: Video =====================================
     bLength            :    0x9 (9 bytes)
     bDescriptorType    :    0x4 Interface
     bInterfaceNumber   :    0x0
     bAlternateSetting  :    0x0
     bNumEndpoints      :    0x1
     bInterfaceClass    :    0xe Video
     bInterfaceSubClass :    0x1
     bInterfaceProtocol :    0x0
     iInterface         :    0x5 Error Accessing String
      ENDPOINT 0x87: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x87 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x6
    INTERFACE 1: Video =====================================
     bLength            :    0x9 (9 bytes)
     bDescriptorType    :    0x4 Interface
     bInterfaceNumber   :    0x1
     bAlternateSetting  :    0x0
     bNumEndpoints      :    0x1
     bInterfaceClass    :    0xe Video
     bInterfaceSubClass :    0x2
     bInterfaceProtocol :    0x0
     iInterface         :    0x5 Error Accessing String
      ENDPOINT 0x82: Bulk IN ===============================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x82 IN
       bmAttributes     :    0x2 Bulk
       wMaxPacketSize   :  0x400 (1024 bytes)
       bInterval        :    0x0
    INTERFACE 2: Video =====================================
     bLength            :    0x9 (9 bytes)
     bDescriptorType    :    0x4 Interface
     bInterfaceNumber   :    0x2
     bAlternateSetting  :    0x0
     bNumEndpoints      :    0x1
     bInterfaceClass    :    0xe Video
     bInterfaceSubClass :    0x2
     bInterfaceProtocol :    0x0
     iInterface         :    0x8 Error Accessing String
      ENDPOINT 0x83: Bulk IN ===============================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x83 IN
       bmAttributes     :    0x2 Bulk
       wMaxPacketSize   :  0x400 (1024 bytes)
       bInterval        :    0x0
    INTERFACE 3: Video =====================================
     bLength            :    0x9 (9 bytes)
     bDescriptorType    :    0x4 Interface
     bInterfaceNumber   :    0x3
     bAlternateSetting  :    0x0
     bNumEndpoints      :    0x0
     bInterfaceClass    :    0xe Video
     bInterfaceSubClass :    0x1
     bInterfaceProtocol :    0x0
     iInterface         :    0x6 Error Accessing String
    INTERFACE 4: Video =====================================
     bLength            :    0x9 (9 bytes)
     bDescriptorType    :    0x4 Interface
     bInterfaceNumber   :    0x4
     bAlternateSetting  :    0x0
     bNumEndpoints      :    0x1
     bInterfaceClass    :    0xe Video
     bInterfaceSubClass :    0x2
     bInterfaceProtocol :    0x0
     iInterface         :    0x6 Error Accessing String
      ENDPOINT 0x84: Bulk IN ===============================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x84 IN
       bmAttributes     :    0x2 Bulk
       wMaxPacketSize   :  0x400 (1024 bytes)
       bInterval        :    0x0

Process finished with exit code 0

看不懂这打印的一堆是啥玩意o_o …

然后运行dev.set_configuration(),报错:

usb.core.USBError: [Errno 2] Entity not found

在这里插入图片描述
不丸了(╯‵□′)╯︵┻━┻

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐