Monday, 27 June 2011

Browse » Home » » » » How To Scanning Process in Ubuntu

How To Scanning Process in Ubuntu

Scanning in Ubuntu is actually quite easy. This guide will walk you through how to use your scanner and what to do if Ubuntu cannot find your scanner.

Does my scanner work with Ubuntu?

There are three ways to see if you scanner works in Ubuntu:
  1. Simply plug it in and try it! If it is a newer USB scanner, it is likely that it will just work.
  2. SANE project listing of support scanners - The SANE (Scanner Access Now Easy) project provides most of the backends to the scanning software on Ubuntu.

Using your scanner

Most of the time, Ubuntu will simply detect your scanner and you just be able to use it. To scan a document, you need to follow these steps:
  1. Place what you want to scan on the scanner
  2. Go to Applications --> Graphics --> XSane Image Scanner
  3. Alternately, pressing the scan button on the scanner should also work

What if it says "No devices available"?

Reasons why you might get this message:
  1. There is a permissions problem. You can run the scanning software as root.
  2. Your scanner is not supported in Ubuntu. The most common type of scanner not supported is old parallel port or Lexmark All-in-One printer/scanner/faxes
  3. The driver for your scanner is not being autoloaded
  4. You need to install the firmware file (probably a *.fw or *.usb) for your particular scanner. You simply need to copy the file into /usr/share/sane/ In my case I got the firmware file from the CD that came with the scanner (if the file is not there, try installing the cd with WINE- don't use the program but search for the needed file and copy it or do a quick internet search) and copied this file "ccd548.fw" into /usr/share/sane/gt68xx/
  5. If your scanner is a Mustek 1200 UB Plus you will need this file sbfw.usb then rename it to "PS1fw.usb" then put the file in the directory "/usr/share/sane/gt68xx" (remember to give read permission to all users)
  6. You have a parallel port scanner and you are not a member of the scanner group. The device /dev/parport0 (or whichever parallel port your scanner is connected to) by default is only readable and writable by user lp and group scanner. You can become member of group scanner via the User Privileges tab of the Account Properties dialog in the User Settings (Users and Groups) administration tool.

Manually installing a scanner

There are some scanners that have less than complete drivers from the SANE project. They can sometimes be used, but not all the features may work. These scanners are:
  • HP 4200
  • HP 3300C
  • HP 4300C
  • Agfa Snapscan Touch
  • HP 4400C
  • HP 4470C
  • Make sure the Universe repository is enabled. The easiest way to do this is probably through Synaptic.
  • Get the drivers by searching Synaptic for libsane-extras or at a terminal type:
sudo apt-get install libsane-extras
  1. Edit the /etc/sane.d/dll.conf and enable the right driver for your scanner. Look for the lines that say:
# The following backends are not part of the SANE distribution
# but are provided by the libsane-extras Debian package
Below it are several commented out lines. Uncomment (delete the #) the right one for your scanner, as follows:
  • HP 4200 - uncomment the hp4200 line.
  • HP 3300C, HP 3400C, HP 4300C, Afga Snapscan Touch - uncomment the niash line.
  • HP 4400C, HP 4470C - uncomment the hp_rts88xx line.
4.) Fire up sane and scan away.
Note: Because of the way Linux's hotplugging stuff works, you may need to plug in the scanner after the computer has booted. If you're having problems seeing the scanner, you might want to try this.

Specific Models

Some specific models have been documented here:

Permission issues

Add saned to the group which owns your scanner device:
sudo adduser saned scanner
Note: I used sane-find-scanner to determine the device and ls -al /dev/bus/usb/XXX/XXX to identify the group. Since I have MFC printer/scanner/fax the device happened to be owned by group 'lp' so I added saned to that group (instead of scanner) to allow it access to the scanner.

ACL permissions for saned

Because of a change is the way access permissions are now applied to devices, saned may still not be able to access the scanner when it is launched by inetd or xinetd. This can happen even though other regular users on the server have access. The following bug-report contains a solution to this problem :

Sharing a Scanner Over a Network

There are two common configurations for using a scanner over a network:

Server-side setup

Note: This assumes your scanner is installed and working on the server computer (the computer to which the scanner is physically attached). If possible, first test that it works on that local machine before attempting to share it over the network.
In this configuration, one computer has a scanner connected by USB or parallel port and wishes to share it with others on the network. The computer with the scanner is called the server and a computer on the network wishing to scan is the client. Both computers need to have sane installed (sudo apt-get install sane). As saned does not automatically detect a scanner that is shared by a remote computer you will need to set up both the server and the client.
There are four steps in setting the server.
  1. Tell it to run sane as a server (daemon, service)
  2. Set the subnet where to share the scanner.
  3. On distributions older that 10.10, set inet (or xinet) to listen on the appropriate port (This is optional, saned can be setup to be running continuously)
  4. Make sane run at start up

Sane as a server

Set sane to run as a server, ie expect connections Edit /etc/default/saned to read:
# Set to yes to start saned                                                     
You must be root to edit this file (hint, use sudo)

Share with

Set the subnet that will be able to see the scanner Edit /etc/sane.d/saned.conf to share the printer on your subnet:
Make sure it is in your range of IPs. It hit me bad when I mis-configured it for when I meant !
The /24 means to share with everybody in to 255.

User setup

In some cases, correct permissions needs to be set. E.g. for HP DesignJet 2050 All-in-one device, the saned user has to be inserted into lp group. To do that, type
sudo adduser saned lp
To verify the saned user has the correct permissions to access the scaner device, run the following commands:
sudo -s
su -s /bin/bash saned
scanimage -L
As a result, you should see a device identified, e.g.
device `hpaio:/usb/Deskjet_3050_J610_series?serial=CN0CQ3B1DH05HX' is a Hewlett-Packard Deskjet_3050_J610_series all-in-one

Set (x)inetd

Only needed for 10.04 and previous distributions. You don't need this step if running 10.10, jump to step four.
Edit /etc/inetd.conf by adding the following line:
sane-port stream tcp nowait saned.saned /usr/sbin/saned saned
Note: that an inetd server need not be installed.
Or, if you are using xinetd, create a file called /etc/xinetd.d/saned and enter the following in the file:
service saned 
socket_type = stream
server = /usr/sbin/saned
protocol = tcp
user = saned
group = scanner
wait = no
disable = no
Note: The saned value (last word on the inet configuration or in the user line in the xinetd configuration) is the name of the user running the server. You can get it form the RUN_AS_USER= line on the /etc/default/saned file
restart inetd or xinetd by
sudo /etc/init.d/(x)inetd restart
==== Run at start-up === Restart saned by (10.10)
sudo service saned restart
or (10.04 and previous)
sudo /etc/init.d/saned restart
One user writes that a reboot is necessary. Not my experience (with 10.10) but YMMV.
To configure the Sane daemon to start automatically at boot up run:
sudo update-rc.d saned defaults

LAN-based scanners

The scanner is connected directly to the network without an intermediary computer.

HP All-in-One devices

  1. Ensure the device is connected to the network and can be pinged.
  2. Ensure hplip is installed:
    $ sudo apt-get install hplip
  3. Run the hp-setup wizard which installs printer, scanner, and any other features.
    $ sudo hp-setup
    1. For Connection Type choose "Network/Ethernet..."
    2. If the device is not detected, click "Show advanced options", tick "Manual discovery" and supply the scanner's IP address.
  4. Check the scanner is now recognized:
    $ scanimage -L
For more details, see HpAllInOne.

Client-side Setup

From the client, all you need to do is add server name or IP address of the scanner server to /etc/sane.d/net.conf:
Now run xsane and it should pick up the new network scanner.

Helping Ubuntu support more scanners

There are a number of ways you can help Ubuntu support more scanners
  • Support the SANE (Scanner Access Now Easy) project, which provides most of the scanning backend information. Contributing to SANE
  • When purchasing a new scanner, always ask if it works in Linux
  • Contact the manufacturer about supporting your scanner under Linux. Make certain you tell them about the SANE project


No comments:

Post a Comment

Note: only a member of this blog may post a comment.