[Python] Windows 11 How do I read data from a USB device>

Discussão em 'Python' iniciado por Stack, Agosto 11, 2025.

  1. Stack

    Stack Membro Participativo

    I have been attempting to read data from a TEMPerHUM USB temperature and humidity device. I can read the device from Linux. I have tried many things, pyusb, wmi, libusb, etc. None seem to work. I get a 'no backend available' error. I can find the device using wmi, but can not find how to read it.

    import wmi

    try:
    c = wmi.WMI()
    print("Connected USB Devices:")
    count = 0
    for usb in c.Win32_USBControllerDevice():
    dependent_device = usb.Dependent
    if dependent_device:
    # Extract relevant information from the dependent device object
    # The 'Dependent' property refers to the connected USB device
    print(f" Device ID: {dependent_device.DeviceID}")
    print(f" Description: {dependent_device.Description}")
    if '10C4' in dependent_device.DeviceID:
    print('Found UART Bridge')
    if '3553' in dependent_device.DeviceID:
    print('Found TEMPerHUM')
    print("-" * 20)
    count += 1
    except Exception as e:
    print(f"An error occurred: {e}")

    print(dir(usb.Dependent))
    print(f'Found {count} devices.')
    x = input('Press enter to continue: ')


    Does anyone have an example of reading a USB device?

    Continue reading...

Compartilhe esta Página