# lpd/printcap -> Trendnet TE100-P1P printserver/H-P5l



## shepper (May 5, 2011)

I am using a Trendnet TE100-P1P printserver with an H-P 5l laserjet that supports the following print command sets

```
HP ENHANCED PCL5,PJL
```
The printserver has a static IP at 192.168.1.2 and supported ipp:// and http:// in cups and has an hp jetdirect ports that I used for an OpenBSD printcap with apsfilter.
The following is my OpenBSD/Debian printcap:

```
## APS1_BEGIN:printer1
# - don't delete start label for apsfilter printer1
# - no other printer defines between BEGIN and END LABEL
hp5l|hp5l;r=300x300;q=draft;c=gray;p=letter;m=auto:\
    :lp=9100@192.168.1.2:\
    :if=/etc/apsfilter/basedir/bin/apsfilter:\
    :sd=/var/spool/lpd/hp5l:\
    :lf=/var/spool/lpd/hp5l/log:\
    :af=/var/spool/lpd/hp5l/acct:\
    :mx#0:\
    :sh:
# APS1_END - don't delete this
```
This printcap also works in Debian squeeze with apsfilter.  I struggled mightly before I found a website that suggested using

```
lp=9100@192.168.1.2
```
instead of the :rp and :rm entries.
This same printcap did not work with FreeBSD 8.2 and the handbook page indicates that I need a :rm entry otherwise the job will the local parallel port by default.
My attempt at a FreeBSD printcap:

```
$ cat /etc/printcap
hp5l|lp|hp5l;r=300x300;q=draft;c=gray;p=letter;m=auto:\
    :rm=PS-8B4C0D:\
    :rp=raw:\
    :if=/usr/local/share/ps2pcl:\
    :sd=/var/spool/lpd/hp5l:\
    :lf=/var/spool/lpd/hp5l/log:\
    :af=/var/spool/lpd/hp5l/acct:\
    :mx#0:\
    :sh:
```
My /etc/hosts:

```
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers.  Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
# Network H-P 5l Laserjet printer
192.168.1.2    PS-8B4C0D.home.yak   PS-8B4C0D
```
My /usr/local/libexec/ps2pcl:

```
#!/bin/sh
/usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=ljet4 -sOutputFile=- -
```
Permissions for /usr/local/libexec/ps2pcl:

```
ls -al /usr/local/libexec/ps2pcl
-rwxr-xr-x  1 root  wheel  81 May  4 18:39 /usr/local/libexec/ps2pcl
```
My attempts to print:

```
$ lpq
Musk.home.yak: waiting for queue to be enabled on PS-8B4C0D
Rank   Owner      Job  Files                                 Total Size
1st    jsh        6    escher.ps                             10617 bytes


$ lpc status all
hp5l:
        queuing is enabled
        printing is enabled
        1 entry in spool area
        waiting for queue to be enabled on PS-8B4C0D
```
I have seen several formats for the 9100 printer port:
9100@192.168.1.2 and 192.168.1.2:9100 and 9100%192.168.1.2.
In cups the following works 192.168.1.21

Thanks in advance


----------



## wblock@ (May 5, 2011)

The printcap looks like mixed CUPS, apsfilter, and standard lpr/lpd.  I'd suggest just standard lpr/lpd, at least to start.  Use hostnames, and the port 9100 style would be

```
:lp=9100@PS-8B4C0D:
```

See lpd Printing With FreeBSD.


----------



## shepper (May 5, 2011)

Thanks - success printing

```
/usr/local/share/ghostscript/8.71/examples/escher.ps
```
Your webpage had the answer at the end of the page.
For documentation this worked

```
hp5l|lp|H-P 5L Laserjet:\
    :lp=9100@PS-8B4C0D:\
    :sh:\
    :mx#0:\
    :sd=/var/spool/lpd/hp5l:\
    :if=/usr/local/libexec/ps2pcl: \
    :lf=/var/spool/lpd/hp5l/log:
```

There is a space on the :if line between the final colon and the backslash that I copied from your website and pasted into my printcap.  I was wondering if it is necessary?


----------



## wblock@ (May 5, 2011)

shepper said:
			
		

> There is a space on the :if line between the final colon and the backslash that I copied from your website and pasted into my printcap.  I was wondering if it is necessary?



No, it's just spurious.  Now fixed; thanks!


----------



## DutchDaemon (May 6, 2011)

@shepper, use the correct formatting tags.


----------

