Setting up HP D2460 printer - BSD

This is a discussion on Setting up HP D2460 printer - BSD ; Hi, I'm trying to set up my HP D2460 printer under FreeBSD 7.0 (RELEASE), but I cannot get it to work. I want to use lpr/lpd, not cups. Here's my set-up: hobbiton# cat /etc/printcap lp:\ :sh:\ :lp=/dev/ulpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:\ :mx#0:if=/usr/local/bin/ifhp:\ :af=/etc/foomatic/HP-DeskJet_D2400-hpijs.ppd: According ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Setting up HP D2460 printer

  1. Setting up HP D2460 printer

    Hi,

    I'm trying to set up my HP D2460 printer under FreeBSD 7.0 (RELEASE),
    but I cannot get it to work.

    I want to use lpr/lpd, not cups. Here's my set-up:

    hobbiton# cat /etc/printcap

    lp:\
    :sh:\
    :lp=/dev/ulpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:\
    :mx#0:if=/usr/local/bin/ifhp:\
    :af=/etc/foomatic/HP-DeskJet_D2400-hpijs.ppd:

    According to linuxprinting.org the recommended driver for this device
    is hpijs, so I installed the port for that.

    The hpijs driver comes with a little input filter script that
    looks as follows (this is after some tweaks by me):

    hobbiton# cat /usr/local/bin/ifhp
    #!/bin/sh

    PATH=/usr/bin
    export PATH

    # Send a reset, then Treat LF as CR+LF:
    #
    printf "\033E\033&k2G" || exit 2
    echo "Reset carried out..."
    # Read first line of the file to determine type of input
    #
    read first_line

    case "${first_line}" in
    \%\!*)
    #
    # PostScript input, so use ghostscript and hpijs
    # http://hpinkjet.sourceforge.net/prin...r.php#DJ9xxVIP
    #
    echo "PostScript. Printing now!"
    /usr/local/bin/gs -q -dNOPAUSE -dSAFER -r600x600 \
    -sDEVICE=ijs -sIjsServer=/usr/local/bin/hpijs -dIjsUseOutputFD \
    -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="DESKJET
    2400" \
    -sIjsParams="Quality:Quality=0,Quality:ColorMode=2,Quality:Medi aType=0,Quality:PenSet=2"
    \
    -sOutputFile=- - && exit 0
    ;;
    *)
    #
    # Plain text or HP/PCL, so just print it directly.
    # Print a form feed at the end to eject the last page.
    #
    echo $first_line && /bin/cat && printf "\033&l0H\033E" && exit 0
    ;;
    esac

    # Should not be reached
    exit 2

    This basically checks whether the file to be printed is PostScript or
    plain text, and acts on this accordingly.

    The printer is connected and powered on. From the messages log:

    hobbiton# cat /var/log/messages | grep D2400
    Aug 30 16:26:48 hobbiton kernel: ulpt0: class 0/0, rev 2.00/1.00, addr 2> on uhub2

    I also updated to the latest version of GhostScript:

    hobbiton# gs -v
    GPL Ghostscript 8.62 (2008-02-29)
    Copyright (C) 2008 Artifex Software, Inc. All rights reserved.

    Now, whenever I try to print a PostScript file

    hobbiton# lpr file.ps

    absolutely nothing happens, and a line such as

    GPL Ghostscript 8.62: Can't start ijs server "/usr/local/bin/hpijs"
    Aug 30 18:03:37 hobbiton lpd[17360]: lp: job could not be printed
    (cfA028hobbiton)

    is appended to my lpd log file.

    When I try to print some plain text

    hobbiton# echo "test test test" | lpr

    again nothing happens, and no extra information appears in the lpd log
    file.

    The test jobs are not queued up either:

    hobbiton# lpq
    no entries

    Anyone knows what's wrong here?

    --
    Women need a reason to have sex. Men just need a place.
    ~ Billy Crystal

  2. Re: Setting up HP D2460 printer

    TomB wrote:

    > Hi,
    >
    > I'm trying to set up my HP D2460 printer under FreeBSD 7.0 (RELEASE),
    > but I cannot get it to work.
    >
    > I want to use lpr/lpd, not cups. Here's my set-up:
    >
    > hobbiton# cat /etc/printcap
    >
    > Snip...
    >
    > Anyone knows what's wrong here?
    >

    apsfilter always worked fine for me with various ps printers

    No GUI required. Essentially

    /usr/ports/print/apsfilter

    http://www.apsfilter.org/


    --

    Bill
    FreeBSD 7 on AMD-64
    "The road less travelled"

  3. Re: Setting up HP D2460 printer

    On Sat, 30 Aug 2008 16:43:31 GMT,
    Bill Laird wrote:
    > TomB wrote:
    >> I'm trying to set up my HP D2460 printer under FreeBSD 7.0 (RELEASE),
    >> but I cannot get it to work.

    [snip!]
    > apsfilter always worked fine for me with various ps printers


    No filter works fine for me, with a postscript-speaking laserjet. :-)


    lp|ps|PostScript|Laserjet 2200D:\
    :sh:mx%0:\
    :lp=/dev/ulpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:


    Which is why I wanted a postscript printer in the first place.

    Note that the OP was trying to print a postscript file which didn't work.

    If the printer supports postscript, I'd suggest kicking out all the
    filtering, make that work, then adding filters to taste again. If not,
    converting the postscript to a format it does speak, running that
    through the spooler, and add filters once that works.

    Using lpc to actually start the daemon and checking the spool directory
    exists also might help. Hm, not sure what else, but disregarding filters
    until the printer can be made to do something is a good start.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

  4. Re: Setting up HP D2460 printer

    TomB wrote:
    > /usr/local/bin/gs -q -dNOPAUSE -dSAFER -r600x600 \
    > -sDEVICE=ijs -sIjsServer=/usr/local/bin/hpijs -dIjsUseOutputFD \
    > -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="DESKJET 2400" \
    > -sIjsParams="Quality:Quality=0,Quality:ColorMode=2,Quality:Medi aType=0,Quality:PenSet=2" \
    > -sOutputFile=- -


    Does your PS job print if you just pipe it to that command? It's easier
    to get that to work standalone before using it as a filter.

    > GPL Ghostscript 8.62: Can't start ijs server "/usr/local/bin/hpijs"


    Maybe hpijs needs the "server" enabled in rc.conf or otherwise
    configured. But work out the filter manually, because it's harder to
    debug once hidden in lpd.

    --
    Warren Block * Rapid City, South Dakota * USA

  5. Re: Setting up HP D2460 printer

    On 2008-08-30, Warren Block wrote:
    > TomB wrote:
    >> /usr/local/bin/gs -q -dNOPAUSE -dSAFER -r600x600 \
    >> -sDEVICE=ijs -sIjsServer=/usr/local/bin/hpijs -dIjsUseOutputFD \
    >> -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="DESKJET 2400" \
    >> -sIjsParams="Quality:Quality=0,Quality:ColorMode=2,Quality:Medi aType=0,Quality:PenSet=2" \
    >> -sOutputFile=- -

    >
    > Does your PS job print if you just pipe it to that command? It's easier
    > to get that to work standalone before using it as a filter.


    >> GPL Ghostscript 8.62: Can't start ijs server "/usr/local/bin/hpijs"

    >
    > Maybe hpijs needs the "server" enabled in rc.conf or otherwise
    > configured. But work out the filter manually, because it's harder to
    > debug once hidden in lpd.
    >


    I never looked into gs before. I just assumed that this input filter
    (it came with the hpijs port) would do the trick after adapting it to
    my specific printer model. The "Can't start ijs server" message is a
    clear indication that it doesn't though :-p

    Anyway, I fired up the gs man page and the hpijs docs and tried building
    the filter myself. From this I learned that my printer model isn't
    supported directly by hpijs:

    hobbiton# gs -sDEVICE=ijs -sIjsServer=/usr/local/bin/hpijs -r600x600
    -sPAPERSIZE=a4 -sDeviceManufacturer="HP" -sDeviceModel="DESKJET D2400"
    -dIjsUseOutputFD -sOutputFile=- -dNOPAUSE
    -sIjsParams="Quality:Quality=0" /home/tommy/file.ps | lpr
    unable to set device=DESKJET D2400, err=16
    unable to read client data err=-2

    When I use e.g. the supported model "DESKJET 890", stuff seems to
    work (if I don't pipe to lpr a heep of code is printed on stdout),
    but obviously my printer cannot handle the output produced by
    this command. I tried some other models, but to no avail :-(
    According to linuxprinting.org the D2400 series use something called
    LIDIL instead of PCL, used on most other Deskjets, so this will prolly
    never work.

    I now am looking into hplip, which I'm using on my Debian box.
    Unfortunately this requires CUPS (I really wanted to use lpr/lpd, just
    for the sake of learning how it works). It also requires a kernel
    built without ulpt, so now I first need to learn about recompiling a
    FreeBSD kernel before I can get to printing again. This truely is a
    very educating OS :-p Ah well, that's why I installed it in the first
    place.

    --
    This job would be great if it wasn't for the ****ing customers.
    ~ Randal Graves

  6. Re: Setting up HP D2460 printer

    TomB wrote:
    >
    > Anyway, I fired up the gs man page and the hpijs docs and tried building
    > the filter myself. From this I learned that my printer model isn't
    > supported directly by hpijs:
    >
    > hobbiton# gs -sDEVICE=ijs -sIjsServer=/usr/local/bin/hpijs -r600x600
    > -sPAPERSIZE=a4 -sDeviceManufacturer="HP" -sDeviceModel="DESKJET D2400"
    > -dIjsUseOutputFD -sOutputFile=- -dNOPAUSE
    > -sIjsParams="Quality:Quality=0" /home/tommy/file.ps | lpr


    You should redirect the output to /dev/ulpt. lpr isn't set up yet.

    > unable to set device=DESKJET D2400, err=16
    > unable to read client data err=-2


    No idea on that. The latest documentation on HPLIP says it supports the
    Deskjet 2460. It also says hpijs is a subcomponent that can be used
    alone without CUPS. Does that mean the DJ2460 can be made to work that
    way? Can't tell. Does the printer need some sort of back channel to
    communicate? Can't tell.

    If that printer can handle plain ASCII, you should be able to check it
    with lptest > /dev/ulpt. Maybe.

    > I now am looking into hplip, which I'm using on my Debian box.
    > Unfortunately this requires CUPS (I really wanted to use lpr/lpd, just
    > for the sake of learning how it works). It also requires a kernel
    > built without ulpt, so now I first need to learn about recompiling a
    > FreeBSD kernel before I can get to printing again. This truely is a
    > very educating OS :-p Ah well, that's why I installed it in the first
    > place.


    It's not so much the OS as cost-reduced-to-absurdity printers, really.

    --
    Warren Block * Rapid City, South Dakota * USA

  7. Re: Setting up HP D2460 printer

    On 2008-08-31, Warren Block wrote:
    > TomB wrote:
    >>
    >> Anyway, I fired up the gs man page and the hpijs docs and tried building
    >> the filter myself. From this I learned that my printer model isn't
    >> supported directly by hpijs:
    >>
    >> hobbiton# gs -sDEVICE=ijs -sIjsServer=/usr/local/bin/hpijs -r600x600
    >> -sPAPERSIZE=a4 -sDeviceManufacturer="HP" -sDeviceModel="DESKJET D2400"
    >> -dIjsUseOutputFD -sOutputFile=- -dNOPAUSE
    >> -sIjsParams="Quality:Quality=0" /home/tommy/file.ps | lpr

    >
    > You should redirect the output to /dev/ulpt. lpr isn't set up yet.


    Yes, tried that as well. And of course I updated my printcap to not do
    any filtering before I started goofing with gs.

    >> unable to set device=DESKJET D2400, err=16
    >> unable to read client data err=-2

    >
    > No idea on that. The latest documentation on HPLIP says it supports the
    > Deskjet 2460. It also says hpijs is a subcomponent that can be used
    > alone without CUPS. Does that mean the DJ2460 can be made to work that
    > way? Can't tell. Does the printer need some sort of back channel to
    > communicate? Can't tell.


    Yes, I read that, but I figured that the hpijs subcomponent only
    supports the printers that are also supported by the stand-alone
    hpijs. I might be wrong though, so maybe I'll give that a shot first.

    > If that printer can handle plain ASCII, you should be able to check it
    > with lptest > /dev/ulpt. Maybe.


    Tried that too. Doesn't work. Mind that this is a *very* cheap printer
    ;-)

    >> I now am looking into hplip, which I'm using on my Debian box.
    >> Unfortunately this requires CUPS (I really wanted to use lpr/lpd, just
    >> for the sake of learning how it works). It also requires a kernel
    >> built without ulpt, so now I first need to learn about recompiling a
    >> FreeBSD kernel before I can get to printing again. This truely is a
    >> very educating OS :-p Ah well, that's why I installed it in the first
    >> place.

    >
    > It's not so much the OS as cost-reduced-to-absurdity printers, really.


    Oh, but I'm not blaming the OS if that's what it looks like. So far I
    really like FreeBSD (installed it for the first time ever about a week
    ago).

    --
    An investment in knowledge always pays the best interest.
    ~ Benjamin Franklin

  8. Re: Setting up HP D2460 printer

    On 2008-08-31, TomB wrote:
    > On 2008-08-31, Warren Block wrote:
    >> No idea on that. The latest documentation on HPLIP says it supports the
    >> Deskjet 2460. It also says hpijs is a subcomponent that can be used
    >> alone without CUPS. Does that mean the DJ2460 can be made to work that
    >> way? Can't tell. Does the printer need some sort of back channel to
    >> communicate? Can't tell.

    >
    > Yes, I read that, but I figured that the hpijs subcomponent only
    > supports the printers that are also supported by the stand-alone
    > hpijs. I might be wrong though, so maybe I'll give that a shot first.


    And wrong I was. The hpijs server that comes with hplip indeed
    supports the D2460.

    Something like

    hobbiton# /usr/local/bin/gs -q -dNOPAUSE -dSAFER -r600x600
    -sDEVICE=ijs -sIjsServer=/usr/local/bin/hpijs -dIjsUseOutputFD
    -sOutputFile=- -sDeviceManufacturer="HP" -sDeviceModel="DJ3600"
    /home/tommy/file.ps > /dev/ulpt0

    does the trick. Thanks for pointing this out!

    --
    Iedereen wil erop, maar ze is te stijl.
    ~ Walter Grootaers

  9. Re: Setting up HP D2460 printer

    On 2008-09-01, TomB wrote:
    > On 2008-08-31, TomB wrote:
    >> On 2008-08-31, Warren Block wrote:
    >>> No idea on that. The latest documentation on HPLIP says it supports the
    >>> Deskjet 2460. It also says hpijs is a subcomponent that can be used
    >>> alone without CUPS. Does that mean the DJ2460 can be made to work that
    >>> way? Can't tell. Does the printer need some sort of back channel to
    >>> communicate? Can't tell.

    >>
    >> Yes, I read that, but I figured that the hpijs subcomponent only
    >> supports the printers that are also supported by the stand-alone
    >> hpijs. I might be wrong though, so maybe I'll give that a shot first.

    >
    > And wrong I was. The hpijs server that comes with hplip indeed
    > supports the D2460.
    >
    > Something like
    >
    > hobbiton# /usr/local/bin/gs -q -dNOPAUSE -dSAFER -r600x600
    > -sDEVICE=ijs -sIjsServer=/usr/local/bin/hpijs -dIjsUseOutputFD
    > -sOutputFile=- -sDeviceManufacturer="HP" -sDeviceModel="DJ3600"
    > /home/tommy/file.ps > /dev/ulpt0
    >
    > does the trick. Thanks for pointing this out!
    >


    Okay, one final word on this...

    I still thought that it was odd that hpijs as subcomponent of hplip
    would support printers that weren't supported by the stand-alone
    hpijs, so I looked in the hpijs docs for the DJ3600 driver, and lo and
    behold: it's there. It just fails to mention the fact that it can be
    used to drive the D2460 model as well. In the hplip docs this *is*
    mentioned. So I end up using the hpijs server after all :-p

    --
    Son, a woman is like a beer. They smell good, they look good,
    you'd step over your own mother just to get one! But you
    can't stop at one. You wanna drink another woman!
    ~ Homer J. Simpson

+ Reply to Thread