LinuxQuestions.org
Help answer threads with 0 replies.
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 07-05-2004, 11:18 PM   #1
craigienz
LQ Newbie
 
Registered: Aug 2003
Location: Wellington, New Zealand
Distribution: Slackware
Posts: 22

Rep: Reputation: 15
Question Scanner only has access under root


Hi,

I am having issues with my scannner.

Which according to (root) scanimage -L is a Mustek BearPaw 1200 USB flatbed scanner.

The problem is that I can only access it under root. I have no real trouble doing this, I don't mind using root, but it would be nice not to have to su all the time.

I upgraded my kernel from 2.4.22 to 2.6.7 and this is when the problem started. Even if I reboot and use the 2.4.22 kernel, it still won't see the scanner.

I don't have time to put all the fancy cat's and things on here at the moment. If they are needed then I will put them up tomorrow. But if there is an easy way of fixing this, it would be helpful. Maybe a chmod somewhere or something.

Any help would be greatly appreciated.

Craig.
 
Old 07-05-2004, 11:33 PM   #2
blk96gt
Member
 
Registered: Jun 2004
Location: Nacogdoches, TX
Distribution: Ubuntu 7.04
Posts: 230

Rep: Reputation: 30
I don't know much about scanners, but my guess would be is to change the permissions of the scanner device under the /dev directory if there is one. Do you have to mount the scanner to use it? If so, change the permisions of the mount directory, and maybe add and entry to /etc/fstab? Someone else would have to help you out there though.

Last edited by blk96gt; 07-05-2004 at 11:34 PM.
 
Old 07-05-2004, 11:40 PM   #3
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Rep: Reputation: 31
run 'sane-find-scanner' as root and if it detects the scanner then it should tell you where it is (for me its /dev/sg0, for you itll probably be /dev/usb/scanner0 or something similar). then you should (as root) chmod a+rw whichever device your scanner is. it should then be accessible as a normal user.

example:
chmod a+rw /dev/usb/scanner0

except change the file to the one given by sane-find-scanner.
 
Old 07-06-2004, 06:16 PM   #4
craigienz
LQ Newbie
 
Registered: Aug 2003
Location: Wellington, New Zealand
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
Still not working

Hi,

I ran sane-find-scanner, and it came up with this:


# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x0400 [National Semiconductor], product=0x1000 [Merlin Scanner], chip=LM9831) at libusb:001:004
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.

# Not checking for parallel port scanners.

# Most Scanners connected to the parallel port or other proprietary ports
# can't be detected by this program.

Which doesn't help as to where the device is. But I remember yesterday reading somewhere on my computer that the device is /dev/usb/scanner0, so I tried the chmod a+rw /dev/usb/scanner0
stated above. Unfortunately it didn't work.

Just in case you need it I have included the cat /proc/bus/usb/devices (for the scanner):
T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0400 ProdID=1000 Rev= 1.00
S: Manufacturer=National Semiconductor
S: Product=Merlin Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=60 MxPwr= 2mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none)
E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=16ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms

Ok, I don't know what else to add to this now.
 
Old 07-06-2004, 06:22 PM   #5
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 49
You will need to look under the /sys directory. I forget exactly where, but the libusb:001:004 will help you out. Sorry I can't be more help at the moment, as I'm away from my Slackware box and I managed to trash my networking yesterday. Let me know if this helps at all and I can give more info tonight.
 
Old 07-06-2004, 06:24 PM   #6
synapse
Member
 
Registered: Jan 2004
Location: On Planet Earth.
Distribution: Slackware 12
Posts: 244

Rep: Reputation: 30
Hi

Try the following

none /proc/bus/usb usbfs defaults,devmode=0666 0 0

add to the fstab file
I have this scanner working fine, gimme a shout if you need any more help, I am assuming you have added the firmware file to the corrsct place as well.

Hope this helps
cheers
 
Old 07-12-2004, 07:29 AM   #7
craigienz
LQ Newbie
 
Registered: Aug 2003
Location: Wellington, New Zealand
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
Nothing Major

I found out how to get a quick get around for the scanner problem. Load 2.4.22 kernel again, it doesn't have issues with the scanner, and the sound works fine on it, where it doesn't under 2.6.5,.6, or .7 So I guess the 2.6.* kernels aren't that good after all.
 
Old 07-14-2004, 11:05 AM   #8
vitko
LQ Newbie
 
Registered: Jul 2004
Posts: 3

Rep: Reputation: 0
AFAIK under 2.6.x kernels USB scanner support is moved (or moving) to userspace. There is no more kernel/module code, no device in /dev. Instead there is USB filesystem (usbfs, must be declared in /etc/fstab). When you plug-in the USB scanner, "device" is created in /proc/bus/usb. By default only root can access this device. To access scanner as user, you (1) set global permissions for usbfs in /etc/fstab (e.g. devmode=0666) - this can be pretty dangerous, or (2) use hotplug scripts, which upon connecting/powering on scanner change permissions on newly spawned device in /proc/bus/usb.

I've learned all this yesterday and as I'll have to make my USB Mustek 1200 CU working tomorrow, I'll keep you informed on my progress. Also if I'm mistaken in some points, please correct me.

Vit
 
Old 07-14-2004, 06:14 PM   #9
craigienz
LQ Newbie
 
Registered: Aug 2003
Location: Wellington, New Zealand
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
Hi, thanks for teh reply.

I had already got the following in fstab:
none /proc/bus/usb usbfs defaults,auto,devmode=0666 0 0
but it did not seem to do anything. So, I was playing around with it for a while, and after some bumps came up with this.

in /proc/bus/usb there is a file called device, it states all the usb devices on your computer, and where to find them. Mine looks a bit like this for the scanner:

T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0400 ProdID=1000 Rev= 1.00
S: Manufacturer=National Semiconductor
S: Product=Merlin Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=60 MxPwr= 2mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none)
E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=16ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms

So, I thought to myself, up the top it says Bus=1 and Dev#= 4. So, under /proc/bus/usb, there was a directory called 001, which I took to mean the bus, then under that there was a file called 004, which I took to be teh device. I then chmod 666 004, and hey presto, the scanner is usable by just common users.

I realise this is probably a very bad thing to do, and now I am going to be shot down by many knowledgable people out there, but it worked. Mind you, I don't know if it will work when I reboot the computer. I guess I will find out soon enough.

If some one has an easier way of fixing this problem, please don't hesitate to tell me, I am all for learning more.
 
Old 07-15-2004, 01:41 AM   #10
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 49
That's exactly what I was alluding to. I have a similar situation with my scanner, so I added the chmod line to /etc/rc.d/rc.local . Probably not the preferred method, but it works for now.
 
Old 07-15-2004, 06:46 AM   #11
kite
Member
 
Registered: Aug 2003
Location: Shenzhen, China
Distribution: Slackware
Posts: 301

Rep: Reputation: 47
Probably this permission problem is related to udev, please check /etc/udev/permissions.dudev.permissions, maybe you have to change or add the default permission for your scanner device, say 660. With udev in use, chmod device in /dev/ will not stay after reboot.

The other day, I installed slack 10, I even found that my modem device disappeard because of udev, I solve the problem by adding some nodes creation scripts into /etc/udev/scripts/make_extra_nodes.sh, and add default group / permission for modem in /dev/udev/permissions.d/udev.permissions, then I was able to use modem as normal user. This is just for your reference.

Hope this help.

Last edited by kite; 07-15-2004 at 06:54 AM.
 
Old 07-16-2004, 03:04 AM   #12
craigienz
LQ Newbie
 
Registered: Aug 2003
Location: Wellington, New Zealand
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
Um, I have no /etc/udev directory and no /dev/udev.

Just in case you wanted to know.
 
Old 07-17-2004, 02:16 AM   #13
lucho
LQ Newbie
 
Registered: Nov 2003
Distribution: Slackware 10.2
Posts: 22

Rep: Reputation: 15
The problem with the solutions above is that if you unplug your scanner and then when you plug it again it doesn't work any longer. The usb subsystem assigns a different device name, and you would have to go and change the permission again. The "right" way of doing it is to add a hotplug script that is executed every time the scanner is plugged in. Mine is at /etc/hotplug/usb/libusbscanner and reads as follows:

if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
chmod 0666 "$DEVICE"
fi

I didn't feel that it was necessary to create a scanner group and give access only to that group (I'm behind a firewall).

Now my problem (that's how I stumbled into this thread) is that I thought the script was also executed at boot time (coldplug), but it doesn't seem that's the case. But if I go and unplug-plug the scanner, it gets the right permissions!
 
Old 07-19-2004, 03:32 PM   #14
vdemuth
Member
 
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),Suse 13.1 (Desktop),, Mepis on the wifes lappy
Posts: 770

Rep: Reputation: 94
Have been following this thread as I have exactly the same problem, and whatever I try, I can only get my scanner to work as root. For the life of me, I just can't get hotplug to recognise my scanner. When I switch it on, it is seen by the system as lsusb shows, and is also confirmed by /etc/rc.d/rc.hotplug status.
I have the libusbscanner script in /etc/hotplug/usb which reads like this:-
#!/bin/sh

# This file is part of sane-backends.
#
# This script changes the permissions and ownership of a USB device under
# /proc/bus/usb to grant access to this device to users in the scanner group.
#
# Ownership is set to root:scanner, permissions are set to 0660.
#
# Arguments :
# -----------
# ACTION=[add|remove]
# DEVICE=/proc/bus/usb/BBB/DDD
# TYPE=usb

# if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
# chown root:scanner "$DEVICE"
# chmod 0666 "$DEVICE"
# fi


# That's an insecure but simple alternative
# Everyone has access to the scanner

if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
chmod 0666 "$DEVICE"
fi

Still it will not work as user, so does anyone have any more ideas.
 
Old 07-19-2004, 06:22 PM   #15
craigienz
LQ Newbie
 
Registered: Aug 2003
Location: Wellington, New Zealand
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
Have you tried what we suggested in posts nine and ten?

I have no need to unplug my scanner all the time, so I don't need to worry about putting in a script for it. Just what I have in rc.local.
 
  


Reply


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
Scanner Access Rick069 Linux - Hardware 5 10-04-2005 05:43 PM
How do I access my scanner? maestro52 Fedora 4 01-24-2005 12:26 AM
Scanner as root 900i Mandriva 3 12-04-2004 02:40 PM
Scanner to work as USER and not forced as ROOT Root (Suse 9.1) 1kyle Linux - Hardware 0 07-10-2004 09:51 AM
scanner access tsitras Linux - Hardware 3 04-29-2004 09:41 AM


All times are GMT -5. The time now is 06:26 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration