Networked scanner and Mac OS X

HP Officejet 3330In the corner of my home office, there sits an HP OfficeJet 3330. I’m rather fond of this beast – it has provided us with a copier, scanner, fax and laser printer (albeit b&w) at home for a very reasonable price, and has never given us any trouble. There’s a JetDirect box stuck to the back so that it’s on the network and we can print to it from any machine in the house.

As an aside – I never realised just how useful having a copier at home could be until I got one. Here’s an example: I occasionally like going for longish walks around the Cambridgeshire countryside on Sunday afternoons. I used to stuff a guide book in one pocket and an Ordnance Survey map in another. Now, I just photocopy a couple of pages and the relevant bit of the map. Much easier to deal with in rain or a high wind…

Anyway – the HP software is laughably bad, but we normally only need the printer driver which works just fine. Occasionally, though, I need to scan things. I forget whether there was no HP Mac software which worked with networked scanners, or whether it was so bad that I abandoned it, but for years I’ve been using the web interface to do any scanning. Not very flexible or convenient, but it worked.

Today, however, Dave Hill showed me a much better way, albeit rather more complex to set up. Those who are unlikely to want to try this should probably move on to John’s blog at this point!

Can you do this and keep sane?

Basically, you use the Open Source SANE project, which supports a wide range of scanners connected in a variety of ways, and you combine it with Mattias Ellert’s excellent TWAIN SANE Interface for Mac OS X, which can make SANE-connected scanners appear as TWAIN devices – the standard that most programs expect when talking to scanners.

You can do this all on the Mac itself, though I followed Dave’s setup and used a Linux machine to provide the SANE service, which then allowed software on the Linux machines as well as on the Macs to make use of the scanner. I won’t go into full details here – you can find out more from the links above – but the basics for my system are:

  • The Linux machine connects to the OfficeJet over the network using the hpoj driver

    Install sane and saned on the Linux box. In the unlikely event that your Linux distribution doesn’t include it or offer a convenient package to install it, you can try the SANE project site. Make sure that hpoj is listed in /etc/sane.d/dll.conf. If that’s the only scanner you want to contact, you can comment out everything else. You’ll need to do something to register your particular scanner device; on my Ubuntu machine this involved running /etc/init.d/hpoj setup and entering the IP address. The scanner should now be available to Linux software; try running scanimage -L and you should see it listed. The HPLIP project may provide an alternative to HPOJ if wanted.

  • The Linux machine shares it on the network using the SANE daemon saned.

    Edit /etc/sane.d/saned.conf and specify that machines on your network will be allowed to connect via SANE – the easiest way is just to put in a line containg a plus (+), which allows everybody. You need to make sure saned is running, typically by starting it from inetd as described in the man page for saned.

  • The Mac SANE backend is configured to connect to the Linux machine, where it can discover the shared scanners.

    Mattias has a page where you can download the SANE backend for the Mac and the TWAIN SANE interface as convenient packages. You need to edit dll.conf here as you did on the Linux box to tell the Mac where to look for scanners – of you’re using Mattias’s packages, it lives in /usr/local/etc. In this case the only line you need to have uncommented is ‘net’. Edit net.conf and put in the name or IP address of your Linux box.

    You may also need to make sure that saned can be automatically run by editing /etc/services and /etc/inetd.conf, as you did on the Linux box..

  • The TWAIN SANE interface makes this available to Photoshop, Image Capture, Acrobat etc.

This sounds pretty convoluted, but it’s not too hard, and it all works fine. You can also use the Linux box to share non-networked USB or parallel port scanners, and convert them into networked ones.

If you want to do it all on the Mac without an intervening Linux machine, you’ll need to find (or compile) a copy of the HPOJ driver for the Mac.

Enjoyed this post? Why not sign up to receive Status-Q in your inbox?

7 Comments

You don’t need to run “saned” on the OSX machine, only on the Linux machine. SANE on OSX will consult the dll.conf file, find it is using the “net” backend, then consult the “net.conf” file to find the machine(s) to poll for saned service.

Any idea if this will work on an all-in-one scanner shared via an airport express?

MrWynn –

I have no idea, but I rather suspect not, sadly. I don’t *think* the airport express implements anything that would export a scanner interface, but I may be wrong…

Not sure where you are, but there are some very good bargains on JetDirect adapters on eBay here in the UK. (I’m assuming you’ve got an HP…)

Any advice or direction you could provide us for how to set this up on a Mac without a networked LINUX box? The TWAIN SANE Interface for Mac OS X installed beautifully, but no drivers for the HP 3030 and HP doesn’t make a HPLIP distribution for Mac. Instead I have to use the HP software to scan instead of working in ImageCapture, PhotoShop, GIMP, etc.

Thanks in advance for any help.

I set this up and it worked nicely, though the process of scanning is a bit slow. This is fine if you are occassionally scanning in a document here or there, but may not be ideal if you are scanning a large number of documents on a regular basis.

Can you recommend an application for scanning to PDF that takes advantage of the 3330’s automatic document feeder for scanning?

Thanks,
Maverick

That’s really cool that this works with Officejets — I wonder what other networked scanners can work in Linux.

I haven’t been able to find ANY direction on setting up saned under OSX. I can get sane running, but the scanner is local and I want to share it…

Got Something To Say:

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

*

© Copyright Quentin Stafford-Fraser