I'm trying to perform bulk read and write operations on a USB-to-Ethernet device using pyusb with libus1 as backend. The code:
dev = usb.core.find(idVendor=..., idProduct=...)
if dev.is_kernel_driver_active(0) is True:
dev.detach_kernel_driver(0)
usb.util.claim_interface(dev, 0)
dev.set_configuration()
read_endpoint = dev[0][(0,0)][0]
write_endpoint = dev[0][(0,0)][1]
data = ...
write_endpoint.write(data)
data = read_endpoint.read(read_endpoint.wMaxPacketSize, timeout = 1000)
On Ubuntu, this works perfectly both for reading and for writing. On OSX (10.10.5), write is working (packets are being sent), however read is not working (I keep getting timeouts). I know there are packets that are received by the device because: 1) It works when I run it in Ubuntu and 2) The LED that indicates incoming packets is blinking.
dmesg shows only the following:
AppleUSBEHCI::Found a transaction past the completion deadline on bus ..., timing out! (Addr: ..., EP: ...)
Which kinda makes me think the problem with OSX not receiving the responses from the device. But thats really just a wild guess. I'm kinda lost here and I'd appreciate any help!