About Zebra | Investors  | Partner Site | Contact Us | How To Buy  | Home
   
 
 
Zebra. Connect with it. Count on it. TM
     

Printing to Zebra Printers via Unix

 

Because of the many different flavors of Unix, it is impossible to write one document to cover all of the different platforms, and impractical to write a document for each specific platform. In development of this Document, Linux was used as the testing platform. Due to this fact all of the information here only refers to Linux systems using LPR printing, although the instructions should be similar for other platforms.

Throughout this document, you will be able to use Linux and Unix interchangeably.

Printing Parallel via Unix

The Unix device names for the parallel ports are /dev/lp0, /dev/lp1, and /dev/lp2. The following chart will show you which device names in Unix match up to which IO addresses for your various parallel ports.

Base Address

IRQ

Unix Device

Possible LPT Assignments

0x3bc

7

/dev/lp0

LPT1

0x378

7

/dev/lp1

LPT1 or LPT2

0x278

5

/dev/lp2

LPT1, LPT2, or LPT3

There is not a consistent match of DOS based LPT ports to /dev/lp? devices. This is because of the way the BIOS assigns the LPT entries for the parallel ports. It will scan all of the above base addresses in order, the first port it finds, becomes LPT1. So, depending upon your configuration, any of the above port addresses could map to LPT1, but the port at address 0x3bc could never be LPT3, since it is scanned first, and if it is determined to be a valid parallel port, would be assigned to LPT1.

Unix does not accept the BIOS’s representation of the parallel ports. The mapping for the /dev/lp? devices is constant. Before knowing which device file to use for printing, you’ll need to find out the base addresses of all your parallel ports. For the rest of this document I’ll assume your parallel port is /dev/lp1, which is how most computers configured with a single parallel port are setup.

At bootup time the Linux kernel will tell you what /dev/lp devices it finds. After the machines you can run "dmesg | less" to view the bootup messages. Look for a line similar to this:

lp1 at 0x0378, (polling)

For additional information on configuring Linux for printing (non-zebra specific) see the Printing-HOWTO at http://sunsite.unc.edu/pub/Linux/docs/HOWTO/Printing-HOWTO.

The simplest way to setup your printer is to enable passthrough printing for zpl/epl/CPCL text files. This configuration will require that the data that you are sending to your printer is already formatted in the appropriate language for the printer to print. To enable pass through printing, add the following entry to your /etc/printcap file:

### Zebra Passthrough printer entry for the parallel port

zebra:\
lp=/dev/lp1:\
sd=/var/spool/zebra:\
sh

Printing Remotely with Unix via LPR

Zebra has a TCP/IP micro print server called ZebraNet which allows you to attach your Zebra printer directly to an Ethernet segment. The ZebraNet device then acts as a print server for LPR printing. What follows is a sample /etc/printcap entry for printing to a ZebraNet device:

### Remote ZebraNet Printer

znet:\
lp=:\
rm=10.27.70.10:\
rp=ZNET_PCL:\
sd=/var/spool/znet:\
sh

This will setup a print queue called ‘znet" that will print via the microprint server at IP address 10.27.70.10, using the service name ZNET_PCL. To print you would then execute the command "lpr –Pznet <FILENAME>" at the command prompt. Here is a brief description of what each line means in the printcap entry:

znet = print queue name

lp = Having the entry blank specifies that the printer is NOT a local printer.

rm = Used to specify the IP address or host name for the remote print server

rp = specifies the remote printer to print to on the remote machine. If you were printing to another Unix machine, you would be able to specify any of the print queues which they have setup in their /etc/printcap file.

On the ZebraNet device, you can do a "show services" to list the printer service names that are valid for this entry.

Serial Printing via Unix

In order to print to your Zebra Printer via the serial port of your Unix box you will need to make sure you are using a Null Modem cable. A standard RS232 serial cable will not work. You will also need to print out a printer configuration label from your printer to get the printers serial port configuration settings.

The default port setting for Linux is 9600, No parity, 8 data bits, 1 stop bit, XON-XOFF flow control. Following is a mapping of COM ports to Linux device file names. Your particular platform may differ.

COM Port

Base Address

IRQ

Unix Device

COM1

0x3f8

4

/dev/ttyS0

COM2

0x2f8

3

/dev/ttyS1

COM3

0x3e8

4

/dev/ttyS2

COM4

0x2e8

3

/dev/ttyS3

 

At bootup time the Linux kernel will tell you what /dev/tty devices it finds. After the machines you can run "dmesg | less" to view the bootup messages. Look for a line similar to this:

tty00 at 0x03f8 (irq = 4) is a 16550A

Although the bootup screens will tell you the port is /dev/tty00, it will actually be mapped to /dev/ttyS0. The device file /dev/tty01 will be mapped to /dev/ttyS1, and so on.

The configuration for LPR to support serial printing is almost identical to the configuration for supporting Parallel printers. To enable printing through the serial port you would add the following entry to your /etc/printcap file:

### Zebra Passthrough printer entry for the serial port

zebra:\
lp=/dev/ttyS0:\
br#9600:\
sd=/var/spool/zebra:\
sh

The only added entry that is added from the parallel port configuration is the "br#" line, which specifies the baud rate which the printer is operating at. It has to match what is on the printer configuration label for Baud . All of the other settings for the printer should be Parity=None, Data bits= 1, Stopbits=1, flow control = XON. See your printer manual for information on how to configure your printers serial port properly.

Additional References:

Parallel Port FAQ:
http://home.rmi.net/~hisys/parport.html

Linux Serial HOWTO
http://sunsite.unc.edu/pub/Linux/docs/HOWTO/Serial-HOWTO

Linux Printing Usage HOWTO
http://sunsite.unc.edu/pub/Linux/docs/HOWTO/Printing-Usage-HOWTO

Linux Printing HOWTO
http://sunsite.unc.edu/pub/Linux/docs/HOWTO/Printing-HOWTO

 

 

 


Copyright  |  Privacy Statement  |  Site Map