Zebra printer not working with CUPS

I'm running into an issue with a Zebra printer model ZT410-203dpi ZPL on SUSE Linux v15SP1 configured with CUPS. The printer has been configured but it can't seem to print for some reason. I used the zebra.ppd driver from GitHub as Zebra doesn't provide their own drivers, which are supposed to work with CUPS. With zebra.ppd at least it says 'Rendering completed' whereas with Generic driver it would just say Printing. I tried various drivers listed below, but it doesn't work either.
Any thoughts?

# rpm -qa |grep cups
libcupscgi1-2.2.7-3.17.1.x86_64
cups-config-2.2.7-3.17.1.x86_64
libcupsmime1-2.2.7-3.17.1.x86_64
cups-2.2.7-3.17.1.x86_64
libcupsppdc1-2.2.7-3.17.1.x86_64
cups-client-2.2.7-3.17.1.x86_64
libcups2-2.2.7-3.17.1.x86_64
cups-filters-1.20.3-3.6.4.x86_64
libcupsimage2-2.2.7-3.17.1.x86_64
 
# ls /usr/share/cups/model/
Postscript-level1.ppd.gz  Postscript-level2.ppd.gz  Postscript.ppd.gz  zebra.ppd  zebra_zpl_II.ppd

# lpinfo -m
lsb/usr/cupsfilters/Fuji_Xerox-DocuPrint_CM305_df-PDF.ppd Fuji Xerox
lsb/usr/cupsfilters/Generic-PDF_Printer-PDF.ppd Generic PDF Printer
Postscript-level1.ppd.gz Generic PostScript level 1 Printer Foomatic/Postscript (recommended)
Postscript-level2.ppd.gz Generic PostScript level 2 Printer Foomatic/Postscript (recommended)
lsb/usr/cupsfilters/HP-Color_LaserJet_CM3530_MFP-PDF.ppd HP Color LaserJet CM3530 MFP PDF
lsb/usr/cupsfilters/pxlcolor.ppd HP Color LaserJet Series PCL 6 CUPS
lsb/usr/cupsfilters/pxlmono.ppd HP LaserJet Series PCL 6 CUPS
lsb/usr/cupsfilters/HP-PhotoSmart_Pro_B8300-hpijs-pdftoijs.ppd HP PhotoSmart Pro B8300 CUPS/pdftoijs/hpijs
Postscript.ppd.gz Postscript Generic postscript printer
raw Raw Queue
lsb/usr/cupsfilters/Ricoh-PDF_Printer-PDF.ppd Ricoh PDF Printer
lsb/usr/cupsfilters/zebra_zpl_II.ppd Zebra ZPL II Label Printer
zebra_zpl_II.ppd Zebra ZPL II Label Printer
zebra.ppd Zebra ZPL Label Printer
everywhere IPP Everywhere
 
# lpstat -t
scheduler is running
no system default destination
PRNQZ003 accepting requests since Fri 21 Oct 2022 01:23:47 PM CST
printer PRNQZ003 is idle.  enabled since Fri 21 Oct 2022 01:23:47 PM CST

# lp -d PRNQZ003 print_page; sleep 1; lpstat -a -p PRNQZ003
request id is PRNQZ003-60 (1 file(s))
PRNQ001 accepting requests since Fri 07 Oct 2022 10:33:31 AM CST
PRNQ002 accepting requests since Fri 07 Oct 2022 10:31:42 AM CST
PRNQZ003 accepting requests since Fri 21 Oct 2022 02:54:27 PM CST
printer PRNQZ003 now printing PRNQZ003-60.  enabled since Fri 21 Oct 2022 02:54:27 PM CST
        Rendering completed

Hello,

We have in the past had some questions come up about Zebra printers and Linux, the most recent of which can be found here. It may be worth taking a look and seeing if anything on that topic is helpful. If not, then by all means come back to us and we can take things from there.

The link provided me further information about ZPL printing. However, I'm trying to setup CUPS for remote printing over the network. The way this is setup is, the SAP application which creates and sends a printing label to SUSE Linux host configured with CUPS which processes the job and forwards it to a configured Zebra printer over the network. The printer is expected to print but it is not. Moreover, there are no errors in /var/log/cups/error_log even with debug mode.

I configured the printer using lpd, ipp and socket device options but none of the works.
Eg..

# lpadmin -p PRNQZ003 -v socket://10.10.2.21/ -P /usr/share/cups/model/zebra.ppd -E

# lpinfo -v
network lpd
file cups-brf:/
network beh
serial serial:/dev/ttyS0?baud=115200
serial serial:/dev/ttyS1?baud=115200
network ipps
network http
network ipp
network socket
network https

Does the port number match?

(Zebra Customer Community)

