Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Mini Thermal Printer Doesn't Connect Over Serial
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Mini Thermal Printer Doesn't Connect Over Serial

by bellab on Mon Aug 03, 2020 7:29 pm

Hello,

I purchased a Mini Thermal receipt Printer Starter Pack on July 12th (order number 2322606), and I haven't been able to get it to print over serial. The test print page works, but nothing else.

I have followed this tutorial: https://learn.adafruit.com/networked-th ... re-printer

When I run this code on my Raspberry Pi 3 or my Raspberry Pi Zero, the terminal hangs and nothing prints.
Code: Select all | TOGGLE FULL SIZE
stty -F /dev/ttyAMA0 19200
echo -e "This is a test.\\n\\n\\n" > /dev/ttyAMA0


I have used two separate Raspberry Pis, tried booting different OS's, and have double checked the wiring (which I've included a picture of). I've disabled the serial console and enabled serial hardware on my pi like the tutorial I linked told me to do, the printer is on, and I'm using the baud rate listed on the test page.

I'm stumped on what to do next, and I hope I don't have a faulty printer. Any help would be appreciated. Thank you!
Attachments
Printer_Wiring.JPG
Printer_Wiring.JPG (677.8 KiB) Viewed 67 times

bellab
 
Posts: 6
Joined: Mon Aug 03, 2020 7:07 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by adafruit_support_carter on Fri Aug 07, 2020 11:34 am

Please post a photo of the self test printout. It has some info on it that might help.

adafruit_support_carter
 
Posts: 16944
Joined: Tue Nov 29, 2016 2:45 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by bellab on Fri Aug 07, 2020 2:19 pm

Attached is the self test. Apologies for not thinking to include it before!
Attachments
SelfTest.JPG
SelfTest.JPG (846.42 KiB) Viewed 52 times

bellab
 
Posts: 6
Joined: Mon Aug 03, 2020 7:07 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by adafruit_support_carter on Fri Aug 07, 2020 2:57 pm

Thanks. That looks like the printer is configured correctly.

Did you disable the serial console in raspi-config?

Also, you probably want to use serial0 instead of ttyAMA0

adafruit_support_carter
 
Posts: 16944
Joined: Tue Nov 29, 2016 2:45 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by bellab on Fri Aug 07, 2020 6:05 pm

I disabled the serial console and enabled serial hardware. The tutorial I linked in my original post said that if using serial0 didn't work, some models of pi use ttyAMA0. Neither work for me when trying to print.

bellab
 
Posts: 6
Joined: Mon Aug 03, 2020 7:07 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by adafruit_support_carter on Fri Aug 07, 2020 7:01 pm

Sorry, I see you mentioned that in your first post also.

Let's verify those settings. Can you attach your /boot/config.txt and /boot/cmdline.txt files here.

adafruit_support_carter
 
Posts: 16944
Joined: Tue Nov 29, 2016 2:45 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by bellab on Fri Aug 07, 2020 9:07 pm

Here are the requested files
Attachments
cmdline.txt
(98 Bytes) Downloaded 1 time
config.txt
(1.76 KiB) Downloaded 1 time

bellab
 
Posts: 6
Joined: Mon Aug 03, 2020 7:07 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by adafruit_support_carter on Mon Aug 10, 2020 10:47 am

Thanks. That looks as expected.

Are the headers on the Pi Zero soldered on?

And just to be sure - you got the same behavior on both a Pi 3 and the Pi Zero shown? And also same behavior if you use serial0?

adafruit_support_carter
 
Posts: 16944
Joined: Tue Nov 29, 2016 2:45 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by bellab on Mon Aug 10, 2020 3:37 pm

Yes, the headers on the Pi Zero are soldered on, and I've experienced the same behavior from both Pis and with both serial0 and ttyAMA0.

bellab
 
Posts: 6
Joined: Mon Aug 03, 2020 7:07 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by adafruit_support_carter on Mon Aug 10, 2020 5:39 pm

I just tested the behavior here. Even if I completely disconnect the printer, I don't get the Pi to hang when sending out the print command with:
Code: Select all | TOGGLE FULL SIZE
echo -e "This is a test.\\n\\n\\n" > /dev/serial0

The command runs and immediately returns to the command prompt.

If I send to an unconfigured port, like ttyAMA0:
Code: Select all | TOGGLE FULL SIZE
echo -e "This is a test.\\n\\n\\n" > /dev/ttyAMA0

the command does not return. The Pi is not frozen though. I can abort the command with <CTRL><C> and get back to the command prompt. Are you able to do that?

adafruit_support_carter
 
Posts: 16944
Joined: Tue Nov 29, 2016 2:45 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by bellab on Mon Aug 10, 2020 11:10 pm

I am not able to do that.

bellab
 
Posts: 6
Joined: Mon Aug 03, 2020 7:07 pm

Re: Mini Thermal Printer Doesn't Connect Over Serial

by adafruit_support_carter on Tue Aug 11, 2020 10:22 am

And you get that same behavior on both the Pi 3 and the Zero? If so, there's something else going on unrelated to the printer.

adafruit_support_carter
 
Posts: 16944
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.