On Mon, Feb 17, 2020 at 06:47:49PM +0100, Claus Assmann wrote:
> I got a 
> HP DeskJet 2630
> printer and connected it via usb
> I tried to use it "directly", i.e., /etc/printcap:
> usb:lp=/dev/ulpt0:sd=/var/spool/output/usb:sf:sh:tr=^D:
> as mentioned in the original mail
> 
> but this results in an "output error" after I started lpd
> and used
> lpr doc.ps
> 
>  ulpt0 at uhub0 port 4 configuration 1 interface 1 "HP DeskJet 2600 series" 
> rev 2.00/1.00 addr 2
>  ulpt0: using bi-directional mode
>  ugen0 at uhub0 port 4 configuration 1 "HP DeskJet 2600 series" rev 2.00/1.00 
> addr 2
>  ulpt0: output error
> 
> I didn't try to set up cups or similar stuff as that seems
> to be overkill for my simple use case and probably results
> in the same USB error?
> If someone has this kind of printer connected via USB: I am
> interested in the config.

Try the cups-filters package and follow the instructions given in
the file /usr/local/share/doc/pkg-readmes/cups-filters

You can't avoid the printer drivers from cups but you may be able to
get away with running lpd(8) instead of cupsd.
You will also need a2ps and a suitable printer driver (foo2zjs in my case).

Here are the packages I use for my HP LaserJet 1020:
a2ps-4.14p15        format files for printing on PostScript printers
cups-filters-1.25.6 OpenPrinting CUPS filters
foo2zjs-20190909    driver for ZjStream wire protocol compatible printers

Note however that ulpt(4) recognizes my printer and loads firmware for it.
If firmware is also required for your model to work (I have no idea if it is)
then the ulpt driver would need to be modified to do that, too.

$ cat /etc/printcap
lp|local line printer|HP-LaserJet_1020:\
        :lf=/var/log/lpd-errs:\
        :sd=/var/spool/output/lpd:\
        :lp=/dev/ulpt0:\
        :if=/etc/foomatic/direct/filter.sh:\ 
        :sh:\
        :mx#0:

And the filter script is this:

$ cat /etc/foomatic/direct/filter.sh
#!/bin/sh

# for debugging:
#echo "$*" >> /tmp/filter-args

args=`getopt cw:l:i:j:n:h: $*`
if [ $? -ne 0 ]
then
        echo 'Usage: [-c] -wwidth -llength -iindent -n login -h host acct-file'
        exit 2
fi

set -- $args

while [ $# -ne 0 ]
do
   case "$1"
   in
           -c)
                   flag="$1"; shift;;
           -o|-w|-l|-i|-j|-n|-h)
                   oarg="$2"; shift; shift;;
           --)
                   shift; break;;
   esac
done

/usr/local/bin/a2ps -BRq --columns=1 -o - | \
        /usr/local/bin/foomatic-rip -P HP-LaserJet_1020 \
        --ppd /etc/foomatic/direct/HP-LaserJet_1020.ppd

Reply via email to