# hpoj - HP OfficeJet - howto

## zion1459

I just installed hpoj and got my HP PSC 750 working.. I can now print and scan images in linux!  :Smile: 

however it took me a couple of hours... the packages needed to make the officejets work are masked and with good reason since they don't work without a doing a couple of tricks.. I just thought I'd post what I did to make my setup work (this is also included on http://hpoj.sourceforge.net in the docs... but reading this should be quicker  :Wink:  )

ok, now in your kenel make sure u have usb configured correctly and that u have usb printer support and usb scanner support as modules... just build the other usb support into the kernel (makes it easier).

first emerge xsane, sane-backends.... then emerge hpoj (which will need hpij emerged too.. u have to do this manually as this currently also is masked)

if u're using gentoo-sources as kernel u'll have to download a new printer.c from the hpoj website... simply follow the instructions in the readme to install it.

once that done u can now go setup CUPS  :Smile:  when selecting USB printer u will see your officeJet  :Very Happy:  sweeet!

now to the scanning part.

this took me a while to figure out... the funny thing is that scanning is properly installed already except for one thing... .

edit /etc/sane.d/dll.conf

and add "hpoj" to the list

now do a 

scanimage --list-devices 

and voila! ur scanner should show!  :Smile:  now u scan all u want using xsane's nice gui  :Smile: 

hope this helps other HP OfficeJet users  :Smile:  or at least saves them some time hehe.

regards zion1459

----------

## yatesco

my hp psc 2115 also works, although I figured it out before I read this post  :Wink: 

https://forums.gentoo.org/viewtopic.php?p=623267#623267

----------

## elyre_elan

I finally got my HP PSC 2210xi all-in-one to work for printing, scanning and photo card.  Thanks to everyone who has given their help and advice through the forums.  If anyone is interested, a most excellent document can be found at http://hpoj.sourceforge.net/doc.shtml.  

The following are my notes I keep in my little binder.  My brain can't remember anything for any length of time.   :Confused: 

HP PSC 2210xi all-in-one

References

See the docs under the appropriate driver.  Look at http://hpoj.sourceforge.net/doc.shtml

The look at the documentation listed under the driver that has been installed, i.e. hpoj-0.91.  This document also provides a wealth of troubleshooting tips!

Pertinent Files

/etc/sane.d/dll.conf ? sane backends configuration file.  Ensure hpoj is uncommented

/etc/cups/ppd/*.ppd ? cups ppd definition files

Devices

/dev/usb/lp0 ? the actual device location using devfsd

Kernel dependencies

usbcore

hotplug

usb-uhci or usb-ohci

usb-storage

Gentoo dependencies

cups

hpijs

hpoj

ghostscript

sane-backends

sane-frontends

xsane

Steps

1)Ensure the kernel and gentoo dependencies are met by compiling the kernel with the options listed and emerging the above items.

2)Run 

```
ptal-init setup
```

  This will establish your device.  Follow the instructions.

3)Enter 

```
rc-update add hpoj default
```

4)Test connectivity by entering the following:  

```
ptal-devid mlc:usb:PSC_2200_Series
```

. You should see a display that prints out information regarding the device.

5)Restart CUPS- 

```
/etc/init.d/cupsd restart
```

 or 

```
killall -HUP /usr/sbin/cupsd
```

6)Enter the CUPS web interface http://127.0.0.1:631.

7)Add printer by doing the following:

a)  Click on printers

b)  Click on the button <Add printer>

c)  Enter the name such as hp_psc_2210xi_all-in-one

d)  location and description are optional.  Click continue.

e)  For device, look under the PTAL descriptor and select that one.  Click continue.

f)  Select HP for make and click continue

g) Select <HP NewDeskjet Series CUPS v1.1 (en)>.  Click continue.  Then select printers and choose the printer just established and print a test page.

8)Enter the file /etc/sane.d/dll.conf and ensure that the line <hpoj> is uncommented.

9)At this point, check to see if SANE can find the device.  From the command line enter 

```
scanimage -L
```

  If it finds the device, GREAT!.  If not, try unplugging the scanner, wait ten seconds and plug it back in.  This is necessary if the scanner was previously connected to a windows box.

10)Now test the scanner by entering 

```
scanimage --test
```

.  It should provide some feedback giving us a warm and fuzzy.

11)Now try xsane as a non-root user.  Use the test page that you got from testing the printer to see if it will scan.

12)You may need to change the date.  Try 

```
xojpanel
```

 from the command line to see what is displayed.  Then enter 

```
ptal-hp clock -set
```

.  Give it a minute and you should see the clock change.  This is really important before reading from the media card below.  

13)Finally, the HP psc 2210xi supports reading directly from a media card.   Mount the card by entering as root on the command line:  

```
mount -t vfat /dev/sda1 /mnt/photo
```

.  It may take a couple of tries for this to work.  Note that your sda number may be different if you have other usb mass storage devices loaded. Once it does, voila!, you can read from the card!

14)NOTE:  For some reason, even if the date is set correctly on the printer, the date of my mount point is 1969 and permissions are only allowed for root.  Even if I touch the directory at that point, it still will not chmod correctly.  When umount is invoked, the underlying directory is referenced correctly.  If anyone has a cure for this problem, let me know...

Hopefully, this helps someone.     :Cool: 

----------

## ian!

Moved to 'Documentation, Tips & Tricks'.

----------

## smukec

I'm having problems scanning.

The printer works correctly.

sane-find-scanner finds the device, xojpanel also works. But scanimage not. 

See output:

```
root # sane-find-scanner

 

  # No SCSI scanners found. If you expected something different, make sure that

  # you have loaded a SCSI driver for your SCSI adapter.

 

found USB scanner (vendor=0x03f0 [Hewlett-Packard], product=0x2811 [PSC 2100 Series]) at libusb:002:003

  # Your USB scanner was (probably) detected. It may or may not be supported by

  # SANE. Try scanimage -L and read the backend's manpage.

 

  # Scanners connected to the parallel port or other proprietary ports can't be

  # detected by this program.

```

```
root # scanimage -L

No scanners were identified. If you were expecting something different,

check that the scanner is plugged in, turned on and detected by the

sane-find-scanner tool (if appropriate). Please read the documentation

which came with this software (README, FAQ, manpages).

```

While unpluging/pluging the USB the following came out:

```
ptal-mlcd: ERROR at ExMgr.cpp:3165, dev=<mlc:usb:PSC_2100_Series@/dev/usb/lp0>, pid=3356, e=19, t=1081342790

llioSubprocess: llioWrite returns -1, expected=6!

 

ptal-mlcd: ERROR at ExMgr.cpp:2820, dev=<mlc:usb:PSC_2100_Series@/dev/usb/lp0>, pid=3349, e=11, t=1081342790

llioService: fdRead returns 0, expected=6!

 

ptal-mlcd: ERROR at ExMgr.cpp:871, dev=<mlc:usb:PSC_2100_Series@/dev/usb/lp0>, pid=3349, e=11, t=1081342790

exClose(reason=0x0010)

```

Any idea?

----------

## dmoulton

 *smukec wrote:*   

> I'm having problems scanning.
> 
> The printer works correctly.
> 
> 

 

This is an all-in-one device, right? I don't own this one but I have another HP all in one (6110xi). I had more or less this same problem.

Even though the printer is working, I would recommend running ptal-init setup again. Make sure you are using the ptal device for the printer. I found that until I did that, the only way I could make the scanner work was by uninstalling hpijs. This of course made the printer not work. I remember that  cups allowed me to use the printer via usb or ptal. Choosing ptal allowed both scanner and printer to function.

BTW, I still get a similar error :

```
ptal-mlcd: ERROR at ExMgr.cpp:3165, dev=<mlc:usb:PSC_2100_Series@/dev/usb/lp0>, pid=3356, e=19, t=1081342790

llioSubprocess: llioWrite returns -1, expected=6!
```

but things seem to work fine. If anyone knows what it is, I'd like to know too.

dm

----------

## koenvl

I just tried to install my PSC 1110 as described above but it won't work. Print jobs are moved to "completed jobs" without actually being printed and xsane doesn't find the scanner.

Maybe this will help :

```
koen@system koen $ ptal-devid mlc:usb:psc_1100_series

MFG:Hewlett-Packard;MDL:psc 1100 series;CMD:LDL,MLC,PML,DYN;CLS:PRINTER;1284.4DL:4d,4e,1;SN:MY39PF821DB0;S:0380008000820000002c1480061c2500055;
```

Can someone help me out here please?

Greetz,

Koen

----------

## smukec

I managed to print, but can't set printing quality. Not DPI, printing quality(Best, Normal, Fast Draft) as available on a comercial OS.

To work trough CUPS i had to start cups after ptal(see).

I'm not sure this will help you, because my print jobs were just waiting in queue and the printer was not detected("...not connected, retry in 30 seconds...")

Scanner still dead.

----------

## koenvl

Tnx! Ptal was being loaded before CUPS but I had to use the right PPD, that's all. It's a pity that one cannot print with the color cartridge and the B/W-cartridge at the same time 'though. There are 7 printout modes: draft color, draft grayscale, normal color, normal grayscale, high quality color, high quality grayscale and photo for printing on photo paper. I use the printer driver from http://www.linuxprinting.org/show_printer.cgi?recnum=HP-PSC_1110.

Scanning is still dead too.

Many thanks,

Koen

Correction: Okay, it is actually possible to use the two cartridges at the same time but it is quite slow even in 300 dpi.

----------

## smukec

Where can you set the print mode?

In the printer(HP PSC 2110) properties(in OpenOffice) I can set:

- Color/grayscale

- Postscript Level: dflt/1/2

- Color depth: 8/24

and additionaly on the properties list:

- Manual feed T/F

- Resolution 72...2400

But this seems to be generic settings for all printers the same.

----------

## koenvl

I use CUPS and setup my printout modes with CUPS' browser interface at http://127.0.0.1:631/. Go to 'printers' and click on 'configure printer'.

----------

## smukec

 *koenvl wrote:*   

> I use CUPS and setup my printout modes with CUPS' browser interface at http://127.0.0.1:631/. Go to 'printers' and click on 'configure printer'.

 

Ok, but this requires users to go to printers administration.

I was thinking about setting this within the print dialog.

----------

## koenvl

 *smukec wrote:*   

>  *koenvl wrote:*   I use CUPS and setup my printout modes with CUPS' browser interface at http://127.0.0.1:631/. Go to 'printers' and click on 'configure printer'. 
> 
> Ok, but this requires users to go to printers administration.
> 
> I was thinking about setting this within the print dialog.

 

I've setup my printer different times in CUPS with different configurations (BW, BW draft, color, color draft). I gave them obvious names and descriptions. Then I can select the print modus of my choice in the print dialog. I know it's a simple workaround but I haven't looked any futher yet.

Hope it helps

The scanner part still does not work. I get exactly the same error as smukec earlier. sane-find-scanner finds the device but scanimage not. Does anyone know something about this problem. Maybe this extra info will ring a bell for some. Hope so anywayz!

```
root@system koen # scanimage -d hpoj:mlc:usb:psc_1100_series --test

scanimage: open of device hpoj:mlc:usb:psc_1100_series failed: Device busy
```

greetz,

Koen

----------

## derk

you may have to try .. hpoj-cvs see Hp's hpoj website on how to access.

----------

## freebaseh

scanning works perfecly but printing i cant get to work when i browse cups interface i get ptal-mlcd: ERROR at ExMgr.cpp:2525, dev=<mlc:usb:psc_1200_series>, pid=10652, e=11, t=1085515885

Couldn't find device!

i have no real idea why it shows like that

----------

## derk

check the order that hpoj and cupsd are started .. if hpoj starts after cupsd then cupsd can not find the device node .. a simple restart of the cupsd daemon "/etc/init.d/cupsd restart" should allow you to print if that is the case.

.. also try rerunning the ptal-init setup script to check if recent changes/updates have taken effect.  Although if scanning works that is probably not the problem.

How are you browsing cups? With it's web interface or some other tool such as the kde printmanager? 

Make sure you've installed the PPD files when installing hpijs/cups/foomatic by setting the USE="ppds" flag in /etc/make.conf before compiling.

----------

## bouriquo

Hi

I want now, if I must install also hpoj for my PSC 2110 for scanning with xsane or, if the driver hpijs that I had installed before can work also

Thanks

----------

## derk

to Bouriquo the answer is yes they will work together

----------

## heeckhau

The same approach also works for the HP laserjet 3020 (http://users.pandora.be/EuphonicWizard/gentoo/)

----------

## EDinATL

Scanning and Printing works great on VMWare no less!  Using latest hpoj, sane and whatever is the current cups.  Only thing I wish I could get working is the Point and Print functionality, as I tried packaging the drivers using the method found in cups documentation and got heavily burnt out after many unsuccessful attempts at it.  

Still stuck at that point, but printing through samba works great when I tell windows it's a deskjet 990c.  

Thank god I don't have to stay stuck in windows for scanning though.

----------

## nitroburn

thanks for the help! got my officejet 5510 working! I love it! Print, scan, fax, copy!!! muhahahahahahahahahahahahahahaha

I love you guys!!!  :Very Happy: 

----------

## chrisdupre

nitroburn,

Could you please explain how you got this to work "exactly".  I'm new to Gentoo Linux and I'm thinking of getting this all-in-one (HP 5510) at Circuit City.  Just tell me what to compile or modularize in the kernel and some steps please.

                                                                              Thanks nitroburn,

                                                                              Chris Dupre'      :Mr. Green: 

----------

## Rainmaker

I got a officejet via a jetdirect pro box... How can I get scanning working? Printing works fine, but with cups, I don't have a officeject driver... Am I missing something here?

----------

## crazy-bee

Cheers! Gentoo forums do rule  :Smile: 

edit /etc/sane.d/dll.conf

and add "hpoj" to the list 

saved my day after I went almost mad  :Smile: 

----------

## Moeller

smukec wrote: *Quote:*   

> ptal-mlcd: ERROR at ExMgr.cpp:3165, dev=<mlc:usb:PSC_2100_Series@/dev/usb/lp0>, pid=3356, e=19, t=1081342790 
> 
>  llioSubprocess: llioWrite returns -1, expected=6! 

 

Had the same problem. Solved it by removeing everything in the /etc /sane.d/dll.conf except hpoj.

----------

## nadamsieee

hello,

I had a working install for my hp pcs 1201xi all-in-one until I upgraded my kernel to version 2.6.9 from 2.4.x. I can print from CUPS, but the scanner is not detected. What are the kernel dependencies for this to work?

Here is what happens when I try to add the scanner (I deleted it earlier):

```
# ptal-init setup

Stopping the HP OfficeJet Linux driver.

----------------------------------------------------------------------

This program manages devices controlled by the HP OfficeJet Linux

driver (hpoj).  It attempts to probe your computer for local parallel-

and USB-connected devices, and allows you to specify network addresses

for remote JetDirect-connected devices.

If you experience any difficulties in detecting your device(s), then

refer to the hpoj documentation for troubleshooting information.

----------------------------------------------------------------------

Currently defined device names ([*]=default):

    (none)

----------------------------------------------------------------------

Probe for parallel-connected devices ([y]/n)?  n

----------------------------------------------------------------------

Probe for USB-connected devices ([y]/n)?  y

Probing "/dev/usblp0"...

    No device found.

Probing "/dev/lp0"...

    No device found.

----------------------------------------------------------------------

Press <Enter> alone to continue, or if you would like to add a

JetDirect-connected device, then enter its dotted-decimal

IP address or hostname here --->

----------------------------------------------------------------------

Done updating device configuration files stored under /etc/ptal.

If you make manual changes to those files, then be sure to run

"/usr/sbin/ptal-init start" so they will take effect.

----------------------------------------------------------------------

Starting the HP OfficeJet Linux driver.

    No hpoj devices have been configured.

    As root, run "/usr/sbin/ptal-init setup".
```

----------

## nadamsieee

OK, the problem was that I had both uhci-hcd and ohci-hcd compiled as modules, but my particular motherboard only need the uhci-hcd module. After I modprobed uhci-hcd, all of my usb stuff started working again.

----------

## Shiven

sweet! thanks guys!

i've been trying to set my scanner up for probably three months now, but could never get it to display under scanimage -L, currently undergoing a reinstall on my desktop so i'll try this out later!

----------

## soulfire

i followed the howto and the tips given in the thread but i still can't get my  psc2510 working   :Sad:   :Sad: 

when i run

```
# ptal-init setup
```

the result is 

```
Starting the HP OfficeJet Linux driver.

    No hpoj devices have been configured.
```

the device is correctly recognized, infact 

```
#dmesg

....

usb 4-1: new full speed USB device using address 3

drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 3 if 1 alt 0 proto 2 vid 0x03F0 pid 0x3711

scsi1 : SCSI emulation for USB Mass Storage devices

  Vendor: HP        Model: psc 2510          Rev: 1.00

  Type:   Direct-Access                      ANSI SCSI revision: 02

Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi1, channel 0, id 0, lun 0,  type 0

USB Mass Storage device found at 3
```

any suggestion ?

----------

## greap

If you're using an HP PSC1210 or somthing similar, and none of the

above tips have worked so far...

Here's something to keep in mind.

Make sure you have the 'usb' use-flag in your make.conf before you

emerge hpoj! Oh, and once it finishes emerging get ready to hit the

cancel button on your printer once for each time you tried to print

and it failed.

>.> (I've got a sore finger now)

----------

## soulfire

the usb flag is set , and i recompiled hpoj at least 5 times without succeeding in making my printer/scanner work    :Sad:   :Sad: 

----------

## coutts99

 *greap wrote:*   

> If you're using an HP PSC1210 or somthing similar, and none of the
> 
> above tips have worked so far...
> 
> Here's something to keep in mind.
> ...

 

i see what you mean about pressing cancel!!

----------

## beastmaster

For those who get this new error https://bugs.gentoo.org/show_bug.cgi?id=77346

```

ptal-mlcd: error while loading shared libraries: libusb-0.1.so.4: cannot open shared object file: No such file or directory

hpoj not compiled for parallel-port support; skipping parallel device probe.

```

Somehow the library naming is changed after some system upgrade.

A temperary solution:

```

cd /usr/lib/

ln -s libusb-0.1.4.4.0 libusb-0.1.so.4

```

 :Rolling Eyes: 

Hope it helps..

----------

