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/
Locked
User avatar
willhobbs
 
Posts: 9
Joined: Fri Mar 23, 2018 9:35 pm

Prints from receipt printer are very faint

Post by willhobbs »

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 157 times

User avatar
mikeysklar
 
Posts: 14181
Joined: Mon Aug 01, 2016 8:10 pm

Re: Prints from receipt printer are very faint

Post by mikeysklar »

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

echo -n '\x1b\x37\x07\xff\x02' > /dev/ttyUSB0

Code: Select all

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

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

Re: Prints from receipt printer are very faint

Post by willhobbs »

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

User avatar
mikeysklar
 
Posts: 14181
Joined: Mon Aug 01, 2016 8:10 pm

Re: Prints from receipt printer are very faint

Post by mikeysklar »

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

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?

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

Re: Prints from receipt printer are very faint

Post by willhobbs »

It looks like I have to use `/dev/serial0`. I can get a print without installing anything using:

Code: Select all

stty -F /dev/serial0 9600
echo -e "This is a test.\\n\\n\\n" > /dev/serial0
but nothing happens with:

Code: Select all

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 138 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-th ... spberry-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?

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

Re: Prints from receipt printer are very faint

Post by willhobbs »

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

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

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

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 135 times

User avatar
mikeysklar
 
Posts: 14181
Joined: Mon Aug 01, 2016 8:10 pm

Re: Prints from receipt printer are very faint

Post by mikeysklar »

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?

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

Re: Prints from receipt printer are very faint

Post by willhobbs »

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.

User avatar
mikeysklar
 
Posts: 14181
Joined: Mon Aug 01, 2016 8:10 pm

Re: Prints from receipt printer are very faint

Post by mikeysklar »

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).

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

Re: Prints from receipt printer are very faint

Post by willhobbs »

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

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

Thanks.

User avatar
mikeysklar
 
Posts: 14181
Joined: Mon Aug 01, 2016 8:10 pm

Re: Prints from receipt printer are very faint

Post by mikeysklar »

@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

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

stty -F /dev/ttyUSB1 speed 9600 raw cs8

Locked
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/

Return to “Adafruit Raspberry Pi® accessories”