Document Possible printer connection
Author Jan Holesovsky <kendy@suse.cz>
Id $Id: spec_connection.html,v 1.1.1.1 2002/06/27 08:53:18 jsrain Exp $

Note: When you see a text like this, it is a TODO part. It is still missing or will be rewritten!

Possible printer connection

Generally you can say, that the printer can be local or connected to another machine via network.

Local printer
It means a printer that is connected to the machine's parallel or serial port, USB or infrared port.
Required information: Name of the device (/dev/lp?, /dev/ttyS?, ...)
Printer devices can be:
Parallel port
Requires: Parport support module, lp module, proc filesystem support, parport_probe module in the kernel.
Autodetection: A list of parallel ports is in /proc/parport. The user must choose if there is more than one not autoprobed port. /proc/devices says whether the connected device is a printer or something else.
Autoprobe of the printer type: If the printer conforms to the IEEE 1284 specification and parport_probe module is loaded, the MODEL and MANUFACTURER fields appear in /proc/parport/?/autoprobe.
Additional info: (Linux kernel)/Documentation/parport.txt
Problems: (in libhd)To probe printer, it is enough to do rmmod parport_probe; modprobe parport_probe. But parallel port must be configured properly. The problem is that SuSE linux adds line options parport_pc io=0x3F8 irq=none,none to /etc/modules.conf. Therefore if computer has more parallel ports or parallel port on other io ports, parallel ports do not work.
Current solution: Parallel port settings are read from bios. It helps if there are the only on-board parallel ports, or simply parallel ports configurable by bios. Do exist non-on-board parallel ports configurable by bios? If user has additional parallel ports (e.g. PCI card), this approach kills working parallel ports. So we read parallel ports options from /etc/modules.conf and replace entries found in bios. Then we load parport_pc module with read options. Example:
     1 parallel port at 0x3f8 found in bios.
     3 parallel ports at 0x2f8, 0xb000, 0xba00 found in /etc/modules.conf
     parport_pc is loaded with io=0x3f8,0xb000,0xba00 irq=none,none,none.
Would it be possible to remove options parport_pc from /etc/modules.conf?
Serial port
Requires: Serial port support module, proc filesystem support in the kernel.
Autodetection: A list of serial ports can be found in /proc/tty/driver/serial. The user must choose.
Settings: It should be possible to set baud rate, data bits, parity and ?flow control?. Defaults can be set according to the printer name set (choosen) by user.

Autoprobe of the printer type: I'm affraid, it is not possible...

Additional info:
USB
Requires: USB support from experimental kernels (2.3.x), proc filesystem support, hotplug.rpm and usbutils.rpm installed.
Autodetection: It is possible to get know if there is a printer connected by scanning /proc/bus/usb/devices. It seems that it is enough to have hotplug started in order to autodetection work.
Autoprobe of the printer type: There are Vendor and ProdId fields in /proc/bus/usb/devices. Sometimes it will not help because the printer can be connected through usb-to-printer convertor.
Additional info: www.linux-usb.org, HOWTO about configuring USB printer under Linux
Infrared
Requires:
Autodetection:
Autoprobe of the printer type:
Additional info:
Printing: Is provided by sending filtered output to the specified device.
Remote printer
It means printing on printers connected to a remote host with lpd running. The printers should be already configured.
Required information: Name of the remote host and name of the remote queue.
Remote host
Name of the remote machine. Configurator can provide a list of machines in user's domain. The remote machine must be set to accept printing requests from user's machine, typically by listing in /etc/hosts.lpd
Remote queue

Is it possible to get list from the remote host without logging in?

Prefilter queue for remote printer
It means printing on printers connected to a remote host with lpd running. The printers should be already configured. Data are filtered on local host and are sent to remote raw queue. In fact this is combination of two queues, one running on local host that actually does filtering and converts data to format that printer understand to, and the second, running on remote host, sending raw data directly to printer.
Required information: Name of the remote host and name of the remote queue.
Remote host
Name of the remote machine. Configurator can provide a list of machines in user's domain. The remote machine must be set to accept printing requests from user's machine, typically by listing in /etc/hosts.lpd
Remote queue

Is it possible to get list from the remote host without logging in?

SMB/Windows 9x/NT printer
It means printing on printers connected to SMB servers.
Required information: Hostname/IP of the SMB server, printer name, user and password and workgroup.
Requires: the samba package installed, networking.
Hostname/IP
Autodetection: The lookup can be done by "nmblookup -M -" followed by "nmblookup -A <ip address>", where the <ip address> is get from the previous nmblookup.

Is it neccessary to let user to be able to select his own setting?

Printer name
Autodetection: In smbclient -N -L <name> list, there are names of connected printers there.
Autoprobe of the printer type:

It is possible in Samba to specify the printer driver name. Is it possible to obtain it?

User and password
The setup tool should recommend to create a special user and password! (because of security)
Workgroup
A list of workgroups can be provided usingsmbclient -N -L <name>.
Printing: Is provided by sending filtered output to smbclient.
Additional info: (samba.tar.gz)/examples/printing, man smbclient
NetWare printer (NCP)
Printing on printers connected to NetWare servers.
Required information: Printer server name, print queue name and user and password.
Requires: the cnpfs package installed, networking.
Printer server name
Autodetection: A list of available NCP servers can be get using slist.
Print queue name
Autodetection: A list of available queues on specified server can be get using pqlist.

Autoprobe of the printer type: I haven't found a word about it...

User and password
Recommend to create a special user and password! (because of security)
Printing: Is provided by sending filtered output to nprint.
Direct to port printer (HP JetDirect or AppSocket protocol)
Printing on printers connected ???directly???. TODO get known how does it work.
Required information: Hostname of the printer and port of the printer.
Hostname of the printer
Port of the printer
(Default: 9100)
Internet Printing Protocol printers
Requires: CUPS system plus CUPS-filters
Autodetection: I guess no. See Internet Printing Protocol
Settings: Network Configuration, Printer Security, File Formats, etc ... (Internet Printing Protocol)
Warning: Installing CUPS will overwrite your existing printing system.
Additional info: www.cups.org, RFC 2569
Printer Access Protocol printers
Printing on AppleTalk connected printers.
Requires:
Autodetection:
Additional info: man pap, rpm -ql netatalk

Functionality necessary for autodetection

All autodetection is possible by scanning files and scanning of the output of programs described above.