Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Parallel Port Scanner
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Thu May 20, 2004 4:40 am    Post subject: HOWTO: Parallel Port Scanner Reply with quote

Who is this for?

If you have a scanner attached to your computer by a parallel printer cable, but expects to do so through a SCSI adapter card rather than directly to the motherboard. If you have a native parallel port scanner, read the other contributions later in this thread.


Requirements

You must be running a 2.6.x series kernel and a have the sources installed.


Configuring the Kernel (kernel <= 2.6.10)

a) Download the patch

http://penguin-breeder.org/kernel/download/linux-ppscsi-2.6.x.patch.gz

b) Patch the kernel as root in the kernel source directory:

Code:
# gzcat <path to download>  | patch -p1


c) Enable the following options (I recommend modules if you need to suspend-to-disk):

Code:
Device Drivers
    -> SCSI device support
        <M> SCSI device support
        <M> SCSI generic support
        -> SCSI low-level drivers
           <M> Parallel Port SCSI adapters
           <M> <your scanner>


My scanner is an HP ScanJet 5100C, so I selected "Shuttle EPST". A rough mapping from scanner badge to optimum driver is here:

http://www.buzzard.org.uk/jonathan/scanners.html

d) Compile and install kernel

Code:
# make
# make modules_install
# cp arch/i386/boot/bzImage /boot/<whatever>


e) If you enabled the items above as modules

Add the module for <your scanner> as well as sg to /etc/modules.autoload.d/kernel-2.6; the remaining SCSI modules will be loaded automatically. Use "modprobe" to load them manually to test without rebooting.


Configuring the Kernel (kernel >=2.6.10)

Use the ebuild at Bug #119196


Configuring /dev (devfsd)

a) Add the following lines to /etc/devfsd.con

Code:
# Set SCSI generic permissions (for scanner)
REGISTER   ^scsi/host0/bus0/target0/lun0/generic$  PERMISSIONS root.scanner 660
REGISTER   ^scsi/host0/bus0/target0/lun0/generic$  CFUNCTION GLOBAL mksymlink $devname scanner
LOOKUP  ^scanner$  CFUNCTION GLOBAL mksymlink scsi/host0/bus0/target0/lun0/generic scanner


b) Do "killall -HUP devfsd" as root to load the new configuration


Configuring /dev (udev)

My rule file in "/etc/udev/rules.d":

Code:
BUS=="scsi", SYSFS{vendor}=="HP*", SYSFS{model}=="C5190A*", NAME="%k", GROUP="uucp", MODE="0660", SYMLINK+="scanner"



Using the scanner

"emerge sane-frontends" for command line tools, or "emerge xsane" for that and a GTK2 front-end.

Enjoy!
_________________
Personal overlay | Simple backup scheme


Last edited by Hypnos on Sat Jan 20, 2007 2:37 am; edited 9 times in total
Back to top
View user's profile Send private message
rhowardiv
n00b
n00b


Joined: 15 Jan 2005
Posts: 5
Location: New York City

PostPosted: Sat Jan 15, 2005 7:12 pm    Post subject: re: HOWTO: Parallel Port Scanner Reply with quote

Great howto, thank you. Needs updating, though:

The patch in step a) is inadequate for kernel 2.6.9 and 2.6.10 (and possibly earlier 2.6 versions as well).

You will probably get symbol errors for symbols scsi_sleep and parport_get_port when trying to load the module for your scsi driver.

Here's a new patch for 2.6.9.

Here's a new patch for 2.6.10.
EDIT: this 2.6.10 patch is new and works now

As I found out from the linux-parport mailing list archive:

For 2.6.9, all occurences of "scsi_sleep" in the 2.6.x patch must be replaced with "msleep".

For 2.6.10, the following lines were added to the patch:
Code:
diff -Nru a/drivers/parport/share.c b/drivers/parport/share.c
--- a/drivers/parport/share.c   2005-01-10 20:00:22 +02:00
+++ b/drivers/parport/share.c   2005-01-10 20:00:22 +02:00
@@ -1007,6 +1007,7 @@
  EXPORT_SYMBOL(parport_unregister_driver);
  EXPORT_SYMBOL(parport_register_device);
  EXPORT_SYMBOL(parport_unregister_device);
+EXPORT_SYMBOL(parport_get_port);
  EXPORT_SYMBOL(parport_put_port);
  EXPORT_SYMBOL(parport_find_number);
  EXPORT_SYMBOL(parport_find_base);


If you try the new patches I assembled, please let me know whether or not they work (I haven't used them yet, I hand-patched my own source after applying the 2.6.x patch and finding it didn't work).
Thanks!


