Skip to content

Instantly share code, notes, and snippets.

@s1lvester
Created January 16, 2017 21:58
Show Gist options
  • Save s1lvester/0fb021dbe07a9b6d9e8e4078c8449fb9 to your computer and use it in GitHub Desktop.
Save s1lvester/0fb021dbe07a9b6d9e8e4078c8449fb9 to your computer and use it in GitHub Desktop.

Write along on how to build an ArchLinuxARM Scan-Server on an RPI.

December 2016

dependencies and software

yaourt -S sane confuse
yaourt -S scanbd

Now manually edit PKGbuild and add: --disable-Werror to ./configure line.

# copy needed config files from sane to scanbd
cp /etc/sane.d/canon* /etc/scanbd/sane.d/

Edit /etc/scanbd/sane.d/dll.conf and select only those to needed for your scanner. For me this means just canon_dr. Now we need to make sure which button is which on the scanner. scanimage -A should list all availible options for your hardware. In /etc/scanbd/scanbd.conf holds a few options we can use to try to map keys to functions. I used the "example.script" to trigger logger-actions until I found suitable button (which wasn't called button-X at all but "start" instead).

#!/bin/bash
# /etc/scanbd/scantofile.test

logger -t "scanbd: $0" "Begin of $SCANBD_ACTION for device $SCANBD_DEVICE"

SANE_CONFIG_DIR=/etc/scanbd scanimage \
    --device=net:localhost:canon_dr:libusb:001:006 \
    --source="ADF Duplex" \
    --format=tiff \
    --mode=Color \
    --resolution=300 \
    --rollerdeskew=yes \
    --stapledetect=yes \
    --swdeskew=yes \
    --df-length=yes \
    --batch="/tmp/out%d.tiff"


logger -t "scanbd: $0" "End   of $SCANBD_ACTION for device $SCANBD_DEVICE"

Proccess

yaourt -S ocrmypdf tesseract-data-deu imagemagick tesseract-data-eng --noconfirm git clone https://github.com/s1lvester/paper-backup /home/markus

# /etc/scanbd/scantofile.script

logger -t "scanbd: $0" "Begin of $SCANBD_ACTION for device $SCANBD_DEVICE"

 SANE_CONFIG_DIR=/etc/scanbd
 # run script using parameters
 /home/markus/paper-backup/scan.sh markus scanbd

logger -t "scanbd: $0" "End   of $SCANBD_ACTION for device $SCANBD_DEVICE"

Frontend

pacman -S nodejs npm
git clone https://github.com/sbs20/scanservjs.git
./install.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment