It’s nice to have a little home-server like the Seagate Dockstar or the Buffalo Linkstation running debian quite smoothly. What do you do if you would like to use your printer and scanner with more than one device?

Yes, you connect it to your server and share it over the network! Because I had to set this up in two locations for now I decided to write down those steps I took from powering on the printer through printing the first testpage I can scan later on.

This HowTo requires debian squeeze installed on your Dockstar/Linkstation. If you haven’t done this yet, please refer to other articles in this blog.

1. Printserver

1.1 CUPS

First of all we install cups, a powerful, web based printermanager:

apt-get install cups

Make the frontend accessible:

vim /etc/cups/cupsd.conf
#Listen localhost:631 # comment these two lines
#Listen /var/run/cups/cups.sock

# Allow remote access
Port 631

There are some lines in the config you may want to edit, not to require logins:

<location></location>
  Order allow,deny
  Allow 192.168.0.0/24
<location></location>

<location /admin>
  Order allow,deny
  Allow 192.168.0.0/24
</location>

<location /admin/conf>
  #AuthType Default
  #Require user @SYSTEM
  Order allow,deny
  Allow 192.168.0.0/24
</location>

After restarting cups you should be able to login the web interface on http://dockstar:631.

1.2 HPLIP

In my case I have an ALL-IN-ONE Device from HP. I tested this HowTo with a psc-1310-series and a Photosmart C4100. To get our printer ready to print we need hplip:

apt-get install hplip

Once it is installed, there is a tool for adding printers:

hp-setup -i # interactive mode (no GUI)

Just follow the instructions and you will have your printer installed properly. If you now look into CUPS you should be able to print a testpage with the newly installed printer.

1.3 Install the shared printer in Windows

To install the printer go to Control Panel, Devices and Printers and click Add a printer:

Click Add a network, wireless or Bluetooth printer:

Then click The printer that I want isn’t listed:

Select the second radio button and fill in the correct URL for your printer in CUPS:

In the following steps you have to select and install the correct driver which fits to your device. When you are ready test the whole setup with another testpage from your windows machine.

2. Scanserver

2.1 Configure Sane-backend

When you install hplip the sane backends come with it as dependency (obviously we have to install the package), so we only need to install inetd in order to make sane accessible from the network:

apt-get install inetutils-inetd sane-utils

Add your network to saned.conf:

vim /etc/sane.d/saned.conf

Enable sane:

vim /etc/default/saned
# Set to yes to start saned
RUN=yes

Configure inetd:

vim /etc/inetd.conf
# add this line:
sane-port	stream	tcp	nowait	saned:saned	/usr/sbin/saned saned

Make sure enabled in /etc/services:

sane-port    6566/tcp    sane saned    # SANE network scanner daemon

Now restart the services:

service inetutils-inetd restart
service saned restart

Run these tests to check if sane sees your scanner:

sane-find-scanner
scanimage -L

2.2 Install sane-twain on the client

Go to http://sanetwain.ozuzo.net and download the newest version. Perform an installation as described.
Go and test the connection, scan your first image.

2.3 Troubleshoot

If you have problems with accessing the sane backends the usb-device probably doesn’t have the proper rights.
Try to modify them. In my case I had to chmod the device:

chmod 666 /proc/bus/usb/001/002 # find out yours

Examples for USB devices would be /dev/usbscanner or /dev/usb/scanner0, /proc/bus/usb/001/005 or /dev/bus/usb/001/005, parallel port scanners are connected for example to /dev/parport0.

3. References