0

Prints from receipt printer are very faint
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

Prints from receipt printer are very faint

by willhobbs on Wed Jul 21, 2021 10:06 pm

The prints from the thermal printer I received (Tiny Thermal Receipt Printer - TTL Serial / USB) are very faint. I'm printing from a Raspberry Pi over serial using the examples here, https://learn.adafruit.com/networked-th ... re-printer, and a photo of the result is attached. Note that the second print, from the command echo "This is a test." | lp, is barely visible.

I've tried powering from 4x Eneloop batteries and from a benchtop power supply and get the same result, so I don't think it is a power/current issue.

Is it possible that I received a defective printer?

- Will
Attachments
0721211807_sm.jpg
0721211807_sm.jpg (192.13 KiB) Viewed 108 times

willhobbs
 
Posts: 9
Joined: Fri Mar 23, 2018 9:35 pm

Re: Prints from receipt printer are very faint

by mikeysklar on Thu Jul 22, 2021 6:54 pm

When you tried the benchtop power supply what did you set the voltage to? I would expect that the battery pack might drop enough to be a problem.

Is the thermal paper our own or from elsewhere?

Have you tried running the calibrate.py script?

There is a manual override for the heat time you can try sending to the printer:

Code: Select all | TOGGLE FULL SIZE
echo -n '\x1b\x37\x07\xff\x02' > /dev/ttyUSB0