Last edited by rhowardiv on Sun Jan 30, 2005 7:52 pm; edited 2 times in total
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Sat Jan 15, 2005 8:11 pm    Post subject: Reply with quote

Thanks!

Also, I've recently switched to udev exclusively. Here's my rule file:

Code:
BUS="scsi",SYSFS{vendor}="HP      ",SYSFS{model}="C5190A          ", SYMLINK="scanner", NAME="%k", GROUP="scanner", MODE="0660"

_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
dencar
Tux's lil' helper
Tux's lil' helper


Joined: 23 Dec 2003
Posts: 108
Location: Noosa, Australia

PostPosted: Mon Jan 17, 2005 7:36 am    Post subject: Reply with quote

rhowardiv said:

Quote:
If you try the new patches I assembled, please let me know whether or not they work (I haven't used them yet, I hand-patched my own source after applying the 2.6.x patch and finding it didn't work).
Thanks!


Code:
root@dencar /usr/src/linux # gzcat /home/dennis/linux-ppscsi-2.6.10.patch.gz  | patch -p1
patching file drivers/scsi/Kconfig
Hunk #1 succeeded at 902 (offset 55 lines).
patching file drivers/scsi/Makefile
Hunk #1 succeeded at 140 (offset 17 lines).
patching file drivers/scsi/epsa2.c
patching file drivers/scsi/epst.c
patching file drivers/scsi/onscsi.c
patching file drivers/scsi/ppscsi.c
patching file drivers/scsi/ppscsi.h
patching file drivers/scsi/sparcsi.c
patching file drivers/scsi/t348.c
patching file drivers/scsi/t358.c
patching file drivers/scsi/vpi0.c
patching file drivers/scsi/vpi2.c
patching file drivers/parport/share.c
Hunk #1 FAILED at 1007.
1 out of 1 hunk FAILED -- saving rejects to file drivers/parport/share.c.rej


share.c.rej says:

Quote:
***************
*** 1007,1012 ****
EXPORT_SYMBOL(parport_unregister_driver);
EXPORT_SYMBOL(parport_register_device);
EXPORT_SYMBOL(parport_unregister_device);
EXPORT_SYMBOL(parport_put_port);
EXPORT_SYMBOL(parport_find_number);
EXPORT_SYMBOL(parport_find_base);
--- 1007,1013 ----
EXPORT_SYMBOL(parport_unregister_driver);
EXPORT_SYMBOL(parport_register_device);
EXPORT_SYMBOL(parport_unregister_device);
+ EXPORT_SYMBOL(parport_get_port);
EXPORT_SYMBOL(parport_put_port);
EXPORT_SYMBOL(parport_find_number);
EXPORT_SYMBOL(parport_find_base);


Should I patch that manually? Thanks.
_________________
dencar
Back to top
View user's profile Send private message
rhowardiv
n00b
n00b


Joined: 15 Jan 2005
Posts: 5
Location: New York City

PostPosted: Mon Jan 17, 2005 5:29 pm    Post subject: Reply with quote

I'd go ahead and add that line to drivers/parport/share.c manually. Sorry the patch didn't all work.

Hypnos, or anyone, I'm new to building patch files...is there something I need to watch out for when combining two patches? I can't see any obvious problems. I tried rebuilding the bad diff in the patch and got the same results.

Any insights?

thanks
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Mon Jan 17, 2005 11:35 pm    Post subject: Reply with quote

There should be no problem if you know C or can impute the syntax.

Try it!
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
rhowardiv
n00b
n00b


Joined: 15 Jan 2005
Posts: 5
Location: New York City

PostPosted: Sun Jan 30, 2005 7:50 pm    Post subject: Reply with quote

OK, I took a few moments to create and test a fresh patch for 2.6.10 that works.

Quote:
Here's a new patch for 2.6.10.


Hope it's useful.
Back to top
View user's profile Send private message
DRi_
n00b
n00b


Joined: 05 Jul 2003
Posts: 22
Location: Salt - Spain

PostPosted: Sat Apr 02, 2005 10:30 am    Post subject: now it work. Reply with quote

Hi all,

I probed the last patch but nothing work. Ok, then I open /src/usr/linux/drivers/parport/share.c and saw that
the variable:
Code:

+EXPORT_SYMBOL(parport_get_port);


didn't exist in this file. I put this variable in the share.c, genkernel all,

modified /etc/modules.autoload/kernel.2.6

add modules sg and epst

modprobe sg , modprobe epst

Code:
sane-find-scanner

found SCSI processor "HP C5190A 3740" at /dev/scanner
found SCSI processor "HP C5190A 3740" at /dev/sg0
  # Your SCSI scanner was detected. It may or may not be supported by SANE. Try
  # scanimage -L and read the backend's manpage.

  # No USB scanners found. If you expected something different, make sure that
  # you have loaded a driver for your USB host controller and have installed a
  # kernel scanner module.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

  # You may want to run this program as root to find all devices. Once you
  # found the scanner devices, be sure to adjust access permissions as
  # necessary.


