Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed availability of USB instance of GenericESCPOS #23

Open
anoraxx opened this issue Feb 24, 2022 · 0 comments
Open

Delayed availability of USB instance of GenericESCPOS #23

anoraxx opened this issue Feb 24, 2022 · 0 comments

Comments

@anoraxx
Copy link

anoraxx commented Feb 24, 2022

When instantiating a USB printer under Windows 11 using libsusb and class escpos.impl.epson.GenericESCPOS I discovered that you have to put in a delay of at least ~130 ms before calling init(). Otherwise there will be an error by libusb (or Windows, actually?) that the device could not be opened.

Quick'n'dirty™ workaround:

while True:
    try:
        printer.init()
    except:
        continue
    else:
        break
@anoraxx anoraxx changed the title Timeout after instantiating GenericESCPOS Delayed availability of USB instance of GenericESCPOS Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant