LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-20-2010, 08:36 PM   #1
Doug Hutcheson
Member
 
Registered: Jun 2009
Location: Philippines
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304

Rep: Reputation: 22
sane parport Canon N640P scanner


1. Unless root chmod's /dev/parport0 to include o+rw, a user running xsane just gets the dialog 'No devices available'. Should the canon_pp driver be installed as su root, perhaps? CUPS uses the same port for printing without problems. Which library or executable needs to have permissions changed to change to run as root?

2. The N640P has a printer output port built in. As I have only one parallel port, I piggy-back my printer through the scanner. This does not work for xsane in Copy mode: nothing prints until I close xsane and then all I get printed is a stream of binary characters, not an image. I guess the canon_pp driver is holding the port open in such a way that CUPS sees the device as being busy. Any ideas on how to combat that? I am a C programmer and quite happy to help by hacking the code, if I have a start point. It irritates me to have to boot the print server into WinXP just so scanning and copying work without fuss.

Cheers, Doug
 
Old 04-21-2010, 03:41 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Disclaimer: I don't use fedora.

Q1] Check your user's group memberships ( groups username in a terminal). To use a scanner they often need to be a member of the group scanner.

Check who can have access to /dev/parport0 with ls -l /dev/parport0 and adjust user's group memberships accordingly. There may be other issues with fedora, I admit I do not know.
Quote:
Should the canon_pp driver be installed as su root, perhaps?
Err, Yes.
If you want the canon_pp driver to be accessible by all users, you need to install it as root, or individually for every user (I don't think you'd want to do this). The reason is that printer-stuff installed as root is generally available to all users. Printer-stuff installed as a user is only applicable to that user ( otherwise, sensibly, "Permission Denied" - maybe one user has a printer they have installed and do not want everyone else to use).

Q2] I don't understand your situation: You have a scanner that is connected by a parallel port, and it is then somehow (how?) connected to your printer?

"Piggy-backing" might not be the way to go.
 
Old 04-21-2010, 10:46 PM   #3
Doug Hutcheson
Member
 
Registered: Jun 2009
Location: Philippines
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304

Original Poster
Rep: Reputation: 22
Thanks, tredegar.

The user is a member of his own group only. As printing via CUPS works for him, I don't think he needs to be a member of any other group in order to access the parport0 device; in other words, CUPS manages this behind the scenes and I was hoping to tweak something in the executable's permissions to enable xsane to silently provide access as well.

My question was ambiguous. I was wondering if an executable or library needs to have 'execute as root' permissions, not whether it should be installed as root. xsane was installed as root and all users (other than root, of course) have the same problem.

As the device ownership is root:lp, I expect CUPS drivers have 'execute as lp' permissions set somewhere and this may work for xsane too. I have an aversion to setting 'execute as' permissions on anything for security reasons, but it might be justified in this case.

As for the scanner, yes the Canon N640Pex has an output parallel port as well as an input. The output port is to attach a printer. The o/s 'sees' the printer at lp0, as if it were directly attached to the parallel port of the computer. The Windows drivers for the scanner and the printer (a Canon BJC-4100 as it happens) handle this transparently. When scanning in 'Copy' mode, the scanner driver acquires the scanned image then sends it to the printer over the same hardware port but presumably using different pins. I have not tried sending a document to print while the scanner is in use, but I assume it is an either/or situation: I can either scan or print, but not both at the same time.

Cheers, Doug.

Last edited by Doug Hutcheson; 04-22-2010 at 01:48 AM. Reason: Missed half the question
 
Old 04-22-2010, 11:04 PM   #4
Laurens73
Member
 
Registered: Aug 2009
Location: Zeewolde, Flevoland NL
Distribution: Debian squeeze (Gnome) on netbooks; Debian Lenny on servers and Debian wheezy (XFCE) on new laptops
Posts: 144

Rep: Reputation: 23
The fastest way to get the scanner working for all users is making them member of the group scanner by editing the file /etc/group

Then add the lines below in /etc/rc.local above the latest line:
Code:
chown root:scanner /dev/parport0
chmod 775 /dev/parport0
After the next user login (reboot or run /etc/rc.local first) this should be working.

