thermalprinter icon indicating copy to clipboard operation
thermalprinter copied to clipboard

Letter 'P' being printed every time before anything else

Open pawelmalak opened this issue 5 years ago • 5 comments

As in the title, every time I'm trying to print something, a new line with the letter 'P' is added.

I tried the sample code from README > Usage and got this as a result:

IMG_2207

And later I tried to print only new lines with this code...

from PIL import Image
from thermalprinter import *

with ThermalPrinter(port='/dev/serial0',baudrate=9600) as printer:
    printer.feed(5)

... with this as a result:

IMG_2206

Any idea what might be causing it?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

pawelmalak avatar Sep 05 '20 09:09 pawelmalak

I have same issue, did you resolve that?

zbyrek avatar Mar 09 '21 16:03 zbyrek

Unfortunately, I did not. I tried different configurations and sample codes but I couldn't get around it and since it only was my side project I just gave up on it. Are you using it with Raspberry Pi by any chance?

pawelmalak avatar Mar 09 '21 16:03 pawelmalak

All right, the issue is in init code, here's the fix in file thermalprinter.py:

-        # Printer settings
-        self.send_command(Command.ESC, 55, self.most_heated_point,
-                          self.heat_time, self.heat_interval)

It seems that printer which you (and I) have don't support these commands.

zbyrek avatar Mar 09 '21 16:03 zbyrek

@pawelmalak, and @zbyrek, what is your printer model?

BoboTiG avatar Jan 12 '23 15:01 BoboTiG

Dear @BoboTiG , I experience that same problem with QR701 priter bought on AliExpress The fix from @zbyrek works fine, no other side effects observed, although no characters other than ASCII are used.

archfurry avatar Mar 27 '24 21:03 archfurry