WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Using xsane to network a scanner  (Read 13363 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Using xsane to network a scanner
« on: March 21, 2009, 07:59:30 AM »
You can use the xsane extension with hplip to share the scanner part of an hp all-in-one device over a local network - note that this will work with both linux and windows machines (the windows machines need xsane for windows, but the setup is the same).

Assuming a tinycore linux machine is the host - in my case this has an hp officejetg85 connected directly to a usb port.

Host Machine
-------------------
Add the following line to /etc/services:
Code: [Select]
sane-port 6566/tcp # SANE network scanner daemon
Add the following line to /etc/inetd.conf:
Code: [Select]
sane-port stream tcp nowait  root /usr/local/sbin/saned saned
Create/edit /etc/sane.d/dll.conf like this:
Code: [Select]
net
hpaio

Create/edit /etc/sane.d/net.conf like this:
Code: [Select]
localhost*this is not strictly neccessary, but is useful for testing purposes.

Create edit /etc/sane.d/saned.conf to allow a range of local network machines like this:
Code: [Select]
192.168.1.101
192.168.1.102
192.168.1.103
192.168.1.104

Finally start the inetd daemon like this:
Code: [Select]
$ sudo inetd
Client Machine
--------------------
Create/edit /etc/sane.d/net.conf like this:
Code: [Select]
192.168.1.100
hostmachinenetname
*use either the host ip address or the host machine network name, otherwise xsane will find two scanners (but both will work)

Create/edit /etc/sane.d/dll.conf like this:
Code: [Select]
net
hpaio

To test if things are set up properly on the host machine, you should see something like this from the host machine:
Code: [Select]
$ scanimage -L
device `net:localhost:hpaio:/usb/OfficeJet_G85?serial=SGG13E0C49VL' is a Hewlett-Packard OfficeJet_G85 all-in-one
device `hpaio:/usb/OfficeJet_G85?serial=SGG13E0C49VL' is a Hewlett-Packard OfficeJet_G85 all-in-one
*the first entry comes from having "localhost" in /etc/sane.d/net.conf and indicates that the host is setup correctly to network the scanner

Now xsane should find the scanner from a client machine  :)