SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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
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.
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.
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.
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.
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:
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.
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.
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.
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!
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.