Last edited by Laurens73; 04-22-2010 at 11:05 PM.
 
1 members found this post helpful.
Old 04-24-2010, 02:46 AM   #5
Doug Hutcheson
Member
 
Registered: Jun 2009
Location: Philippines
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304

Original Poster
Rep: Reputation: 22
Hi, Laurens73.
Thanks for the reminder about rc.local: now at least I can scan OK. Printing down the same cable is going to be a problem, because xsane is using /dev/parport0 and CUPS is using /dev/lp0.
I think I will just have to keep the print server booted into WinXP to drive both devices correctly.
Now to solve my CUPS problems ... sigh!
Cheers,
Doug
 
Old 04-24-2010, 06:08 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
xsane is using /dev/parport0 and CUPS is using /dev/lp0.
I would take that as being a good sign.

Just set up cups with http://localhost:631 and let it use /dev/lp0

I would be interested to see the output of lsusb with both the printer and scanner plugged in and turned on.
 
Old 04-24-2010, 06:33 PM   #7
Doug Hutcheson
Member
 
Registered: Jun 2009
Location: Philippines
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304

Original Poster
Rep: Reputation: 22
Hi tredegar.
CUPS is already using /dev/lp0. Do you mean I should get CUPS to use /dev/parport0? I'm a bit confused, but I appreciate your help.
Also confused about using lsusb, as both devices are parallel. I would have thought what would be good would be to see what devices are attached to parport0 or lp0. Is there a way of doing that?
Cheers, Doug
 
Old 04-25-2010, 10:17 AM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
OK, it is clearer now. I don't know where I got the idea one of your devices was USB.

AFAIK the parallel port cannot be used for your printer at the same time as it is being used for scanner.
/dev/parport0 seems to be your scanner (cups won't know what to do with this)
/dev/lp0 seems to be your printer, which is connected to your scanner.

I'd guess the way this works is something like this: The scanner monitors the parallel port connected to the PC. If it receives commands that look like printer commands, it sends them to the scanner's parallel port, so the printer gets what it needs. If the scanner sees commands suitable for a scanner, it uses the port, and sends nothing to the printer.

I don't think you will be able to scan and print at the same time.

If you want to use xsane in "copy" mode, you are going to have to scan to a file, then print the file.
Or get a USB scanner, and let the printer have exclusive use of the parallel port.

Quote:
....to see what devices are attached to parport0 or lp0. Is there a way of doing that?
I know of no utility to do this, but the linux is capable of discovering my HPLaserjet that is attached to the parallel port. So there must be some low-level <ESC> sequence that can be sent to /dev/lp0 to make a printer identify itself.
 
1 members found this post helpful.
Old 04-25-2010, 08:49 PM   #9
Doug Hutcheson
Member
 
Registered: Jun 2009
Location: Philippines
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304

Original Poster
Rep: Reputation: 22
Quote:
I don't think you will be able to scan and print at the same time.
Thanks for your help. I agree it will not be possible with the available Linux software. It works in windows only because the Win driver software is especially written to control the parallel port and Canon are not particularly helpful <grin> when it comes to releasing driver details to the Open Source community.
I will keep my existing setup, having the printer/scanner driven by a server booted into WinXP, until the scanner reaches its use-by date. When the scanner goes belly-up, I will buy one from a manufacturer with good Linux drivers.
Thanks again for your time and input.
Cheers, Doug.
 
  


Reply



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
usb scanner premissions issue when running sane-find-scanner vlsd Linux - Hardware 4 08-20-2009 02:20 PM
Problem with my Canon Lide 25 scanner and Sane/XSane hansdezwart Linux - Hardware 1 08-22-2007 06:10 AM
canoscan n640P ex scanner (parallel port) qazwsx27 Linux - Hardware 0 11-02-2006 02:32 PM
Canon N640P EX & Xsane don't work Neeko Linux - Hardware 0 02-20-2005 11:40 PM
sane /dev/scanner? jeru Linux - Hardware 3 10-22-2004 09:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:25 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
Open Source Consulting | Domain Registration