Helpful commands for Troubleshooting sane

Applies to: sane v.1.0.25, 1.0.27

The following are the standard tools for troubleshooting sane issues. If you have to troubleshoot an issue, make sure to have these commands ready to go.

$ lsusb

Returns all usb devices

$ sane-find-scanner

Returns all attached scanners, supported or not

$ scanimage -L

Returns attached supported scanners

$ SANE_DEBUG_DLL=5 scanimage -L

Same as above, with a lot more detail, including telling you what backends are and are not loaded.

$ sudo scanimage -L

same as above, with root privileges.

$ scanimage -T

Runs a test of the scanner

$ scanimage -V

returns version of sane-backends


Adding a Scanner that is not auto-detected

Applies to: sane v.1.0.25, 1.0.27

Sane often disables older backends and scanners that are not used often. This results in scanners not being auto-detected. If you are using an scanner and it is not auto detected (especially a parallel or SCSI port scanners), you will need to check to make sure the backend and scanner are enabled.

Look to see if your scanner is supported

Open the supported scanners page on the sane-project website. Now look up your manufacturer and model. It will look something like this:

Manufacturer: EXAMPLE SCANNER MAKER

Model

Interface

USB id

Status

Comment

Backend

Manpage

EXAMPLE

USB

0x01aa/0x0001

Good

FCC ID EXAMPLE

example-backend (1.0-10)

sane-example-backend

NOTE: Make sure to use the correct values for your scanner. If you use the example values from this tutorial, your scanner won't work.

NOTE: Your scanner may be listed on the supported scanners page as "Not supported" with a link to a site from which you can download drivers that will allow xsane to work. In that case, simply installing those drivers may be all you need to do.

Enabling a backend

Applies to: sane v.1.0.25, 1.0.27

If your scanner is supported, check the file /etc/sane.d/dll.conf and make sure that your backend is not commented with a '#'. You can do that with the following command:

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

If your backend is commented out, then delete the #

To do that, fire up gedit as root using this command:

$ sudo nano /etc/sane.d/dll.conf

remove the # and save the file.

Once your back end is enabled, try the scanner again. If it doesn't work, go on to the next step.

Enabling a scanner in the backend configuration file

Applies to: sane v.1.0.25, 1.0.27

If you are using a supported scanner that is not auto detected, and you have made sure the backend is enabled (especially a parallel or SCSI port scanners). To do that, we need the results of sane-find-scanner.

$ sane-find-scanner

You can ignore everything that starts with a hash tag, but the important part is this line:

found USB scanner (vendor=0x01aa [EXAMPLE], product=0x0001 [EXAMPLE SCANNER]) at libusb:001:003

Check the file /etc/sane.d/<backend.conf>, where backend is the name of the backend that your scanner uses. Your scanner should be listed in this file, along with its usb id. In this example we are checking a scanner that uses the genesys backend.

$ cat /etc/sane.d/genesys.conf

If your scanner is commented out, open up the file with the following command (replace genesys with the file name for the backend of your scanner)

$ sudo nano /etc/sane.d/genesys.conf

then delete the # and save the file.

Adding the scanner to the backend configuration file

Applies to: sane v.1.0.25, 1.0.27

If your scanner is listed as supported by a backend, but its not listed in the configuration file, then we need to add those two values from sane-find-scanner to the back end of our scanner, in this case the example backend.

To do that, fire up gedit as root using this command:

$ sudo nano /etc/sane.d/example.conf

Find the line that reads:

 usb

and after it we need to add a line with the word "usb" followed by the vendor number and the product number we got with the sane-find-scanner command. That line should look like this:

 usb 0x01aa 0x0001

After you have added that line, save and close the file. If your scanner is properly added and supported, it should now work.

Installing SCSI, Parallel or Proprietary Port Scanner

Applies to: Ubuntu 17+

The process for installing other types of scanners is the almost identical to installing a USB scanner, however you need to add the address to the proper section of the backend file (e.g. under SCSI).


Use the most up-to-date repository

Applies to: Ubuntu 17+

The most up-to-date repository for sane is the https://launchpad.net/~rolfbensch/+archive/ubuntu/sane-git repository maintained by one of the primary authors of SANE.

You can install this by running the following command:

$ sudo add-apt-repository ppa:rolfbensch/sane-git
$ sudo apt-get update
$ sudo apt-get upgrade


The USB3 Issue

Applies to: sane v. 1.0.27

If your scanner is plugged into a USB 3 port and it isn't working, you can diagnose if its a USB3 issue by running the following command:

$ SANE_USB_WORKAROUND=1 simple-scan

If simple-scan works as expected, you can permanently fix this issue by adding that default environmental variable to the /etc/systemd/user.conf file.

$ sudo nano /etc/systemd/user.conf

and at the bottom of the file add the line:

'DefaultEnvironment=SANE_USB_WORKAROUND=1'

Your scanner should now work as expected.


The symlink and udev tricks

Applies to: sane v. 1.0.27, Ubuntu 17.xx, 18.xx, 19.xx

Starting with Ubuntu 17.10, Ubuntu changed the directory where dll looks for third party drivers in. This configuration effectively broke backward compatibility for many third-party drivers. Third party sane drivers in previous version of sane were located under /usr/lib/sane/, however, the current version of sane on Ubuntu only looks for 64 bit drivers under the /usr/lib/x86_64-linux-gnu/sane directory. Many third party scanner issues can be resolved by placing the proper sym links.

Likewise, Ubuntu 17.10 printer related udev rules appear to be clobbering a number of third-party scanner rules (more common with all-in-one type devices). To complicate matters further, the Ubuntu specific sane-backends rules may clobber part of those printer rules yet again.

Thus far, the only known workaround to these two issues is to symlink the old drivers to the new folder, and to manually edit the udev rules. Where known, we have included working udev rules for various scanners below.


Known Workarounds

The following are known workarounds for the scanning issues on various scanners.

It should be noted that for many of these workarounds, restarting the scanner and/or computer may be required, even if not explicitly stated.

Brother

Applies to:sane v. 1.0.27, Ubuntu 17.xx, 18.xx, 19.xx

Most Brother DCP and MFP's work with the latest Brother drivers (09/13/2018 or later), however these should be installed using the install script and following the manufacturer directions found on the download page to the letter. If you need to update a driver (say, from the to the 09/13/2018 driver to the 01/21/2019 driver), uninstall the old driver before installing the new one.

Installation

Applies to: sane v. 1.0.27, Ubuntu 17.xx, 18.xx, 19.xx

Download the tool.(linux-brprinter-installer-*.*.*-*.gz). The tool will be downloaded into the default "Download" directory. (e.g. /home/(LoginName)/Download).

Once downloaded, run the following commands:

$ sudo apt-get update
$ sudo apt-get upgrade
$ cd ~/Download
$ gunzip linux-brprinter-installer-*.*.*-*.gz*
$ sudo su
$ bash linux-brprinter-installer-*.*.*-* ''''Brother machine name'''' *

The driver installation will start. Follow the installation screen directions.

When you see the message

Will you specify the DeviceURI ?

For USB Users: Choose N(No)

For Network Users: Choose Y(Yes) and enter the device URI.

The install process may take some time. Please wait until it is complete.

brscan, brscan2, brscan3

Applies to:sane v. 1.0.27, Ubuntu 17.xx, 18.xx, 19.xx

If the above process does not work as expected, you can use the following sym link and udev trick to get most Brother scanners operational.

It should be noted that libusb-0.1.so.4 was used when libsane-brother2.so.1.0.7 was compiled, and it should have been stated the libusb-0.1-4 package (which installs that .so file) as a dependency in the brscan2 .deb package. Manually installing this package is necessary to get brscan and brscan2 working correctly.

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo ln -sfr /usr/lib64/libbr* /usr/lib/x86_64-linux-gnu
$ sudo ln -sfr /usr/lib64/sane/libsane-brother* /usr/lib/x86_64-linux-gnu/sane
$ sudo touch /etc/udev/rules.d/59-udev-local.rules
$ sudo nano /etc/udev/rules.d/59-udev-local.rules

Add the following to that file:

# Brother brscan devices
ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="*", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

brscan4

Applies to:sane v. 1.0.27, Ubuntu 17.xx, 18.xx, 19.xx

Update and upgrade the system:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install libsane-extras

install brscan4 as per the instructions above, then run the commands:

$ ln -sfr /usr/lib64/sane/libsane-brother* /usr/lib/x86_64-linux-gnu/sane

The following command will give you the VendorId (04f9) and ProductID of your scanner:

lsusb

Create '/etc/udev/hwdb.d/brother4.hwdb' using the following command

$ sudo touch /etc/udev/hwdb.d/brother4.hwdb

Use nano to enter the needed info into that file:

$ sudo nano /etc/udev/hwdb.d/brother4.hwdb

The content of that file should be:

usb:v04f9pYYYY* 
libsane_matched=yes

Replacing YYYY with the product ID you got earlier. The entry for the Brother MFC-1910W would be "usb:v04f9p035d", where 04f9 is vendor ID, and 035d is the product ID.

edit '/etc/sane.d/dll.d/libsane-extras' to add the brother4 backend

