User Tools

Site Tools


raspberry_pi
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


raspberry_pi [2023/01/17 08:50] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Netzwerkscanner am Raspberry Pi: ======
 +
 +https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=109169
 +http://support.epson.net/linux/src/scanner/iscan/
 +
 +FAQ Register Login
 +Scanning Server for Epson L350 Series Printer/Scanner
 +
 +Post a reply  
 +7 posts
 +by Alexey » Sat May 02, 2015 10:11 am
 +The L351 Epson All-in-one printer/scanner device was a huge pain in the ass to configure, but after a few days I've managed to figure it out. The printer part is actually really easy so I'm not going to cover it in this guide, you can find other guides for this. I will be devoting this guide to configuring the Raspberry Pi running Raspbian to work as a scanner server on for this particular device for a Windows client assuming it is already configured to work as a printer server (i.e. CUPS has been installed and configured). Due to the nature of this device being a combo there are special steps to be taken in order to achieve the desired effect.
 +
 +Lets get SANE (the scanner operator for linux) and an internet superdaemon:
 +
 +Code: Select all
 + $ sudo apt-get install xinetd sane-utils
 +
 +
 +
 +Now we configure SANE to run automatically:
 +
 +Code: Select all
 + $ sudo nano /etc/default/saned
 +
 +
 +
 +Edit it to look like this:
 +
 +Code: Select all
 + # Defaults for the saned initscript, from sane-utils
 +
 + # Set to yes to start saned
 + RUN=yes
 +
 + # Set to the user saned should run as
 + RUN_AS_USER=saned
 +
 +
 +Start saned:
 +
 +Code: Select all
 + $ sudo /etc/init.d/saned start
 +
 +
 +
 +Let's see if our scanner is listed:
 +
 +Code: Select all
 + $ lsusb
 + Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
 + Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 + Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
 + Bus 001 Device 006: ID 04b8:08a1 Seiko Epson Corp.
 + Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
 +
 +
 +In my case, it's listed as "Bus 001 Device 006: ID 04b8:08a1 Seiko Epson Corp.". Now let's try activating the scanner:
 +
 +Code: Select all
 + $ scanimage -L
 +
 +
 +
 +If your output was:
 +
 +Code: Select all
 + No scanners were identified. If you were expecting something different,
 + check that the scanner is plugged in, turned on and detected by the
 + sane-find-scanner tool (if appropriate). Please read the documentation
 + which came with this software (README, FAQ, manpages).
 +
 +
 +
 +Then you have the same problem as I had, so keep following the guide. If your output is different, and you actually see a device ID and scanner name after that, then your scanner is already configured (perhaps by the time you read this SANE will include the Epson drivers and will detect automaticaly)
 +
 +Let's first prepare our network sharing of the scanner for our Windows client:
 +
 +Code: Select all
 + $ sudo cat /etc/services | grep sane
 + sane-port       6566/tcp        sane saned      # SANE network scanner daemon
 +
 +
 +
 +You should see the sane-port line. If you don't - add it.
 +
 +Code: Select all
 + $ cd /etc/xinetd.d
 + $ sudo touch sane-daemon
 + $ which saned
 + /usr/sbin/saned
 + $ sudo nane sane-daemon
 +
 +
 +
 +This will set up the XInet configuration. Please use the following configuration for the /etc/xinetd.d/sane-daemon file:
 +
 +Code: Select all
 + service sane-port
 + {
 +   socket_type = stream
 +   server = /usr/sbin/saned
 +   protocol = tcp
 +   user = saned
 +   group = saned
 +   wait = no
 +   disable = no
 + }
 +
 +
 +
 +Note that we used the output from “which saned” in the configuration above. If it is different for you – e.g. on Archlinux – adjust accordingly.
 +
 +Set up saned to accept connections from your network by editing /etc/sane.d/saned.conf:
 +
 +Code: Select all
 + $ sudo nano /etc/sane.d/saned.conf
 +
 +
 +
 +To look like this:
 +
 +Code: Select all
 + # saned.conf
 + # Configuration for the saned daemon
 +
 + ## Daemon options
 + # [...]
 + # data_portrange = 10000 - 10100
 +
 +
 + ## Access list
 + # [...]
 + # The hostname matching is not case-sensitive.
 +
 + #scan-client.somedomain.firm
 + 192.168.1.0/24
 +
 + #192.168.0.1
 + #192.168.0.1/29
 + #[2001:7a8:185e::42:12]
 + #[2001:7a8:185e::42:12]/64
 +
 + # [...]
 +
 +
 +
 +Please adjust the subnet specification 192.168.1.0/24 to your network architecture. You can also explicitly specify single IPs (in my case I just added 192.168.0.20, which is the IP of my main PC). If you do not edit this file, SaneTwain will hang when contacting your Raspberry Pi scanner server.
 +Now you can reboot the Raspberry Pi (sudo reboot).
 +
 +Installing the Epson scanner drivers:
 +
 +The first thing we need to do is to compile the Epson iscan drivers. They are available for download from the Epson driver portal (http://download.ebz.epson.net/dsc/searc ... ch/?OSC=LX)
 +
 +You need the iscan and iscan-data .tar.gz files. The packages available there are for other architectures, and will not work on the Raspberry Pi, that's why we are forced to download the sources and compile for ourselves:
 +
 +Code: Select all
 + $ cd ~
 + $ wget http://support.epson.net/linux/src/scanner/iscan/[[iscan_2.30.1-1.tar.gz]]
 + $ wget http://support.epson.net/linux/src/scanner/iscan/[[/iscan-data_1.36.0-1.tar.gz]]
 +
 +
 +
 +Note: the wget link may be different for you if the version of the driver ever changes. Refer to the epson driver portal
 +
 +Before we get to compiling, let's install all the dependencies:
 +
 +Code: Select all
 + $ sudo apt-get install xsltproc libgtk2.0-dev libxml2-dev libsane-dev libltdl-devmake
 +
 +
 +
 +
 +Great, now let's get to compiling, we compile the iscan-data first:
 +
 +Code: Select all
 + $ cd iscan-data-1.36.0
 + $ sudo ./configure
 + $ sudo make
 + $ sudo make install
 +
 +
 +
 +Hopefully, no errors come up. Keep an eye out, there may be some dependencies missing, in which case you should manually install them. Now, we do the same thing with iscan:
 +
 +Code: Select all
 + $ cd ..
 + $ cd iscan-2.30.1
 + $ sudo ./configure
 + $ sudo make
 + $ sudo make install
 +
 +
 +
 +We'll make a dir for sane's drivers and transfer some driver files there just for good measure (WARNING: I'M USING RASPBERRY PI MODEL B, THE /lib/arm* FOLDER NAME MAY BE DIFFERENT FOR YOU DEPENDING ON YOUR PI, TO MAKE SURE JUST DO ls /lib/ | grep arm AND YOU WILL SEE THE PROPER FOLDER NAME)
 +
 +Code: Select all
 + $ sudo mkdir /lib/arm-linux-gnueabihf/sane
 + $ sudo cp /usr/local/lib/sane/libsane-epkowa* /lib/arm-linux-gnueabihf/sane/
 + $ sudo cp /home/pi/iscan-data-1.36.0/epkowa.desc /lib/arm-linux-gnueabihf/sane/
 +
 +
 +
 +Now let's make sure SANE only loads the Epson drivers so as to not overload the system more than we need to:
 +
 +Code: Select all
 + $ sudo nano /etc/sane.d/dll.conf
 +
 +
 +
 +Starting from "net", you need to comment out (add a # to the beginning of each line) all the lines except epson2. DO NOT COMMENT OUT epson2.
 +
 +Now we must add the device ID to the SANE epson2 config:
 +
 +Code: Select all
 + $ sudo nano /etc/sane.d/epson2.conf
 +
 +
 +
 +After the "usb" line, add the following line:
 +
 +Code: Select all
 + usb 0x4b8 0x8a1
 +
 +
 +
 +
 +Where the "4b8" and "8a1" are simply the last three characters of both parts of the device ID of the scanner/printer, which we found out when we did the lsusb command at the beginning of the guide (Bus 001 Device 006: ID 04b8:08a1 Seiko Epson Corp). It might be different in your case, so make sure to check it.
 +
 +Accounting for the permission problems due to the printer/scanner conflict:
 +
 +First, we add user saned to the lp group:
 +
 +Code: Select all
 + $ sudo adduser saned lp
 +
 +
 +
 +Lastly, we create a custom rule for udev to grant special permissions:
 +
 +Code: Select all
 + $ sudo nano /etc/udev/rules.d/99-custom.rules
 +
 +
 +
 +Add the following line:
 +
 +Code: Select all
 + ATTR{idVendor}=="04b8", ATTR{idProduct}=="08a1", MODE="0666", GROUP="lp"
 +
 +
 +
 +NOTE: the idVendor and idProduct attribute values may be different for you. Once again, refer to the device ID we get from the lsusb command. Pay attention, the format here is different from the epson2.conf file.
 +
 +That's it! Reboot the pi!
 +
 +Code: Select all
 + $ sudo reboot
 +
 +
 +
 +Let's see if it works, running the scanimage -L command you should have the following or similar output:
 +
 +Code: Select all
 + $ scanimage -L
 + device `epson2:libusb:001:004' is a Epson PID 08A1 flatbed scanner
  
raspberry_pi.txt · Last modified: 2023/01/17 08:50 by 127.0.0.1