DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default FreeBSD scanner

hello everybody,

I am a computer newby, learning Linux and started with FreeBSD lately. The only OSs I know about.

I am struggling with FreeBSD7 both as an i386 and amd64 architecture.

The problem is my scanner a Canon Lide 60. Running #scanimage -L I get "device `genesys:libusb:/dev/usb1:/dev/ugen0' is a Canon Lide 60 flatbed scanner" which is right and it shows up with xsane as root (when I am lucky to use xsane as root in gnome)

Now trying to: "7.6.4 Giving Other Users Access to the Scanner

All previous operations have been done with root privileges. You may however, need other users to have access to the scanner. The user will need read and write permissions to the device node used by the scanner. As an example, our USB scanner uses the device node /dev/uscanner0 which is owned by the operator group. Adding the user joe to the operator group will allow him to use the scanner:

# pw groupmod operator -m joe

For more details read the pw(8) manual page. You also have to set the correct write permissions (0660 or 0664) on the /dev/uscanner0 device node, by default the operator group can only read the device node. This is done by adding the following lines to the /etc/devfs.rules file:

[system=5]
add path uscanner0 mode 660

Then add the following to /etc/rc.conf and reboot the machine:

devfs_system_ruleset="system"

More information regarding these lines can be found in the devfs(8) manual page.

Note: Of course, for security reasons, you should think twice before adding a user to any group, especially the operator group."

I cannot find "/etc/devfs.rules" file, it does not exist. I tried to make one adding what I was instructed, to no avail. I tried to put "[system=5]" etc in the "/etc/defaults/devfs.rules" file, which exists, but it did not work either.

I suppose I must be doing something wrong. Please bear in mind that this is my first time that I am using the command line. I have been able to thanks to the very easy and instructive FreeBSD's handbook.

If you know why "/etc/devfs.rules" file is missing from both i386 and amd64 installations and what I can do if anything, please inform me.

Thank you very much for your efort,


borgibo
Reply With Quote
  #2   (View Single Post)  
Old 2nd October 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

/etc/devfs.rules does not exist by default. Just create it.

After you have made the changes, you will have to apply them. Apart from restarting, I do not know exactly how to do that.

Note: Do not, ever, edit the /etc/defaults. The defaults are defaults, and are overwritten or added to by the /etc/ files. There are no exceptions to that rule. /etc/defaults are there for reference only.

All you need to do is :

1. Create /etc/devfs.rules
2. Add the following to it
Code:
[system=5]
add path uscanner0 mode 660
3. Add this line to /etc/rc.conf
Code:
devfs_system_ruleset="system"
4. Restart.

Then ls -l /dev/uscanner0 should look like this:
Code:
crw-rw----  1 root    operator    0,  87 Sep 20 09:23 uscanner0
which tells us that it has worked.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
  #3   (View Single Post)  
Old 3rd October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

Thank you very much robbak,

I had already done what you suggest except: 4. Restart.

Then ls -l /dev/uscanner0 should look like this:
Code:

crw-rw---- 1 root operator 0, 87 Sep 20 09:23 uscanner0

which tells us that it has worked.
__________________
It gave me: crw-rw---- 1 root operator 0, 39 Oct 3 13:54 dev/ugen0

ugen0 is my scanner's node instead of uscanner0.

None the less the scanner does not show up in gnome as a user, it does as root or rather it did the first couple of times I tried to use it giving the command in the command applet
of gnomes's bar where I placed it.
Now when I try as root, the command window shows up but disappears immediately!
Rather frustrating

Thank you very much for your reply it is really appreciated.

There must be something else which goes wrong, I have had bad experience from whimsical scanners with Linux in the past two years that I am playing around with computers. Although lately most of the distributions I use, learning, (about 20 !), handle it ok.

Thanks again,
JV
Reply With Quote
  #4   (View Single Post)  
Old 4th October 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

'Bad experience with scanners' pretty much sums the situation up.

Things to try:

Check that you user is in the 'operator' group. do this by reading the /etc/group file . Your user should be included in a line like this:
Code:
operator:*:5:root,borgibo
Again, applying changes in /etc/group is another thing I am not sure of: Logging out should do it.

ugen is the generic USB driver: any USB device that does not have a driver gets that. It provides access to the raw data streams to use processes. I think that the usb libraries used with sane are quite happy talking to a ugen device - if you have tried to load a kernel module for your scanner, you have not succeeded. If it is working as root, though, you have no problems with the driver.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
  #5   (View Single Post)  
Old 7th October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

