Skip to content

Instantly share code, notes, and snippets.

@SvenFestersen
Last active February 25, 2023 14:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SvenFestersen/d024fe8ca30fa0d98f7b to your computer and use it in GitHub Desktop.
Save SvenFestersen/d024fe8ca30fa0d98f7b to your computer and use it in GitHub Desktop.
Install a sane server for Epson scanners on Raspbian

Install a Scanner Server for the Epson Perfection V330 on Raspberry Pi

This guide is for raspbian wheezy and based on this blog post: https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=109169

Prepare sane daemon and network access

Install:

sudo apt-get install xinetd sane-utils

To make saned start automatically at boot, edit /etc/default/saned to contain:

# Defaults for the saned initscript, from sane-utils

# Set to yes to start saned
RUN=yes

# Set to the user saned should run as
RUN_AS_USER=saned

Enable sane network service by creating /etc/xinetd.d/sane-daemon:

service sane-port
        {
          socket_type = stream
          server = /usr/sbin/saned
          protocol = tcp
          user = saned
          group = saned
          wait = no
          disable = no
        }

Configure allowed clients by editing /etc/sane.d/saned.conf:

...
## Access list
# The hostname matching is not case-sensitive.
192.168.178.0/24
...

Start saned:

sudo /etc/init.d/saned start

Configure multi-arch support

Some parts of the Epson scanner driver can not be compiled on the Raspberry's ARM platform. It is therefore necessary to enable multi-arch support and emulate the i386 platform via qemu. The procedure is taken from c't magazine 18/2015.

To enable multi-arch:

sudo dpkg --add-architecture i386

Add i386 repositories to /etc/apt/sources.list.d/i386.list:

deb [arch=i386] http://ftp.de.debian.org/debian stable main contrib non-free
deb [arch=i386] http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
deb [arch=i386] http://security.debian.org/ wheezy/updates main contrib non-free

Add architecture hints to existing repository lists by inserting [arch=armhf] between "deb" and the URL in /etc/apt/sources.list:

deb [arch=armhf] http://mirrordirector.raspbian.org/raspbian/ ...

Update sources:

sudo apt-get update

Install qemu and automatic i386 emulation:

sudo apt-get -y install qemu-user binfmt-support

Repackage Epson Drivers for Multi-arch

Download and extract iscan-data sources:

wget https://download3.ebz.epson.net/dsc/f/03/00/03/61/59/646738a219f7354bf3268897385f6ce48c0776bf/iscan-data_1.36.0-1.tar.gz
tar -xvf iscan-data_1.36.0-1.tar.gz
cd iscan-data-1.36.0

Add multi-arch support by editing debian/control and debian/control.in and adding the following line after Architecture: All:

Multi-Arch: foreign

Install build dependencies:

sudo apt-get -y install cdbs xsltproc dpkg-dev debhelper

Build the new package:

dpkg-buildpackage -tc

The parent directory now contains the package iscan-data_1.36.0-1_all.deb. Install it by running

sudo dpkg -i iscan-data_1.36.0-1_all.deb

Download and extract iscan:

wget https://download3.ebz.epson.net/dsc/f/03/00/03/61/59/a3f8b8d60e8702a1c5bf3977d018cc2336e308a8/iscan_2.30.1-1.tar.gz
tar -xvf iscan_2.30.1-1.tar.gz
cd iscan-2.30.1

Edit debian/control and debian/control.in as described above. And additionally append armhf to the Architecture line, so it looks like this:

Architecture: i386 amd64 armhf
Multi-Arch: foreign

Also edit the configure script. Find the lines

{ echo "$as_me:$LINENO: checking whether to build the frontend application" >&5
echo $ECHO_N "checking whether to build the frontend application... $ECHO_C" >&6; }
# Check whether --enable-frontend was given.
if test "${enable_frontend+set}" = set; then
  enableval=$enable_frontend; if test "x$enable_frontend" != xno; then
		  case $host_cpu in
		    i?86) :
			  ;;
		    x86_64) :
			  ;;
		    *)	  { { echo "$as_me:$LINENO: error: requires IA32 architecture" >&5
echo "$as_me: error: requires IA32 architecture" >&2;}
   { (exit 1); exit 1; }; }
			  ;;
		  esac
	       fi
else
  case $host_cpu in
	         i?86)   enable_frontend=yes ;;
		 x86_64) enable_frontend=yes ;;
		 *)      enable_frontend=no  ;;
	       esac
fi

and replace them by

 enable_frontend=no

Install dependencies:

sudo apt-get install -y libsane-dev libltdl7-dev libgtk2.0-dev libjpeg-dev libgimp2.0-dev libtiff4-dev libxml2-dev libusb-1.0-0-dev

Rebuild the package:

dpkg-buildpackage -tc
@slumlorde
Copy link

slumlorde commented May 20, 2016

Was looking for some help. While building the last package I'm getting this error.

make[3]: Entering directory '/home/pi/iscan-2.30.1/lib/tests' /usr/bin/make test-pcx make[4]: Entering directory '/home/pi/iscan-2.30.1/lib/tests' g++ -DHAVE_CONFIG_H -I. -I../.. -I../../lib -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -c -o test-pcx.o test-pcx.cc gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -c pnm.c pnm.c: In function ‘read_pnm’: pnm.c:42:11: warning: ignoring return value of ‘getline’, declared with attribute warn_unused_result [-Wunused-result] pnm.c:51:11: warning: ignoring return value of ‘getline’, declared with attribute warn_unused_result [-Wunused-result] pnm.c:53:13: warning: ignoring return value of ‘getline’, declared with attribute warn_unused_result [-Wunused-result] pnm.c:57:11: warning: ignoring return value of ‘getline’, declared with attribute warn_unused_result [-Wunused-result] make[4]: *** No rule to make target '../libimage-stream.la', needed by 'test-pcx'. Stop. make[4]: Leaving directory '/home/pi/iscan-2.30.1/lib/tests' Makefile:524: recipe for target 'check-am' failed make[3]: *** [check-am] Error 2 make[3]: Leaving directory '/home/pi/iscan-2.30.1/lib/tests' Makefile:491: recipe for target 'check-recursive' failed make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory '/home/pi/iscan-2.30.1/lib' Makefile:388: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory '/home/pi/iscan-2.30.1' /usr/share/cdbs/1/class/makefile.mk:71: recipe for target 'debian/stamp-makefile-check' failed make: *** [debian/stamp-makefile-check] Error 2 dpkg-buildpackage: error: debian/rules build gave error exit status 2

@davand01
Copy link

@slumlorde - did you ever manage to get past the "exit status 2" error?

When troubleshooting, I found that the enable_frontend=no disables the building of "libimage-stream", but not the test "test-ctx"... Commenting out the test-ctx in /lib/tests/Makefile.in managed to get me a bit further.

Still no go after installing and executingscanimage -L though... :P

@Maxr1998
Copy link

Maxr1998 commented Jun 5, 2016

@slumlorde @davand01 I get the same problem. Interestingly, the linked c't article doesn't change the configure script, but installs libc6:i386.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment