Menu

Problems reading from HID device

Help
2009-07-13
2012-12-06
  • Celia San Martín

    Hello,
    I´m using libusb in Linux and libusb-win32 in Windows in order to read and write telegrams between a KNX network and my PC through a KNX device (ABB i.bus EIB/KNX USB/S1.1) with USB connection.
    Firstly I made the changes that are necessary in both OS so that the device is considered as a device controlled by libusb or libusb-win32.
    When I execute the java wrapper a timeout error appears:
    ch.ntb.usb.USBTimeoutException: LibusbJava.usb_interrupt_read: No error
       at ch.ntb.usb.Device.readInterrupt(Device.java:521)
       at ReadWrite.main(ReadWrite.java:69)

    I've made some tests with another device (an HID mouse) and the application can read the telegram.
    Could somebody help me, please?? Thank you in advance

     
    • andi

      andi - 2009-07-18

      A timeout exception can have the following reasons:
      1. The device doesn't send any data
      2. The device wants to send data but the timeout is too short

      Most likely (1) is the problem.
      How it works technically: The timeout parameter passed to the function ch.ntb.usb.Device.readInterrupt(int, byte[], int, int, boolean) specifies the amount of time the function call will wait for data to be received (blocking call). If no data is received within this time a timeout exception is thrown.

      Verify that the device does send data and that you are reading from the correct endpoint.

       
      • Celia San Martín

        Hello, I've made some progress and the problem was that some telegrams needed to be sent previously in order that the device could be able to send some data to the PC by USB. That was the reason why timeout exception appeared.
        Thank you very much

         
  • abid bodal

    abid bodal - 2009-09-16

    I am having a similar problem. I also get a reap timeout error. My send data works and read data works sometimes, and once it starts working, it works until I click reset. I don't know if this means there is a timing issue or the in endpoint is not configured properly. Below are the details of my in endpoint:

    Usb_Endpoint_Descriptor
    blenght: 0x7
    bDescriptorType: 0x5
    bEndpointAddress: 0x81
    bmAttributes: 0x2
    wMaxPacketSize: 0x200 (512)
    bInterval: 0x0
    bRefresh: 0x0
    bSynchAddress: 0x0
    extralen: 0x0
    extra: null

    Please advise.

     
  • andi

    andi - 2009-09-17

    You can try to increase the timeout to a high value ( e.g. 10 seconds). If the situation is the same it's probably a device error. Without more detail of the device it's difficult to say what the problem is.

    Note that a reset of the device invalidates the device handle and the device must be reopened.

     
  • Anonymous

    Anonymous - 2009-10-25

    I suddenly started having issues talking to my USB device from Java, and after trying a ton of stuff, I looked at the propertys of libusbjava.dll in system32.  it said something about being blocked and had a button to unblock it.  a little notice would have been nice.  i think this is what got me back on track, but i tried a ton of stuff so it could have been something else. 

    good luck
    -james

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.