Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Using your flatbed scanner from any pc on the network
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
schurke
n00b
n00b


Joined: 05 Dec 2003
Posts: 16
Location: Wien

PostPosted: Fri Dec 31, 2004 10:06 am    Post subject: Using your flatbed scanner from any pc on the network Reply with quote

Hi everybody!

I own an Epson GT-7000 SCSI Scanner. I am quite satisfied with its speed and picture quality.
On the other hand, my girlfriend only has an old, almost borked usb-scanner connected to
her windows-pc. So i thought about a solution, how she could use my scanner over our LAN.
Since i found no software to do that (ok, i didn't try too hard :wink: ), this is what i did:

Use apache2 and a cgi-bin to scan from network:

Since my scanner device "/dev/sg2" is owned by my everyday user and group root with
permissions 660, i had to change that, to allow user apache access to my scanner:
Code:
chmod a+rw /dev/sg2

then i wrote this little cgi-bin:
Code:
nano -w /var/www/localhost/cgi-bin/scan

Code:

#!/bin/sh
echo Content-type: image/jpeg
echo

scanimage --format tiff --mode Color --resolution 200 | convert tiff:- jpeg:-

make it executable:
Code:
chmod a+rx /var/www/localhost/cgi-bin/scan

scanimage is part of sane-backends, convert is part of imagemagick. You will also need
apache, so emerge them, if you don't have already:
Code:
USE=tiff emerge sane-backends imagemagick apache

start apache:
Code:
/etc/init.d/apache2 start

Finally point your browser to the cgi-bin (192.168.0.1 is my pc's ip on our lan):
Code:
http://192.168.0.1/cgi-bin/scan

and there the picture is!
You can change mode and resolution in the script, man scanimage is your friend :)

I'm using udev and still have to find out how to permanently change permissions on my
scanner, so i don't have to chmod it after every reboot. Help appreciated :lol:

Hope this is useful to somebody else, too!
_________________
Wir haben Platz für deine Party! www.meineparty.at Partykeller Wien
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 729
Location: Moscow, Id.

PostPosted: Fri Dec 31, 2004 9:57 pm    Post subject: Reply with quote

While a web page for scanning is a nice touch, I'm not sure what this buys you over just using sane on the network. If you setup sane to allow network scanning, you can scan directly into gimp from a scanner on a remote machine.
Back to top
View user's profile Send private message
Zzoot
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jan 2003
Posts: 98
Location: Iowa.

PostPosted: Sat Jan 01, 2005 12:51 am    Post subject: Reply with quote

But does that work from Gimp on a Windows machine? (Like the one he said his GF uses?)
I may be wrong, but I'm thinking probably not.

GREAT Hack there Schurke-- I don't have a whole lot of use for it, but I may try it out just for neat-factor...
Back to top
View user's profile Send private message
jdmulloy
Tux's lil' helper
Tux's lil' helper


Joined: 24 Dec 2004
Posts: 139
Location: Massachusetts, USA

PostPosted: Sat Jan 01, 2005 3:10 am    Post subject: Try the udev Configuration file Reply with quote

open up
Code:
 /etc/udev/permissions.d/50-udev.permissions
with your favorite editor and see if your device is listed in the scanner devices or camera devices section.

If not add it relative to /dev
The syntax of the file should be easy enough to understand.

p.s. Isn't it great how linux allows us to do things like share a scanner over a network and write our own code to do something that isn't natively supported
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
Page 1 of 1

 
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