🇺🇸Adafruit will not be shipping orders on Independence Day Monday 7/4/2022. Please allow extra time for your order to ship and plan accordingly.🇺🇸
0

Mini Thermal Printer Flow Control
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Mini Thermal Printer Flow Control

by Kyle1997 on Wed May 18, 2022 4:55 am

Hi, I'm following this tutorial, https://learn.adafruit.com/networked-thermal-printer-using-cups-and-raspberry-pi/connect-and-configure-printer for my thermal printer. I'm attempting to change the flow control using the gv2_thermal_printer_config.py file but am getting errors returned that I don't fully understand. The default flow control for my printer is HW Flow Ctrl according to the test sheet.

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~/zj-58 $ sudo python gv2_thermal_printer_config.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 398, in _reconfigure_port
    orig_attr = termios.tcgetattr(self.fd)
termios.error: (5, 'Input/output error')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/zj-58/gv2_thermal_printer_config.py", line 12, in <module>
    ser = serial.Serial(PORT, BAUD, timeout=0.5)
  File "/usr/local/lib/python3.9/dist-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 332, in open
    self._reconfigure_port(force_update=True)
  File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 401, in _reconfigure_port
    raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (5, 'Input/output error')

Kyle1997
 
Posts: 6
Joined: Wed May 18, 2022 4:51 am

Re: Mini Thermal Printer Flow Control

by mikeysklar on Wed May 18, 2022 5:59 pm

Can you show a photo of your test page printout?

Have you been able to print the simple command line test to verify the baudrate and serial lines?

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


Once we can rule out wiring, configuration and permissions we can focus on your actual question of changing flow control.

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

Re: Mini Thermal Printer Flow Control

by Kyle1997 on Wed May 25, 2022 1:26 am

I've been able to do some short prints, one line max. Any more than one line and the printer begins to print gibberish. For instance, printing a multi-line text file or an image or even just a string that's too long. When I get home I'll post pictures of the test sheet and the prints I've gotten so far. But as far as wiring, configuration and permissions go I believe that's all functional as my initial single-line prints do work.

Kyle1997
 
Posts: 6
Joined: Wed May 18, 2022 4:51 am

Re: Mini Thermal Printer Flow Control

by mikeysklar on Wed May 25, 2022 7:56 pm

Seeing the test print page photo and an example for a short amount of text fail might help. It does sound like HW flow control is the area to focus on.

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

Re: Mini Thermal Printer Flow Control

by Kyle1997 on Mon May 30, 2022 10:22 pm

Sorry for the delay, something came up.

https://imgur.com/a/FnXzGma

That’s the test sheet and a sheet I printed with basic commands.

Kyle1997
 
Posts: 6
Joined: Wed May 18, 2022 4:51 am

Re: Mini Thermal Printer Flow Control

by mikeysklar on Tue May 31, 2022 8:32 pm

The self test page is really light. I see 8v on the power supply. Do you know how many amps your power supply is rated for?

The following image "mini-project -thermal printer / This is a test." reads much better.

Have you tried using this repo?

https://github.com/adafruit/Python-Thermal-Printer

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

Re: Mini Thermal Printer Flow Control

by Kyle1997 on Tue May 31, 2022 8:38 pm

Yeah, sorry about the test page. The printer won’t print another one so all I have is the one that came in the box with it. The manual says to hold the button in “for some time” but it doesn’t do anything.

The power supply I’m using is the one that was suggested by the retailer, this one https://core-electronics.com.au/5v-dc-2 ... gpack.html. It appears to be 5V

Kyle1997
 
Posts: 6
Joined: Wed May 18, 2022 4:51 am

Re: Mini Thermal Printer Flow Control

by Kyle1997 on Tue May 31, 2022 8:39 pm

Just realized you asked for amps, it looks like it’s rated for 2A

Kyle1997
 
Posts: 6
Joined: Wed May 18, 2022 4:51 am

Re: Mini Thermal Printer Flow Control

by mikeysklar on Wed Jun 01, 2022 5:05 pm

Try this printertest script. It has some configurable settings like warmup time which might help. We do recommend the 5v 2A so your power supply sounds correctly sized.

https://github.com/adafruit/Python-Ther ... tertest.py

; scroll down the github page for instructions.
https://github.com/adafruit/Python-Thermal-Printer

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

Re: Mini Thermal Printer Flow Control

by Kyle1997 on Wed Jun 01, 2022 5:59 pm

Thanks for all of your help but it looks like I was able to fix it. The university I’m studying at has their own version of Raspbian, which I had installed on the Pi due to needing it for other components of my study. After digging through the system files I figured it was worth flashing the latest vanilla version of Raspbian onto the SD card, which evidently fixed the issues I was having with printing (after some tinkering with config files to enable uart).

Kyle1997
 
Posts: 6
Joined: Wed May 18, 2022 4:51 am

Re: Mini Thermal Printer Flow Control

by mikeysklar on Fri Jun 03, 2022 3:56 pm

Great work. I had no idea you were running a custom older release. We probably should have started with that. Good to know the current release seemed to resolve the issue.

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

Please be positive and constructive with your questions and comments.