Sorry for the delay, I had no connection for about 5 days, some tractor here in the village ripped the telephone cable so everyone was without phone which happens from time to time!

I think I discovered the culprit though! "operator:*:5:root" that is all I get in /etc/group.
I should have "operator:*:5:root,jv" as jv is my user.

I went initially in FreeBSD's handbook nr 7.6.4 "#pw groupmod operator -m jv"

Then I created using ee the /etc/devfs.rules file wherein I wrote:
[system=5]
add path ugen0 mode 660

and then added to /etc/rc.conf file devfs_system_ruleset="system"

So there you know my steps.

I got so angry those few days that I was not connected and I played extensively with FreeBSD that I erased the amd64 architecture I still have the i386 though.

More on the funny side, I had been frustrated for quite a while as one of my favourite distros 64Studio, which I use now, would not spell check. Now it does! US. favourite is wrong

Is it probable that I did not create the file properly with ee?


Thanks a lot for your help
Reply With Quote
  #6   (View Single Post)  
Old 7th October 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

Not having your user account in the operator group would have stopped it from working. Try echo "test" > /dev/ugen0 and cat /dev/ugen0. Those commands should either do nothing or produce an error, but that error should not be "permission denied".

Of course, maybe you have got it working, and you do not need any more help. You didn't say!
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
  #7   (View Single Post)  
Old 8th October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

echo "test" did nothing but cat /dev/ugen0 produced: Operation not supported by device.

Something else that you might find interesting is that when I try from terminal: #xsane I get: Gtk-WARNING **: cannot open display
Reply With Quote
  #8   (View Single Post)  
Old 9th October 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

That is good: Operation not supported is the sort of thing I wanted to see. You were allowed to talk to the device, but it did not know what the word 'test' means.

The error from Xsane simply means that it cannot talk to X. Is X running? Are you running it from an xterm, or from the console? It will not work from the console, you must run it from within X.

Everything seems to be fine: Can we confirm that your scanner is now working properly?
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
  #9   (View Single Post)  
Old 10th October 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Thanked 36 Times in 34 Posts
Default

Quote:
Originally Posted by borgibo View Post
Something else that you might find interesting is that when I try from terminal: #xsane I get: Gtk-WARNING **: cannot open display
Are you trying to run xsane as root while being logged in as a different user? That is probably the reason it can't open a display.
Reply With Quote
Old 10th October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

First and main thing I want to apologize for my computer illiteracy which gives you a hard time.

I did not know what the difference between a console and a terminal is, also that "xsane" that I have used innumerable times means "sane" in the gui of the X Window System or X11 here !!!! ( I only guess the latter, probably I am wrong. )

So I logged in as root, used the xterminal " #xsane enter " and everything worked
It showed me "canon60:ugen0" as well and I even scanned a document to the monitor. The printer is not configured yet, I know I am expecting trouble there ! as it is BSD and not cups but I enjoy torturing myself ! Fetish So I can not copy.

So actually I was: " Are you trying to run xsane as root while being logged in as a different user? That is probably the reason it can't open a display."

Thanks a lot,

borgibo
Reply With Quote
Old 10th October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

Scratching around the pw command and trying to make ends meet from the manual page, which thankfully I can copy from FreeBSD Man Pages, I suspect that the Handbook's 7.6.4 #pw groupmod operator -m jv (jv being specific me in this case) is not the perfect command. Reading the USER OPTIONS -m which I do not understand of course, I get the feeling that since jv has already a home directory that command -m is somehow not the proper one. That is only my silly intuition.

borgibo
Reply With Quote
Old 10th October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

Back again!

I ran without logging in in Gnome at the console:#pw groupmod operator -m jv and this time sure enough jv appeared in the /etc/group file besides operator. But still no luck with scanner.

#echo "test" > /dev/ugen0 tells me: Operation not supported by device
#cat /dev/ugen0 tells me: No such file or directory

If that is not confusing

I will survive!

borgibo
Reply With Quote
Old 11th October 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

Does it work scanning? If not, what error does it show? I'm totally in the dark here.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
Old 11th October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

Today I tried to scann as root from the x terminal and got the famous "no devices available". Got a shock but I unplugged and replugged the scanner and this time it worked again like yesterday. Scanned a document to the desktop. Upside down it went