And now it works.
Back to top
View user's profile Send private message
MatzeG
n00b
n00b


Joined: 01 Aug 2004
Posts: 42

PostPosted: Thu Aug 04, 2005 12:00 pm    Post subject: Reply with quote

I'm currently using kernelversion 2.6.12-r6 and tried to apply the patch, because I have a scanner that needs this drivers (onscsi).

I applied the newest patch mentioned above, although it's not 2.6.10. All seemed to be fine, but when I compile the driver for the scanner as module,
and try to modprobe it, it gives me:

WARNING: Error inserting ppscsi (/lib/modules/2.6.12-gentoo-r6/kernel/drivers/scsi/ppscsi.ko): Unknown symbol in module, or unknown parameter (see dmesg)
FATAL: Error inserting onscsi (/lib/modules/2.6.12-gentoo-r6/kernel/drivers/scsi/onscsi.ko): Unknown symbol in module, or unknown parameter (see dmesg)

and in dmesg:

ppscsi: Unknown symbol parport_get_port
onscsi: Unknown symbol ppsc_make_map
onscsi: Unknown symbol ppsc_queuecommand
onscsi: Unknown symbol ppsc_abort
onscsi: Unknown symbol ppsc_reset
onscsi: Unknown symbol ppsc_proc_info
onscsi: Unknown symbol ppsc_detect
onscsi: Unknown symbol ppsc_biosparam
onscsi: Unknown symbol ppsc_release

I checked if it is in /usr/src/linux/drivers/parport/share.c and it is,
but after the compilation, it is not in /lib/modules/2.6.12-gentoo-r6/modules.symbols.

Can anyone help me with this, please?


Thank you very much,

Matthias
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Thu Aug 04, 2005 8:20 pm    Post subject: Reply with quote

Is reverting to kernel 2.6.10 an option? If that works, it just means that the patch needs some work to be updated.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
MatzeG
n00b
n00b


Joined: 01 Aug 2004
Posts: 42

PostPosted: Thu Aug 04, 2005 10:04 pm    Post subject: Reply with quote

Well, i have virtually no knowledge on how to update this patch,
but will try it with 2.6.10 and keep you informed.

What version are you using?

Thanks,

Matthias
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Thu Aug 04, 2005 10:11 pm    Post subject: Reply with quote

2.6.7
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Alexandr
n00b
n00b


Joined: 06 Sep 2005
Posts: 11
Location: Ukraine

PostPosted: Tue Sep 06, 2005 2:14 pm    Post subject: Reply with quote

Btw, linux-ppscsi-2.6.9.patch.gz (from http://penguin-breeder.org/kernel/download/) works fine with gentoo-sources-2.6.9-r9...
Even without "Configuring /dev" section from 1st post...
Back to top
View user's profile Send private message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Mon Sep 26, 2005 1:37 pm    Post subject: Re: HOWTO: Parallel Port Scanner Reply with quote

Hypnos wrote:


c) Enable the following options (I recommend modules if you need to suspend-to-disk):

Code:
Device Drivers
    -> SCSI device support
        <M> SCSI device support
        <M> SCSI generic support
        -> SCSI low-level drivers
           <M> Parallel Port SCSI adapters
           <M> <your scanner>


My scanner is an HP ScanJet 5100C, so I selected "Shuttle EPST". A rough mapping from scanner badge to optimum driver is here:

http://www.buzzard.org.uk/jonathan/scanners.html



I have a mustek 1200CP parallel port scanner, which scanner driver should i chose as module in the kernel?? (I successfully patched my 2.6.12-suspend2-r6 kernel)
Anybody knows? :?:
Back to top
View user's profile Send private message
Alexandr
n00b
n00b


Joined: 06 Sep 2005
Posts: 11
Location: Ukraine

PostPosted: Mon Sep 26, 2005 5:38 pm    Post subject: Reply with quote

Wow, TemplarKnight, used what patch you successfully patched your kernel?
Back to top
View user's profile Send private message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Mon Sep 26, 2005 5:44 pm    Post subject: Reply with quote

Alexandr wrote:
Wow, TemplarKnight, used what patch you successfully patched your kernel?

the 2.6.10 that rhowardiv shows...
but no luck cause there seems to be no in kernel driver for my scanner...
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Mon Sep 26, 2005 7:57 pm    Post subject: Reply with quote

It seems like your scanner doesn't require ppscsi; rather the SANE driver can talk to it directly over the parallel port:

