Solved No Scanner for user available

D

Deleted member 43773

Guest
Hi all readers,

trying to install my scanner and xsane as described in hb 7.7 works fine so far - as root.
(12.0-RELEASE-p3)
But as
user # scanimage -L
gives me the "No scanners were identified.[...]" Message

I understood that's an issue of permissions, as it's also written in manpage of sane-usb.

But how do I set the permissions right?

hb 7.7.3 Scanner Permissions (it is /etc/defaults/devfs.rules instead of (not existing) /etc/devfs.rules, right?)
as also proceeding as described in 4.3.8 of
makes no differences whatsoever, neither when I do change permission directly to /dev/ugen* or /dev/usb/* -
btw the symlinks /dev/ugen* belong to wheel, /dev/usb/* to operator - and/or (for testing only) add user to operator group.

What do I not see? Where is my mistake?

Thanks for any hints.

Profighost
 
hb 7.7.3 Scanner Permissions (it is /etc/defaults/devfs.rules instead of (not existing) /etc/devfs.rules, right?)
It is not a good idea to edit files under /etc/defaults, better let them as they are and make any configuration, after creating, to its equivalent in /etc.

Remove any configuration you have added in /etc/defaults/devfs.rules, put it in /etc/devfs.rules, configure /etc/rc.conf.

From devfs.rules(5)
Code:
One custom    ruleset    has to be enabled in /etc/rc.conf, otherwise it    will
     not be applied to the /dev    file system by the default system startup
     process.  For example, to enable a    ``localrules'' ruleset for the /dev
     file system, you would have to use    something like this in your rc.conf
     file:

       devfs_system_ruleset="localrules"
Taking the example from the handbook for /etc/devfs.rules
Code:
[system=5]
add path ugen0.2 mode 0660 group usb
add path usb/0.2.0 mode 0666 group usb

Set in /etc/rc.conf
Code:
devfs_system_ruleset=“system”
Apply rules:

service devfs restart
devfs ruleset 5
devfs rule applyset

(Thanks k.jacker)

If still unsuccessful please post the output of:

pkg info | grep sane
scanimage -L (as root) or camcontrol rescan all and camcontrol devlist
cat /etc/devfs.rules
cat /etc/rc.conf | grep devfs
cat /etc/group | grep usb
groups (as user who wants to use the scanner)
 
Thank you very much for all of your answers, and also thank you very much for answering so quickly.

I've tried some stuff early this morning (also corrected that /etc/default... stuff. You're absolutely right, to keep fingers away from default config files; I already learned that's not a good idea; but sometimes one tries stuff - and then it's good, when it's not working, because one might let it be...), but then the golf course called ^^

I will work me through your hints and tipps this weekend, and I am convinced to find the solution by your advices.

However you'll receive here report from me monday at the latest when/if I succeeded .. or not,
and I'll tell you, what I've done.

Until then: Have a nice weekend and/or holidays (who has).

P.S.: It's a HP Scanjet 3970, vendor=0x03f0, product=0x2305, at libusb:000:004
answering/responding to
root# scanimage -L
device `hp3900:libusb:000:004' is a Hewlett-Packard Scanjet 3970 flatbed scanner
(and not with 'hp3970:/dev/ugen0.4' or 'hp3970:/dev/usb/0.4.0')

Thanks again.
 
6420

Your hints helped me a lot to learn much more about that stuff and to check the files again - Thank you for that - and also looking closer again to the files and so correcting some typemismatches (yes, *SIGH*, that's stupid, but also stays a concern :))


What did I do to make it work?

create a new file:
root # edit /etc/devfs.rules
[myusb_scanner=5]
add path 'ugen*' unhide
add path 'usb/*' unhide
add path 'ugen*' mode 0660 group usb
add path 'usb/*' mode 0666 group usb

Comments to that:
I was not sure if the paths need to be set within ' ' or not, because you'll find both ways (hb and T-Deamon's example are without, at other places it's with... - confusing, at least for newcomers); so I looked into my /etc/default/devfs.rules how it's done there - with ' '. But I figured out, it doesn't matter - either way works.

On single user systems you may set the rules to your user's group instead of creating a new group and add your user to it - either way works.

One has to watch out to not get in conflict with already existing rulesets in /etc/default/devfs.rules by not using the same ruleset name or number. I didn't have that, but I think it's important to know.
man devfs(8):
"
FILES:

/etc/devfs.rules Local devfs configuration file.
Rulesets in here override those in
/etc/defaults/devfs.rules with the
same ruleset number, otherwise the
two files are effectively merged.
"


The main point within my problem I had I believe was in unhiding the usb ports for users.

to /etc/rc.conf I added
#scanner
devfs_system_ruleset="myusb_scanner"

then applied the rules as described.

root # service devfs restart
root # devfs ruleset 5
This is the number of your defined ruleset
root # devfs rule applyset

So the scanner can be found by my user and also the xsane Gimp-plugin works.
user % scanimage -L
device `hp3900:libusb:003:004' is a Hewlett-Packard Scanjet 3970 flatbed scanner
P.S.: yes, I changed the usb-plug from 0.4 to 3.4. There does not lies the problem; I just checked if there was a problem with my usb card - but it wasn't.

Voilá!

Thank you all - you really helped me to solve my problem and to learn a little bit more about the system.

yours (until my next question ;-))

Profighost
 
The handbook seems to advise (among other things like the USB group etc) putting these lines
add path 'ugen*' mode 0660 group usb
add path 'usb/*' mode 0666 group usb


in /etc/devfs.rules - but that didn't work, it seemed to be ignored.

However, when put in /etc/defaults/devfs.rules, everything works fine.

I cannot seem to understand the purpose of the two devfs.rules files, and how one takes precedence over the other.
If someone can enlighten me sometime, I'd appreciate it.
Thanks,
 
See T-Daemon's post from April 18, 2019 above.


What I learned by this thread was: For (system)settings there is not one single config-file in one location only.
There are several, different reasons for doing so, depending on what is to be configured. Some of those reasons are compatibility reasons (e.g. look at X), such as keeping the former ways alive, and others.
Also since FreeBSD's basic nature is like other unixlike-systems not being primary a single stand-alone-machine but a network, for config in many cases one needs to distinguish what is ment: the individual user settings, the settings of this machine, global settings...

However:
In this case it's simply the difference between "general system preset rules" and "individual adaptation for this particular machine"
See the section FILES in devfs.rules(5)

At first you only find one file existing in /etc/defaults
Files in ./defaults/ are part kind of "rudimentary basic system preset foothold config" - default
You better do not touch those (except you really know, what your are doing, and really know why and how). Besides it's kind of "brute" to make things run that way and you're changing (messing with) rudimentary system settings, those files may be overwritten by a system's update, and if this happens...you spent lot of time to be pi§§*# and figure out why the fu(& suddenly runs not anymore as it should and formerly bravely does until you figure out: "your" configfiles have been overwritten - to default... - You see, I've learned it the hard way myself :D

The other one /etc/devfs.rules not yet exists until you decide to make changes to your system - not running all at default-conditions.
Also in the man page of devfs.rules(5) you can read that /etc/ overrides /etc/defaults/
That makes sense:
First you have basic settings, and than make changes/adaptations to them.
As formerly mentioned there are many good reasons to keep them seperate.

Why in your case only in ./defaults/ it works and in /etc/ it doesn't I don't know. Maybe you simply have forgotten to tell the system to use it by forgetting to activate it in your /etc/rc.conf
in my rc.conf :
Code:
#scanner
devfs_system_ruleset="system"
and the /etc/devfs.rules contains:
Code:
[system=5] # give it a (sensible) name and the number of system's runlevel, where this is valid
add path 'ugen*' mode 0660 group usb
add path 'usb/*' mode 0666 group usb
You noticed the link "system" between rc.conf and the /etc/devfs.rules.

...or you maybe simply have a typo anywhere e.g. misspelled devfs.rules or something like that (Always beware of typos! 🤓 )
 
Did somebody made some little formatation improves of my last post?
It's way better than I thought I wrote it - if so, thank you.
(I still do not figured it out yet, how to change font and color of pathnames in gree... - Ah, got it! 😁)
 
Profighost: many thanks for your explanation and the time taken.
Everything now working as expected and intended.
For some reason I had originally interpreted the string within the square bracket [system=5] as some kind of comment and ignored it.
More than that, when moving the lines from /etc/defaults/devfs.rules to /etc/devfs.rules, I discovered I had the permission rules for CUPS in /etc/defaults/devfs - so I moved those as well.
As you mention, the defaults version could be overwritten by an update - and that would have cost me hours digging around.
And not only that, I now understand the logic / structure of these rules a little better.
Thanks again.
 
Back
Top