$ nano  /etc/sane.d/dll.d/libsane-extras

At the end of that file, add:

brother4

Additional Resources

Applies to:sane v. 1.0.27, Ubuntu 18.xx, 19.xx

EZ Linux Projects page on Brother Printers

Brother Support

Dell

Dell MFP Laser Printer 1135n

Applies to:sane v. 1.0.27, Ubuntu 18.xx, 19.xx

This (very old) scanner uses the xerox_mfp back end. To make this scanner work in Ubuntu 18.xx, you have to manually add it to the /etc/sane.d/xerox_mfp.conf file.

Run the following command:

sudo nano /etc/sane.d/xerox_mfp.conf

and add the following to the end of the file:(replacing 192.168.xxx.yyy with the correct IP address)

#Dell MFP Laser Printer 1135n
tcp 192.168.xxx.yyy 9400

Save and close the file, and the scanner should work.

Epson

General

Applies to:sane v. 1.0.27, Ubuntu 17.xx, 18.xx, 19.xx

This procedure fixes the majority of Epson scanners, however you may still need to use the IScan work-around.

Start by installing the latest Epson 1.3.38 driver released 10-18-2018. This driver uses the multiarch folders and works out of the box for many Epson scanners.

If this does not work, run the following commands:

$ sudo ln -sfr /usr/lib/sane/libsane-epk* /usr/lib/x86_64-linux-gnu/sane/

Use nano to enter the needed info into the /etc/udev/rules.d/79-udev-epson.rules file:

$ sudo nano /etc/udev/rules.d/79-udev-epson.rules

The content of that file should be:

# chmod device EPSON group
# ACTION=="add", ATTRS{manufacturer}=="EPSON", DRIVERS=="usb", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="*", MODE="0666"
ATTRS{manufacturer}=="EPSON", DRIVERS=="usb", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="*", MODE="0777"

For an Epson network scanner, edit the file /etc/sane.d/epson2.conf using the following command:

$ sudo nano /etc/sane.d/epson2.conf

Modify the line that reads

net 192.168.xxx.yyy

to match your scanner IP address.

Epson Iscan

Applies to:sane v. 1.0.27, Ubuntu 17.xx, 18.xx, 19.xx

If the Epson Iscan does not work, the following workaround is known to fix it in most cases.

Sim Link the /usr/lib/sane/libsane-epkowa* directory to the /usr/lib/x86_64-linux-gnu/sane directory using the following command:

$ sudo ln -sfr /usr/lib/sane/libsane-epkowa* /usr/lib/x86_64-linux-gnu/sane

Create the /etc/udev/rules.d/79-udev-epson.rules file using the following command:

$ sudo touch /etc/udev/rules.d/79-udev-epson.rules

Use nano to edit the /etc/udev/rules.d/79-udev-epson.rules file using the following command:

$ sudo nano /etc/udev/rules.d/79-udev-epson.rules

The content of that file should be:

# chmod device EPSON group
ATTRS{manufacturer}=="EPSON", DRIVERS=="usb", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="*", MODE="0777"

Samsung

Samsung M2070

Applies to:sane v. 1.0.27, Ubuntu 17.xx, 18.xx, 19.xx

Sim Link the /usr/lib/sane/libsane-smfp* directory to the /usr/lib/x86_64-linux-gnu/sane directory using the following command:

$ sudo ln -sfr /usr/lib/sane/libsane-smfp* /usr/lib/x86_64-linux-gnu/sane

Create the /etc/udev/rules.d/59-smfp_samsung.rules file using the following command:

$ sudo touch /etc/udev/rules.d/59-smfp_samsung.rules

Use nano to edit the /etc/udev/rules.d/59-smfp_samsung.rules file using the following command:

$ sudo nano/etc/udev/rules.d/59-smfp_samsung.rules

The content of that file should be:

ATTRS{idProduct}=="2070", ENV{libsane_matched}="yes"

Xerox

Xerox Workcentre 3225

Applies to:sane v. 1.0.27, Ubuntu 17.xx, 18.xx, 19.xx

Sim Link the /usr/lib/sane/libsane-smfp* directory to the /usr/lib/x86_64-linux-gnu/sane directory using the following command:

$ sudo ln -sfr /usr/lib/sane/libsane-smfp* /usr/lib/x86_64-linux-gnu/sane

Add the current user to the lp group using the following command:

$ sudo adduser $USER lp


Filing a Bug Report

Bug reports for sane may be reported through the following site:

http://www.sane-project.org/bugs.html


CategoryHardware

sane_Troubleshooting (last edited 2019-07-01 19:11:10 by 5g3-steven-7tv)