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.






