sbs20 / scanservjs

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

Canon Pixma scanner only works if /etc/sane.d/pixma.conf is modified by hand #594

Open robertozanasi opened 1 year ago

robertozanasi commented 1 year ago

Canon Pixma scanner not automatically recongnized I'm trying to use scanservjs inside a docker container, with a Canon Pixma MX920 printer/scanner connected via ethernet.

This is the output of scanimage -L outside the docker container:

device `pixma:MX920_192.168.1.5' is a CANON Canon PIXMA MX920 Series multi-function peripheral
device `airscan:w0:Canon MX920 series' is a WSD Canon MX920 series ip=192.168.1.5

But if I run the same program inside the docker container, nothing is found.

After some tests, I found that adding the following line to /etc/sane.d/pixma.conf inside the docker container solves every problem:

bjnp://192.168.1.5

But this line will be overwritten at every container update. So, how can I solve the problem permanently?

My docker-compose.yml file


version: "3"
services:
  scanservjs:
    build:
      context: .
      args:
        # ----- enter UID and GID here -----
        # UID: 1034
        GID: 1000
        # target: scanservjs-user2001
    container_name: scanservjs
    image: sbs20/scanservjs:latest
    environment:
      # ----- specify network scanners here; see above for more possibilities -----
      - SANED_NET_HOSTS=192.168.1.20
      - DEVICES="pixma:MX920_192.168.1.5"
      #- DEVICES="airscan:w0:Canon MX920 series"
      #- AIRSCAN_DEVICES='Canon MX920 series = http://192.168.1.5:80/wsd/scanservice.cgi'
    volumes:
      # ---- enter your target location for scans before the ':' character -----
      - ./scans:/app/data/output
      - ./config:/app/config
      - /var/run/dbus:/var/run/dbus

    ports:
      - 8090:8080
    restart: unless-stopped

**Server:**
 - OS: Debian 11
 - Docker version 20.10.5+dfsg1, build 55c4c88
GrumpyRobsel commented 1 year ago

I have the same problem with my Canon Pixma MG5550 and docker. After adding bjnp://<scanner-ip> manually to the /etc/sane.d/pixma.conf inside the container it worked for me: echo "bjnp://<scanner-ip>" >> /etc/sane.d/pixma.conf

Maybe there could be a way to add Canon PIXMA scanners using an extra environment variable like SANED_NET_HOSTS or AIRSCAN_DEVICES.

Krytten commented 1 year ago

Can confirm that this is also needed on my 'Canon Pixma MP620' connected via wifi. It will not find it automatically inside docker without modifying '/etc/sane.d/pixma.conf' like previously mentioned.

sbs20 commented 1 year ago

I've merged the fix from @Scowl13 into master. I'm not doing a proper release just yet, but there should be a docker nightly available tomorrow for scanservjs:staging.

Hopefully this should help everyone. If it looks good I'll see if I can get another release done soonish.