In this tutorial we are going to scan a
document using a Raspberry Pi connected
to an old flatbed scanner. I have a
raspberry pi here and it's connected to
this scanner via USB and of course I've
also provided power just using a regular
USB power adapter. To prevent this from
being a big waste of time, you want to
ensure that what we're about to do will
actually work with your scanner. This
website will let you know, so just click
on scanner search engine and then type
in the scanners manufacturer here. In my
case it's Canon and then type in the
model number of the scanner should be
written on the front or in the
instruction manual. Now if you see the
status label that's good, right here, you
should be alright. As you saw earlier I
don't actually have a monitor or a
keyboard connected to the Raspberry Pi,
so I just control it remotely over Wi-Fi
using this protocol called SSH.
Now in Windows you need to download this
program called putty to do this. Now
Windows doesn't natively support the SSH
protocol so you need to download a
program called putty, so go to the
website putty.org
and we are just going to download the
regular putty, nothing special
Just save it somewhere, and then run it,
and this is putty.
Before using SSH or putty, we need to
find the raspberry PI's IP address the
easiest way to do this is to download
this program called fing if you're using
an iOS device you can find it on the App
Store and it's on the Google Play Store
as well if you're using Android. Alright
once you download Fing, open it up
hit refresh, and you should see your
raspberry PI's IP address listed.
Back to putty now, input your Raspberry
Pi's IP address, once entered, click the
Open button.
Input the raspberry PI's username which
is just pi, press ENTER and then put in
the password. You won't see any letters
appear as you type, but type it in anyway
and then just press Enter
Now you see this text that I've
highlighted with my cursor, this is what
we must input into our SSH terminal to
install the software, so that's what
we're going to do next. Now that we're
back at the SSH terminal we are going to
install the software. The first line that
you're going to enter is sudo su and
then press the Enter key. Now type out
aptitude update and then again press the
Enter key. Now unfortunately you are
going to have to wait a while.
While we're waiting I should just give a heads
up that the next command that I type in
the word installed should have been just
install, so I will have to fix that up in
a moment.
Okay. It's now time
fix it up. I'm just going to re-enter
that line and just delete the ed at the
end of installed, and it should be good.
Now you got to be really careful to
enter everything in right, or
stuff messes up. Once you are sure you've
inputted everything incorrectly press
the Enter key. When you see the do you
want to continue prompt just type in y
for yes and then hit the enter key. Now
we have to wait a while.
Next we need to configure the software,
to do so, we need to input the following
at the SSH prompt. Now remembering that
upper case versus lower case is
important input run equals yes, and then
hit the enter key.
Next, input run as user equals saned
now don't forget the underscores they
are really important. After inputting all
that press the Enter key.
Again at the SSH terminal, input the text,
exactly as I do here,
and then press the Enter key
I should mention that each time you
see a space, it's only a single space,
never double or triple, at least for this
tutorial.
Now input this line. This should start up
the sane software. After you filled it
all out, press the Enter key. And now you
are in sane, this is the scanner software.
Now let's see if we are actually connected
to our scanner, for this to work, your
scanner has to be on. Just type out lsusb
and then press Enter
and you should see the manufacturer of
your scanner listed next type in scanimage space - L and then hit the enter
key. Now you should have the name of your
scanner in this area I'm underlining the
name of my scanner in red and now that
we have the name of our scanner we
should write that down for later use. To
exit the same software just type exit
and then press Enter
so now just to make things easy I'm
going to close out of here so just click
on the X in the top right-hand corner
Now I'm going to start up a new SSH
session and so I'm going to just put the
IP address for the Raspberry Pi in here.
Once I got it entered in I'll just click
the Open button. I would like to make the
Documents folder on the Raspberry Pi
accessible to the same software so we're
going to log back in to the PI now that
we started now that we started a new SSH
session we're going to put the password
and user name back in hit enter after
each there we go and now type out ls and
press Enter
Here you see listed the different
directories that are available. I would
like to save any scanned documents
directly to the Documents folder or
directory and you know it just makes
sense to me, so to make this work we need
to open up the Documents folder, so the
sane software actually has access to it.
To open up access to a folder just use
the chmod command followed by triple
seven and then the name of the folder
that you want to open up. In my case it's
the Documents folder I would like to
open up, so as you can see ,I typed out
the name of the Documents folder and
then I pressed enter. Now the Documents
folder is open for the sane software to
write to.
For the remainder of the tutorial, I'm
going to be using SSH from the Mac
instead of using putty in Windows. Now
it's exactly the same, once you're in
other than the colors, and you get the
advantage of being able to copy and
paste, which I haven't been able to do in
Windows for some reason. Now if we're
logging in to SSH at the Mac terminal
just type out SSH the PI's username
which is just PI in this case followed
by the @ symbol and then the PI's IP
address, and then press the Enter key
afterwards. Okay then I'm just going to
put the password in, which is just
raspberry. Just a refresher for Windows
users, at putty you just provide the IP
address and then click the Open button
provide the PI's username and password
Alright, here's a breakdown of what we've
pasted into the prompt here the dash D
represents that we are using the flatbed
part of the scanner, followed by the name
of the scanner. Notice the single quotes
are still there and then followed by 300
which means we're using 300 dots per
inch. You may need to look up in the
scanners manual what dpi values it's
capable of. Regular is 300 and 600 are
very common as well. This number here you
take your 300 and you multiply it by the
width of the page which is 8.5 inches
Alright so that's how we got the 2550
It's the same thing for the Y number, but
instead it's 300 x 11 inches
and last, we have the path and the
filename that we would like to call our
scan document
Okay. Just hit the enter key, and I'm now
scanning, just waiting for the scanner to
do its thing
All right, I'm just making a remote
connection using VNC to the
Raspberry Pi. Just to show you that the
scanned document is actually there. If you
would like to set up your computer so
you can VNC into your Raspberry Pi
like I just did, I've actually put
together a tutorial that will show you how
to do this. Best of all there isn't a
keyboard or a mouse that you need to
like plug into your PI to accomplish
this. as long as you have a Mac or PC
that's connected to the same network
that your pi is you will be good to go I
placed a link down in the description
below this video that provides the
tutorial
To view the document you must go to
accessories and then image viewer and
then open the document through here to
actually view it and here it is the
document that we had scanned earlier.
Last I wanted to say if you want to
convert this image file to a PDF and
compress it as well
or if you would like to transfer it from
the raspberry pi to a PC or Mac there
are some links found in the description
below this video that will take you to
some further instruction on how to get
these things done.