Code: Select all | TOGGLE FULL SIZE
The '\xff' is the heat time, as a hexidecimal value in the range x03 to xff, default value x50. You can try dialing this down until the desired heat time is achieved (use a divide-and-conquer approach...e.g. try x80, then up or down by half the difference (e.g. xC0 or x40) and so forth. Once a good value is found, copy the exact line used into /etc/rc.local so it's issued to the printer on startup.


viewtopic.php?f=19&t=97705

mikeysklar
 
Posts: 5520
Joined: Mon Aug 01, 2016 8:10 pm

Re: Prints from receipt printer are very faint

by willhobbs on Thu Jul 22, 2021 10:06 pm

The benchtop power supply is set to 9V. The thermal paper is the paper from Adafruit, although I tried some other paper and had similar results.

I have not tried running calibrate.py. I see it's here: https://github.com/adafruit/Python-Ther ... librate.py. Is there a blog post that walks through using it? I can figure it out, but thought I'd check.

I'm using the TTL connection, not USB. Does echo -n '\x1b\x37\x07\xff\x02' > /dev/ttyUSB0 need to be modified for a serial connection?

Thanks.

Will

willhobbs
 
Posts: 9
Joined: Fri Mar 23, 2018 9:35 pm

Re: Prints from receipt printer are very faint

by mikeysklar on Fri Jul 23, 2021 12:46 pm

Here is the device name (typically) for the serial connection on a Pi (as opposed to the USB device name I had provided):

Code: Select all | TOGGLE FULL SIZE
echo -n '\x1b\x37\x07\xff\x02' >  /dev/ttyAMA0


Most of the instructions for the Python Thermal Printer github repo are on the main page. Sadly, no specifics for calibrate.py, but it might be getting called as part of the setup if you wish to follow them.

https://github.com/adafruit/Python-Ther ... ter-module

The 9v bench power supply seems like an ideal power source.

Does the self test page also look faint or only when printed from the Pi?

mikeysklar
 
Posts: 5520
Joined: Mon Aug 01, 2016 8:10 pm

Re: Prints from receipt printer are very faint

by willhobbs on Fri Jul 23, 2021 6:10 pm

It looks like I have to use `/dev/serial0`. I can get a print without installing anything using:
Code: Select all | TOGGLE FULL SIZE
stty -F /dev/serial0 9600
echo -e "This is a test.\\n\\n\\n" > /dev/serial0


but nothing happens with:

Code: Select all | TOGGLE FULL SIZE
stty -F /dev/ttyAMA0 9600
echo -e "This is a test.\\n\\n\\n" > /dev/ttyAMA0


See below/attached for self test prints (press and hold the button on the printer before applying power, then applying power). The print on the left is with 4 freshly charged Eneloop batteries, the middle is with the benchtop power supply set at 5 V, and the right is with the power supply set at 8 V. The power supply is clearly better, and 8 V is a little better than 5 V.

0723211644_sm.jpg
0723211644_sm.jpg (286.03 KiB) Viewed 89 times


While doing the self test, I noticed that I can change the USB function from "USB:Printable Port" to "USB:COM". Does this setting matter for printing from either a tty or USB connection?

I also just saw the notice at the top of https://learn.adafruit.com/networked-thermal-printer-using-cups-and-raspberry-pi:
This guide currently does not work with TTL thermal printers with the latest firmware (System:A2 Version: GV2.*) — Python library is the only option there. USB printers, and older TTL printers, still work.

How do I know if that applies to my printer?

willhobbs
 
Posts: 9
Joined: Fri Mar 23, 2018 9:35 pm

Re: Prints from receipt printer are very faint

by willhobbs on Sat Jul 24, 2021 11:25 am

It looks like I can't edit my last post...

As an update, I did the following, all with the printer power by the benchtop power supply set to 8 V:

I ran:
Code: Select all | TOGGLE FULL SIZE
sudo apt-get update
sudo apt-get install libcups2-dev libcupsimage2-dev git build-essential cups system-config-printer
sudo apt-get install cups wiringpi python3-serial python-pil python-unidecode
git clone https://github.com/adafruit/zj-58
cd zj-58
make
sudo ./install
sudo lpadmin -p ZJ-58 -E -v serial:/dev/serial0?baud=9600    -m zjiang/ZJ-58.ppd
sudo lpoptions -d ZJ-58
sudo reboot


then

Code: Select all | TOGGLE FULL SIZE
git clone https://github.com/adafruit/Python-Thermal-Printer/
cd Python-Thermal-Printer


I changed the baud rate from 19200 to 9600 in printertest.py and calibrate.py using nano....

Code: Select all | TOGGLE FULL SIZE
python3 printertest.py
python3 calibrate.py
echo "This is a test." | lp
lp -o fit-to-page /usr/share/raspberrypi-artwork/raspberry-pi-logo.png   


Results are in the photo below (left: printertest.py; middle: calibrate.py; right: the rest):
0724211004_sm.jpg
0724211004_sm.jpg (247.04 KiB) Viewed 86 times

willhobbs
 
Posts: 9
Joined: Fri Mar 23, 2018 9:35 pm

Re: Prints from receipt printer are very faint

by mikeysklar on Mon Jul 26, 2021 2:02 pm

In summary would you say dropping the printer speed from 19,200 --> 9,600 and running the powersupply at 8v were the key changes to get a high quailty print?

mikeysklar
 
Posts: 5520
Joined: Mon Aug 01, 2016 8:10 pm

Re: Prints from receipt printer are very faint

by willhobbs on Wed Jul 28, 2021 12:06 am

The power supply certainly helps, but it seems like something still isn't working correctly. The results from calibrate.py almost don't show up at all.

And I'm not sure if this is normal, but the top and bottom of the raspberry pi logo aren't the same darkness as the rest of the print.

willhobbs
 
Posts: 9
Joined: Fri Mar 23, 2018 9:35 pm

Re: Prints from receipt printer are very faint

by mikeysklar on Wed Jul 28, 2021 5:30 pm

The manual print test label looks pretty good. Do we agree on that?

The calibrate.py script is pretty unusable, but is old enough to be irrelevant.

The Pi printing at various levels of darkness seems like a settings issue we can explore on the linux side (disable dithering, max out darkness settings).

mikeysklar
 
Posts: 5520
Joined: Mon Aug 01, 2016 8:10 pm

Re: Prints from receipt printer are very faint

by willhobbs on Thu Jul 29, 2021 10:47 am

I agree, the self test prints look good (with adequate power).

Do you have guidance on those next steps on the linux side?

Thanks.

willhobbs
 
Posts: 9
Joined: Fri Mar 23, 2018 9:35 pm

Re: Prints from receipt printer are very faint

by mikeysklar on Thu Jul 29, 2021 4:23 pm

@willhobbs,

I was not able to find any settings in Linux / CUPS to adjust settings.

It looks like it will all need to be done via control codes.

http://scruss.com/blog/2014/08/02/notes ... and-linux/

The above link is older, but has some examples of sending codes.

Code: Select all | TOGGLE FULL SIZE
stty -F /dev/ttyUSB1 0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0


Code: Select all | TOGGLE FULL SIZE
stty -F /dev/ttyUSB1 speed 9600 raw cs8

mikeysklar
 
Posts: 5520
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.