From 7b97ff2e24c512daac725d3423a316ac89424662 Mon Sep 17 00:00:00 2001 From: aerialist Date: Wed, 24 Jan 2024 21:27:59 +0900 Subject: [PATCH] Add sleep in sending fragments Adding sleep prevents "USBTimeoutError: [Errno 110] Operation timed out". --- src/escpos/escpos.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/escpos/escpos.py b/src/escpos/escpos.py index ada52ec..945dd63 100644 --- a/src/escpos/escpos.py +++ b/src/escpos/escpos.py @@ -13,6 +13,7 @@ from __future__ import annotations import textwrap import warnings +import time from abc import ABCMeta, abstractmethod # abstract base class support from re import match as re_match from types import TracebackType @@ -244,6 +245,7 @@ class Escpos(object, metaclass=ABCMeta): impl=impl, fragment_height=fragment_height, ) + time.sleep(0.3) return if impl == "bitImageRaster":