Maybe you must configure the Cups queue to port 6101?
Make a connection test:

telnet 10.10.2.21 6101

These printers are setup to use 9100 which is a default port for socket type of connection. I also tried using 6101 and it doesn't work. As can be noticed there is communication if using port 6101. I might have to check locally on the printer to see if there is an option to update the port to 6101 or the network team to see if anything needs to be opened up for 6101. Either way I think I should still be able to use socket type of configuration using its default port of 9100.

# lpstat -v
device for PRNQ001: socket://10.20.2.11/
device for PRNQ002: socket://10.20.2.12/
device for PRNQZ003: ipp://10.10.2.21/:6101

# echo 'Test' |telnet  10.10.2.21 6101
Trying 10.10.2.21...


# echo 'Test' |telnet  10.10.2.21 9100
Trying 10.10.2.21...
Connected to 10.10.2.21.
Escape character is '^]'.
Connection closed by foreign host.

# /usr/lib/YaST2/bin/test_remote_socket 10.10.2.21 9100
Port '9100' on host '10.10.2.21' accepts data

# /usr/lib/YaST2/bin/test_remote_socket 10.10.2.21 6101
/usr/lib/YaST2/bin/test_remote_socket: line 39: 30407 Terminated ( echo -n '' > /dev/tcp/$HOST/$PORT )
No connection possible to port '6101' on host '10.10.2.21'.

Okay, your printer uses port 9100.
Should give you less problems.
Do you see a communication with
tcpdump port 9100
?

# tcpdump -w captured_packets.pcap -nnSX port 9100

# tcpdump -r captured_packets.pcap
reading from file captured_packets.pcap, link-type EN10MB (Ethernet)
16:25:35.381321 IP <cupserver>.com.51512 > 10.10.2.21.net.hp-pdl-datastr: Flags [S], seq 2979585976, win 29200, options [mss 1460,sackOK,TS val 2968345800 ecr 0,nop,wscale 7], length 0
16:25:35.445656 IP 10.10.2.21.net.hp-pdl-datastr > <cupserver>.com.51512: Flags [S.], seq 2134786412, ack 2979585977, win 8192, options [mss 1330,nop,wscale 0,nop,nop,TS val 1 ecr 2968345800,sackOK,nop,nop], length 0
16:25:35.445704 IP <cupserver>.com.51512 > 10.10.2.21.net.hp-pdl-datastr: Flags [.], ack 1, win 229, options [nop,nop,TS val 2968345865 ecr 1], length 0
16:25:35.445801 IP <cupserver>.com.51512 > 10.10.2.21.net.hp-pdl-datastr: Flags [P.], seq 1:1025, ack 1, win 229, options [nop,nop,TS val 2968345865 ecr 1], length 1024
16:25:35.445928 IP <cupserver>.com.51512 > 10.10.2.21.net.hp-pdl-datastr: Flags [.], seq 1025:3661, ack 1, win 229, options [nop,nop,TS val 2968345865 ecr 1], length 2636
16:25:35.445936 IP <cupserver>.com.51512 > 10.10.2.21.net.hp-pdl-datastr: Flags [.], seq 3661:6297, ack 1, win 229, options [nop,nop,TS val 2968345865 ecr 1], length 2636
16:25:35.445938 IP <cupserver>.com.51512 > 10.10.2.21.net.hp-pdl-datastr: Flags [P.], seq 6297:7505, ack 1, win 229, options [nop,nop,TS val 2968345865 ecr 1], length 1208
16:25:35.446017 IP <cupserver>.com.51512 > 10.10.2.21.net.hp-pdl-datastr: Flags [F.], seq 7505, ack 1, win 229, options [nop,nop,TS val 2968345865 ecr 1], length 0
16:25:35.511658 IP 10.10.2.21.net.hp-pdl-datastr > <cupserver>.com.51512: Flags [.], ack 2343, win 63194, options [nop,nop,TS val 1 ecr 2968345865], length 0
16:25:35.513227 IP 10.10.2.21.net.hp-pdl-datastr > <cupserver>.com.51512: Flags [.], ack 4979, win 60558, options [nop,nop,TS val 1 ecr 2968345865], length 0
16:25:35.514475 IP 10.10.2.21.net.hp-pdl-datastr > <cupserver>.com.51512: Flags [.], ack 7505, win 58032, options [nop,nop,TS val 1 ecr 2968345865], length 0
16:25:35.514484 IP 10.10.2.21.net.hp-pdl-datastr > <cupserver>.com.51512: Flags [.], ack 7506, win 58032, options [nop,nop,TS val 1 ecr 2968345865], length 0
16:25:35.519851 IP 10.10.2.21.net.hp-pdl-datastr > <cupserver>.com.51512: Flags [.], ack 7506, win 65535, options [nop,nop,TS val 1 ecr 2968345865], length 0
16:25:35.640648 IP 10.10.2.21.net.hp-pdl-datastr > <cupserver>.com.51512: Flags [F.], seq 1, ack 7506, win 65535, options [nop,nop,TS val 1 ecr 2968345865], length 0
16:25:35.640666 IP <cupserver>.com.51512 > 10.10.2.21.net.hp-pdl-datastr: Flags [.], ack 2, win 229, options [nop,nop,TS val 2968346060 ecr 1], length 0

Hello,
from ZEBRA
ZSN108111-v4_CUPS_Installation.pdf (477.0 KB)

zpl -> https://www.zebra.com/content/dam/zebra_new_ia/en-us/manuals/printers/common/programming/zpl-zbi2-pm-en.pdf

Embed the ZPL-Commands in your SAP Report and send it to the printer.
For example and testing:

File : zebratest
Labeldimensions = 68x35 mm

Block Code

^XA
^MD15
^LH0,0
^FO20,20,0
^FDTEST ON ZEBRA^FS
^FO30,100,0
^BQThis is QR Code^FS
^FO30,200,0
^AT^FDDifferent Font^FS

^XZ


Printout :
lp -d Zebra_Technologies_ZTC_ZT230-300dpi_ZPL -oRAW zebratest

For result see attachment !

![image|690x360](upload://13qXj2vJ7Ki6E0EtAaXuqOxd5gD.jpeg)





Regards
2 Likes

I tried printing using different ZPL commands earlier. I gave your suggestion a try along with printing a PDF page and I'm waiting on someone to validate the print as the printer is at a remote location.

In the meantime, based on the logs, the CUPS server is sending the printable data to the printer and completing its job i.e., it says Rendering Completed.

Here is the log from /var/log/cups/error_log, not in it's entirety though.

D [24/Oct/2022:14:45:13 -0700] [Job 84] Start rendering...
D [24/Oct/2022:14:45:13 -0700] cupsdMarkDirty(---J-)
D [24/Oct/2022:14:45:13 -0700] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [24/Oct/2022:14:45:13 -0700] [Job 84] Set job-printer-state-message to "Start rendering...", current level=INFO
D [24/Oct/2022:14:45:13 -0700] [Job 84] Processing page 1...
D [24/Oct/2022:14:45:13 -0700] cupsdMarkDirty(---J-)
D [24/Oct/2022:14:45:13 -0700] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [24/Oct/2022:14:45:13 -0700] [Job 84] Set job-printer-state-message to "Processing page 1...", current level=INFO
d [24/Oct/2022:14:45:13 -0700] cupsdAddEvent(event=job-progress, dest=0x55b56a731220(PRNQZ003), job=0x55b56a784cc0(84), text="%s", ...)
D [24/Oct/2022:14:45:13 -0700] Discarding unused job-progress event...
d [24/Oct/2022:14:45:13 -0700] cupsdAddEvent(event=printer-state-changed, dest=0x55b56a731220(PRNQZ003), job=(nil)(0), text="Printer \"%s\" state changed.", ...)
D [24/Oct/2022:14:45:13 -0700] Discarding unused printer-state-changed event...
d [24/Oct/2022:14:45:13 -0700] select_timeout: JobHistoryUpdate=1666718848
D [24/Oct/2022:14:45:13 -0700] [Job 84] PAGE: 1 1
D [24/Oct/2022:14:45:13 -0700] cupsdMarkDirty(---J-)
D [24/Oct/2022:14:45:13 -0700] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [24/Oct/2022:14:45:13 -0700] cupsdMarkDirty(---J-)
D [24/Oct/2022:14:45:13 -0700] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
d [24/Oct/2022:14:45:13 -0700] cupsdAddEvent(event=job-progress, dest=0x55b56a731220(PRNQZ003), job=0x55b56a784cc0(84), text="Printed %d page(s).", ...)
D [24/Oct/2022:14:45:13 -0700] Discarding unused job-progress event...
d [24/Oct/2022:14:45:13 -0700] select_timeout: JobHistoryUpdate=1666718848
D [24/Oct/2022:14:45:13 -0700] [Job 84] Starting page 1.



D [24/Oct/2022:14:45:13 -0700] cupsdMarkDirty(---J-)
D [24/Oct/2022:14:45:13 -0700] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [24/Oct/2022:14:45:13 -0700] [Job 84] Set job-printer-state-message to "Printing page 1, 98% complete.", current level=INFO
D [24/Oct/2022:14:45:13 -0700] [Job 84] ATTR: job-media-progress=98
d [24/Oct/2022:14:45:13 -0700] cupsdAddEvent(event=job-progress, dest=0x55b56a731220(PRNQZ003), job=0x55b56a784cc0(84), text="Print
ing page %d, %d%%", ...)
D [24/Oct/2022:14:45:13 -0700] Discarding unused job-progress event...
D [24/Oct/2022:14:45:13 -0700] [Job 84] Finished page 1.
D [24/Oct/2022:14:45:13 -0700] cupsdMarkDirty(---J-)
D [24/Oct/2022:14:45:13 -0700] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [24/Oct/2022:14:45:13 -0700] [Job 84] Set job-printer-state-message to "Finished page 1.", current level=INFO
d [24/Oct/2022:14:45:13 -0700] cupsdAddEvent(event=job-progress, dest=0x55b56a731220(PRNQZ003), job=0x55b56a784cc0(84), text="%s",
...)
D [24/Oct/2022:14:45:13 -0700] Discarding unused job-progress event...
d [24/Oct/2022:14:45:13 -0700] cupsdAddEvent(event=printer-state-changed, dest=0x55b56a731220(PRNQZ003), job=(nil)(0), text="Printe
r \"%s\" state changed.", ...)
D [24/Oct/2022:14:45:13 -0700] Discarding unused printer-state-changed event...
d [24/Oct/2022:14:45:13 -0700] select_timeout: JobHistoryUpdate=1666718848
D [24/Oct/2022:14:45:13 -0700] [Job 84] Rendering completed
D [24/Oct/2022:14:45:13 -0700] cupsdMarkDirty(---J-)
D [24/Oct/2022:14:45:13 -0700] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [24/Oct/2022:14:45:13 -0700] [Job 84] Set job-printer-state-message to "Rendering completed", current level=INFO
d [24/Oct/2022:14:45:13 -0700] cupsdAddEvent(event=job-progress, dest=0x55b56a731220(PRNQZ003), job=0x55b56a784cc0(84), text="%s", ...)
D [24/Oct/2022:14:45:13 -0700] Discarding unused job-progress event...
D [24/Oct/2022:14:45:13 -0700] Discarding unused job-progress event...
d [24/Oct/2022:14:45:13 -0700] cupsdAddEvent(event=printer-state-changed, dest=0x55b56a731220(PRNQZ003), job=(nil)(0), text="Printer \"%s\" state changed.", ...)
D [24/Oct/2022:14:45:13 -0700] Discarding unused printer-state-changed event...
d [24/Oct/2022:14:45:13 -0700] select_timeout: JobHistoryUpdate=1666718848
d [24/Oct/2022:14:45:13 -0700] process_children()
d [24/Oct/2022:14:45:13 -0700] cupsdFinishProcess(pid=13432, name=0x7ffe988dcb90, namelen=1024, job_id=0x7ffe988dcad8(84)) = "/usr/lib/cups/filter/gstoraster"
D [24/Oct/2022:14:45:13 -0700] [Job 84] PID 13432 (/usr/lib/cups/filter/gstoraster) exited with no errors.
d [24/Oct/2022:14:45:13 -0700] select_timeout: JobHistoryUpdate=1666718848
d [24/Oct/2022:14:45:13 -0700] select_timeout(-1): 31 seconds to write dirty config/state files
d [24/Oct/2022:14:45:13 -0700] process_children()
d [24/Oct/2022:14:45:13 -0700] cupsdFinishProcess(pid=13433, name=0x7ffe988dcb90, namelen=1024, job_id=0x7ffe988dcad8(84)) = "/usr/lib/cups/filter/rastertolabel"
D [24/Oct/2022:14:45:13 -0700] [Job 84] PID 13433 (/usr/lib/cups/filter/rastertolabel) exited with no errors.

Hello,
do you have installed the emulator for PDF ?
https://supportcommunity.zebra.com/s/article/Printing-PDF-files-using-the-PDF-direct-virtual-device?language=en_US

Thank you @bdittmar and everyone for their response. I'm able to print the label directly from SUSE Linux server running CUPS.
Thanks once again @bdittmar for pointing me in the right direction. The issue for direct print from the server had to do with the way the Zebra printers receives the print job. Since this Zebra printer is used to print labels, it needs to have an embedded ZPL (Zebra Printing Language) format in the file to create images that can be printed on the labels.

This is the Online ZPL code reviewer that can come in handy.

As for printing from the SAP application, it also needs to have certain device types installed and below are some of the links I'm sharing as it could be of help to someone.

Knowledge articles in detail about printing to SAP from Zebra printer:
https://www.zebra.com/us/en/support-downloads/knowledge-articles/device-type-used-to-print-to-a-zebra-printer-from-sap-smart-forms.html

4 Likes