Linux - SoftwareThis 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
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.
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304
Rep:
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.
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?
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304
Original Poster
Rep:
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
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304
Original Poster
Rep:
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
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304
Original Poster
Rep:
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
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.
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304
Original Poster
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.