Manual: Network scanning with HPLIP and Sane (HP all in one)

Questions that don't fit in any category below may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.

Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby WJST » Fri May 15, 2009 9:46 pm

Okay, so here it is, my manual to setup network scanning using Sane, HPLIP and DBus to be able to use (for instance) SaneTwain to scan from windows over the network or even internet.

I like comments on this, so leave a message if you like!

Basic needs:
You do need to use a HP All in one compatible with the HPLip package, see http://hplipopensource.com for more info on this.
I use the HP Photosmart C4200 All In One.

I started out with a fresh Synology DS207+ installation, only edited the smb.conf file with extra netbios support to get my mediaplayer to find it, but thats besides the point. You should have SSH conenction to your DS! I use the newest firmware for this, 844 in my case.



So; here we go.

First of all, we need to install the bootstrap to get IPKG working.
Pretty default, but if you don't know this; http://forum.synology.com/wiki/index.ph ... #Bootstrap

Next up, let's start installing:

"ipkg install sane-backends"

Code: Select all
WJNAS> ipkg install sane-backends
Installing sane-backends (1.0.20-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/sane-backends_1.0.20-1_arm.ipk
package sane-backends suggests installing xinetd
package sane-backends suggests installing inetutils
Installing libjpeg (6b-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/libjpeg_6b-2_arm.ipk
Installing libtiff (3.8.2-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/libtiff_3.8.2-1_arm.ipk
Installing zlib (1.2.3-3) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/zlib_1.2.3-3_arm.ipk
Installing libstdc++ (6.0.3-6) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/libstdc++_6.0.3-6_arm.ipk
Installing libusb (0.1.12-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/libusb_0.1.12-1_arm.ipk
Configuring libjpeg
Configuring libstdc++
Configuring libtiff
Configuring libusb
Configuring sane-backends

Adding sane-port to /etc/services...done.

sane-backends has been installed. To finish the installation, you should consider installing
either xinetd or inetd to make sane-backend running.

For inetd, add the following to /opt/etc/inetd.conf:
        sane-port  stream  tcp  nowait  root.root  /opt/sbin/saned saned

For xinetd, create a /opt/etc/xinet.d/saned file like:
{
        socket_type = stream
        server = /opt/sbin/saned
        protocol = tcp
        user = root
        group = root
        wait = no
        disable = no
}
Configuring zlib
Successfully terminated.
WJNAS>


Interesting:
For inetd, add the following to /opt/etc/inetd.conf:
sane-port stream tcp nowait root.root /opt/sbin/saned saned
Lets keep that in mind, but first things first.

"ipkg install dbus"

Code: Select all
WJNAS> ipkg install dbus
Installing dbus (1.1.1-3) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/dbus_1.1.1-3_arm.ipk
Installing expat (2.0.1-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/expat_2.0.1-1_arm.ipk
Installing adduser (1.10.3-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/adduser_1.10.3-1_arm.ipk
Configuring adduser
update-alternatives: Linking //opt/bin/su to /opt/bin/adduser-su
Configuring dbus
No messagebus user found, creating it... done
Configuring expat
Successfully terminated.
WJNAS>


Install python:

"ipkg install python"

Code: Select all
WJNAS> ipkg install python
Installing python (2.5-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/python_2.5-1_arm.ipk
Configuring python
Successfully terminated.
WJNAS>



Ok, cool, now, last up:

"ipkg install hplip"

Code: Select all
WJNAS> ipkg install hplip
Installing hplip (2.8.9-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/hplip_2.8.9-1_arm.ipk
package hplip suggests installing cups
Installing python25 (2.5.4-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/python25_2.5.4-1_arm.ipk
Installing readline (5.2-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/readline_5.2-2_arm.ipk
Installing bzip2 (1.0.5-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/bzip2_1.0.5-1_arm.ipk
Installing openssl (0.9.7m-5) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/openssl_0.9.7m-5_arm.ipk
Installing libdb (4.2.52-3) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/libdb_4.2.52-3_arm.ipk
Installing sqlite (3.6.13-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/sqlite_3.6.13-1_arm.ipk
Installing ncursesw (5.7-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/ncursesw_5.7-1_arm.ipk
Installing net-snmp (5.4.2.1-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/net-snmp_5.4.2.1-1_arm.ipk
    Configuration file '/opt/etc/sane.d/dll.conf'
    ==> File on system created by you or by a script.
    ==> File also in package provided by package maintainer.
       What would you like to do about it ?  Your options are:
        Y or I  : install the package maintainer's version
        N or O  : keep your currently-installed version
          D     : show the differences between the versions (if diff is installed)
     The default action is to keep your current version.
    *** dll.conf (Y/I/N/O/D) [default=N] ?y
Configuring bzip2
update-alternatives: Linking //opt/bin/bzip2 to /opt/bin/bzip2-bzip2
Configuring hplip
Configuring libdb
Configuring ncursesw
Configuring net-snmp
Configuring openssl
Configuring python25
Configuring readline
Configuring sqlite
Successfully terminated.
WJNAS>


At the prompt about dll.conf I give in Yes, this replaces the original sane dll.conf, which is filled with a lot of sane supported drivers with a dll.conf with only hpaio in it. I;ll check it further on, so don't worry at this point.

Now, lets see if the scanner can be found:
"sane-find-scanner"

It'll probably give you an error; install libieee1284 for this: ipkg install libieee1284, if all goed well, it should give something like:

Code: Select all
WJNAS> sane-find-scanner

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x03f0 [HP], product=0x5c11 [Photosmart C4200 series]) at libusb:001:004
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.


Looking good.

Last thing:

Install cups. I hear you thinking; that printing isn't it? Yeah, it is, but hplip needs it. Point.

ipkg install cups

Code: Select all
WJNAS> ipkg install cups
Installing cups (1.3.10-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/cups_1.3.10-1_arm.ipk
Installing libpng (1.2.36-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/libpng_1.2.36-1_arm.ipk
Installing openldap-libs (2.3.43-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/openldap-libs_2.3.43-1_arm.ipk
Installing gdbm (1.8.3-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/gdbm_1.8.3-2_arm.ipk
Installing cyrus-sasl-libs (2.1.22-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/cyrus-sasl-libs_2.1.22-2_arm.ipk
Configuring cups
Configuring cyrus-sasl-libs
Configuring gdbm
Configuring libpng
Configuring openldap-libs
Successfully terminated.
WJNAS>





Now, lets check the sane configuration, I don't know what kind of editor you use, I use joe, simple and works like a charm, nano, vi or whatever should be gread to.

open the sane.d configuration:

"joe /opt/etc/sane.d/saned.conf"

Here is the default one

Code: Select all
# saned.conf
# Configuration for the saned daemon

## Daemon options
# Port range for the data connection. Choose a range inside [1024 - 65535].
# Avoid specifying too large a range, for performance reasons.
#
# ONLY use this if your saned server is sitting behind a firewall. If your
# firewall is a Linux machine, we strongly recommend using the
# Netfilter nf_conntrack_sane connection tracking module instead.
#
# data_portrange = 10000 - 10100


## Access list
# A list of host names, IP addresses or IP subnets (CIDR notation) that
# are permitted to use local SANE devices. IPv6 addresses must be enclosed
# in brackets, and should always be specified in their compressed form.
#
# The hostname matching is not case-sensitive.

#scan-client.somedomain.firm
#192.168.0.1
#192.168.0.1/29
#[2001:7a8:185e::42:12]
#[2001:7a8:185e::42:12]/64

# NOTE: /etc/inetd.conf (or /etc/xinetd.conf) and
# /etc/services must also be properly configured to start
# the saned daemon as documented in saned(8), services(4)
# and inetd.conf(4) (or xinetd.conf(5)).



As you can see there are a lot of IP's listed, but all commented out. ad you own range here. I give access to my entire network, way to much, but what ever, I use: 192.168.0.1/16, remove the # in front of the line!

Save the file and lets check the dll.conf


"joe /opt/etc/sane.d/dll.conf"
This should only say one thing: "hpaio"

If there's way way way more, it's probably the original sane dll.conf file, and not the one replaced by hplip; just use hpaio as first one, way on top, on its own line.

Should work out fine.

Now; first part completed; Reboot the NAS to get HPLIP find the scanner.
In the meanwhile install something like sanetwain one your client computer, you can fine this at: http://sanetwain.ozuzo.net/
Configure it to connect to your nas, and keep the port and other settings original, so only replace the IP.



Next up, run sane in debugging mode:

"saned -d5"
Code: Select all
WJNAS> saned -d5
[saned] main: starting debug mode (level 5)
[saned] read_config: searching for config file
[saned] read_config: done reading config
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.20 starting up
[saned] do_bindings: trying to get port for service "sane-port" (getaddrinfo)
[saned] do_bindings: [0] socket () using IPv6
[saned] do_bindings: [0] socket failed: Address family not supported by protocol
[saned] do_bindings: [1] socket () using IPv4
[saned] do_bindings: [1] setsockopt ()
[saned] do_bindings: [1] bind () to port 6566
[saned] do_bindings: [1] listen ()
[saned] run_standalone: waiting for control connection


And start up sane twain, it should go out and do lots of stuff:

Code: Select all
WJNAS> saned -d5
[saned] main: starting debug mode (level 5)
[saned] read_config: searching for config file
[saned] read_config: done reading config
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.20 starting up
[saned] do_bindings: trying to get port for service "sane-port" (getaddrinfo)
[saned] do_bindings: [0] socket () using IPv6
[saned] do_bindings: [0] socket failed: Address family not supported by protocol
[saned] do_bindings: [1] socket () using IPv4
[saned] do_bindings: [1] setsockopt ()
[saned] do_bindings: [1] bind () to port 6566
[saned] do_bindings: [1] listen ()
[saned] run_standalone: waiting for control connection
[saned] handle_connection: processing client connection
[saned] check_host: access by remote host: 192.168.123.33
[saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK
[saned] check_host: local hostname: WJNAS
[saned] check_host: local hostname(s) (from DNS): WJNAS
[saned] check_host: local hostname(s) (from DNS): WJNAS
[saned] check_host: local hostname(s) (from DNS): WJNAS
[saned] check_host: remote host doesn't have same addr as local
[saned] check_host: opening config file: /etc/hosts.equiv
[saned] check_host: can't open config file: /etc/hosts.equiv (No such file or directory)
[saned] check_host: opening config file: saned.conf
[saned] check_host: config file line: `# saned.conf'
[saned] check_host: config file line: `# Configuration for the saned daemon'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `## Daemon options'
[saned] check_host: config file line: `# Port range for the data connection. Choose a range inside [1024 - 65535].'
[saned] check_host: config file line: `# Avoid specifying too large a range, for performance reasons.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# ONLY use this if your saned server is sitting behind a firewall. If your'
[saned] check_host: config file line: `# firewall is a Linux machine, we strongly recommend using the'
[saned] check_host: config file line: `# Netfilter nf_conntrack_sane connection tracking module instead.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# data_portrange = 10000 - 10100'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `## Access list'
[saned] check_host: config file line: `# A list of host names, IP addresses or IP subnets (CIDR notation) that'
[saned] check_host: config file line: `# are permitted to use local SANE devices. IPv6 addresses must be enclosed'
[saned] check_host: config file line: `# in brackets, and should always be specified in their compressed form.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# The hostname matching is not case-sensitive.'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `#scan-client.somedomain.firm'
[saned] check_host: config file line: `#192.168.0.1'
[saned] check_host: config file line: `192.168.0.1/16'
[saned] check_host: subnet with base IP = 192.168.0.1, CIDR netmask = 16
[saned] check_host: access granted from IP address 192.168.123.33 (in subnet 192.168.0.1/16)
[saned] init: access granted
[saned] init: access granted to root@192.168.123.33
[saned] process_request: waiting for request
[saned] process_request: got request 1
[saned] process_request: waiting for request
[saned] process_request: got request 10
[saned] bailing out, waiting for children...
[saned] bail_out: all children exited
WJNAS>


Hmmm.

Didn't see the scanner as it seems.

Seems it doesn't

Lets unplug the scanner, replug it and try again.

"saned -d5"

Code: Select all
WJNAS> saned -d5
[saned] main: starting debug mode (level 5)
[saned] read_config: searching for config file
[saned] read_config: done reading config
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.20 starting up
[saned] do_bindings: trying to get port for service "sane-port" (getaddrinfo)
[saned] do_bindings: [0] socket () using IPv6
[saned] do_bindings: [0] socket failed: Address family not supported by protocol
[saned] do_bindings: [1] socket () using IPv4
[saned] do_bindings: [1] setsockopt ()
[saned] do_bindings: [1] bind () to port 6566
[saned] do_bindings: [1] listen ()
[saned] run_standalone: waiting for control connection
[saned] handle_connection: processing client connection
[saned] check_host: access by remote host: 192.168.123.33
[saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK
[saned] check_host: local hostname: WJNAS
[saned] check_host: local hostname(s) (from DNS): WJNAS
[saned] check_host: local hostname(s) (from DNS): WJNAS
[saned] check_host: local hostname(s) (from DNS): WJNAS
[saned] check_host: remote host doesn't have same addr as local
[saned] check_host: opening config file: /etc/hosts.equiv
[saned] check_host: can't open config file: /etc/hosts.equiv (No such file or directory)
[saned] check_host: opening config file: saned.conf
[saned] check_host: config file line: `# saned.conf'
[saned] check_host: config file line: `# Configuration for the saned daemon'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `## Daemon options'
[saned] check_host: config file line: `# Port range for the data connection. Choose a range inside [1024 - 65535].'
[saned] check_host: config file line: `# Avoid specifying too large a range, for performance reasons.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# ONLY use this if your saned server is sitting behind a firewall. If your'
[saned] check_host: config file line: `# firewall is a Linux machine, we strongly recommend using the'
[saned] check_host: config file line: `# Netfilter nf_conntrack_sane connection tracking module instead.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# data_portrange = 10000 - 10100'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `## Access list'
[saned] check_host: config file line: `# A list of host names, IP addresses or IP subnets (CIDR notation) that'
[saned] check_host: config file line: `# are permitted to use local SANE devices. IPv6 addresses must be enclosed'
[saned] check_host: config file line: `# in brackets, and should always be specified in their compressed form.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# The hostname matching is not case-sensitive.'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `#scan-client.somedomain.firm'
[saned] check_host: config file line: `#192.168.0.1'
[saned] check_host: config file line: `192.168.0.1/16'
[saned] check_host: subnet with base IP = 192.168.0.1, CIDR netmask = 16
[saned] check_host: access granted from IP address 192.168.123.33 (in subnet 192.168.0.1/16)
[saned] init: access granted
[saned] init: access granted to root@192.168.123.33
[saned] process_request: waiting for request
[saned] process_request: got request 1
[saned] process_request: waiting for request
[saned] process_request: got request 2
[saned] process_request: access to resource `hpaio' granted
[saned] process_request: sane_open returned: Success
[saned] process_request: waiting for request
[saned] process_request: got request 6
[saned] process_request: waiting for request
[saned] process_request: got request 4
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request
[saned] process_request: got request 5
[saned] process_request: waiting for request



As you can see hpaio drive is used and you can see the scanner now in the sane twain window; mine is seen as
hpaio:/usb/Photosmart_C4200_series?serial=CN7C5R207R04VP

Lets try to get the preview scan;

I get the error:

Code: Select all
[saned] process_request: waiting for request
[saned] process_request: got request 6
[saned] process_request: waiting for request
[saned] process_request: got request 7
[saned] start_scan: trying to bind data port 0
[saned] start_scan: using port 4548 for data
process 6876: arguments to dbus_connection_send() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 3046.
This is normally a bug in some application using the D-Bus library.
  D-Bus not built with -rdynamic so unable to print a backtrace
Aborted (core dumped)


and then sane gets killed.

I figured out this is a dbus error; fix it by giving dbus all rights possible:

edit the dbus config file:

edit /opt/etc/dbus-1/system.conf


Change:
<!-- Run as special user -->
<user>root</user>

And run: "dbus-uuidgen --ensure" to create a uuid file.

Then restart dbus:

WJNAS> cd init.d
WJNAS> dir
drwxr-xr-x 2 root root 4096 May 15 21:50 .
drwxr-xr-x 12 root root 4096 May 15 22:24 ..
-rwxr-xr-x 1 root root 191 May 5 19:31 S01sane-backends
-rwxr-xr-x 1 root root 1711 May 1 17:30 S20dbus
-rwxr-xr-x 1 root root 140 Dec 28 01:48 S70net-snmp
WJNAS> ./S20dbus
Usage: /opt/etc/init.d/dbus {start|stop|restart|force-reload}
WJNAS> ./S20dbus restart
Stopping system message bus: ./S20dbus: kill: 87: (4502) - No such process


Hey, weird, pid file does exist, but the process isn't there?!

"rm /opt/var/run/dbus/pid"

Try again:

WJNAS> cd /opt/etc/init.d
WJNAS> ./S20dbus start
Starting system message bus: dbus.


And try sane again:

saned -d5

Hell yeah, working like a charm, now, only thin left is get it to start in deamon mode.
Remember way one top?

Edit the following file:

/etc/inetd.conf

It probably sais:
#telnet stream tcp nowait root /usr/sbin/telnetd telnetd

The telnet deamon is disabled, no worries;
just add:

sane-port stream tcp nowait root.root /opt/sbin/saned saned

right below it.

Reboot your nas and see if everything works as it should.

Works like a charm.

And a whoopty doo.
WJST
Trainee
Trainee
 
Posts: 10
Joined: Sun Jul 27, 2008 7:03 pm

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby niallcook » Fri May 15, 2009 10:30 pm

This is awesome. Spend all evening searching the net for info on this. Got as far as installing all of the relevant packages, but your config changes were the things I was missing. Working like a charm now.

All we need next is a way to get the "Scan To" button on the HP All-In-Ones to scan directly into a folder on the Syno! :shock:
niallcook
Trainee
Trainee
 
Posts: 17
Joined: Wed Oct 29, 2008 4:42 pm

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby WJST » Fri May 15, 2009 10:40 pm

niallcook wrote:This is awesome. Spend all evening searching the net for info on this. Got as far as installing all of the relevant packages, but your config changes were the things I was missing. Working like a charm now.

All we need next is a way to get the "Scan To" button on the HP All-In-Ones to scan directly into a folder on the Syno! :shock:


Hehe, good to mention, to be honest, I'm trying to get the scannbuttond deamon to work, but it's not going well. The project allso has been abbandoned for about 3 years now..
HP says the scan button are on the RFC list in HPLIP, but they don't know if they will implement it in the near future...

I I can get the scanbuttond to run I'll let you know, but don't get your hopes up, cuz I don't think it will work well... But hey, sanetwain works great to :)
WJST
Trainee
Trainee
 
Posts: 10
Joined: Sun Jul 27, 2008 7:03 pm

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby seanm » Mon May 18, 2009 11:09 am

Thanks for the steps WJST !

Wierdly I managed to get it working without the dbus part working properly ?!

I will now follow your steps and see if I can get the dbus part working aswell.

FYI, my AIO is the HP2840 and the NAS is the DS508.

Also I can't emphasise enough that you need to reboot as specified for some things to get kicked off correctly.
seanm
Apprentice
Apprentice
 
Posts: 92
Joined: Tue Apr 29, 2008 12:40 pm

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby Barberousse » Mon May 25, 2009 8:39 pm

Thank you !

It works with my HP PSC 1610.

Barberousse
Barberousse
Novice
Novice
 
Posts: 45
Joined: Fri Jan 04, 2008 1:07 pm

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby rogererens » Thu Jul 16, 2009 1:23 pm

Hi,

Thanks for the very detailed instructions. I've got this almost working with a DS209+II (firmware 844) and an HP psc 2410.

I am able to scan with SaneTwain's ScanImage.exe.
However, as soon as I start to scan, Disk Station Manager's (v2.1) page with the Printer info (menu: External Devices -> USB Printer) shows a pop-up box telling me that "No USB printer is connected". Which seems kind of fair to me during the scanning process. However, after closing ScanImage.exe, the pop-ub box does not disappear and no entry in the USB Printer table becomes available like I had before starting to scan.
(the entry containing field values: usbprinter, Hewlett-Packard, PSC 2410 Photosmart, USB 1.1)

Only after unplugging the USB-printer from the NAS and plugging it back in again results in having the printing capabilities available again. In SaneTwain enabling the setting "Delay printing until program exit" (default not enabled) appears not to have any effect.

Any idea on how to make my printer automatically available again after scanning?

Roger
rogererens
I'm New!
I'm New!
 
Posts: 8
Joined: Wed Jul 15, 2009 10:30 pm

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby burn » Mon Jul 20, 2009 2:14 pm

if anyone is struggeling to get scanning working on a hp cm1015 or cm1017 mfp, you'll have to wait untill a package with hplip 2.8.10 is available. Currently 2.8.9.1 will be installed using ipk. see https://answers.launchpad.net/hplip/+question/21217

I will try to get hplip 2.8.10 working. If i succeed, i will show how i did it (I need to learn compiling and ipk)

update:
seems inpossible... plugin doesn want to get working
viewtopic.php?f=40&t=16055
burn
Trainee
Trainee
 
Posts: 10
Joined: Mon Jul 20, 2009 10:02 am

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby tipsen » Wed Jan 13, 2010 1:24 am

This topic seems very interesting to me - will this also be possible with for instance Canon MFPs - It seems like they (a lot of them) are supported by SANE as well but there might be other requirements not fulfilled?
DS-212 / DSM 4.1-2636 / 2 x Seagate ST2000DL003-9VT1 2TB (Non-Raid) / Squeezebox Server 7.7.2 (Synology Package) / 2 x Squeezebox Classic + 1 x Boom
tipsen
Sharp
Sharp
 
Posts: 152
Joined: Wed Aug 08, 2007 1:31 pm
Location: Denmark

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby Jagellovsk » Sat Mar 13, 2010 2:17 pm

Thank you for your instructions!

I got scanning to work; but with problems:
- the saned daemon is not automatically started by inetd; has to be started manually;
- only "saned -d5" starts sane so that I can scan
- the dbus error appears every time saned is being started; so pid needs to be removed and dbus started again every time you want to scan
- after one scan saned shuts down
Additionally, the printer is no more visible (side effect of the cups installation??)
My configuration:

ds210j with firmware 2.3-1139
HP Photosmart C5280

Any suggestions?

Thank you!
Jagellovsk
I'm New!
I'm New!
 
Posts: 1
Joined: Sat Mar 13, 2010 1:04 pm

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby powerdesigner » Sun May 16, 2010 7:28 am

Thanks for this tutorial but I have a small problem after the configuration. I have installed my old OfficeJet 6110 on my DS210J and it’s working.

But when I launch the program lance SaneTwain V1.29 to scan a document, the printer disappears from the list of connected devices (No USB printer is connected). I can scan documents but after that I can’t print a document.

I have a small workaround: I disconnected and reconnect the printer and I can print but it’s not user friendly.

Any idea or solutions
powerdesigner
I'm New!
I'm New!
 
Posts: 7
Joined: Sun May 16, 2010 6:47 am

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby alexspires » Sat May 29, 2010 10:33 pm

Hello guys, I need your super help... I installed sucessfully bootstrap but I unable to continue after the command "ipkg install sane-backends" because generates an error:

Code: Select all
DiskStation> ipkg install sane-backends
Installing sane-backends (1.0.21-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/sane-backends_1.0.21-1_arm.ipk
package sane-backends suggests installing xinetd
package sane-backends suggests installing inetutils
Installing libjpeg (6b-3) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libjpeg_6b-3_arm.ipk
Installing libtiff (3.9.2-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libtiff_3.9.2-1_arm.ipk
Installing zlib (1.2.5-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/zlib_1.2.5-1_arm.ipk
Installing libstdc++ (6.0.9-6) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libstdc++_6.0.9-6_arm.ipk
Installing libusb (0.1.12-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libusb_0.1.12-2_arm.ipk
Configuring libjpeg
Configuring libstdc++
Configuring libtiff
Configuring libusb
Configuring sane-backends

Adding saned to /etc/services...done.

sane-backends has been installed. To finish the installation, you should consider installing
either xinetd or inetd to make sane-backend running.

For inetd, add the following to /opt/etc/inetd.conf:
        sane-port  stream  tcp  nowait  root.root  /opt/sbin/saned saned

For xinetd, create a /opt/etc/xinetd.d/saned file like:
service saned
{
        socket_type = stream
        server = /opt/sbin/saned
        protocol = tcp
//opt/lib/ipkg/info/sane-backends.postinst: //opt/lib/ipkg/info/sane-backends.postinst: 65: cannot create /opt/etc/xinetd.d/saned: Directory nonexistent
//opt/lib/ipkg/info/sane-backends.postinst: //opt/lib/ipkg/info/sane-backends.postinst: 66: cannot create /opt/etc/xinetd.d/saned: Directory nonexistent
//opt/lib/ipkg/info/sane-backends.postinst: //opt/lib/ipkg/info/sane-backends.postinst: 68: cannot create /opt/etc/xinetd.d/saned: Directory nonexistent
postinst script returned status 2
ERROR: sane-backends.postinst returned 2
Configuring zlib
Successfully terminated.


:?: :?: :?:

Do you know how to solve this?
alexspires
Trainee
Trainee
 
Posts: 17
Joined: Wed Apr 21, 2010 9:10 pm

Re: Manual: Network scanning with HPLIP and Sane (HP all in one)

Postby maxxfi » Sun May 30, 2010 1:19 pm

Here you have the answer:
sane-backends has been installed. To finish the installation, you should consider installing
either xinetd or inetd to make sane-backend running.

For inetd, add the following to /opt/etc/inetd.conf:
sane-port stream tcp nowait root.root /opt/sbin/saned saned

For xinetd, create a /opt/etc/xinetd.d/saned file like:
service saned
{
socket_type = stream
server = /opt/sbin/saned
protocol = tcp

Install xinetd (with 'ipkg install xinetd') and edit the file /opt/etc/xinetd.d/saned as indicated.
If it still doesn't work, try to remove both xinetd and saned, and reinstall first xinetd and then saned.
DS-411 (DSM 4.3-3827u5) w/ 2x WD20EFRX + 1x WD10EFRX
DS-106j (DSM 3.0-1357), PATA-to-SATA adapter, 2.5" HM250HI
User avatar
maxxfi
Programmer
Programmer
 
Posts: 5767
Joined: Sun Dec 27, 2009 12:13 pm
Location: Espoo, Finland

Re: Manual: Network scanning with HPLIP and Sane (HP all in

Postby edje » Fri Oct 29, 2010 12:12 pm

Hi all,

It has been a while, but is there a solution for the print after scanning problem?

Following this great howto I am able to scan documents, but after scanning the print function won't work anymore.
Regarding the DSM (3.0) the printer is there but the name is "Unknown".
I realy hope there is a proper solution, because reconnecting the USB is not a neat one...

Edje
edje
I'm New!
I'm New!
 
Posts: 1
Joined: Fri Oct 29, 2010 12:07 pm

Re: Manual: Network scanning with HPLIP and Sane (HP all in

Postby powerdesigner » Wed Nov 24, 2010 7:10 pm

Hi all,
Since 6 months, I used this solution with success. Last week I had a general power failure and it’s now impossible to scan through the network.
After many trials and errors, I have the following situation:
• When I launch the SaneTwain interface, I received the error message “Error establishing connection to host”
• If previously I start a “saned –d5”, I can scan documents with the saneTwain Interface
Where is the problem ? Do you know how to solve this?
Thanks in advance

Synology DS-210j and HP officeJet 6110
powerdesigner
I'm New!
I'm New!
 
Posts: 7
Joined: Sun May 16, 2010 6:47 am

Re: Manual: Network scanning with HPLIP and Sane (HP all in

Postby A2Z » Mon Dec 06, 2010 1:58 pm

can anyone confirm if this works with DSM 3.0-1354? I fear this was doen with DSM 2.3 release right?
A2Z
Trainee
Trainee
 
Posts: 10
Joined: Wed Dec 01, 2010 12:59 pm

Next

Return to General Mods

Who is online

Users browsing this forum: No registered users and 5 guests