john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Linux printer cupsd example serial port printer

Usually the fastest "modern" route is to have a relatively new kernel 2.4 or greater and install CUPS http://www.cups.org/doc-1.1/sam.html

Then use the web interface

apt-get install cups OR yum install cups

SAMBA is important as well (for printer sharing across OS Platforms) apt-get install samba

lpinfo -v

modify smb.conf to include

printing = cups printcap = cups

http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html


http://www.cups.org/documentation.php/ref-cupsd-conf.html

nano /etc/cups/cupsd.conf

Change "Listen localhost:631" to one or more of the following...

Listen 127.0.0.1:631 Listen 192.0.2.1:631 Listen [::1]:631 Listen *:631

BrowseAllow from all BrowseAllow from none BrowseAllow from 192.0.2 BrowseAllow from 192.0.2.0/24 BrowseAllow from 192.0.2.0/255.255.255.0 BrowseAllow from *.domain.com BrowseAllow from @LOCAL BrowseAllow from @IF(name)

DefaultAuthType Basic DefaultEncryption IfRequested

... Allow from All Allow from None Allow from .domain.com Allow from .domain.com Allow from host.domain.com Allow from nnn. Allow from nnn.nnn. Allow from nnn.nnn.nnn. Allow from nnn.nnn.nnn.nnn Allow from nnn.nnn.nnn.nnn/mm Allow from nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm Allow from xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx Allow from @LOCAL Allow from @IF(name)


e.g. A totally "insecure" option to just see if it's working (in case we're on a command line server)...

Administrator user group... //these people will be prompted if they make changes to the print system

SystemGroup sys root printeradminusername

The below settings control the need for SSL configuration...

DefaultEncryption Never

Encryption IfRequired

Encryption Required

Listen *:631 BrowseAllow from 192.168.1.0/24

Allow 192.168.1.* Order allow,deny

Encryption Required

Allow 192.168.1.* Order allow,deny

Allow 192.168.1.*

AuthType Default

Require user @SYSTEM

Order allow,deny

YAY, it works!


/etc/init.d/cups reload /etc/init.d/cups restart


/sbin/service lpd stop /sbin/service cups start


Connect your printer to the parallel port or USB. then restart the CUPS daemon with

killall -HUP cupsd

and check with

lpinfo -v

direct parallel:/dev/lp0 direct usb://hp/dj450?serial=SG31K210C23S

for usb: lsusb

For parallel printers check with "/proc/sys/dev/parport/parport?/autoprobe*":

http://www.linuxprinting.org/~till/printing-tutorial/tut.html


serial port printer connected. I have an HP laserjet printer. My serial port is assigned to 3F8 IRQ4 in the Bios.

You should put something like this in /etc/conf.modules file. This works with HP parallel printer connected to my zip drive.

alias parport_lowlevel parport_pc options parport_pc io=0x378 irq=4,none

Reboot and try modprobe lp. It should work. Else; check the log files and /proc/... status.


The parallel ports are called /dev/lp${n} (/dev/lp0 [LPT1:], /dev/lp1, etc). Serial ports are called /dev/ttyS${n} (/dev/ttyS0 [COM1:], etc).


setserial -a /dev/ttyS0 baud_base 9600 chmod 777 /dev/ttyS0

CUPS' http : / / localhost : 631 and modified the printer port to serial: /dev /ttyS0 ? baud = 9600 + bits = 8 + parity = none + flow = soft (ignore embedded spaces)



cd /usr/spool/lp/model and then do a "grep stty *", I guess it looks like: "9600 -parenb cs8 ixon" is the most common


this is how you define printcap

dina:/usr/users/andy/work/lpd/lpd# stty -a < /dev/ttyS2 speed 9600 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; min = 1; time = 0; -parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff -iuclc -ixany -imaxbel -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke


  • « Linux printer hp laser network setup
  • Linux printer cups lpadmin »

Published

Feb 6, 2010

Category

linux

~505 words

Tags

  • cupsd 1
  • example 36
  • linux 249
  • port 10
  • printer 4
  • serial 1