Since i got a raspberry pi 4 laying around and an old printer, i decided to made this and share it with the world.
- Base image changed to compile for arm64
- Installed libsane-hpaio drivers (for my old HP deskjet F4180)
- run.sh script restarts dbus service (if DBUS_WORKAROUND is "true")
Credit for the original project should go to Sam Strachan.
Check the original instructions for returning the 00X and 00Y and run something like this:
docker run -d \
-p 8080:8080 \
-v /var/run/dbus:/var/run/dbus \
-v /docker/scanservjs/scans:/app/data/output \
-e DBUS_WORKAROUND='false' \
--restart always \
--name scanservjs-rpi \
--device /dev/bus/usb/00X/00Y:/dev/bus/usb/00X/00Y \
brunoalves/scanservjs-rpi:latest
or add the "privileged" which is unsafer:
docker run -d \
-p 8080:8080 \
-v /var/run/dbus:/var/run/dbus \
-v /docker/scanservjs/scans:/app/data/output \
-e DBUS_WORKAROUND='false' \
--restart always \
--name scanservjs-rpi \
--privileged brunoalves/scanservjs-rpi:latest
If your device is not found, you may need to run this on your host:
sudo chmod a+rw /dev/bus/usb/00X/00Y
In my case, everytime i connected my printer the 00Y was different. So i decided to set the permissions automatically when i connected my printer.
When you run
lsusb
You will see something like this:
Bus XXX Device YYY: ID VENDOR:PRODUCT My awesome printer
Create a script in your desired path '/PATH/script.sh' and add the vendor and product:
#!/bin/sh
bus=$(lsusb | grep "VENDOR:PRODUCT" | tr -d ':'| awk '{print $2}')
device=$(lsusb | grep "VENDOR:PRODUCT" | tr -d ':'| awk '{print $4}')
sudo chmod a+rw "/dev/bus/usb/$bus/$device"
Set permissions:
sudo chmod +x /PATH/script.sh
Create a new file /etc/udev/rules.d/permission.rules and paste inside:
ATTRS{idVendor}=="VENDOR", ATTRS{idProduct}=="PRODUCT", RUN+="/bin/sh -c '/PATH/script.sh'"
Now everytime the printer is connected, the command will be run. It's useful for things like restarting a docker container if needed.
Copyright 2016-2021 Sam Strachan
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.
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.
- 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.
- SANE Scanner
- Linux host (or VM with necessary pass-through e.g. USB)
- Software sane-utils, ImageMagick, Tesseract (optional) and nodejs
- Manual installation
- Docker installation
- Scanner and SANE setup
- Proxy setup
- Troubleshooting
- Development notes
- Configuration and device override
- Integration
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.