Skip to content

garbage after sending image? #367

@lexelby

Description

@lexelby

Hi folks, thanks for an awesome project!

I'm new to thermal printers and I'm having a little trouble. It seems like, after I print an image, I get a bunch of garbage characters printed out the next time I try to do anything.

With 2.2.0 (from pypi), if I send text('\n') after printing an image, I seem to avoid the issue. In master (3.0a6) that doesn't help.

I get the same problem even if I use a simple program like this, with an ESC/POS data blob captured from an android esc/pos printer app:

from escpos.printer import Usb
import sys

data = sys.stdin.read()
printer = Usb(0x0416, 0x5011, 0, 0x81, 0x01)
printer._raw(data)
printer.close()

The first time it prints fine, but if I run it again, I see a bit of the image shifted to the right, and then the third time, I get part of the image and garbage. The fourth time, the printout works great, and then the pattern repeats. I could swear it seems like the printer is getting confused, as if it's missing the end of a command or something. Maybe I'm not doing it right?

test.escpos.zip

Device info

Printer: POS-5890K (this one)

python-escpos version: 2.2.0, 3.0a6

python version: 2.7.14

operating system: Ubuntu 18.04.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions