# [SOLVED] SANE client can no longer see my networked scanner

## m27315

Previously, I was able to scan from my HP Photosmart 7520 over my network using SANE (XSANE), GIMP, and hplip.  However, a few months ago, something got upgraded or changed, and now I can no longer scan.  Whenever I use Gimp (File > Create > XSane: Device Dialog..), it comes back almost immediate after "scanning for devices", complaining:

```
no devices available
```

I have tried to follow this guide:  https://wiki.gentoo.org/wiki/HPLIP.

And, everything seems to be fine.

How can I troubleshoot this?  Has anybody else had this problem?

Thanks!Last edited by m27315 on Tue Nov 24, 2015 6:17 pm; edited 2 times in total

----------

## bbgermany

Hi,

are you running saned via xinetd or as standalone service? I had a similiar issue as i was running it via xinetd. As soon as i switched back to standalone service, i was able to use my hp deskjet scanner/printer combination again.

greets, bb

----------

## ian.au

 *m27315 wrote:*   

> Previously, I was able to scan from my HP Photosmart 7520 over my network using SANE (XSANE), GIMP, and hplip.  However, a few months ago, something got upgraded or changed, and now I can no longer scan.  Whenever I use Gimp (File > Create > XSane: Device Dialog..), it comes back almost immediate after "scanning for devices", complaining:
> 
> ```
> no devices available
> ```
> ...

 

I had this problem with a brother mfc, after a sane update - no devices. In that case the backend file got nuked from 

```
/etc/sane.d/dll.conf
```

For HP scanners the backend is hpaio so if 

```
grep hpaio /etc/sane.d/dll.conf
```

 returns nothing, you could try adding it back. That worked for me.

----------

## m27315

 *bbgermany wrote:*   

> are you running saned via xinetd or as standalone service? I had a similiar issue as i was running it via xinetd. As soon as i switched back to standalone service, i was able to use my hp deskjet scanner/printer combination again.

 

Actually, I did not have either one running.    :Shocked:   I started saned, but it did not make any difference.  I still get the same error message almost immediately - "no devices found". ... Is saned required for networked scanners?

 *ian.au wrote:*   

> I had this problem with a brother mfc, after a sane update - no devices. In that case the backend file got nuked from 
> 
> ```
> /etc/sane.d/dll.conf
> ```
> ...

 

It is still listed, so I think that's ok.

```
$ grep hp /etc/sane.d/dll.conf

31:hp

32:hp3900

33:hpsj5s

34:hp3500

35:hp4200

36:hp5400

37:hp5590

38:hpljm1005

88:# Add support for the HP-specific backend.  Needs net-print/hplip installed.

89:hpaio
```

Thanks for the suggestions, both of you.  I appreciate the help very much.

Any other suggestions?

----------

## bbgermany

Hi,

i think i misunderstood you a bit. You should check your /etc/sane.d/net.conf if your device is listed via ip or dns-name there. IIRC this file is used if you want to connect to a network scanner as client  :Wink: 

greets bb

----------

## m27315

 *bbgermany wrote:*   

> i think i misunderstood you a bit. You should check your /etc/sane.d/net.conf if your device is listed via ip or dns-name there. IIRC this file is used if you want to connect to a network scanner as client 

 

Thanks for the tip.  I had already found that one via Google, and I added my ip:

```
$ cat /etc/sane.d/net.conf

192.168.0.11
```

Am I missing something?  Is there a special format maybe?  I haven't been able to find any examples, except of people using either hostnames or IP addresses directly.

Thanks!

----------

## m27315

What relevant packages do you two have installed with use flags?  I have:

```
$ emerge -pvt cups xsane sane-backends hplip avahi 

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!

[ebuild   R    ] net-print/hplip-3.14.10::gentoo  USE="X fax hpcups kde libnotify (policykit) qt4 scanner snmp static-ppds -doc -hpijs -libusb0 -minimal -parport" PYTHON_TARGETS="python2_7" 0 KiB

[ebuild   R    ]  media-gfx/xsane-0.999-r1::gentoo  USE="gimp jpeg lcms nls ocr png tiff" 0 KiB

[ebuild   R    ]   media-gfx/sane-backends-1.0.24-r5::gentoo  USE="avahi ipv6 snmp threads usb -doc -gphoto2 -systemd -v4l -xinetd" ABI_X86="32 (64) (-x32)" SANE_BACKENDS="hp net -abaton -agfafocus -apple -artec -artec_eplus48u -as6e -avision -bh -canon -canon630u -canon_dr -canon_pp -cardscan -coolscan -coolscan2 -coolscan3 -dc210 -dc240 -dc25 -dell1600n_net -dmc -epjitsu -epson -epson2 -fujitsu -genesys -gt68xx -hp3500 -hp3900 -hp4200 -hp5400 -hp5590 -hpljm1005 -hpsj5s -hs2p -ibm -kodak -kodakaio -kvs1025 -kvs20xx -kvs40xx -leo -lexmark -ma1509 -magicolor -matsushita -microtek -microtek2 -mustek -mustek_pp -mustek_usb -mustek_usb2 -nec -niash -p5 -pie -pixma -plustek -plustek_pp -pnm -qcam -ricoh -rts8891 -s9036 -sceptre -sharp -sm3600 -sm3840 -snapscan -sp15c -st400 -stv680 -tamarack -teco1 -teco2 -teco3 {-test} -u12 -umax -umax1220u -umax_pp -xerox_mfp" 0 KiB

[ebuild   R    ]    net-dns/avahi-0.6.31-r10::gentoo  USE="dbus gdbm gtk introspection ipv6 nls qt4 -autoipd -bookmarks -doc -gtk3 -howl-compat -mdnsresponder-compat -mono -python (-selinux) {-test} -utils" ABI_X86="32 (64) (-x32)" PYTHON_TARGETS="python2_7" 0 KiB

[ebuild   R    ]  net-print/cups-2.0.3::gentoo  USE="X acl dbus pam ssl threads usb -debug -java -kerberos -lprng-compat -python (-selinux) -static-libs -systemd -xinetd -zeroconf" ABI_X86="32 (64) (-x32)" LINGUAS="ca cs de es fr it ja pt_BR ru" PYTHON_TARGETS="python2_7" 0 KiB

Total: 5 packages (5 reinstalls), Size of downloads: 0 KiB
```

Do you have anything different?

----------

## bbgermany

Hi,

i dont have a real network based scanner/printer. I have a HP Deskjet 1050A AIO system which is connected via usb to a cubietruck. I have sane-backends-1.0.25 installed with the useflags for net and hp systems. I share the scanner with Windows machines and linux machines. i havent looked into the linux system fully, but i think the backend for net should be enough.

bb

----------

## m27315

 *bbgermany wrote:*   

> i dont have a real network based scanner/printer. I have a HP Deskjet 1050A AIO system which is connected via usb to a cubietruck. I have sane-backends-1.0.25 installed with the useflags for net and hp systems. I share the scanner with Windows machines and linux machines. i havent looked into the linux system fully, but i think the backend for net should be enough.

 

Ok, thanks! ... How do you like the cubietruck? ... I also had to fire up my Windows VM to get some scanning done.    :Sad: 

----------

## m27315

Thanks to bbgermany and ian.au for all the help!    :Smile: 

Short Answer:

In addition to other requirements, the CUPS print URI must match a specific format; otherwise, the printer will be unrecognized.  My new, working printer.conf looks like:

```
$ cat /etc/cups/printers.conf

# Printer configuration file for CUPS v2.0.3

# Written by cupsd on 2015-11-24 11:50

# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING

<Printer HP_Photosmart_7520_series>

UUID urn:uuid:112e87a4-b284-33f3-4ea3-4748f44fd861

Info HP Photosmart 7520 series

Location Office

DeviceURI hp:/net/Photosmart_7520_series?ip=192.168.0.11

State Stopped

StateMessage Rendering completed

StateTime 1448380948

Reason paused

Type 4

Accepting Yes

Shared No

JobSheets none none

QuotaPeriod 0

PageLimit 0

KLimit 0

OpPolicy default

ErrorPolicy stop-printer

</Printer>
```

The DeviceURI is the critical line for this case.

```
DeviceURI hp:/net/Photosmart_7520_series?ip=192.168.0.11
```

Previously, I had:

```
DeviceURI hp:/net/HP_Photosmart_7520_series?ip=192.168.0.11
```

Which was auto-generated and did NOT work.

Troubleshooting:

This pointed me in the right direction:

```
$ hp-check -t

...

HP Linux Imaging and Printing System (ver. 3.14.10)

Dependency/Version Check Utility ver. 15.1

...

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

|  Scan Configuration |

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

 hpaio                HPLIP-SANE-Backend        REQUIRED        -               3.14.10         OK         'hpaio found in /etc/sane.d/dll.conf'

 scanext              Scan-SANE-Extension       REQUIRED        -               3.14.10         OK         -

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

| DISCOVERED SCANNER DEVICES |

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

No Scanner found.

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

| DISCOVERED USB DEVICES |

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

No devices found.

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

| INSTALLED CUPS PRINTER QUEUES |

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

Photosmart_7520_series

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

Type: Printer

Device URI: hp:/net/HP_Photosmart_7520_series?ip=192.168.0.11

error: Unsupported model: HP_Photosmart_7520_series

error: Communication status: Failed
```

Also, this post suggests that the connection method (hp vs socket) is critical:

http://lists.alioth.debian.org/pipermail/sane-devel/2009-February/024117.html

So, I played with variations of the printer name that I had seen in various auto-detection results, restarting cups after each change, and testing with "scanimage -L" until it was found.

Now, the checking tool reports:

```
$ hp-check -t

...

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

|  Scan Configuration |

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

 hpaio                HPLIP-SANE-Backend        REQUIRED        -               3.14.10         OK         'hpaio found in /etc/sane.d/dll.conf'

 scanext              Scan-SANE-Extension       REQUIRED        -               3.14.10         OK         -

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

| DISCOVERED SCANNER DEVICES |

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

device `hpaio:/net/Photosmart_7520_series?ip=192.168.0.11' is a Hewlett-Packard Photosmart_7520_series all-in-one

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

| DISCOVERED USB DEVICES |

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

No devices found.

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

| INSTALLED CUPS PRINTER QUEUES |

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

HP_Photosmart_7520_series

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

Type: Printer

Device URI: hp:/net/Photosmart_7520_series?ip=192.168.0.11

PPD: /etc/cups/ppd/HP_Photosmart_7520_series.ppd

PPD Description: HP Photosmart 7520 Series, hpcups 3.14.10

Printer Rendering completedPhotosmart_7520_series disabled since Tue 24 Nov 2015 10:02:28 AM CST -

Communication status: Good

...
```

And, scanimage reports:

```
$ scanimage -L

device `hpaio:/net/Photosmart_7520_series?ip=192.168.0.11' is a Hewlett-Packard Photosmart_7520_series all-in-one
```

Other Requirements and Facets:

Here are the contents of other configuration files, which may be helpful.  (Incidentally, I do not know which are absolutely required, because I did not test all of these exhaustively.)

```
$ cat /etc/portage/make.conf

...

SANE_BACKENDS="hp net"

...

```

You must rebuild sane-backends, if you modify the above setting.

```
$ cat /etc/sane.d/dll.conf

# enable the next line if you want to allow access through the network:

net

hp

# Add support for the HP-specific backend.  Needs net-print/hplip installed.

hpaio
```

I trimmed the above file, so that sane did not try to load every conceivable plug-in under the sun.  The above is all that is required for the HP Photosmart 7520.

```
 cat /etc/sane.d/net.conf

# This is the net backend config file.

## net backend options

# Timeout for the initial connection to saned. This will prevent the backend

# from blocking for several minutes trying to connect to an unresponsive

# saned host (network outage, host down, ...). Value in seconds.

# connect_timeout = 60

## saned hosts

# Each line names a host to attach to.

# If you list "localhost" then your backends can be accessed either

# directly or through the net backend.  Going through the net backend

# may be necessary to access devices that need special privileges.

# localhost

192.168.0.11
```

Replace with the IP address of your remote networked scanner.

```
$ emerge -pvt xsane sane-backends hplip cups

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!

[ebuild   R    ] net-print/hplip-3.14.10::gentoo  USE="X fax hpcups kde libnotify (policykit) qt4 scanner snmp static-ppds -doc -hpijs -libusb0 -minimal -parport" PYTHON_TARGETS="python2_7" 0 KiB

[ebuild   R    ]  net-print/cups-2.0.3::gentoo  USE="X acl dbus pam ssl threads usb -debug -java -kerberos -lprng-compat -python (-selinux) -static-libs -systemd -xinetd -zeroconf" ABI_X86="32 (64) (-x32)" LINGUAS="ca cs de es fr it ja pt_BR ru" PYTHON_TARGETS="python2_7" 0 KiB

[ebuild   R    ]  media-gfx/xsane-0.999-r1::gentoo  USE="gimp jpeg lcms nls ocr png tiff" 0 KiB

[ebuild   R    ]   media-gfx/sane-backends-1.0.24-r5::gentoo  USE="avahi ipv6 snmp threads usb -doc -gphoto2 -systemd -v4l -xinetd" ABI_X86="32 (64) (-x32)" SANE_BACKENDS="hp net -abaton -agfafocus -apple -artec -artec_eplus48u -as6e -avision -bh -canon -canon630u -canon_dr -canon_pp -cardscan -coolscan -coolscan2 -coolscan3 -dc210 -dc240 -dc25 -dell1600n_net -dmc -epjitsu -epson -epson2 -fujitsu -genesys -gt68xx -hp3500 -hp3900 -hp4200 -hp5400 -hp5590 -hpljm1005 -hpsj5s -hs2p -ibm -kodak -kodakaio -kvs1025 -kvs20xx -kvs40xx -leo -lexmark -ma1509 -magicolor -matsushita -microtek -microtek2 -mustek -mustek_pp -mustek_usb -mustek_usb2 -nec -niash -p5 -pie -pixma -plustek -plustek_pp -pnm -qcam -ricoh -rts8891 -s9036 -sceptre -sharp -sm3600 -sm3840 -snapscan -sp15c -st400 -stv680 -tamarack -teco1 -teco2 -teco3 {-test} -u12 -umax -umax1220u -umax_pp -xerox_mfp" 0 KiB

Total: 4 packages (4 reinstalls), Size of downloads: 0 KiB
```

The versions and use flags for the relevant packages, which works for me.  Here are portage configs for me:

```
$ cat /etc/portage/package.use/use.use

...

media-gfx/xsane gimp ocr

media-gfx/sane-backends snmp avahi

net-print/hplip fax scanner snmp static-ppds
```

Conclusion:

Thanks again for all the help!  I'm thankful this is fixed.  Now that my OCD has been soothed, I can return to my normal life.   :Wink: 

----------

## Frautoincnam

 *bbgermany wrote:*   

> are you running saned via xinetd or as standalone service? I had a similiar issue as i was running it via xinetd. As soon as i switched back to standalone service, i was able to use my hp deskjet scanner/printer combination again.

 

Same problem for me today with "HP Deskjet  1050 J410 series".

Never could scan with saned via xinetd, and worked when switched to saned service (openrc).

----------

