Sign inSign up

masterokhan/pi-scanservjs

By masterokhan

•Updated over 4 years ago

(Raspberry Pi or other Arm64) SANE scanner nodejs web ui - see https://github.com/sbs20/scanservjs

Image
0

172

masterokhan/pi-scanservjs repository overview

⁠pi-scanservjs

screenshot

Copyright 2016-2021 Sam Strachan⁠

⁠Raspberry Pi (Arm64)

Welcome to the unofficial Raspberry Pi image of sbs20/scanservjs⁠. Please note your Pi MUST be running the 64-bit version of Raspbian. This image was built from an unmodified clone of the latest revision on Github⁠.

You may follow the same instructions included in the original Github⁠ repo, although be sure to sub out the amd64 repo (sbs20/scanservjs) for this arm64 repo (masterokhan/pi-scanservjs)

I highly recommend you use docker-compose for your install:
docker-compose.yml

version: "3"
services:
  scanservjs:
    container_name: scanservjs
    image: masterokhan/pi-scanservjs:latest
    restart: unless-stopped
    ports:
      - '8080:8080'
    devices:
      - '/dev/bus'
      - '/dev/usb'
    volumes:
      - '/run/udev/control:/run/udev/control'
      - '/var/run/dbus:/var/run/dbus'

⁠Conflict with CUPS

It is possible that this container will conflict with CUPS running in a separate container. In this case, I recommend creating a new Udev rule to resolve the conflict and allow both containers to communicate with the printer.

Create a new file on the host machine (outside of all docker containers) named: /etc/udev/rules.d/99-printer.rules and include:

ATTRS{idVendor}=="vendor id", ATTRS{idProduct}=="product id", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"

Substitute in the USB vendor and Product ID found with the 'lsusb' command. In my case, the file appears as so:

ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1746", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"

Add a new volume in both containers (pi-saneservjs and cups).

docker-compose.yml (add this line under volumes:)

- '/run/udev/control:/run/udev/control'

or Command line Docker:

 -v /run/udev/control:/run/udev/control

Unplug your printer's USB and plug it back in, it now should be accessible for both printing and scanning.

⁠What people are saying

I've decided to switch to using only this, I find using this in a browser is just perfect and way better than bloated software from printer manufacturers

It enabled me to still use my old hp3900 scanner without worrying about drivers and vendor specific UIs. Furthermore, scans just being accessible via an awesome web interface makes it even more brilliant!

This is a great project! The touchscreen and buttons on my Brother scanner are broken, meaning the device is useless by itself because one cannot trigger scans, but with this project I can trigger it remotely just fine.

Absolutely love untethering my scanner from my laptop. Also means that I know it will work "forever", regardless of OS updates, since its all just a docker container.

⁠About

scanservjs is a web UI frontend for your scanner. It allows you to share one or more scanners (using SANE) on a network without the need for drivers or complicated installation.

⁠Features

  • Cropping
  • Source selection (Flatbed / ADF)
  • Resolution
  • Output formats (TIF, JPG, PNG, PDF and TXT with Tesseract OCR) with varying compression settings
  • Filters: Autolevels, Threshold, Blur
  • Configurable overrides for all defaults as well as filters and formats
  • Multipage scanning (with collation for double sided scans)
  • International translations: Czech, Dutch, French, German, Italian, Mandarin, Polish, Portuguese (PT & BR), Russian, Spanish, Turkish; Help requested⁠
  • Light and dark mode
  • Responsive design

It supports any SANE compatible devices⁠.

⁠Requirements

  • SANE Scanner
  • Linux host (or VM with necessary pass-through e.g. USB)
  • Software sane-utils, ImageMagick, Tesseract (optional) and nodejs

⁠Documentation

⁠Running scanservjs

In most cases the use of the app should be fairly self-explanatory. When the app first loads, it attempts to detect your scanner - this step is the most precarious and may either require custom drivers or some additional steps if you're running a network scanner or docker. See the documentation above for more.

Once the scanner is detected then you have a number of pages.

⁠Scan

This page gives access to the controls for your scanner. The app will generally find the settings available automatically, although some scanners mis-report their abilities. (If this is the case, then you can override what's detected, see Configuration and device override⁠ for more). If geometry is available (selecting scan size and position) then you will have cropping available to you.

There is also the ability to perform batch scanning. If you have a document feeder, then just use the Auto option. If not then use Manual and the app will prompt you to change pages between scans.

Any scan operation will always result in a single file. Some image formats, such as PDF and TIF support multiple pages, while others, such as PNG and JPG do not. If the scan pipeline results in more than one file, then the app will zip the files into a single output. You can choose the image format under Format.

You can create and customise your own pipelines.

⁠Files

Any scanned files will be saved in a flat directory which has a simple web view available on this page. The intended usage of the app is to allow the user to save their scans locally - i.e. to download the files. The app will never delete these files, but if you run under docker then unless volume mapping is specified then the files may be lost when you run a new version.

Furthermore, users in real life will want to store their scans with their own names, directory structures and cloud services or NAS devices. The permutations and possibilities are endless and are beyond the scope of the app.

⁠Settings

The settings page allows you to change the appearance and locale / language.

⁠About

Copyright information and system info.

⁠Why?

This is yet another scanimage-web-front-end. Why? It originally started as an adaptation of phpsane - just to make everything a bit newer, give it a refresh and make it work on minimal installations without imagemagick - that version is still available⁠ but is no longer maintained. Since then, I just wanted to write it in node and enhance it a bit, and it's been a labour of love ever since.

⁠Acknowledgements

  • This project owes its genesis to phpsane⁠
  • Everyone⁠ who has filed issues, tested, fixed issues, added translations and helped over the years. Thank you!

⁠More about SANE

Tag summary

Content type

Image

Digest

Size

301.2 MB

Last updated

over 4 years ago

docker pull masterokhan/pi-scanservjs