Ppf
From M1Research
Printer Port Forwarder
Contents |
Description
ppf is simple solution for sharing USB or LPT printer across the network using Network Printing Protocol (JetDirect/AppSocket protocols).
I use this solution for connecting printer to diskless Linux terminal station (see LTSP project for more info) and share it to throw another server (Windows or Unix printing system) with complex queuing and minitoring system.
ppf software is a TCP deamon that listen TCP/9100 and forward all datas comes to phisical printer port, like simple print server (which embedded into network attached printers, like JetDirect)
Goals
We use ppf for sharing printer connected to diskless station station. There are no need to install Samba or CUPS on PC where printer connected to. You use printer throw "standart network port" (in Windows terms).
Downloads
Version 0.1-alpha:
- Source download: ppf-0.1-alpha.tar.bz2
- Precompiled binary: ppf-0.1-alpha.fc1.bz2
Installation
From sources:
- 1. Download c source tarball
- 2. Unpack. (
bzip2 -9 ppf-X.Y-zzz.src.bz2 | tar xvf -
) - 3. Compile. (
cd ppf-X.Y-zzz; make
) - 4. Install binary. (
chmod u=rwx,g=rx,o=rx ppf ; chown root.root ppf ; cp -f ppf /usr/sbin/ppf
)
From binary
- 1. Download precompiled binary file archive
- 2. Unpack. (
cat ppf-X.Y-zzz.fc1.bz2 | bzip2 -cd > ppf
) - 3. Install binary. (
chmod u=rwx,g=rx,o=rx ppf ; chown root.root ppf ; cp -f ppf /usr/sbin/ppf
)
Running
Start program required 2 arguments:
/usr/sbin/ppf <printer port> <tcp port>
Where:
<printer port>
- device name where printer connected to;<tcp port>
- number of tcp port to listen, typicaly you should use 9100.
Example:
/usr/sbin/ppf /dev/usb/lp0 9100 or /usr/sbin/ppf /dev/lp0 9100
Printer connected is shared using JetDirect/AppSocket protocols. ppf directly send all data from remote host to printer, that mean driver on computer where this printer shared to public from should send data that can be accepted by printer directly (without previous pre- precessing like converting to EPS or PCL or RAW).
*NOTICE* during connecting ppf's provided printer you can find some delay coused by system desire to determine printer type by SNMP subsystem ussualy provided by serios print-servers.
Troubleshooting
ppf sends all warning, notices and error events to system log. In case of problem you can review syslog files for details.
For example:
in a case of not connected usb printer:
Nov 14 06:21:05 airforce ppf[16148]: Opened connection: from 127.0.0.1:41220, job id: 2 Nov 14 06:21:05 airforce ppf[16148]: Unable to open '/dev/usb/lp0' due to: No such device Nov 14 06:21:05 airforce ppf[16148]: Closed connection: job id: 2, in: 0 bytes, out: 0 bytes
closed tcp connection from print server:
Nov 14 05:22:42 airforce ppf[9122]: Opened connection: from 127.0.0.1:37380, job id: 17 Nov 14 05:22:42 airforce ppf[9122]: read from 'socket' error (Resource temporarily unavailable) Nov 14 05:22:42 airforce ppf[9122]: Closed connection: job id: 17, in: 8192 bytes, out: 0 bytes
successfull prints:
Nov 14 05:04:28 airforce ppf[9002]: Opened connection: from 127.0.0.1:36356, job id: 11 Nov 14 05:04:43 airforce ppf[9002]: Closed connection: job id: 11, in: 881741 bytes, out: 0 bytes ..... Nov 14 05:59:15 airforce ppf[15123]: Opened connection: from 10.1.5.76:28167, job id: 10 Nov 14 05:59:41 airforce ppf[15123]: Closed connection: job id: 10, in: 521592 bytes, out: 0 bytes