Skip to content

USB Read Timeout Issues on Raspberry Pi #5

@inancme

Description

@inancme

When the project is run on Raspberry Pi unfortunately there are timeouts while reading from the USB. There is a hack that involves magic numbers and adding timeout to the read and sleep when the buffer size exceeds a certain size. The hack was found on stackoverflow belongs to Jordan Grider (thanks) and it works fine. However should be improved before being committed. It looks like this:

def read_packet(self):
    try:
       res = self.dev.read(self.read_endpoint, self.usb_packetlength, 1000)
       if (len(res)>10000):
           sleep(1)
       return res
    except ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions