labelle-org / labelle

Label printing software
Apache License 2.0
50 stars 8 forks source link

Frequent overflow issues #68

Open jgoerzen opened 3 months ago

jgoerzen commented 3 months ago

Hello, and THANK YOU for Labelle!

I have a LabelManager 280 on Linux and using 12mm label tape.

I have found that when the text size exceeds approximately 50mm in width, I get frequent "overflow" errors and only part of the label prints.

Attempting to print after that is likely to yield further errors, including possible I/O errors, until I either power cycle the 280 or unplug it from USB and plug it back in again.

This is on Debian Linux and I would be happy to provide whatever debugging would be helpful!

jgoerzen commented 3 months ago

I can also duplicate this with the CLI, and it need not be a long label.

In fact, after printing the first label, subsequent ones fail. Here's an exceprt from the --verbose output of one run:

│ /home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_l │
│ abeler.py:214 in _get_status                                                                     │
│                                                                                                  │
│   211 │   def _get_status(self):                                                                 │
│   212 │   │   """Ask for and return the device's status (HLF)."""                                │
│   213 │   │   self._status_request()                                                             │
│ ❱ 214 │   │   return self._send_command()                                                        │
│   215 │                                                                                          │
│   216 │   def print_label(self, lines: list[list[int]]):                                         │
│   217 │   │   """Print the label described by lines.                                             │
│                                                                                                  │
│ ╭──────────────────────────────────────── locals ─────────────────────────────────────────╮      │
│ │ self = <labelle.lib.devices.dymo_labeler.DymoLabelerFunctions object at 0x7f1c35aa8f10> │      │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────╯      │
│                                                                                                  │
│ /home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_l │
│ abeler.py:101 in _send_command                                                                   │
│                                                                                                  │
│    98 │   │   │   │   # Send a status request                                                    │
│    99 │   │   │   │   cmdBin = array.array("B", [ESC, ord("A")])                                 │
│   100 │   │   │   │   cmdBin.tofile(self._devout)                                                │
│ ❱ 101 │   │   │   │   rspBin = self._devin.read(8)                                               │
│   102 │   │   │   │   _ = array.array("B", rspBin).tolist()                                      │
│   103 │   │   │   │   # Ok, we got a response. Now we can send a chunk of data                   │
│   104                                                                                            │
│                                                                                                  │
│ ╭───────────────────────────────────────── locals ──────────────────────────────────────────╮    │
│ │ cmdBin = array('B', [27, 65])                                                             │    │
│ │   self = <labelle.lib.devices.dymo_labeler.DymoLabelerFunctions object at 0x7f1c35aa8f10> │    │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────╯    │
│                                                                                                  │
│ /home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/core.py:423 in read    │
│                                                                                                  │
│    420 │   │                                                                                     │
│    421 │   │   For details, see the Device.read() method.                                        │
│    422 │   │   """                                                                               │
│ ❱  423 │   │   return self.device.read(self, size_or_buffer, timeout)                            │
│    424 │                                                                                         │
│    425 │   def clear_halt(self):                                                                 │
│    426 │   │   r"""Clear the halt/status condition of the endpoint."""                           │
│                                                                                                  │
│ ╭───────────────── locals ──────────────────╮                                                    │
│ │           self = <ENDPOINT 0x81: Bulk IN> │                                                    │
│ │ size_or_buffer = 8                        │                                                    │
│ │        timeout = None                     │                                                    │
│ ╰───────────────────────────────────────────╯                                                    │
│                                                                                                  │
│ /home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/core.py:1029 in read   │
│                                                                                                  │
│   1026 │   │   else: # here we consider it is a integer                                          │
│   1027 │   │   │   buff = util.create_buffer(size_or_buffer)                                     │
│   1028 │   │                                                                                     │
│ ❱ 1029 │   │   ret = fn(                                                                         │
│   1030 │   │   │   │   self._ctx.handle,                                                         │
│   1031 │   │   │   │   ep.bEndpointAddress,                                                      │
│   1032 │   │   │   │   intf.bInterfaceNumber,                                                    │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │        backend = <usb.backend.libusb1._LibUSB object at 0x7f1c35a9c0d0>                      │ │
│ │           buff = array('B', [0, 0, 0, 0, 0, 0, 0, 0])                                        │ │
│ │       endpoint = <ENDPOINT 0x81: Bulk IN>                                                    │ │
│ │             ep = <ENDPOINT 0x81: Bulk IN>                                                    │ │
│ │             fn = <bound method _LibUSB.bulk_read of <usb.backend.libusb1._LibUSB object at   │ │
│ │                  0x7f1c35a9c0d0>>                                                            │ │
│ │         fn_map = {                                                                           │ │
│ │                  │   2: <bound method _LibUSB.bulk_read of <usb.backend.libusb1._LibUSB      │ │
│ │                  object at 0x7f1c35a9c0d0>>,                                                 │ │
│ │                  │   3: <bound method _LibUSB.intr_read of <usb.backend.libusb1._LibUSB      │ │
│ │                  object at 0x7f1c35a9c0d0>>,                                                 │ │
│ │                  │   1: <bound method _LibUSB.iso_read of <usb.backend.libusb1._LibUSB       │ │
│ │                  object at 0x7f1c35a9c0d0>>                                                  │ │
│ │                  }                                                                           │ │
│ │           intf = <INTERFACE 0: Printer>                                                      │ │
│ │           self = <DEVICE ID 0922:1005 on Bus 001 Address 083>                                │ │
│ │ size_or_buffer = 8                                                                           │ │
│ │        timeout = None                                                                        │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/backend/libusb1.py:846 │
│ in bulk_read                                                                                     │
│                                                                                                  │
│   843 │                                                                                          │
│   844 │   @methodtrace(_logger)                                                                  │
│   845 │   def bulk_read(self, dev_handle, ep, intf, buff, timeout):                              │
│ ❱ 846 │   │   return self.__read(self.lib.libusb_bulk_transfer,                                  │
│   847 │   │   │   │   │   │      dev_handle,                                                     │
│   848 │   │   │   │   │   │      ep,                                                             │
│   849 │   │   │   │   │   │      intf,                                                           │
│                                                                                                  │
│ ╭───────────────────────────────── locals ──────────────────────────────────╮                    │
│ │       buff = array('B', [0, 0, 0, 0, 0, 0, 0, 0])                         │                    │
│ │ dev_handle = <usb.backend.libusb1._DeviceHandle object at 0x7f1c35a8e050> │                    │
│ │         ep = 129                                                          │                    │
│ │       intf = 0                                                            │                    │
│ │       self = <usb.backend.libusb1._LibUSB object at 0x7f1c35a9c0d0>       │                    │
│ │    timeout = 1000                                                         │                    │
│ ╰───────────────────────────────────────────────────────────────────────────╯                    │
│                                                                                                  │
│ /home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/backend/libusb1.py:954 │
│ in __read                                                                                        │
│                                                                                                  │
│   951 │   │   │   │     timeout)                                                                 │
│   952 │   │   # do not assume LIBUSB_ERROR_TIMEOUT means no I/O.                                 │
│   953 │   │   if not (transferred.value and retval == LIBUSB_ERROR_TIMEOUT):                     │
│ ❱ 954 │   │   │   _check(retval)                                                                 │
│   955 │   │   return transferred.value                                                           │
│   956                                                                                            │
│   957 def get_backend(find_library=None):                                                        │
│                                                                                                  │
│ ╭────────────────────────────────── locals ──────────────────────────────────╮                   │
│ │     address = 139759163119344                                              │                   │
│ │        buff = array('B', [0, 0, 0, 0, 0, 0, 0, 0])                         │                   │
│ │  dev_handle = <usb.backend.libusb1._DeviceHandle object at 0x7f1c35a8e050> │                   │
│ │          ep = 129                                                          │                   │
│ │          fn = <_FuncPtr object at 0x7f1c35a95a50>                          │                   │
│ │        intf = 0                                                            │                   │
│ │      length = 8                                                            │                   │
│ │      retval = -8                                                           │                   │
│ │        self = <usb.backend.libusb1._LibUSB object at 0x7f1c35a9c0d0>       │                   │
│ │     timeout = 1000                                                         │                   │
│ │ transferred = c_int(0)                                                     │                   │
│ ╰────────────────────────────────────────────────────────────────────────────╯                   │
│                                                                                                  │
│ /home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/backend/libusb1.py:604 │
│ in _check                                                                                        │
│                                                                                                  │
│   601 │   │   elif ret == LIBUSB_ERROR_TIMEOUT:                                                  │
│   602 │   │   │   raise USBTimeoutError(_strerror(ret), ret, _libusb_errno[ret])                 │
│   603 │   │   else:                                                                              │
│ ❱ 604 │   │   │   raise USBError(_strerror(ret), ret, _libusb_errno[ret])                        │
│   605 │                                                                                          │
│   606 │   return ret                                                                             │
│   607                                                                                            │
│                                                                                                  │
│ ╭─ locals ─╮                                                                                     │
│ │ ret = -8 │                                                                                     │
│ ╰──────────╯                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
USBError: [Errno 75] Overflow

The above exception was the direct cause of the following exception:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/cli/cli.py:543 in  │
│ default                                                                                          │
│                                                                                                  │
│   540 │   │   │   min_width_px=min_payload_len_px,                                               │
│   541 │   │   )                                                                                  │
│   542 │   │   bitmap, _ = render.render_with_meta(render_context)                                │
│ ❱ 543 │   │   dymo_labeler.print(bitmap)                                                         │
│   544 │   else:                                                                                  │
│   545 │   │   render = PrintPreviewRenderEngine(                                                 │
│   546 │   │   │   render_engine=render_engine,                                                   │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │                         _ = {                                                                │ │
│ │                             │   'horizontal_offset_px': -1.4015748031496074,                 │ │
│ │                             │   'vertical_offset_px': 0                                      │ │
│ │                             }                                                                │ │
│ │                     align = <Direction.LEFT: 'left'>                                         │ │
│ │           barcode_content = None                                                             │ │
│ │              barcode_text = None                                                             │ │
│ │              barcode_type = <BarcodeType.CODE128: 'code128'>                                 │ │
│ │ barcode_with_text_content = None                                                             │ │
│ │                    bitmap = <PIL.Image.Image image mode=1 size=263x64 at 0x7F1C35A9C910>     │ │
│ │                       ctx = <click.core.Context object at 0x7f1c360bf050>                    │ │
│ │                    device = <labelle.lib.devices.usb_device.UsbDevice object at              │ │
│ │                             0x7f1c35a9c410>                                                  │ │
│ │            device_manager = <labelle.lib.devices.device_manager.DeviceManager object at      │ │
│ │                             0x7f1c360c2990>                                                  │ │
│ │            device_pattern = None                                                             │ │
│ │              dymo_labeler = <labelle.lib.devices.dymo_labeler.DymoLabeler object at          │ │
│ │                             0x7f1c35a9c850>                                                  │ │
│ │              fixed_length = None                                                             │ │
│ │                      font = None                                                             │ │
│ │                 font_path = PosixPath('/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3… │ │
│ │                font_scale = 90.0                                                             │ │
│ │            frame_width_px = 0                                                                │ │
│ │               imagemagick = False                                                            │ │
│ │                   justify = <Direction.LEFT: 'left'>                                         │ │
│ │                 margin_px = 56.0                                                             │ │
│ │          max_label_mm_len = None                                                             │ │
│ │                max_length = None                                                             │ │
│ │        max_payload_len_px = None                                                             │ │
│ │          min_label_mm_len = 0.0                                                              │ │
│ │                min_length = 0.0                                                              │ │
│ │        min_payload_len_px = 0                                                                │ │
│ │                 old_align = None                                                             │ │
│ │               old_barcode = None                                                             │ │
│ │                  old_font = None                                                             │ │
│ │                 old_frame = False                                                            │ │
│ │                  old_help = False                                                            │ │
│ │               old_justify = None                                                             │ │
│ │                old_margin = None                                                             │ │
│ │            old_min_length = None                                                             │ │
│ │               old_picture = None                                                             │ │
│ │                 old_style = None                                                             │ │
│ │             old_tape_size = None                                                             │ │
│ │                    output = <Output.PRINTER: 'printer'>                                      │ │
│ │                   picture = None                                                             │ │
│ │                   preview = False                                                            │ │
│ │          preview_inverted = False                                                            │ │
│ │                qr_content = '9780689808654'                                                  │ │
│ │                    render = <labelle.lib.render_engines.print_payload.PrintPayloadRenderEng… │ │
│ │                             object at 0x7f1c35a9c610>                                        │ │
│ │            render_context = RenderContext(                                                   │ │
│ │                             │   height_px=64,                                                │ │
│ │                             │   preview_show_margins=False,                                  │ │
│ │                             │   background_color='white',                                    │ │
│ │                             │   foreground_color='black'                                     │ │
│ │                             )                                                                │ │
│ │             render_engine = <labelle.lib.render_engines.horizontally_combined.HorizontallyC… │ │
│ │                             object at 0x7f1c35a8e5d0>                                        │ │
│ │            render_engines = [                                                                │ │
│ │                             │   <labelle.lib.render_engines.text.TextRenderEngine object at  │ │
│ │                             0x7f1c360c2890>,                                                 │ │
│ │                             │   <labelle.lib.render_engines.qr.QrRenderEngine object at      │ │
│ │                             0x7f1c360c3950>                                                  │ │
│ │                             ]                                                                │ │
│ │            sample_pattern = None                                                             │ │
│ │                     scale = None                                                             │ │
│ │                     style = <FontStyle.REGULAR: 'regular'>                                   │ │
│ │              tape_size_mm = 12                                                               │ │
│ │              test_pattern = None                                                             │ │
│ │                      text = ['PZ8 .S23', '1996']                                             │ │
│ │                   verbose = True                                                             │ │
│ │                   version = None                                                             │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_l │
│ abeler.py:350 in print                                                                           │
│                                                                                                  │
│   347 │   │   │   │   self._device.dispose()                                                     │
│   348 │   │   │   LOG.debug("Cleaned up.")                                                       │
│   349 │   │   except POSSIBLE_USB_ERRORS as e:                                                   │
│ ❱ 350 │   │   │   raise DymoLabelerPrintError(str(e)) from e                                     │
│   351                                                                                            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │            bitmap = <PIL.Image.Image image mode=1 size=263x64 at 0x7F1C35A9C910>             │ │
│ │      label_matrix = [                                                                        │ │
│ │                     │   [0, 0, 0, 0, 0, 0, 0, 0],                                            │ │
│ │                     │   [0, 0, 0, 0, 0, 0, 0, 0],                                            │ │
│ │                     │   [0, 0, 0, 64, 3, 255, 255, 128],                                     │ │
│ │                     │   [0, 0, 0, 96, 3, 255, 255, 128],                                     │ │
│ │                     │   [0, 12, 0, 112, 3, 255, 255, 128],                                   │ │
│ │                     │   [0, 12, 0, 56, 0, 6, 1, 128],                                        │ │
│ │                     │   [0, 12, 0, 28, 0, 6, 1, 128],                                        │ │
│ │                     │   [0, 15, 255, 254, 0, 6, 1, 128],                                     │ │
│ │                     │   [0, 15, 255, 254, 0, 6, 1, 128],                                     │ │
│ │                     │   [0, 15, 255, 254, 0, 6, 1, 128],                                     │ │
│ │                     │   ... +253                                                             │ │
│ │                     ]                                                                        │ │
│ │        label_rows = [                                                                        │ │
│ │                     │   b'\x00\x00\x00\x00\x00\x00\x00\x00',                                 │ │
│ │                     │   b'\x00\x00\x00\x00\x00\x00\x00\x00',                                 │ │
│ │                     │   b'\x00\x00\x00@\x03\xff\xff\x80',                                    │ │
│ │                     │   b'\x00\x00\x00`\x03\xff\xff\x80',                                    │ │
│ │                     │   b'\x00\x0c\x00p\x03\xff\xff\x80',                                    │ │
│ │                     │   b'\x00\x0c\x008\x00\x06\x01\x80',                                    │ │
│ │                     │   b'\x00\x0c\x00\x1c\x00\x06\x01\x80',                                 │ │
│ │                     │   b'\x00\x0f\xff\xfe\x00\x06\x01\x80',                                 │ │
│ │                     │   b'\x00\x0f\xff\xfe\x00\x06\x01\x80',                                 │ │
│ │                     │   b'\x00\x0f\xff\xfe\x00\x06\x01\x80',                                 │ │
│ │                     │   ... +253                                                             │ │
│ │                     ]                                                                        │ │
│ │    rotated_bitmap = <PIL.Image.Image image mode=1 size=64x263 at 0x7F1C36513C90>             │ │
│ │              self = <labelle.lib.devices.dymo_labeler.DymoLabeler object at 0x7f1c35a9c850>  │ │
│ │            stream = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ stream_row_length = 8                                                                        │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
DymoLabelerPrintError: Print error: [Errno 75] Overflow

Parent is shutting down, bye...

Incidentally, it wasn't documented in the README about needing USB libraries; on Debian, before labelle would work at all, I had to install libusb-1.0-0-dev. It might be nice to talk about the USB library needs in the README, including which are preferred.

Thanks again!

jgoerzen commented 3 months ago

FYI, I tried switching to libusb0 (libusb-dev package on Debian) and that didn't help.

jgoerzen commented 3 months ago

On a lark, I changed the line in dymo_labeler.py:101 from read(8) to read(2048). That seemed to help. Printing a long label with the GUI, however, still showed this on the console:

Reading profile /home/jgoerzen/.config/firejail/labelle.profile
Reading profile /home/jgoerzen/.config/firejail/disable-common-except-sbin.inc
Parent pid 521029, child pid 521030
Child process initialized in 35.03 ms
[DEBUG] Active device configuration already found.
[DEBUG] Opened printer interface: <INTERFACE 0: Printer>
[DEBUG] Detaching kernel driver from interface 0
[DEBUG] Active device configuration already found.
[DEBUG] Opened printer interface: <INTERFACE 0: Printer>
[DEBUG] Detaching kernel driver from interface 0
[DEBUG] Active device configuration already found.
[DEBUG] Opened printer interface: <INTERFACE 0: Printer>
[DEBUG] Active device configuration already found.
[DEBUG] Opened printer interface: <INTERFACE 0: Printer>
[DEBUG] Active device configuration already found.
[DEBUG] Opened printer interface: <INTERFACE 0: Printer>
[DEBUG] Detaching kernel driver from interface 0
[DEBUG] Active device configuration already found.
[DEBUG] Opened printer interface: <INTERFACE 0: Printer>
[DEBUG] Active device configuration already found.
[DEBUG] Opened printer interface: <INTERFACE 0: Printer>
[DEBUG] Printing label..
[DEBUG] Sending chunk of 573 bytes
[DEBUG] Sending chunk of 567 bytes
[DEBUG] Sending chunk of 567 bytes
[DEBUG] Sending chunk of 103 bytes
[DEBUG] Post-send response: [96, 3, 0, 100, 25, 30, 0, 0]
[DEBUG] Sending chunk of 570 bytes
[DEBUG] Sending chunk of 567 bytes
[DEBUG] Sending chunk of 567 bytes
[DEBUG] Sending chunk of 103 bytes
[DEBUG] Post-send response: [96, 3, 0, 100, 25, 30, 0, 0]
[DEBUG] Sending chunk of 570 bytes
[DEBUG] Sending chunk of 567 bytes
[DEBUG] Sending chunk of 567 bytes
[DEBUG] Sending chunk of 103 bytes
[DEBUG] Post-send response: [96, 3, 0, 100, 25, 30, 0, 0]
[DEBUG] Sending chunk of 570 bytes
[DEBUG] Sending chunk of 567 bytes
[DEBUG] Sending chunk of 567 bytes
[DEBUG] Sending chunk of 103 bytes
[DEBUG] Post-send response: [96, 3, 0, 100, 25, 30, 0, 0]
[DEBUG] Sending chunk of 133 bytes
[ERROR] Print error: [Errno 75] Overflow
Traceback (most recent call last):
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 345, in print
    self._functions.print_label(label_matrix)
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 225, in print_label
    self._raw_print_label(lines)
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 234, in _raw_print_label
    status = self._get_status()
             ^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 215, in _get_status
    return self._send_command()
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 133, in _send_command
    responseBin = self._devin.read(8)
                  ^^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/core.py", line 423, in read
    return self.device.read(self, size_or_buffer, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/core.py", line 1029, in read
    ret = fn(
          ^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/backend/libusb1.py", line 846, in bulk_read
    return self.__read(self.lib.libusb_bulk_transfer,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/backend/libusb1.py", line 954, in __read
    _check(retval)
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 75] Overflow

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/gui/gui.py", line 135, in _on_print_label
    self._dymo_labeler.print(self._label_bitmap_to_print)
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 351, in print
    raise DymoLabelerPrintError(str(e)) from e
labelle.lib.devices.dymo_labeler.DymoLabelerPrintError: Print error: [Errno 75] Overflow

It popped up a box showing this:

DymoLabelerPrintError('Print error: [Errno 75] Overflow')

Traceback (most recent call last):
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 345, in print
    self._functions.print_label(label_matrix)
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 225, in print_label
    self._raw_print_label(lines)
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 234, in _raw_print_label
    status = self._get_status()
             ^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 215, in _get_status
    return self._send_command()
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 133, in _send_command
    responseBin = self._devin.read(8)
                  ^^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/core.py", line 423, in read
    return self.device.read(self, size_or_buffer, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/core.py", line 1029, in read
    ret = fn(
          ^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/backend/libusb1.py", line 846, in bulk_read
    return self.__read(self.lib.libusb_bulk_transfer,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/backend/libusb1.py", line 954, in __read
    _check(retval)
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 75] Overflow

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/gui/gui.py", line 135, in _on_print_label
    self._dymo_labeler.print(self._label_bitmap_to_print)
  File "/home/jgoerzen/.local/pipx/venvs/labelle/lib/python3.11/site-packages/labelle/lib/devices/dymo_labeler.py", line 351, in print
    raise DymoLabelerPrintError(str(e)) from e
labelle.lib.devices.dymo_labeler.DymoLabelerPrintError: Print error: [Errno 75] Overflow
jgoerzen commented 3 months ago

Further update: I suspect cups was interfering. Creating an empty /etc/udev/rules.d/70-printers.rules seems to have blocked CUPS from trying to detect USB printers and worked around the issue.

I'm not sure what someone with a USB printer would do, though.

maresb commented 3 months ago

Thanks so much for your efforts on this!

I suspect that the print head on the 280 is only 32 pixels high. Perhaps this would explain the overflow errors? I have never seen those before. See #69.

jgoerzen commented 3 months ago

Actually, I am pretty convinced that it was CUPS. After that workaround to block udev from triggering CUPS, I have had not even one more overflow error.

So I think this issue is just a documentation request: document the issue for others, along with the workaround. Sorry it took me so long to get there, but I think that's all it is!

jgoerzen commented 3 months ago

Well, spoke too soon. After printing a verrrry long tape, I got an overflow at the end -- after it had printed the entire thing correctly. And it didn't prevent it from printing the next label. So I think that may be a different cause than the CUPS interference. If it happens again, I will try to capture a traceback.

maresb commented 3 months ago

Unfortunately I don't have any ideas here about what's wrong or how to fix

jgoerzen commented 3 months ago

I think this is just a documentation issue. I will make a PR for you in the next day or two. Thanks!

maresb commented 1 month ago

Possibly closed by #76