Struggling to get tiny thermal receipt printer to work

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
TomAndThat
 
Posts: 4
Joined: Sat Mar 18, 2023 4:32 pm

Struggling to get tiny thermal receipt printer to work

Post by TomAndThat »

Hey folks!

I was just wondering whether anyone might be able to help me with a bit of troubleshooting? I've just very excitedly unboxed my new tiny thermal receipt printer, and connected it up to my raspberry pi zero via USB, but for whatever reason it doesn't seem to be working.

Image

I have successfully been able to print the test page, so the printer is working. I have noticed that the light on the printer is emitting a consistent red flash, but I'm not sure what the significance of that is.

For reference, in case it's a power issue, I'm running the system off a 9v 5a DC brick into a splitter - with a step-down converter to go into the pi of course.

I've been following the instructions at https://learn.adafruit.com/networked-th ... re-printer and got as far as running the test print on the USB printer, and that's where I got stuck.

I ran

Code: Select all

ls -l /dev/usb/lp0
and got the "crwxrwxr-x 1 root lp (etc etc)" response, but then when I tried to print out the test line, my terminal returned the below error:

Code: Select all

bash: echo: write error: Input/output error
Does anyone know what I'm doing wrong here? Many thanks in advance for your help!

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

Re: Struggling to get tiny thermal receipt printer to work

Post by mikeysklar »

What release and type of Pi OS are you running is 32/64/lite/desktop?

Can you paste in what you observe from running these two commands?

Code: Select all

 chmod 777 /dev/usb/lp0
echo -e "This is a test.\\n\\n\\n" > /dev/usb/lp0

Code: Select all

 echo -e "This is a test.\\n\\n\\n" > /dev/ttyUSB0

User avatar
TomAndThat
 
Posts: 4
Joined: Sat Mar 18, 2023 4:32 pm

Re: Struggling to get tiny thermal receipt printer to work

Post by TomAndThat »

I'm running Raspbian GNU/Linux 11 (bullseye) 32bit desktop

When I ran "chmod 777 /dev/usb/lp0" initially I got permission denied, so I ran it again with sudo, which didn't return any error messages. I then ran "echo -e "This is a test.\\n\\n\\n" > /dev/usb/lp0" and got this:

-bash: /dev/usb/lp0: Permission denied

And got the same result for "echo -e "This is a test.\\n\\n\\n" > /dev/ttyUSB0"

Thanks very much for this!

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

Re: Struggling to get tiny thermal receipt printer to work

Post by mikeysklar »

try putting a sudo in front of the echo commands since you are seeing a permission denied. Do either of them work?

Code: Select all

sudo echo -e "This is a test.\\n\\n\\n" > /dev/usb/lp0

Code: Select all

sudo echo -e "This is a test.\\n\\n\\n" > /dev/ttyUSB0

User avatar
TomAndThat
 
Posts: 4
Joined: Sat Mar 18, 2023 4:32 pm

Re: Struggling to get tiny thermal receipt printer to work

Post by TomAndThat »

Hello! I finally got this to work. I did two things:

1. A clean install of the OS. As it was a fresh install, and this only took 2 minutes, it didn't seem like any harm could be done.

2. I bought a micro usb to mini usb cable, so I could connect the printer directly to the pi without using a hub/adapter, and that seemed to do the trick

Thanks so much for your time!

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

Re: Struggling to get tiny thermal receipt printer to work

Post by mikeysklar »

Congrats. Thank you for the followup.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”