sbs20 / scanservjs

SANE scanner nodejs web ui
https://sbs20.github.io/scanservjs/
GNU General Public License v2.0
691 stars 139 forks source link

Newbie: Synology and Brother MFC-L2710DW setup #601

Open gittynick opened 1 year ago

gittynick commented 1 year ago

Hello I have difficulties with the setup of scanservjs: it does not seem to find my Brother MFC-L2710DW connected by ethernet I followed the instructions of this github and added my environment variables and volumes --> I can access scanservjs's interface The problem is that my Brother does not appear in the "Device" Menu in that interface... in my docker environment, i tried

SANE_NET_HOSTS = 192.168.1.55 AIRSANE_DEVICES = '"MFC-L2710DW" = "http://192.168.1.55/eSCL"' DEVICES = net:192.168.1.55

any other ideas ? Thanks for helping ;-)

sbs20 commented 1 year ago

Hi! Please share the logs and details as per the issue template. I'm afraid there is just not enough information for me to be able to help.

gittynick commented 1 year ago

I have installed scanservjs via docker on my synology NAS - trying to follow your synology hosting example

here is my log : ` name: 'A4 (@:paper-size.portrait)', dimensions: { x: 210, y: 297 } }, { name: 'A5 (@:paper-size.portrait)', dimensions: { x: 148, y: 210 } }, { name: 'A5 (@:paper-size.landscape)', dimensions: { x: 210, y: 148 } }, { name: 'A6 (@:paper-size.portrait)', dimensions: { x: 105, y: 148 } }, { name: 'A6 (@:paper-size.landscape)', dimensions: { x: 148, y: 105 } }, { name: 'B3 (@:paper-size.portrait)', dimensions: { x: 353, y: 500 } }, { name: 'B4 (@:paper-size.portrait)', dimensions: { x: 250, y: 353 } }, { name: 'B5 (@:paper-size.portrait)', dimensions: { x: 176, y: 250 } }, { name: 'B5 (@:paper-size.landscape)', dimensions: { x: 250, y: 176 } }, { name: 'B6 (@:paper-size.portrait)', dimensions: { x: 125, y: 176 } }, { name: 'B6 (@:paper-size.landscape)', dimensions: { x: 176, y: 125 } }, { name: 'DIN D3 (@:paper-size.portrait)', dimensions: { x: 272, y: 385 } }, { name: 'DIN D4 (@:paper-size.portrait)', dimensions: { x: 192, y: 272 } }, { name: 'DIN D5 (@:paper-size.portrait)', dimensions: { x: 136, y: 192 } }, { name: 'DIN D5 (@:paper-size.landscape)', dimensions: { x: 192, y: 136 } }, { name: 'DIN D6 (@:paper-size.portrait)', dimensions: { x: 96, y: 136 } }, { name: 'DIN D6 (@:paper-size.landscape)', dimensions: { x: 136, y: 96 } }, { name: '@:paper-size.letter (@:paper-size.portrait)', dimensions: { x: 216, y: 279 } }, { name: '@:paper-size.legal (@:paper-size.portrait)', dimensions: { x: 216, y: 356 } }, { name: '@:paper-size.tabloid (@:paper-size.portrait)', dimensions: { x: 279, y: 432 } }, { name: '@:paper-size.ledger (@:paper-size.portrait)', dimensions: { x: 432, y: 279 } }, { name: '@:paper-size.junior-legal (@:paper-size.portrait)', dimensions: { x: 127, y: 203 } }, { name: '@:paper-size.half-letter (@:paper-size.portrait)', dimensions: { x: 140, y: 216 } } ], actions: [] } [2023-05-06T12:38:50.429Z] INFO (Http): { method: 'GET', path: '/preview' } [2023-05-06T12:38:50.438Z] INFO (Process): { execute: '/usr/bin/scanimage -d net:192.168.0.55 -A' } [2023-05-06T12:38:50.452Z] ERROR (Application): Ignoring net:192.168.0.55. Error: Error: Command failed: /usr/bin/scanimage -d net:192.168.0.55 -A Output format is not set, using pnm as a default. scanimage: open of device net:192.168.0.55 failed: Error during device I/O

`

sbs20 commented 1 year ago

Can you run

# Logs if in docker
docker logs scanservjs-container > scanservjs.log.docker.txt

And upload the file?

Can you share your docker-compose?

Also, in your original post you use 192.168.1.55 but the logs above are talking about 192.168.0.55

If the scanner supports driverless mode then you should just be able to map the dbus volume and probably require no other settings. If it does not, then you'll need the exact device id.

gittynick commented 1 year ago

Thanks for helping :-)

yes, the scanner's ip is 192.168.0.55 (just a typo on this forum, not on the container)

the scanservjs.log.docker.txt file is empty (0 byte file) :-/

i didn't use docker-compose but synology's docker GUI on the general setting, i filled in:

SANE_NET_HOSTS = 192.168.0.55 AIRSANE_DEVICES = '"MFC-L2710DW" = "http://192.168.0.55/eSCL"' DEVICES = net:192.168.0.55

and mounted the volumes:

v- /docker/scanservjs/config:/app/config v- /docker/scanservjs/scanner:/app/data/output

I think my scanner MFC-L2710DW can work in driverless mode (eSCL = mopria ? there are apple airprint and mopria logos on the box)

sbs20 commented 1 year ago

Hi.

So, ultimately I don't know. Since it's driverless and on the same network as the host you should just be able to use the default and not specify any additional settings. SANE_NET_HOSTS is for when you are using saned (which would mean the scanner was attached to another host). DEVICES is for when scanimage can't pick up the device names automatically (again, usually because of saned).

So something like:

docker run -d -p 8080:8080 \
  -v /var/run/dbus:/var/run/dbus \
  --name scanservjs-container sbs20/scanservjs:latest

... should just work - the dbus volume mount is essential for airsane though (in my experience at least).

gittynick commented 1 year ago

i tried to reinstall using the option "same network as Docker Host" and to "execute container using high privilege" but it didn't work... network install seems tricky (unless it's my brother scanner that is fussy) i will go and buy a (long) usb cable 😉

Thanks for your help 👍

sbs20 commented 1 year ago

If it's any consolation I spent a couple of hours this weekend trying hook up a USB brother scanner for testing and still haven't got it working even without docker. I've been doing this 8 years. Drives me crazy.

tdylewski83 commented 1 year ago

Hi, dunno if still relevant, but I have it running on Synology DS220+ here's my docker-composer.json, hope it helps

version: "3"
services:
  scanservjs:
    build:
      context: ./../scanservjs/
      args:
# just some user I created for this container
        UID: XXX
# just some group I created for this container  
        GID: YYY
    container_name: scanservjs
    environment:
      - AIRSCAN_DEVICES="EPSON L4150 Series" = http://192.168.XXX.YYY/WDP/SCAN, wsd
    volumes:
      - /volume2/scans:/app/data/output
      - /volume2/docker/scanservjs:/app/config
      - /var/run/avahi-daemon:/var/run/avahi-daemon
      - /var/run/dbus:/var/run/dbus
    ports:
# port for my reverse proxy
      - XXX:8080
    restart: unless-stopped
gittynick commented 1 year ago

Thanks tdylewski83 for helping :-)

I tweaked your docker-composer to fit my setting in Portainer

but it didn't work, I get the following error when trying to deploy:

failed to deploy a stack: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /volume1/@docker/tmp/buildkit-mount3735956557/Dockerfile: no such file or directory

tdylewski83 commented 1 year ago

gittynick it has to do with the path provided at

build:
      context: ./../scanservjs/

I keep all my docker-comopose files in 1 place and sources in another, so my path is not typical.

Make sure that your path points to Dockerfile and scanservjs sources, relative to your docker-compose file.

mdeanda commented 1 year ago

It may not be the same issue I ran into but I was able to get my Brother DCP-L2540DW to work with the following:

docker run -ti --rm \
  --net host \
  -v /var/run/dbus:/var/run/dbus\
  --privileged \
  -p 8080:8080 \
  -e SANED_NET_HOSTS="192.168.1.10" \
  sbs20/scanservjs:latest

Some parameters might be omitted but I didn't spend much time as I was trying to move this to docker-compose but ran into issues with the non-configurable port 8080 as my docker host needs it for something else.