Page 1 of 2

Linux Scanner Server testing

Posted: Sat Aug 29, 2009 11:10 am
by Khelmar
I just got done packaging this app, and wondered if anyone wants to be the second alpha tester.

Linux Scanner Server (http://scannerserver.online02.com/) is a web-based interface to SANE, letting people on a network with a Javascript-capable browser scan and download images and text. It supports Tesseract for OCR.

If anyone's interested, let me know and I'll add you as a collaborator.

Re: Linux Scanner Server testing

Posted: Sat Aug 29, 2009 1:31 pm
by cpg
very neat!!

the webapp works, however, it cannot detect my printer/scanner,
somehow not too surprising, since even for scanning with gimp/xsane, i have to do it as root.

you do not get permission/root issues?

Code: Select all

Aug 29 13:25:15 florence scanimage: io/hpmud/musb.c 135: unable get_string_descriptor -1: Operation not permitted Aug 29 13:25:15 florence scanimage: io/hpmud/musb.c 1995: invalid product id string ret=-1 Aug 29 13:25:15 florence scanimage: io/hpmud/musb.c 135: unable get_string_descriptor -1: Operation not permitted Aug 29 13:25:15 florence scanimage: io/hpmud/musb.c 2000: invalid serial id string ret=-1
i took the freedom to create a wiki page on how to make an Amahi server into a scanner server.

please share tips on how to make this work, it's really nice!

Re: Linux Scanner Server testing

Posted: Sat Aug 29, 2009 2:22 pm
by Khelmar
I still haven't had a chance to hook my scanner up yet, but it looks like a scanner permission problem, which should be able to be fixed by altering the udev rules. (See http://www3.sane-project.org/README.linux and http://reactivated.net/writing_udev_rules.html). I'll keep working on it, and post these links to the wiki as well.

Can install scripts run sudo without a problem? If so, that might work.

Re: Linux Scanner Server testing

Posted: Sat Aug 29, 2009 5:13 pm
by bsk
No root access in the installers yet, thats a touchy subject.

Re: Linux Scanner Server testing

Posted: Sat Aug 29, 2009 7:57 pm
by Khelmar
Yeah, root access is a big security hole.

I've found an answer that works for me, but I don't know how to generalize it... :) Basically, I ended up editing the /lib/udev/rules.d/50-udev-default.rules file, to make my scanner device get added as mode 0666 (read and write for all users).

To do that, I had to add something that looked for the USB ID of my scanner.

There are several options for this - one is to make ALL USB devices read and write for all users, which would be a fast change (although it would still require root access). The other is to search for the scanner IDs, and add them by hand. Grep might be able to do that, but it's a long process, and I don't have time to make a shell script to do that right now.

Anyone else have any thoughts, or have a better way to let the apache user get at the scanner?

It looks like no matter what, I'll have to include a script to have the user run as root after installing the package.

Re: Linux Scanner Server testing

Posted: Sun Aug 30, 2009 12:34 pm
by Khelmar
Ugh... looks like further work will be delayed - my dog knocked the external drive off my desk, which then died. Since it was part of a volume with the internal drive, I'll have to rebuild, and I don't have time for that right now.

Re: Linux Scanner Server testing

Posted: Sun Aug 30, 2009 5:23 pm
by cpg
is there a way that you could provide a little tidbit in the wiki to make it easier?

the pointers there (e.g. http://n2.nabble.com/Automatically-gran ... 74924.html ) seem like long threads, which make it not too clear for a regular human like myself.

sorry about the drive. that is why i do not like or recommend using volumes, even as they are convenient.

Re: Linux Scanner Server testing

Posted: Sun Aug 30, 2009 9:13 pm
by Khelmar
sorry about the drive. that is why i do not like or recommend using volumes, even as they are convenient.
It's my fault for going with the default Fedora partitioning scheme.

I've added a guide in the Wiki that SHOULD work - I was using a slightly different technique, in that mine was just RW for everyone. This should be a little more secure, as only the scanner group has access. I haven't tried that part out, since I'm reinstalling Fedora, but it's not a major change. I hope.

Anyways, let me know if it works. The only part of this that would be difficult to script is finding the USB device numbers. I suppose you could grep the lsusb output for "scan", but on the laptop I'm using as a temporary server, the fingerprint scanner keeps coming up, which isn't helpful. :)

If anyone else has a brilliant idea how to specify the scanner specifically, let me know.

Link to the wiki: http://wiki.amahi.org/index.php/ScannerServer

Re: Linux Scanner Server testing

Posted: Mon Aug 31, 2009 5:18 am
by bigfoot65
This would be a nice addition to Amahi. Is it possible to add the scanner as a shared device via samba. I thought may since a printer can be shared, that maybe the scanner could as well.

Re: Linux Scanner Server testing

Posted: Mon Aug 31, 2009 6:40 am
by Khelmar
Not that I know of, but my knowledge of Samba is really limited.

Also, one other thing I should add - some scanners (like mine) need an extra package installed over and above the normally installed SANE-backend. I have an HP all-in-one printer, and it required me to install the libsane-hpaio package as well. If SANE can't find your scanner, that might be a reason why.

I think you could set up a Samba share to point to the /var/hda/web-apps/scanner/html/scans directory, which would allow network access to all the scans from the server. It'd be another option to the web page listing the scans.