Tried as user "jv" and I got : Failed to open device `genesys:libusb:/dev/usb4:/dev/ugen0':
Error during device I/O

As jv I can use both the three gear icon in gnome to start xsane and the xterminal as $.
As root I cannot use the gnome three gear icon as the popping up window disappears immediately.
Reply With Quote
Old 11th October 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

OK - let's be sure of things.

ls -l /dev/ugen0

let's have the contents of /etc/group while we are at it.

Check whether /var/log/message (and /var/log/all ) have more information on what that error is. I think it is would be permission denied, but you never know.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
Old 11th October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

ls -l /dev/ugen0 shows: crw-rw---- 1 root operator 0, 115 Oct11 13:26 /dev/ugen0

/etc/group shows: operator:*:5:root,jv

/var/log/messages shows innumerable messages with the same content any of which unfortunately I cannot copy and paste. I will try to copy the latest:

Oct 11 15:21:37 borgiboi386 gnome-keyring-daemon[1236]:Scheduling hal init retry
Oct 11 15:22:08 borgiboi386 gnome-keyring-daemon[1236]:error connecting to D-BUS system bus:Failed to connect to socket /var/run/dbus/system-bus-socket: No such file or directory.

This is being repeated continuously.

Could not find /var/log/all .

I am writing this from FreeBSD so the fonts are not very good I am afraid.
Reply With Quote
Old 11th October 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

No font problems here. There is a port called, I think, urw-fonts you can install your end to fix that.

The dbus errors can be fixed by enabling dbus. I think the port will have inserted an init script in /usr/local/etc/rc.d, and reading that script should tell you what line to insert into rc.conf to enable it.

You can get /var/log/all.log by editing syslog.conf and uncommenting the appropriate entry, creating /var/log/all.log, chown/chmodding it to root:wheel rw------- (0600 in octal) and restarting syslogd. It logs all messages, and has proved itself useful in tracking down issues for me.

So much for the off-topics.

On topic: Look, I have no idea why it is still not working - maybe it is that dbus thing, but I doubt it - but you seem to have given yourself read-write access to ugen0, so i have no explanation why it is not working. Can you turn on any debug options on xsane? (I just read the man page and it didn't show me any debug options.)

Nope, I'm stumped.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
Old 11th October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

Thank you very very much robbak,

I will try what you suggest but first I have to digest it ! You know I am so new to computing that I get really exhausted trying to follow up what I am told !

The fact that xsane is working as root is enough for me. Who knows probably it will settle down and work as jv as well within days. After all that is what happened with /etc/group
where jv surfaced beside root after 4-5 days.

Thank you once again both for your help and the lessons I got from you.

borgibo happy
Reply With Quote
Old 12th October 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Thanked 36 Times in 34 Posts
Default

What kind of desktop are you using?

I think this might be a HAL issue. Just doing a quick Google search reveals several other people with the same problem with xsane.

You stated dbus errors before. If dbus is not running then HAL must not be running. First thing is to get them running:
Add the following lines to /etc/rc.conf to enable HAL and dbus:
Code:
dbus_enable="YES"
hald_enable="YES"
You will have to start them manually or reboot. To do this manually:
Code:
# /usr/local/etc/rc.d/dbus start
# /usr/local/etc/rc.d/hald start
That's a start. It should at least get rid of the dbus errors.

Can you run $ sane-find-scanner or $ scan-image -L as a normal user from an xterm?

AFAIK sane itself doesn't need HAL or even use it, but it can support HAL device info. This might be required for xsane since it is tied into GNOME. Sorry if all this is confusing, but I would like to narrow this down a bit.
Reply With Quote
Old 12th October 2008
borgibo borgibo is offline
Real Name: John Vliouras
borgibo
 
Join Date: Sep 2008
Location: Crete, Greece
Posts: 28
Thanked 0 Times in 0 Posts
Default

Really amazed at your perseverance I must say that I am learning a lot from you. I did not want to bother you any more so I did not inform you that yesterday I already got rid of dbus following your instructions plus went over to the Handbook again and understood this time 4.6 Post-Installation Activities, found the place of xsane docs and applied some of the suggestions i.e. I uncommented, (that is put a # in front of), all back ends except genesys.

That rendered xsane extremely fast showing up as root and same in telling me: cannot open..... etc, I/O error..., as jv

Unfortunately I was unable to discover the file of syslog.conf much as I tried. So was unable to try and create /var/log/all.log

Now there are no endless dbus errors but I have endless "failed to initialize a HAL context: (null)"

I will let you know as soon as I 'digest' your newer instructions!
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NetBSD 5.0 wifi/wireless network browser/scanner vermaden NetBSD General 9 5th July 2009 12:56 AM
qmail scanner problem t4y4n FreeBSD General 1 5th August 2008 07:36 PM


All times are GMT. The time now is 02:55 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick