A solution to transparent printing using cups in Linux. Problem description: Performing transparent, pass-through printing to a printer hanging off a dumb serial terminal. When a user is logged in or agetty is running, cups sees the serial line as busy and won''t print.

Create a named pipe, which provides a printer "device" to receive the cups print jobs on one side of the pipe while allowing you to successfully cat the output to the serial device, even when the terminal is in use or agetty is running on it.

First, create the named pipe:

# mkfifo /home/fifo-printers/inv

Next, create the printer "inv" specifying /home/fifo-printers/inv as the device. This will queue the print jobs properly to the named pipe.

redhat-printer-config created this entry in /etc/cups/printers.conf:

Info Created by redhat-config-printer 0.6.x Location Invoice Printer DeviceURI file:/home/fifo-printers/inv State Idle Accepting Yes JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0

Changing the Device URI from "file" to "serial" will be required:

DeviceURI serial:/home/fifo-printers/inv

Restart Cups:

# /etc/init.d/cups restart

Finally, catch the output and send it to the port (this is the pass-through printer port device from a Digi Portserver TS4):

# while : ; do cat < /home/fifo-printers/inv >> /dev/prb00; done &

This should be added into a script that runs at boot-up to be sure the named pipe is still there and to start a process running in the background to catch those print jobs and direct them along to the desired serial port.

Your M2M Expert®for Businessfor Developers
Contact Us
Phone
Email
Chat
Feedback
Newsletter SignupYouTubeGoogle+FacebookCopyright © 1996-2014 Digi International Inc. All rights reserved. Legal