# HOWTO Printer - HP Deskjet 3940

## zurd

It's really easy once you know how.

1) We clean stuff up :

emerge -C foomatic-gui foomatic-filters foomatic-db-engine foomatic-db foomatic

emerge -C cups hpijs hplip

rm -fr /var/tmp/*

rm -fr /usr/portage/distfiles/*

rm -fr /usr/portage/packages/*

emerge sync

2) We emerge what we need

nano /etc/make.conf #and add ppds to your flag (i.e. USE="ppds")

emerge cups foomatic hplip

3) We start the service

/etc/init.d/hplip start #my hpssd service doesn't start but it'll still work

/etc/init.d/cupsd starthpssd

rc-update add cupsd default

rc-update add hplip default

4) We add the printer and test it

Go to http://localhost:631 and click Printers / Add Printers

Name is HP Deskjet 3940, location is /dev/lp0 then Continue

Choose HP then choose your printer model, mine was Deskjet 3940

Click Continue and print a test page.

Note : hpijs and hplip are 2 different drivers for different printers, to know which one you need, go to inkjet.sourceforge.net in Supported Printers.

 :Cool: 

----------

## LordArthas

Hi zurf!

Thank you for this fine HowTo. Just a note on this:

 *Quote:*   

> 
> 
> Note : hpijs and hplip are 2 different drivers for different printers, to know which one you need, go to inkjet.sourceforge.net in Supported Printers. 
> 
> 

 

Actually, when (well, after) emerging hpjis portage says that this package is deprecated and hplip should be used in any case. The latter seems to have all HP drivers by the way.

Michele.

----------

## opensas

Small and at the same time great HowTo!!!

Worked like a charm here with an HP LaserJet 1022

Just two things

where it says

 *Quote:*   

> 
> 
> /etc/init.d/hplip start #my hpssd service doesn't start but it'll still work 
> 
> /etc/init.d/cupsd starthpssd 
> ...

 

there's a little typo

```

/etc/init.d/cupsd start

```

And in respect to 

 *Quote:*   

> 
> 
> rm -fr /usr/portage/distfiles/* 
> 
> rm -fr /usr/portage/packages
> ...

 

I think that's far too drastic...

I have a couple GB of distfiles I wouldn't like having to download again...

And let's not mention my beloved packages that took me so many compiling hours...

Anyway, thanks for the howto  :Wink: 

Saludos

Sas

----------

## basvanlola

Worked like a charm  :Smile: 

Just a little note:

 *zurd wrote:*   

> 
> 
> Name is HP Deskjet 3940, location is /dev/lp0 then Continue
> 
> 

 

You can't actually use spaces in the name...

But apart from that, it worked nicely, thanks!

----------

## another_lobster

I'm adding my experience, it might be useful to someone else.

My gentoo box had "CUPS" already installed (it probably came with "emerge kde", I don't know).

What i did to have my "test page" printed was:

1) configuring CUPS according to the "Gentoo Printing Guide". After this I tried to print the

test page but my /var/log/cups/error_log (with LogLevel set to 'debug') said:

```
D [30/Oct/2005:16:56:27 +0100] [Job 5] /usr/lib/cups/filter/foomatic-rip: No such file or directory
```

2) emerge foomatic

At this stage the problem, according to error_log, was:

```
D [31/Oct/2005:15:20:20 +0100] [Job 6] sh: line 1: hpijs: command not found
```

3) emerge hpijs

at the end of emerge output there was the following line:

```
* net-print/hpijs is deprecated, please use net-print/hplip
```

I ran "emerge -C hpijs" and "emerge hplip". At this point emerge said:

```
!!! All ebuilds that could satisfy "hplip" have been masked.

!!! One of the following masked packages is required to complete your request:

- net-print/hplip-0.9.4 (masked by: ~x86 keyword)

- net-print/hplip-0.9.5 (masked by: ~x86 keyword)

- net-print/hplip-0.9.3 (masked by: ~x86 keyword)

```

I unmerged hplip ("emerge -C hplip") and emerged hpijs again ("emerge hpijs")

4) At this point I could almost print the "test page". The printer started and

I could hear the usual noise of the printer, the sheet was swallowed by the printer

and then spat off completely blank.

Browsing the CUPS (Printers -> modify printer -> printout mode) I realised that

the printer was configured to use the color cartridge. I never installed that

cartridge as I print most of times B/W document, so I had to change the printout

mode to "Normal Grayscale (black cartridge)".

At this point I could see the "test page" correctly printed.

Amyway... I'm still stuck there, as the "test page" is the only thing I

can print... I tried to print a PDF document using KGhostView but it doesn't

work yet.

I'll be back when I fix this problem too.

If any one has any suggestion, it would be greatly appreciated.

Regards,

Lobster

----------

## another_lobster

 *another_lobster wrote:*   

> 
> 
> Amyway... I'm still stuck there, as the "test page" is the only thing I
> 
> can print... I tried to print a PDF document using KGhostView but it doesn't
> ...

 

I don't know why but today I could print the same PDF I couldn't some days ago.

I didn't do anything since then, I just turned my PC off and turned it on today

(OK... it's been turned off for days, I know, that's because I've got a newborn

child at home, my 3 months old baby, who needs a lot more care than my Gentoo

box).

Here is what I did today:

First of all I tried to print a different PDF file both with "lpr" and with KGhostView and

I succeded. At this point I thought "let's go back to the old PDF" and succeded

in printing it both with "lpr" and KGhostView.

The first question I'd like to have an answer for is:

why I couldn't print that file some days ago and I can print it now?

I thought I was dreaming and I tried again printing this blasted file. This time the

printer started printing but stopped after a while with the LED flashing (at a higher

frequency than when it boots). I rebooted the printer (by unplugging it) and I tried

and tried and tried but I've got always the same result: the printer starts and

after a couple of lines it stops with the LED flashing quickly.

This is what I get with lpstat:

```

root@xam $ lpstat -t

scheduler is running

system default destination: hpdjet3940

device for hpdjet3940: usb://3940?serial=CN57A1H48B048H

hpdjet3940 accepting requests since Jan 01 00:00

printer hpdjet3940 now printing hpdjet3940-21.  enabled since Jan 01 00:00

hpdjet3940-21           max              16384   Thu Nov  3 19:29:38 2005

```

Everything seems OK but the printer is dead.

Printing with HP Deskjet 3940 keeps being a mistery...

Regards,

Lobster

----------

## another_lobster

I'm sorry, this is my third post...

I'm getting crazy, today the problem is:

```
max@xam $ lpstat -t

scheduler is running

system default destination: hpdjet3940

device for hpdjet3940: usb://3940?serial=CN57A1H48B048H

hpdjet3940 accepting requests since Jan 01 00:00

printer hpdjet3940 now printing hpdjet3940-26.  enabled since Jan 01 00:00

        USB printer is busy; will retry in 5 seconds...

hpdjet3940-26           root             20480   Fri Nov  4 18:28:30 2005
```

Obviously, the printer is not busy at all: it is not printing and it's LED is on

without flashing.

I can't understand why printig must be so difficult. Most of all, I can't understand  why

everiday I've got a different problem. Now the blame seems to be on USB side.

tomorrow it will probably be something like "IRQ conflict between printer and washing

machine".

How could you print so easily using HP deskjet 3940?

PLEASE HELP!

Regards,

Lobster

----------

