LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-02-2006, 11:33 AM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Rep: Reputation: 36
Setting up a scanner in Slackware


I just got my first Linux scanner, and need some help setting it up to work under Slackware.

sane-find-scanner gives:
Code:
found USB scanner (vendor=0x04a9 [Canon], product=0x221c [CanoScan], chip=GL841) at libusb:001:008
and when running "scanimage -L" as root I get
Code:
device `genesys:libusb:001:008' is a Canon LiDE 60 flatbed scanner
However, running it as a normal user does not work, which tells me there's a permissions problem, and chmod'ing it won't probably help after I reboot/unplug the device.

dmesg shows activity when I plug/unplug, and lsusb gives
Code:
Bus 001 Device 008: ID 04a9:221c Canon, Inc.
According to udev-howto, it's not possible to write udev rules for scanners, but the sane-documentation refers to udev frequently. I'm having a hard time finding out which is true..

I have not done any changes to /etc/sane.d/* files, but /etc/sane.d/genesys.conf contains my scanner, uncommented.

I'm on 2.6.15.7 vanilla on Slackware-current.

Anyone?

-Y1

Last edited by Yalla-One; 06-02-2006 at 11:35 AM.
 
Old 06-02-2006, 12:14 PM   #2
jimX86
Member
 
Registered: Mar 2006
Distribution: Slackware64 -current
Posts: 268
Blog Entries: 1

Rep: Reputation: 79
Is your user a member of the group "scanner"?
 
Old 06-02-2006, 12:26 PM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
Yes.

The problem is though that I don't know which devicefile the scanner corresponds to, and how to manipulate the permissions on that file.

/dev/usb contains only lp0

So my question remains - can I manipulate this with udev?

-Y1
 
Old 06-02-2006, 01:27 PM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116
You could try this to mount the usbfs:
Code:
mount none -t usbfs /proc/bus/usb -o devgid=10,devmode=0660
and make yourself member of group 'wheel' (gid=10). This corresponds to this line in /etc/fstab:
Code:
usbfs            /proc/bus/usb    usbfs       devgid=10,devmode=0660         0   0
It is not elegant, but I have been trying to get the hotplug usbscanner scripts ported to usb and only had partial success. The above works for 'wheel' members, but it also gives access to all other USB devices (and you might not want that).

Eric
 
Old 06-02-2006, 02:37 PM   #5
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Rep: Reputation: 63
Hey Yalla, if you can please. Let us know how you make out. I'm looking to buy a scanner so I can use it with slackware, and they have that model here for 79 bux at a local store. Seems like a nice every day scanner to use. Thanks.
 
Old 06-02-2006, 03:17 PM   #6
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
Thanks for the input Eric,

I guess I could be blamed for putting the standards too high, but what I'd really really like is to be able to just have the scanner work automagically whenever it's plugged in, just like other USB devices... Mounting it means it'll be more complex than in Windows, and my (silly?) quest is to prove my Linux system is both easier and more userfriendly than Windows...

I added the following line to my /etc/udev/rules.d/10-local.rules
Code:
BUS="usb", SYSFS{product}="CanoScan", MODE="0666", SYMLINK="scanner"
This gave me /dev/scanner -> /dev/usbdev1.8 with permission 0666.
However, the scanner still only works for the super-user, which leads me to believe this is a userspace/sane problem rather than a udev/file permission problem.

I noticed that Slackware comes with 0.1.8 rather than the latest 0.1.12 (which according to Pat is because the lates version breaks kernel 2.4), so maybe that's where the problem is.

Will investigate and reporat back when/if I find something. This is an *annoying* problem, as permission-based issues such as programmes/systems functioning as root but breaking as normal users are normally so lame...

-Y1
 
Old 06-02-2006, 07:21 PM   #7
jimX86
Member
 
Registered: Mar 2006
Distribution: Slackware64 -current
Posts: 268
Blog Entries: 1

Rep: Reputation: 79
Quote:
Originally Posted by Yalla-One
I guess I could be blamed for putting the standards too high, but what I'd really really like is to be able to just have the scanner work automagically whenever it's plugged in, just like other USB devices...
That's how my usb scanner works.

Please be patient with me... I know I'm not answering your udev question and maybe I'm missing the point. My understanding is that hotplug uses the entries in libsane.usermap to detect the scanner, and then the libusbscanner script changes the device ownership to root:scanner. Why not just add an entry for your scanner to libsane.usermap and let hotplug take care of this?
 
Old 06-03-2006, 01:36 AM   #8
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,450

Rep: Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788
This sounds like the problem that I encountered with my Brother DCP-110C scanner/copier/printer. In my case the problem was resolved by adding this line to my /etc/fstab file.

scanner /proc/bus/usb usbfs auto,devmode=0666 0 0

Last edited by allend; 06-03-2006 at 01:39 AM.
 
Old 06-03-2006, 02:07 AM   #9
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Rep: Reputation: 63
I havent' done scanners before, but allend this line you typed
Quote:
/proc/bus/usb usbfs auto,devmode=0666 0 0
sounds almost like what we all have to do to get DRI working. I'm glad you mentioned it I'll make a note of it for myself.
 
Old 06-03-2006, 03:36 AM   #10
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
Once again plenty thanks to Alien_Bob and allend and the rest for coming to the rescue.

Adding a line to fstab was all it took and now the scanner works perfectly well for all users!

I guess I read the initial advise wrong, thinking each user would have to manually "mount" the scanner before it would function..

As I still don't understand the underlaying fundamentals of this, I would greatly appreciate if someone could point me towards where i can read up on how the architecture behind this system is designed, and why the scanner must be "mounted"...

Also - I noticed that the /etc/hotplug/usb/libsane.usermap does not contain an entry for my precice scanner, but /etc/sane.d/genesys.conf does - could this cause problems, or is one selectd over the other?
The sane.conf contains both my model (LiDE 60) as well as LiDE 50, 25 and 30. However, the libsane.usermap contains only the LiDE 50.

Thanks again!

-Y1
 
Old 06-03-2006, 06:39 AM   #11
jimX86
Member
 
Registered: Mar 2006
Distribution: Slackware64 -current
Posts: 268
Blog Entries: 1

Rep: Reputation: 79
Quote:
Originally Posted by Yalla-One
Also - I noticed that the /etc/hotplug/usb/libsane.usermap does not contain an entry for my precice scanner, but /etc/sane.d/genesys.conf does - could this cause problems, or is one selectd over the other?
Now I'm curious. I understand why changing fstab works. I've just never done it that way. The reason I like using hotplug is that it changes the permissions for just that specific device.

I think that the sane.d stuff recognizes your scanner but doesn't change any permissions. Hotplug does. Would you be up for confirming this? I'd be interested in knowing what happens if you comment out the new fstab line, add your scanner to libsane.usermap, and then plug the scanner in again.

Anyway, I'm glad it works for you now.
 
Old 06-03-2006, 07:28 PM   #12
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,671
Blog Entries: 7

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Quote:
Originally Posted by Yalla-One
Also - I noticed that the /etc/hotplug/usb/libsane.usermap does not contain an entry for my precice scanner
That's the problem.

When you plug in a USB scanner, hotplug searches thru the libsane.usermap file. If it finds a match, then it'll change the associated device's ownership to 'root:scanner'.

This obviously wasn't happening in your case, hence the inability to use the scanner as a normal user.

Personally, all I had to do was add my user to the 'scanner' group and it worked without having to do anything else. Our scanner is a CanoScan N1240U.
 
Old 10-06-2007, 09:38 AM   #13
thick_guy_9
Member
 
Registered: Jan 2004
Location: Singapore
Distribution: VMS, CentOS
Posts: 109

Rep: Reputation: 16
Guys,
Can someone summarize what needs to be done for Slackware 12?
I have read this thread, and want to setup a USB Canoscan N 656U under Slackware 12.

Many thanks
 
Old 10-06-2007, 09:45 AM   #14
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116
Try adding yourself to the groups 'scanner' and 'plugdev' and see if it works.
Code:
gpasswd -a your_account scanner
gpasswd -a your_account plugdev
Add the correct name for "your_account" in the commands above.

Don't forget to logoff and login again after you added yourself to these groups if you are logged in at the time you run the commands. After that, also restart the messagebus:
Code:
/etc/rc.d/rc.messagebus reload
...and if X is running, restart your X session as well.

Eric
 
Old 10-06-2007, 05:57 PM   #15
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 881

Rep: Reputation: 120Reputation: 120
I have been sharing a scanner from a slackware server for awhile now. The server is running Slack-11.0 with a 2.6 kernel. I have no doubt that the way I set up sane in 11.0 will work in 12.0. HPLIP worked just fine for my hp psc2355 on a single machine but sane with hpoj was the way I went for a shared scanner. After it's working on one box its not to hard to share it. Here are my notes (below) for setinng up the first box. The complete networking setup is here: http://www.turtlespond.net/scripts/s...t_server_notes.

Quote:
5. HPOJ and CUPS
As far as I know, my options are rather limited when it comes to networking my HP-PSC scanner. I can do it with Sane but I need hpoj to access the scanner across the lan. Hpoj is no longer in development and has been replaced by HPLIP but the source is still available and it is an easy compile and there is good documentation avaialble in the source's /doc directory. As of yet HPLIP can not be used to network HP scanners

All I need is is to untar the source, then cd into the directory and:

./configure --prefix=/usr
make
checkinstall
installpkg hpoj-0.91-i386-1.tgz

I'm lazy. In this instance I have let checkinstall make the slack pack for me.

After I have connected my two printers and turned them on I will run "ptal-init-setup" a CLI wizard used to set up hpoj-managed devices.

Note that ptal-init has to start before the print spooler (CUPS). I have made up an rc.hpoj script for starting hpoj.

#! /bin/bash
#
# Startup/shutdown script for hpoj
# Note: This script must start before cupsd.

case "$1" in
start)
echo "Starting hpoj"
echo "ptal-init start"
ptal-init start
echo "ptal-init start"
ptal-cups
;;
stop)
echo "Stopping hpoj"
ptal-init stop
;;

restart)
echo "Stopping hpoj"
ptal-init stop
echo "Restarting hpoj"
ptal-init start
;;

*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
;;
esac

exit $?

In order to get /etc/rc.d/rc.hpoj to run before /etc/rc.d/rc.cups put the following lines into /etc/rc.d/rc.M just befor the stanza for CUPS

# Start hpoj before CUPS:
if [ -x /etc/rc.d/rc.hpoj ]; then
/etc/rc.d/rc.hpoj start
fi

If you already have an hpoj stanza in rc.M make sure it is called befor CUPS.

Since I started ptal-init when I set up my devices I will have to restart CUPS "with /etc/rc/rc.cups restart" before I can open up my CUPS server at 192.168.1.1:631.

I will then have to delete any previously configured printers on the server and set up new ones because I will now access printers as ptal devices and not usb devices. For example, when configuring my HP-PSC , I would select "Device URI: ptal:/mlc:usb:PSC_2350_series".
 
  


Reply

Tags
scanner


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
permission setting of a scanner? behmjoe Linux - Hardware 1 01-01-2006 03:53 AM
setting up hp scanner in suse-9.2? greythorne SUSE / openSUSE 2 05-15-2005 09:34 AM
My experience with setting up hp scanner 3300C in Slackware 10 laiboonh Slackware 0 11-04-2004 02:03 AM
Setting up Hp 5470c scanner with sane Guust Linux - Hardware 11 12-06-2003 04:20 AM
setting up Plustek 9630p Parallel port scanner dave37 Linux - Hardware 0 10-31-2003 09:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration