Fujitsu iX500 Scansnap scanner

The iX500 Scansnap scanner is a powerful scanner. Unfortunately, this scanner has no official support on Linux. For that reason, my tutorial will explain how to install it on Ubuntu or on a Raspberry PI. It could also work for other Linux based distributions but I only have tested those two.

Installation

Many commands will need to be executed as root. To ease the installation process please login as root.

sudo -s  

Then we will use a specific group called scanner. Replace username with your default user when you login. For example, on a raspberry pi, it might be pi.

addgroup scanner  
adduser username scanner  

We will need to add necessary packages

apt-get install libusb-dev  

Switch to the right directory and get the official sane-backends needed to add the ix500 driver.

cd /usr/local/src && git clone git://git.debian.org/sane/sane-backends.git  

Now we need to install sane-backends. This might take some time on the raspberry pi

cd sane-backends  
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make && make install  

We won't use the libsane library from this repository. So you can delete it.

apt-get remove libsane  

Now we can check that the libsane libraries have been installed

ldconfig -v | grep libsane  
   $ libsane.so.1 -> libsane.so.1.0.24
   $ libsane.so.1 -> libsane.so.1.0.26

You should have at least one library displayed. If there are two libraries and it is not in order this command will help.

echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/1-sane.conf  

Test scanimage. You should at least have one or two versions.

scanimage -V  
   $ scanimage (sane-backends) 1.0.24; backend version 1.0.24

Link the language (en is for english)

cd /usr/share/locale/en/LC_MESSAGES  
ln -sf /usr/local/share/locale/en/LC_MESSAGES/sane-backends.mo .  
cd -  

Update the udev rules to be able to recognize your scanner when you plug it and unplug it.

cd /usr/local/src/sane-backends  
cp tools/udev/libsane.rules /etc/udev/rules.d  

The scanner should now be detected. The scanner must be on with the blue light on.

scanimage -L  
device `fujitsu:ScanSnap iX500:40404' is a FUJITSU ScanSnap iX500 scanner  

You can also test if the device is also being recognized with an unpriviledged user for example pi. If it does not work a reboot might help.

exit  
scanimage -L  
device `fujitsu:ScanSnap iX500:40404' is a FUJITSU ScanSnap iX500 scanner  

The scanner is now fully working.

Installing software to handle the scanner button

To detect the scanner button we will use the scanbd package which is responsible for monitoring the scanner's button. First install all needed packages

sudo -s  
cd /usr/local/src  
ln -s /bin/sed /usr/bin/sed  
apt-get install gawk libconfuse-dev libsane-dev libudev-dev libusb-dev -y  

Then download and install scanbd 1.4.3 version. I tried to install the version 1.5 on Ubuntu but I had no success with it.

wget -O scanbd-1.4.3.tgz http://downloads.sourceforge.net/project/scanbd/releases/scanbd-1.4.3.tgz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fscanbd%2Ffiles%2Freleases%2F&ts=1438690952&use_mirror=netcologne  
tar xvzf scanbd-*.tgz  
cd 1.4.3  
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
USE_SANE=yes make -e clean all  
USE_SANE=yes make install  

Copy the configuration file. scanbd is the client and sane the server.

cp /etc/sane.d/dll.conf /etc/scanbd/  

In the dll.conf remove everything except the line net. I mainly use vim as the editor but you could use gedit, nano, vi or emacs.

vim /etc/sane.d/dll.conf  

In the other dll.conf file of scanbd, disable the line net by putting a # before or just by removing the line.

vim /etc/scanbd/dll.conf  

Now we want to configure sane:

  • enable connect_timeout = 60
  • localhost
vim /etc/sane.d/net.conf  

Copy all backend files from sane to scanbd. Be careful: do not overwrite anything!!

cp -i /etc/sane.d/*.conf /etc/scanbd/  

Make sure you have increased the debug level to at least 5 so you can try to debug if there is a problem. Make sure the group parameter is assigned to scanner because only this group is allowed to scan.

vim /etc/scanbd/scanbd.conf  

Try to use scanbd.

export SANE_CONFIG_DIR=/etc/scanbd  
/usr/sbin/scanbd -f -d -c /etc/scanbd/scanbd.conf

Make scanbd a service

cp /usr/local/src/1.4.3/integration/scanbd.debian /etc/init.d/scanbd  
chmod 755 /etc/init.d/scanbd  
update-rc.d scanbd defaults  
systemctl enable scanbd.service  

Make sure the daemon path is correctly set. On my raspberry pi it was DAEMON=/usr/sbin/$NAME. If you are not sure you can use the command which scanbd.

vim /etc/init.d/scanbd  

Try to start the daemon:

/etc/init.d/scanbd start

If everything is okay, you can switch back the debug level to 2

vim /etc/scanbd/scanbd.conf  

Now try to reboot and make sure everything is working fine.

sudo /etc/init.d/scanbd status  

You can see what's going on under the hood by looking at the logs. It could be used to debug the scanbd service.

tail -f /var/log/syslog  

Try to press the scan button and it should be displayed that the button was detected.

Plug/Unplug device

When unplugging the device I had an issue because the process had an I/O exception and failed. To fix that, I have to add those two lines to the /lib/systemd/system/scanbd.service :

Restart=always  
RestartSec=3  

This will basically restart the process automatically in case of failure.

Basic scan script

You will need other packages:

sudo apt-get install libtiff-tools libtiff-dev -y  

Now create a sh script inside /etc/scanbd/ folder and paste this:

#!/bin/bash
OUT_DIR=/tmp/scan  
mkdir -p $OUT_DIR  
TMP_DIR=`mktemp -d`  
cd $TMP_DIR  
echo "################## Scanning ###################"  
scanimage \  
 --resolution 600 \
 --batch=scan_%03d.tif --format=tiff \
 --mode Gray \
 --device-name "fujitsu:ScanSnap iX500:25874" \
 -y 297 -x 210 \
 --page-width 210 --page-height 297 \
 --sleeptimer 1
echo "############## Converting to PDF ##############"

# Use tiffcp to combine output tiffs to a single mult-page tiff
tiffcp scan_*.tif output.tif  
# Convert the tiff to PDF
tiff2pdf output.tif -j -q 60 -p A4 > $OUT_DIR/scan.pdf  
cd ..  
echo "################ Cleaning Up ################"  
rm -rf $TMP_DIR  
echo "Pdf file saved in: $OUT_DIR/scan.pdf"  

This is just a basic script that can be used as demo. Feel free to modify it as you want!

Edit the /etc/scanbd/scanbd.conf file and update the script inside scan. Below the part of the file that needs to be modified:

# Inside /etc/scanbd/scanbd.conf
action scan {  
   filter = "^scan.*"
   numerical-trigger {
     from-value = 1
     to-value   = 0
   }
 desc   = "Scan to file"
 script = "your-script.script"
}

Now restart the service and when pressing the scan button a scan should be triggered. You can also use a GUI client like simplescan to be able to scan with many more options.

Again, if you have any issue, make sure to check the logs:

tail -f /var/log/syslog  

Conclusion

This is exactly what I did to get the scansnap iX500 working on my raspberry pi 2. For my Ubuntu computer, I have just installed the driver and mainly use simplescan to scan documents. If there is an issue do not hesitate to contact me.

In my current setup, I also have a script that will be triggered after the scan and upload my scanned file to Google Drive.