question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Advice for debugging a communication issue when using pyusb

See original GitHub issue

Hi @jonasmalacofilho and @mcuee,

I’m using pyusb in my spectrometer library python-seabreeze and a user reported an issue where communication with a specific spectrometer model via pyusb works on Windows, but fails on Linux. Another different type of spectrometer works on both of the user’s operating systems, so we can rule out some library installation issue.

We have debug logs that were created with LIBUSB_DEBUG=4 and PYUSB_DEBUG=debug from the Linux and the Windows machine. On both machines the pyusb backend is libusb1 and the libusb library version is v1.0.24.11584

❌   Here is the linux log: https://github.com/ap--/python-seabreeze/issues/133#issuecomment-926065589 ✅   And here the windows log: https://github.com/ap--/python-seabreeze/issues/133#issuecomment-926073213

The linux log shows that a timeout occurs when it’s trying to read information back after the first command. But I’m out of ideas what the issue could be.

Could you give me some advice how to best proceed with the debugging here?

Thank you so much, Cheers, Andreas 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ap--commented, Sep 28, 2021

Thank you so much for your help @mcuee I’ll go and ask the linux-usb mailing list then. In the meantime I will close this issue, and report back with whatever I find out.

Thanks again, Andreas 😃

0reactions
mcueecommented, Sep 28, 2021

Unfortunately the capture does not tell much. The first bulk-in failed under Linux. I will suggest you ask in linux-usb mailing list to get better help. I can only think that the many control requests in the beginning somewhat put the device into a wrong state under Linux.

linux-usb mailing list. http://vger.kernel.org/vger-lists.html#linux-usb

Frame 115: 27 bytes on wire (216 bits), 27 bytes captured (216 bits)
USB URB
    [Source: host]
    [Destination: 1.3.1]
    USBPcap pseudoheader length: 27
    IRP ID: 0xffffb08a631744e0
    IRP USBD_STATUS: Unknown (0xffffffff)
    URB Function: URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER (0x0009)
    IRP information: 0x00, Direction: FDO -> PDO
        0000 000. = Reserved: 0x00
        .... ...0 = Direction: FDO -> PDO (0x0)
    URB bus id: 1
    Device address: 3
    Endpoint: 0x81, Direction: IN
        1... .... = Direction: IN (1)
        .... 0001 = Endpoint number: 1
    URB transfer type: URB_BULK (0x03)
    Packet Data Length: 0
    [bInterfaceClass: Vendor Specific (0xff)]

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advice for debugging a communication issue when using pyusb
I'm using pyusb in my spectrometer library python-seabreeze and a user reported an issue where communication with a specific spectrometer model via pyusb...
Read more >
The default example at tutorial.rst does not work: ep is None
Hello, I opened your tutorial to try it out and modified it only slightly, so my Arduino device is found without errors. It...
Read more >
PyUsb does not recognize my USB device while my PC does
I've sorted out the problem. The solution is that PyUSB module will search for libusb0.dll and libusb-1.0.dll files which are backends to communicate...
Read more >
The Cisco PyUSB Developer Guide - Document
Ease of Programming - because of the ease of programming with PyUSB, you can use the Cisco PyUSB to easily communicate with a...
Read more >
Thread: [pyusb-users] reading multimeter - SourceForge
I'm having a bit of trouble understanding how to use the debug feature. ... The multimeter has > very poor documentation, so I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found