# Network Printer: HP Jet Direct How-To

## sephtin

I'm going to try to make this short, because I've just spent the last hour and a half overcoming lots of little things to make this work.

I just hope I don't leave out any details...

FYI-

Couple years experience with FreeBSD... (which is AWESOME for servers, but I've found isn't quite as practical for laptops), couple weeks experience on Gentoo.

So far I like!  

K.  back to topic!

I have an HP OfficeJet D125 printer, with network module.

The docs I've seen on this site only cover printers connected to Parallel port or USB.

Here is how I set mine up:

Need cups and foomatic (to make life easy..  :Wink:    so let's emerge them.

Found my Printer on www.linuxprinting.org and it states that the hpijs driver works fine.  So we'll emerge that too.

#emerge cups

#emerge foomatic

#emerge hpijs

Once this is in place, we need to get the .ppd file.

The documentation on gentoo.org describes how to use foomatic to create ppd's for parallel (/dev/lp0) and USB (/dev/usb/lp0), but not for networked (via jetdirect module). 

Rather than spend a day asking and figuring it out, I took a shortcut.  I went to www.linuxprinting.org.  Link on left to Printer Listings.  Found my printer, and click on the link for "Download PPD".

Saved it to home dir.

Then I moved it to /usr/share/cups/model as root:

# cp /home/<usrid>/HP-printer-blah.ppd /usr/share/cups/model/

NOTE:  After it's moved to that dir (needs to be moved by root user), it will need to be chmodded to 644.   

# chmod 644 /usr/share/cups/model/HP-Printer-blah.ppd

Now you can add your printer using the cups print manager (not sure what the command line of it is, but it's under K-> Settings -> Print Manager in KDE.

Change print system to CUPS (bottom right).

Right click in the window and select add printer/class

Next, then I was able to select network printer (TCP), Next.

Then I input the IP addy of my printer (and the port, which for HP Jetdirect printers is 9100), and next.

Then click the "other" button, as my printer is NOT listed.

I then browsed to /usr/share/cups/model/HP-yougettheidea.ppd

When I clicked ok, it found my printer (if it says print driver wrong type, check permissions on the .ppd file again, see note above).

Click Next.  I tested it at this point, and it said it printed, but nothing came out.  Clicked next 4 times, gave my printer a name, clicked next and Finish to complete the wizard.

If it prompts you for a user/pass, give it one that has permissions to print over the network.  (root works.  Probly not sucure.. but it works)...

I then tested printing to find that it still didn't work.

I turned logging in /etc/cups/cupsd.conf from info to debug.

It then showed an error about a missing foomatic-rip file.

I found a way to get the file after much googling.

Download foomatic-filters-3.0.0.tar.gz from:

http://www.linuxprinting.org/download/foomatic/

I saved it to my home dir again.

I su'd to root, and copied it to a new dir.  While in the same dir as the file, typed:

# tar -xvzf foomatic-filters-3.0.0.tar.gz

# cd foomatic-filters-3.0.0

# ./configure

# make

it completed.

Then copied foomatic-rip to /usr/lib/cups/filter.

printing works fine..

Again, as I'm a newb to linux please offer additional suggestions advice.

As a side note, in FreeBSD, printing worked fine using cups after simply installing the hpijs port and adding the printer using the print manager.  *shrug*

Hopefully if someone has a similar problem to mine, this may be of help.

Enjoy.

John

----------

## int1

Try emerge gimp-print-cups.  It has a lot more drivers for the printers and that are appropriately setup to use the other subsystems as needed.

int1

----------

## jonesvery

Thanks for posting your experience, sephtin -- I'm also new to Gentoo (moving off a few months of RedHat on the desktop), and hit exactly this problem.  

Every time I've hit something like this, however, I find that someone else has already come across it and has been thoughtful enough to post the results of their work.  I only hope that I eventually come up with something that *hasn't* been dealt with already, so that I can make my own contribution...  :Smile: 

Many thanks.

----------

## DawgG

i'm trying to print to a hplj2100 network-printer (fully supported acc. to linux-printing.org). it's NOT connected locally, i know the ip  and that it supports lpd, raw, jetdirect, ipp...) HOW  TO?

i have emerged cups, foomatic, ghostscript, put the ppds in /etc/cups/ppd and can play around with cups' webgui (local & from other machine). i can change settings with it (print-proto etc.), but no effect  and it won't print (or rather i don't exactly know which settings to change). so far i think that cups isn't even REALLY necessary... 

the doze-clients print to raw ip:9100

the logs show nothing.

should i revert to printcap? do i have to?

THX for the help.

----------

## Xyrilon

The downloading and manual compiling of foomatic-filter isnt needed as in the top post just 

#emerge foomatic-filter

To get my printer ( HP LaserJet 4M Plus ) to work I had to set the location as

'socket://192.168.1.103:9100'  (where as the 192.168.1.103 is the printers IP)

I used gnome-cups-manager and the 'HP Jetdirect Printer' settings to do this and it was pretty straight forward.

----------

## DawgG

thx to great forums &  great free software (and quite a bit of fiddling around) they can print now.  i portscanned the printboxes to find that the ipp-ports (631) are open; the printer uri is

ipp://<prinbox-ip>:631/ipp

(or whats suggested in the cups.conf or web-gui when configuring a printer)

----------

## mallchin

I've just set this up on a friends box (running suse) under KDE and it was as easy as running through the printer setup wizard, choosing IPP, then using ipp://192.168.214.231:631/ipp (thanks DawgG) as the address.

Printed test page first time round, HP LaserJet 2300n.

----------