http://penguin-breeder.org/sane/mustek_pp/
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Mon Sep 26, 2005 10:43 pm    Post subject: Reply with quote

Hypnos wrote:
It seems like your scanner doesn't require ppscsi; rather the SANE driver can talk to it directly over the parallel port:

http://penguin-breeder.org/sane/mustek_pp/


you are the man....
but sorry for another noobish question....how do i get my parallel port in kernel?? where is it in 2.6 kernel configuration??
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Tue Sep 27, 2005 12:08 am    Post subject: Reply with quote

I think it's on my default. It's under "Device Drivers" -> "Parallel Port" or something like that.

Make sure that IEEE 1284 support is activated.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Tue Sep 27, 2005 4:40 pm    Post subject: Reply with quote

Hypnos wrote:
I think it's on my default. It's under "Device Drivers" -> "Parallel Port" or something like that.

Make sure that IEEE 1284 support is activated.


You are so the man!!! :D :D
Thanks a lot, its working now.
My kernel didnt have neither parallel port support nor 1284 support.

My current kernel config is ::

Code:
tuxy birbilakos # grep PPDEV /usr/src/linux/.config
CONFIG_PPDEV=m

tuxy birbilakos # grep 1284 /usr/src/linux/.config
CONFIG_PARPORT_1284=y

(which i think if put as a module is also ok)

Also at Bios i have my Parallel Port type: EPP (havent tried the others, may also work...)

xsane does all the job....
some permission config now for it ...

Thanks again Hypnos (Are u Greek??) for this tutorial. 8)
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Tue Sep 27, 2005 6:15 pm    Post subject: Reply with quote

TemplarKnight wrote:
Thanks again Hypnos (Are u Greek??) for this tutorial. 8)

Nope, ugly American. :P
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
afterstep
n00b
n00b


Joined: 03 Dec 2003
Posts: 2

PostPosted: Fri Sep 30, 2005 12:57 pm    Post subject: Reply with quote

hi all, I tryed to compile the ppscsi path on 2.6.12-r10 but when I try to load epst module it wait forever whitout messages.

my scanner is hp5100c
Back to top
View user's profile Send private message
yesi
Guru
Guru


Joined: 25 Oct 2004
Posts: 331

PostPosted: Thu Oct 20, 2005 2:08 am    Post subject: Reply with quote

hi!

i've just seen your topic after having got to work my (parallel port) scanner.

what i did:

i chose mine http://www.sane-project.org/cgi-bin/driver.pl?manu=medion&model=&bus=par
i put in /etc/make.conf
Quote:
SANE_BACKENDS="the_name_of_your_backend_goes_here"--------->>>>>>>>>>>here, it's dangerous http://gentoo-wiki.com/HOWTO_Install_a_USB_scanner

here, this is mustek_pp for my model

some options for the kernel must be necessary...:)
i installed
Quote:
sane-backends xsane sane-frontends

( i chose the FLAG gimp)


the most importance files in /etc/sane.d are dll.conf and my mustek_pp.conf and the others files you can remove them.

in /etc/sane.d/dll.conf
Quote:

...
# all toto
mustek_pp
# all toto
...


in /etc/sane.d/mustek_pp.conf
i chose one of mine.

i added:
Code:
# gpasswd -a root scanner
# gpasswd -a <user> scanner

i tested
Code:
sane-find-scanner -q

Quote:
found USB scanner (vendor=0x046d, product=0x08b2) at libusb:002:002
--->strange!!!!!!!! :::::: :)
Code:
scanimage -L
Quote:
device `mustek_pp:Mustek-1200CP' is a Mustek 1200CP flatbed scanner


Code:
grep scanner /etc/group
scanner:x:1977:root,yesi


with root, it works but not with the user...(because of "udev" i suppose)
i'll go to get a look in the forum.
Back to top
View user's profile Send private message
yesi
Guru
Guru


Joined: 25 Oct 2004
Posts: 331

PostPosted: Thu Oct 20, 2005 12:48 pm    Post subject: Reply with quote

i remove in /etc/make.conf the line
Quote:
SANE_BACKENDS="mustek_pp"


and i compile again with
Quote:
media-gfx/sane-backends -usb
in /etc/portage/package.use
the packages: sane-backends sane-frontends xsane
and it works fine in root.

Code:
sane-find-scanner -q
--> nothing
Code:
scanimage -L
-->device `mustek_pp:Mustek-1200CP' is a Mustek 1200CP flatbed scanner


:)
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Thu Oct 20, 2005 5:09 pm    Post subject: Reply with quote

Thanks to everyone -- I'll make it clear in my original post that those steps are for parellel port-SCSI translation, and to look below for native parallel ports scanners.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum